Search is not available for this dataset
repo_name
string | path
string | license
string | full_code
string | full_size
int64 | uncommented_code
string | uncommented_size
int64 | function_only_code
string | function_only_size
int64 | is_commented
bool | is_signatured
bool | n_ast_errors
int64 | ast_max_depth
int64 | n_whitespaces
int64 | n_ast_nodes
int64 | n_ast_terminals
int64 | n_ast_nonterminals
int64 | loc
int64 | cycloplexity
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
forked-upstream-packages-for-ghcjs/ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
|
evVarPred :: EvVar -> PredType
evVarPred var
| debugIsOn
= case evVarPred_maybe var of
Just pred -> pred
Nothing -> pprPanic "tcEvVarPred" (ppr var <+> ppr (varType var))
| otherwise
= varType var
| 216
|
evVarPred :: EvVar -> PredType
evVarPred var
| debugIsOn
= case evVarPred_maybe var of
Just pred -> pred
Nothing -> pprPanic "tcEvVarPred" (ppr var <+> ppr (varType var))
| otherwise
= varType var
| 216
|
evVarPred var
| debugIsOn
= case evVarPred_maybe var of
Just pred -> pred
Nothing -> pprPanic "tcEvVarPred" (ppr var <+> ppr (varType var))
| otherwise
= varType var
| 185
| false
| true
| 0
| 14
| 52
| 90
| 39
| 51
| null | null |
olorin/amazonka
|
amazonka-directconnect/test/Test/AWS/Gen/DirectConnect.hs
|
mpl-2.0
|
testConfirmConnectionResponse :: ConfirmConnectionResponse -> TestTree
testConfirmConnectionResponse = res
"ConfirmConnectionResponse"
"fixture/ConfirmConnectionResponse.proto"
directConnect
(Proxy :: Proxy ConfirmConnection)
| 241
|
testConfirmConnectionResponse :: ConfirmConnectionResponse -> TestTree
testConfirmConnectionResponse = res
"ConfirmConnectionResponse"
"fixture/ConfirmConnectionResponse.proto"
directConnect
(Proxy :: Proxy ConfirmConnection)
| 241
|
testConfirmConnectionResponse = res
"ConfirmConnectionResponse"
"fixture/ConfirmConnectionResponse.proto"
directConnect
(Proxy :: Proxy ConfirmConnection)
| 170
| false
| true
| 0
| 6
| 30
| 36
| 17
| 19
| null | null |
sahnib/haskell-make
|
src/Make/DependencyBuilder.hs
|
mit
|
runCommands (x:xs) =
do
exitCode <- system x
case exitCode of ExitSuccess -> runCommands xs
ExitFailure a -> return $ ExitFailure a
| 162
|
runCommands (x:xs) =
do
exitCode <- system x
case exitCode of ExitSuccess -> runCommands xs
ExitFailure a -> return $ ExitFailure a
| 162
|
runCommands (x:xs) =
do
exitCode <- system x
case exitCode of ExitSuccess -> runCommands xs
ExitFailure a -> return $ ExitFailure a
| 162
| false
| false
| 0
| 11
| 52
| 58
| 26
| 32
| null | null |
AKST/lisp.hs
|
src/Lisp/Runtime.hs
|
mit
|
-- consider it a stateless version of eval
reduce :: Environment -> AST -> AST
reduce env ast = case ast of
Compound [] -> invokeEmptyExpr
Compound (f:args) -> case (reduce env f) of
Func fn -> invoke env fn evalArgs
other -> notInvokable other
where
evalArgs = map (reduce env) args
Ref ref -> case (lookup ref env) of
Just ast -> ast
Nothing -> outOfScope ref
IfExpr pred cons altv -> case (reduce env pred) of
Boolean True -> reduce env cons
Boolean False -> reduce env altv
_ -> boolError
-- makes closure
Func (LangFn ps body) -> Func (ClojFn env ps body)
_ -> ast
-- derefences a reference
| 726
|
reduce :: Environment -> AST -> AST
reduce env ast = case ast of
Compound [] -> invokeEmptyExpr
Compound (f:args) -> case (reduce env f) of
Func fn -> invoke env fn evalArgs
other -> notInvokable other
where
evalArgs = map (reduce env) args
Ref ref -> case (lookup ref env) of
Just ast -> ast
Nothing -> outOfScope ref
IfExpr pred cons altv -> case (reduce env pred) of
Boolean True -> reduce env cons
Boolean False -> reduce env altv
_ -> boolError
-- makes closure
Func (LangFn ps body) -> Func (ClojFn env ps body)
_ -> ast
-- derefences a reference
| 683
|
reduce env ast = case ast of
Compound [] -> invokeEmptyExpr
Compound (f:args) -> case (reduce env f) of
Func fn -> invoke env fn evalArgs
other -> notInvokable other
where
evalArgs = map (reduce env) args
Ref ref -> case (lookup ref env) of
Just ast -> ast
Nothing -> outOfScope ref
IfExpr pred cons altv -> case (reduce env pred) of
Boolean True -> reduce env cons
Boolean False -> reduce env altv
_ -> boolError
-- makes closure
Func (LangFn ps body) -> Func (ClojFn env ps body)
_ -> ast
-- derefences a reference
| 647
| true
| true
| 0
| 12
| 243
| 253
| 119
| 134
| null | null |
keithodulaigh/Hets
|
Common/Lib/Pretty.hs
|
gpl-2.0
|
nicest1 :: Int -> Int -> Int -> Doc -> Doc -> Doc
nicest1 w r sl p q | fits ((w `minn` r) - sl) p = p
| otherwise = q
| 136
|
nicest1 :: Int -> Int -> Int -> Doc -> Doc -> Doc
nicest1 w r sl p q | fits ((w `minn` r) - sl) p = p
| otherwise = q
| 136
|
nicest1 w r sl p q | fits ((w `minn` r) - sl) p = p
| otherwise = q
| 86
| false
| true
| 0
| 12
| 51
| 86
| 41
| 45
| null | null |
VictorDenisov/jdi
|
src/Language/Java/Jdwp.hs
|
gpl-2.0
|
-- Dynamic value marshalling functions
putDynamicSizedValue :: JavaInt -> Word64 -> Put
putDynamicSizedValue s v = case s of
1 -> put ((fromIntegral v) :: Word8)
2 -> put ((fromIntegral v) :: Word16)
4 -> put ((fromIntegral v) :: Word32)
8 -> put ((fromIntegral v) :: Word64)
_ -> error $ "Currently we can not process values of this size: " ++ show s
| 371
|
putDynamicSizedValue :: JavaInt -> Word64 -> Put
putDynamicSizedValue s v = case s of
1 -> put ((fromIntegral v) :: Word8)
2 -> put ((fromIntegral v) :: Word16)
4 -> put ((fromIntegral v) :: Word32)
8 -> put ((fromIntegral v) :: Word64)
_ -> error $ "Currently we can not process values of this size: " ++ show s
| 332
|
putDynamicSizedValue s v = case s of
1 -> put ((fromIntegral v) :: Word8)
2 -> put ((fromIntegral v) :: Word16)
4 -> put ((fromIntegral v) :: Word32)
8 -> put ((fromIntegral v) :: Word64)
_ -> error $ "Currently we can not process values of this size: " ++ show s
| 283
| true
| true
| 0
| 11
| 83
| 135
| 68
| 67
| null | null |
arekfu/project_euler
|
p0043/p0043.hs
|
mit
|
allNums = filter areAllTripletsDivisible candidates
| 51
|
allNums = filter areAllTripletsDivisible candidates
| 51
|
allNums = filter areAllTripletsDivisible candidates
| 51
| false
| false
| 1
| 5
| 4
| 15
| 5
| 10
| null | null |
postgres-haskell/postgres-wire
|
tests/Fault.hs
|
mit
|
testSimpleQuery :: (ConnectionCommon -> IO ()) -> IO ()
testSimpleQuery interruptAction = withConnectionCommon $ \c -> do
asyncVar <- async $ sendSimpleQuery c "SELECT pg_sleep(5)"
-- Make sure that query was sent.
threadDelay 500000
interruptAction c
r <- wait asyncVar
assertUnexpected r
| 313
|
testSimpleQuery :: (ConnectionCommon -> IO ()) -> IO ()
testSimpleQuery interruptAction = withConnectionCommon $ \c -> do
asyncVar <- async $ sendSimpleQuery c "SELECT pg_sleep(5)"
-- Make sure that query was sent.
threadDelay 500000
interruptAction c
r <- wait asyncVar
assertUnexpected r
| 313
|
testSimpleQuery interruptAction = withConnectionCommon $ \c -> do
asyncVar <- async $ sendSimpleQuery c "SELECT pg_sleep(5)"
-- Make sure that query was sent.
threadDelay 500000
interruptAction c
r <- wait asyncVar
assertUnexpected r
| 257
| false
| true
| 0
| 12
| 65
| 93
| 41
| 52
| null | null |
zeniuseducation/poly-euler
|
Alfa/haskell/tutorial/one.hs
|
epl-1.0
|
psum [] = 0
| 11
|
psum [] = 0
| 11
|
psum [] = 0
| 11
| false
| false
| 0
| 6
| 3
| 11
| 5
| 6
| null | null |
dolio/irc-core
|
src/Client/State/Extensions.hs
|
isc
|
clientStartExtensions ::
ClientState {- ^ client state -} ->
IO ClientState {- ^ client state with new extensions -}
clientStartExtensions st =
do let cfg = view clientConfig st
st1 <- clientStopExtensions st
foldM start1 st1 (view configExtensions cfg)
-- | Start a single extension and register it with the client or
-- record the error message.
| 387
|
clientStartExtensions ::
ClientState {- ^ client state -} ->
IO ClientState
clientStartExtensions st =
do let cfg = view clientConfig st
st1 <- clientStopExtensions st
foldM start1 st1 (view configExtensions cfg)
-- | Start a single extension and register it with the client or
-- record the error message.
| 346
|
clientStartExtensions st =
do let cfg = view clientConfig st
st1 <- clientStopExtensions st
foldM start1 st1 (view configExtensions cfg)
-- | Start a single extension and register it with the client or
-- record the error message.
| 243
| true
| true
| 0
| 10
| 96
| 67
| 32
| 35
| null | null |
fmthoma/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
byteArrayPrimTyConKey = mkPreludeTyConUnique 5
| 65
|
byteArrayPrimTyConKey = mkPreludeTyConUnique 5
| 65
|
byteArrayPrimTyConKey = mkPreludeTyConUnique 5
| 65
| false
| false
| 0
| 5
| 22
| 9
| 4
| 5
| null | null |
trenttobler/hs-asteroids
|
src/Asteroids/UILogic/TextScreen.hs
|
bsd-3-clause
|
textRow, textCell :: TextPos -> Int
textRow (r,_) = r
| 54
|
textRow, textCell :: TextPos -> Int
textRow (r,_) = r
| 53
|
textRow (r,_) = r
| 17
| false
| true
| 0
| 6
| 10
| 26
| 15
| 11
| null | null |
TomMD/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
ratioDataConName = conName gHC_REAL (fsLit ":%") ratioDataConKey
| 77
|
ratioDataConName = conName gHC_REAL (fsLit ":%") ratioDataConKey
| 77
|
ratioDataConName = conName gHC_REAL (fsLit ":%") ratioDataConKey
| 77
| false
| false
| 0
| 7
| 19
| 19
| 9
| 10
| null | null |
keithodulaigh/Hets
|
CommonLogic/Analysis.hs
|
gpl-2.0
|
propsOfSentence (AS.Bool_sent bs _) = case bs of
AS.Junction _ xs -> uniteMap propsOfSentence xs
AS.Negation x -> propsOfSentence x
AS.BinOp _ s1 s2 -> Sign.unite (propsOfSentence s1) (propsOfSentence s2)
| 216
|
propsOfSentence (AS.Bool_sent bs _) = case bs of
AS.Junction _ xs -> uniteMap propsOfSentence xs
AS.Negation x -> propsOfSentence x
AS.BinOp _ s1 s2 -> Sign.unite (propsOfSentence s1) (propsOfSentence s2)
| 216
|
propsOfSentence (AS.Bool_sent bs _) = case bs of
AS.Junction _ xs -> uniteMap propsOfSentence xs
AS.Negation x -> propsOfSentence x
AS.BinOp _ s1 s2 -> Sign.unite (propsOfSentence s1) (propsOfSentence s2)
| 216
| false
| false
| 0
| 10
| 41
| 89
| 41
| 48
| null | null |
imh/plover
|
src/Language/Plover/Reduce.hs
|
mit
|
compoundVal (a :/ b) = compoundVal a || compoundVal b
| 54
|
compoundVal (a :/ b) = compoundVal a || compoundVal b
| 54
|
compoundVal (a :/ b) = compoundVal a || compoundVal b
| 54
| false
| false
| 0
| 6
| 10
| 27
| 12
| 15
| null | null |
yuroyoro/stashh
|
src/Stashh/Table.hs
|
bsd-3-clause
|
left = fillLeft ' '
| 19
|
left = fillLeft ' '
| 19
|
left = fillLeft ' '
| 19
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
sajith/betty-web
|
Handler/Api/V0/User.hs
|
agpl-3.0
|
getPassword :: forall site.
(YesodPersist site,
YesodPersistBackend site ~ SqlBackend)
=> Text -> HandlerT site IO (Maybe Text)
getPassword email = runDB $ do
$logDebug ("getPassword: " <> email <> "\n")
liftM (userPassword . entityVal) (getBy404 (UniqueUser email))
------------------------------------------------------------------------
| 394
|
getPassword :: forall site.
(YesodPersist site,
YesodPersistBackend site ~ SqlBackend)
=> Text -> HandlerT site IO (Maybe Text)
getPassword email = runDB $ do
$logDebug ("getPassword: " <> email <> "\n")
liftM (userPassword . entityVal) (getBy404 (UniqueUser email))
------------------------------------------------------------------------
| 394
|
getPassword email = runDB $ do
$logDebug ("getPassword: " <> email <> "\n")
liftM (userPassword . entityVal) (getBy404 (UniqueUser email))
------------------------------------------------------------------------
| 220
| false
| true
| 0
| 12
| 93
| 106
| 52
| 54
| null | null |
leshchevds/ganeti
|
src/Ganeti/Luxi.hs
|
bsd-2-clause
|
-- | Testing result status for more verbose error message.
fromJValWithStatus :: (J.JSON a, Monad m) => (JSValue, JSValue) -> m a
fromJValWithStatus (st, v) = do
st' <- fromJVal st
Qlang.checkRS st' v >>= fromJVal
| 217
|
fromJValWithStatus :: (J.JSON a, Monad m) => (JSValue, JSValue) -> m a
fromJValWithStatus (st, v) = do
st' <- fromJVal st
Qlang.checkRS st' v >>= fromJVal
| 158
|
fromJValWithStatus (st, v) = do
st' <- fromJVal st
Qlang.checkRS st' v >>= fromJVal
| 87
| true
| true
| 0
| 9
| 39
| 75
| 38
| 37
| null | null |
prasmussen/magmod
|
Util/PHP.hs
|
mit
|
parse :: Parser -> String -> (Status, Parser)
parse [] _ = (Done, [])
| 69
|
parse :: Parser -> String -> (Status, Parser)
parse [] _ = (Done, [])
| 69
|
parse [] _ = (Done, [])
| 23
| false
| true
| 0
| 7
| 13
| 40
| 22
| 18
| null | null |
OS2World/DEV-UTIL-HUGS
|
demos/GLUT/examples/RedBook/BezMesh.hs
|
bsd-3-clause
|
myInit :: IO ()
myInit = do
clearColor $= Color4 0 0 0 0
depthFunc $= Just Less
m <- newMap2 (0, 1) (0, 1) (transpose ctrlPoints)
map2 $= Just (m :: GLmap2 Vertex3 GLfloat)
autoNormal $= Enabled
mapGrid2 $= ((20, (0, 1)), (20, (0, 1 :: GLfloat)))
initlights -- for lighted version only
| 307
|
myInit :: IO ()
myInit = do
clearColor $= Color4 0 0 0 0
depthFunc $= Just Less
m <- newMap2 (0, 1) (0, 1) (transpose ctrlPoints)
map2 $= Just (m :: GLmap2 Vertex3 GLfloat)
autoNormal $= Enabled
mapGrid2 $= ((20, (0, 1)), (20, (0, 1 :: GLfloat)))
initlights -- for lighted version only
| 307
|
myInit = do
clearColor $= Color4 0 0 0 0
depthFunc $= Just Less
m <- newMap2 (0, 1) (0, 1) (transpose ctrlPoints)
map2 $= Just (m :: GLmap2 Vertex3 GLfloat)
autoNormal $= Enabled
mapGrid2 $= ((20, (0, 1)), (20, (0, 1 :: GLfloat)))
initlights -- for lighted version only
| 291
| false
| true
| 0
| 10
| 75
| 146
| 76
| 70
| null | null |
nushio3/ghc
|
compiler/basicTypes/RdrName.hs
|
bsd-3-clause
|
isQual :: RdrName -> Bool
isQual (Qual _ _) = True
| 50
|
isQual :: RdrName -> Bool
isQual (Qual _ _) = True
| 50
|
isQual (Qual _ _) = True
| 24
| false
| true
| 0
| 6
| 10
| 30
| 14
| 16
| null | null |
gibiansky/IHaskell
|
src/IHaskell/Convert/Args.hs
|
mit
|
mergeArg (ConvertLhsStyle lhsStyle) convertSpec
| Just previousLhsStyle <- convertLhsStyle convertSpec,
previousLhsStyle /= fmap LT.pack lhsStyle
= error $ printf "Conflicting lhs styles requested: <%s> and <%s>" (show lhsStyle)
(show previousLhsStyle)
| otherwise = convertSpec { convertLhsStyle = Just (LT.pack <$> lhsStyle) }
| 352
|
mergeArg (ConvertLhsStyle lhsStyle) convertSpec
| Just previousLhsStyle <- convertLhsStyle convertSpec,
previousLhsStyle /= fmap LT.pack lhsStyle
= error $ printf "Conflicting lhs styles requested: <%s> and <%s>" (show lhsStyle)
(show previousLhsStyle)
| otherwise = convertSpec { convertLhsStyle = Just (LT.pack <$> lhsStyle) }
| 352
|
mergeArg (ConvertLhsStyle lhsStyle) convertSpec
| Just previousLhsStyle <- convertLhsStyle convertSpec,
previousLhsStyle /= fmap LT.pack lhsStyle
= error $ printf "Conflicting lhs styles requested: <%s> and <%s>" (show lhsStyle)
(show previousLhsStyle)
| otherwise = convertSpec { convertLhsStyle = Just (LT.pack <$> lhsStyle) }
| 352
| false
| false
| 2
| 11
| 65
| 113
| 50
| 63
| null | null |
channable/icepeak
|
server/src/HttpServer.hs
|
bsd-3-clause
|
buildResponse :: EnqueueResult -> ActionM ()
buildResponse Enqueued = status accepted202
| 88
|
buildResponse :: EnqueueResult -> ActionM ()
buildResponse Enqueued = status accepted202
| 88
|
buildResponse Enqueued = status accepted202
| 43
| false
| true
| 0
| 7
| 10
| 26
| 12
| 14
| null | null |
gridaphobe/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
pprPendingSplice :: OutputableBndr id => SplicePointName -> LHsExpr id -> SDoc
pprPendingSplice n e = angleBrackets (ppr n <> comma <+> ppr e)
| 142
|
pprPendingSplice :: OutputableBndr id => SplicePointName -> LHsExpr id -> SDoc
pprPendingSplice n e = angleBrackets (ppr n <> comma <+> ppr e)
| 142
|
pprPendingSplice n e = angleBrackets (ppr n <> comma <+> ppr e)
| 63
| false
| true
| 0
| 9
| 22
| 54
| 25
| 29
| null | null |
runjak/projectEuler
|
src/Problem215.hs
|
mit
|
mkLineEdges :: [Line] -> [(Line, Line)]
mkLineEdges [] = []
| 59
|
mkLineEdges :: [Line] -> [(Line, Line)]
mkLineEdges [] = []
| 59
|
mkLineEdges [] = []
| 19
| false
| true
| 0
| 7
| 9
| 34
| 19
| 15
| null | null |
kumasento/accelerate
|
Data/Array/Accelerate/Analysis/Match.hs
|
bsd-3-clause
|
hashPrimFun (PrimLogBase _) = hash "PrimLogBase"
| 60
|
hashPrimFun (PrimLogBase _) = hash "PrimLogBase"
| 60
|
hashPrimFun (PrimLogBase _) = hash "PrimLogBase"
| 60
| false
| false
| 0
| 7
| 17
| 18
| 8
| 10
| null | null |
mishun/tangles
|
src/Math/Topology/KnotTh/Algebra/SurfaceDiagram.hs
|
lgpl-3.0
|
rightFace :: (SurfaceDiagram a) => Dart a t -> Face a t
rightFace = leftFace . opposite
| 87
|
rightFace :: (SurfaceDiagram a) => Dart a t -> Face a t
rightFace = leftFace . opposite
| 87
|
rightFace = leftFace . opposite
| 31
| false
| true
| 1
| 8
| 16
| 45
| 20
| 25
| null | null |
ony/hledger
|
bin/hledger-check.hs
|
gpl-3.0
|
-------------------------------------------------------------------------------
-- Dates
-- | Check if two postings are in the same day.
sameDay :: H.Posting -> H.Posting -> Bool
sameDay = sameish id
| 200
|
sameDay :: H.Posting -> H.Posting -> Bool
sameDay = sameish id
| 62
|
sameDay = sameish id
| 20
| true
| true
| 0
| 7
| 25
| 29
| 16
| 13
| null | null |
JacquesCarette/literate-scientific-software
|
code/drasil-example/Drasil/NoPCM/Body.hs
|
bsd-2-clause
|
sensHtEdesc :: Sentence
sensHtEdesc = foldlSent [ch QT.sensHeat, S "occurs as long as the", phrase material_, S "does not reach a",
phrase temp, S "where a", phrase phaseChange, S "occurs" `sC` S "as assumed in", makeRef2S assumpWAL]
| 235
|
sensHtEdesc :: Sentence
sensHtEdesc = foldlSent [ch QT.sensHeat, S "occurs as long as the", phrase material_, S "does not reach a",
phrase temp, S "where a", phrase phaseChange, S "occurs" `sC` S "as assumed in", makeRef2S assumpWAL]
| 235
|
sensHtEdesc = foldlSent [ch QT.sensHeat, S "occurs as long as the", phrase material_, S "does not reach a",
phrase temp, S "where a", phrase phaseChange, S "occurs" `sC` S "as assumed in", makeRef2S assumpWAL]
| 211
| false
| true
| 0
| 8
| 38
| 79
| 40
| 39
| null | null |
luinix/haskell_snail
|
.cabal-sandbox/share/x86_64-osx-ghc-7.6.3/hlint-1.8.59/Default.hs
|
gpl-3.0
|
error = foldl1 (*) ==> product where note = RemovesError "on []"
| 66
|
error = foldl1 (*) ==> product where note = RemovesError "on []"
| 66
|
error = foldl1 (*) ==> product where note = RemovesError "on []"
| 66
| false
| false
| 0
| 7
| 13
| 25
| 13
| 12
| null | null |
blippy/sifi
|
src/Utils.hs
|
gpl-3.0
|
-- example usage: x = [], v2 = $(headQ 'x)
headQ xs = [| assert (not (null $(varE xs))) (head $(varE xs)) |]
| 108
|
headQ xs = [| assert (not (null $(varE xs))) (head $(varE xs)) |]
| 65
|
headQ xs = [| assert (not (null $(varE xs))) (head $(varE xs)) |]
| 65
| true
| false
| 0
| 5
| 22
| 13
| 8
| 5
| null | null |
pjones/byline
|
src/Byline/Internal/Stylized.hs
|
bsd-2-clause
|
-- | Produce bold text.
--
-- @since 1.0.0.0
bold :: Stylized Text -> Stylized Text
bold (Stylized m t) = Stylized (m {modBold = On}) t
| 135
|
bold :: Stylized Text -> Stylized Text
bold (Stylized m t) = Stylized (m {modBold = On}) t
| 90
|
bold (Stylized m t) = Stylized (m {modBold = On}) t
| 51
| true
| true
| 0
| 8
| 26
| 51
| 27
| 24
| null | null |
liefswanson/projectEuler
|
app/p1/q14/Main.hs
|
gpl-2.0
|
-- would it could be faster to build a collatz tree and create a hashmap to each root
main :: IO ()
main =
let
target = 1*10^6
iter = [1..target-1]
sequences = map collatzSequenceFrom iter
lens = map length sequences
results = zip lens iter
(len, elem) = maximum results
output = "length: " ++ (show len) ++ "\n" ++
"start : " ++ (show elem) ++ "\n"
in
putStr output
| 458
|
main :: IO ()
main =
let
target = 1*10^6
iter = [1..target-1]
sequences = map collatzSequenceFrom iter
lens = map length sequences
results = zip lens iter
(len, elem) = maximum results
output = "length: " ++ (show len) ++ "\n" ++
"start : " ++ (show elem) ++ "\n"
in
putStr output
| 372
|
main =
let
target = 1*10^6
iter = [1..target-1]
sequences = map collatzSequenceFrom iter
lens = map length sequences
results = zip lens iter
(len, elem) = maximum results
output = "length: " ++ (show len) ++ "\n" ++
"start : " ++ (show elem) ++ "\n"
in
putStr output
| 358
| true
| true
| 0
| 15
| 163
| 140
| 70
| 70
| null | null |
FranklinChen/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
-- | Pretty-print a high-level closed Idris term with no information
-- about precedence/associativity
prettyImp :: PPOption -- ^ pretty printing options
-> PTerm -- ^ the term to pretty-print
-> Doc OutputAnnotation
prettyImp impl = pprintPTerm impl [] [] []
| 282
|
prettyImp :: PPOption -- ^ pretty printing options
-> PTerm -- ^ the term to pretty-print
-> Doc OutputAnnotation
prettyImp impl = pprintPTerm impl [] [] []
| 179
|
prettyImp impl = pprintPTerm impl [] [] []
| 42
| true
| true
| 0
| 7
| 63
| 44
| 23
| 21
| null | null |
sgillespie/ghc
|
compiler/basicTypes/Unique.hs
|
bsd-3-clause
|
mkTvOccUnique fs = mkUnique 'v' (uniqueOfFS fs)
| 49
|
mkTvOccUnique fs = mkUnique 'v' (uniqueOfFS fs)
| 49
|
mkTvOccUnique fs = mkUnique 'v' (uniqueOfFS fs)
| 49
| false
| false
| 0
| 7
| 8
| 20
| 9
| 11
| null | null |
rueshyna/gogol
|
gogol-genomics/gen/Network/Google/Genomics/Types/Product.hs
|
mpl-2.0
|
-- | If this field is present, this variant call\'s genotype ordering implies
-- the phase of the bases and is consistent with any other variant calls in
-- the same reference sequence which have the same phaseset value. When
-- importing data from VCF, if the genotype data was phased but no phase
-- set was specified this field will be set to \`*\`.
vcPhaseset :: Lens' VariantCall (Maybe Text)
vcPhaseset
= lens _vcPhaseset (\ s a -> s{_vcPhaseset = a})
| 459
|
vcPhaseset :: Lens' VariantCall (Maybe Text)
vcPhaseset
= lens _vcPhaseset (\ s a -> s{_vcPhaseset = a})
| 106
|
vcPhaseset
= lens _vcPhaseset (\ s a -> s{_vcPhaseset = a})
| 61
| true
| true
| 0
| 9
| 83
| 52
| 29
| 23
| null | null |
massysett/penny
|
penny/lib/Penny/Positive.hs
|
bsd-3-clause
|
eight = Positive 8
| 18
|
eight = Positive 8
| 18
|
eight = Positive 8
| 18
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
jparyani/capnproto-boostpython
|
compiler/src/Main.hs
|
bsd-2-clause
|
-- ".." at the beginning of the path refers to the parent of the root directory. Arguably this
-- is illegal but let's at least make sure that "../../foo" doesn't canonicalize to "foo"!
canonicalizePath ("..":rest) = "..":canonicalizePath rest
| 244
|
canonicalizePath ("..":rest) = "..":canonicalizePath rest
| 57
|
canonicalizePath ("..":rest) = "..":canonicalizePath rest
| 57
| true
| false
| 0
| 7
| 38
| 25
| 13
| 12
| null | null |
jekor/jcoreutils
|
xtee/xtee.hs
|
gpl-3.0
|
usage :: String
usage = "Usage: xtee [option...] -i input-file -o output-file"
| 85
|
usage :: String
usage = "Usage: xtee [option...] -i input-file -o output-file"
| 85
|
usage = "Usage: xtee [option...] -i input-file -o output-file"
| 66
| false
| true
| 0
| 4
| 18
| 11
| 6
| 5
| null | null |
bezirg/hlogo
|
src/Language/Logo/Prim.hs
|
bsd-3-clause
|
-- | The turtle turns right by number degrees. (If number is negative, it turns left.)
right :: Double -> C Turtle _s' STM ()
right n = do
(MkTurtle {heading_=th},_,_) <- Reader.ask
lift $ modifyTVar' th (\ h -> mod_ (h+n) 360)
| 233
|
right :: Double -> C Turtle _s' STM ()
right n = do
(MkTurtle {heading_=th},_,_) <- Reader.ask
lift $ modifyTVar' th (\ h -> mod_ (h+n) 360)
| 145
|
right n = do
(MkTurtle {heading_=th},_,_) <- Reader.ask
lift $ modifyTVar' th (\ h -> mod_ (h+n) 360)
| 106
| true
| true
| 0
| 13
| 48
| 89
| 46
| 43
| null | null |
lukexi/ghc-7.8-arm64
|
compiler/cmm/CmmMachOp.hs
|
bsd-3-clause
|
mo_wordSRem dflags = MO_S_Rem (wordWidth dflags)
| 52
|
mo_wordSRem dflags = MO_S_Rem (wordWidth dflags)
| 52
|
mo_wordSRem dflags = MO_S_Rem (wordWidth dflags)
| 52
| false
| false
| 0
| 7
| 9
| 18
| 8
| 10
| null | null |
tjakway/blackjack-simulator
|
src/Jakway/Blackjack/IO/DatabaseCommon.hs
|
mit
|
createTables :: IConnection a => a -> TableNames -> IO ()
createTables = Postgres.createTables
| 94
|
createTables :: IConnection a => a -> TableNames -> IO ()
createTables = Postgres.createTables
| 94
|
createTables = Postgres.createTables
| 36
| false
| true
| 0
| 9
| 13
| 33
| 16
| 17
| null | null |
IreneKnapp/Faction
|
faction/Distribution/Client/Tar.hs
|
bsd-3-clause
|
getString :: Int64 -> Int64 -> ByteString -> String
getString off len = BS.Char8.unpack . BS.Char8.takeWhile (/='\0') . getBytes off len
| 136
|
getString :: Int64 -> Int64 -> ByteString -> String
getString off len = BS.Char8.unpack . BS.Char8.takeWhile (/='\0') . getBytes off len
| 136
|
getString off len = BS.Char8.unpack . BS.Char8.takeWhile (/='\0') . getBytes off len
| 84
| false
| true
| 0
| 8
| 20
| 54
| 28
| 26
| null | null |
cryptica/slapnet
|
src/Printer/SARA.hs
|
gpl-3.0
|
renderFormula :: String -> String -> PetriNet -> Formula Place -> Builder
renderFormula = renderDisjunction
| 107
|
renderFormula :: String -> String -> PetriNet -> Formula Place -> Builder
renderFormula = renderDisjunction
| 107
|
renderFormula = renderDisjunction
| 33
| false
| true
| 0
| 9
| 14
| 30
| 15
| 15
| null | null |
DavidAlphaFox/ghc
|
libraries/Cabal/cabal-install/Distribution/Client/BuildReports/Anonymous.hs
|
bsd-3-clause
|
-- -----------------------------------------------------------------------------
-- Description of the fields, for parsing/printing
fieldDescrs :: [FieldDescr BuildReport]
fieldDescrs =
[ simpleField "package" Text.disp Text.parse
package (\v r -> r { package = v })
, simpleField "os" Text.disp Text.parse
os (\v r -> r { os = v })
, simpleField "arch" Text.disp Text.parse
arch (\v r -> r { arch = v })
, simpleField "compiler" Text.disp Text.parse
compiler (\v r -> r { compiler = v })
, simpleField "client" Text.disp Text.parse
client (\v r -> r { client = v })
, listField "flags" dispFlag parseFlag
flagAssignment (\v r -> r { flagAssignment = v })
, listField "dependencies" Text.disp Text.parse
dependencies (\v r -> r { dependencies = v })
, simpleField "install-outcome" Text.disp Text.parse
installOutcome (\v r -> r { installOutcome = v })
, simpleField "docs-outcome" Text.disp Text.parse
docsOutcome (\v r -> r { docsOutcome = v })
, simpleField "tests-outcome" Text.disp Text.parse
testsOutcome (\v r -> r { testsOutcome = v })
]
| 1,558
|
fieldDescrs :: [FieldDescr BuildReport]
fieldDescrs =
[ simpleField "package" Text.disp Text.parse
package (\v r -> r { package = v })
, simpleField "os" Text.disp Text.parse
os (\v r -> r { os = v })
, simpleField "arch" Text.disp Text.parse
arch (\v r -> r { arch = v })
, simpleField "compiler" Text.disp Text.parse
compiler (\v r -> r { compiler = v })
, simpleField "client" Text.disp Text.parse
client (\v r -> r { client = v })
, listField "flags" dispFlag parseFlag
flagAssignment (\v r -> r { flagAssignment = v })
, listField "dependencies" Text.disp Text.parse
dependencies (\v r -> r { dependencies = v })
, simpleField "install-outcome" Text.disp Text.parse
installOutcome (\v r -> r { installOutcome = v })
, simpleField "docs-outcome" Text.disp Text.parse
docsOutcome (\v r -> r { docsOutcome = v })
, simpleField "tests-outcome" Text.disp Text.parse
testsOutcome (\v r -> r { testsOutcome = v })
]
| 1,425
|
fieldDescrs =
[ simpleField "package" Text.disp Text.parse
package (\v r -> r { package = v })
, simpleField "os" Text.disp Text.parse
os (\v r -> r { os = v })
, simpleField "arch" Text.disp Text.parse
arch (\v r -> r { arch = v })
, simpleField "compiler" Text.disp Text.parse
compiler (\v r -> r { compiler = v })
, simpleField "client" Text.disp Text.parse
client (\v r -> r { client = v })
, listField "flags" dispFlag parseFlag
flagAssignment (\v r -> r { flagAssignment = v })
, listField "dependencies" Text.disp Text.parse
dependencies (\v r -> r { dependencies = v })
, simpleField "install-outcome" Text.disp Text.parse
installOutcome (\v r -> r { installOutcome = v })
, simpleField "docs-outcome" Text.disp Text.parse
docsOutcome (\v r -> r { docsOutcome = v })
, simpleField "tests-outcome" Text.disp Text.parse
testsOutcome (\v r -> r { testsOutcome = v })
]
| 1,385
| true
| true
| 0
| 10
| 678
| 375
| 209
| 166
| null | null |
silky/Tidal
|
Sound/Tidal/Strategies.hs
|
gpl-3.0
|
sinewave4 = ((*4) <$> sinewave1)
| 32
|
sinewave4 = ((*4) <$> sinewave1)
| 32
|
sinewave4 = ((*4) <$> sinewave1)
| 32
| false
| false
| 1
| 8
| 4
| 21
| 10
| 11
| null | null |
rcampbell/vcard
|
VCard.hs
|
apache-2.0
|
propFields :: Parser [[String]]
propFields = do
fs <- field `sepBy` char ';'
return $ map (map concat) fs
where field = many component `sepBy` char ','
component = propEscaping "\\,;\r\n"
{- | 5. Property Parameters -}
| 234
|
propFields :: Parser [[String]]
propFields = do
fs <- field `sepBy` char ';'
return $ map (map concat) fs
where field = many component `sepBy` char ','
component = propEscaping "\\,;\r\n"
{- | 5. Property Parameters -}
| 234
|
propFields = do
fs <- field `sepBy` char ';'
return $ map (map concat) fs
where field = many component `sepBy` char ','
component = propEscaping "\\,;\r\n"
{- | 5. Property Parameters -}
| 202
| false
| true
| 2
| 10
| 52
| 94
| 43
| 51
| null | null |
nevrenato/HetsAlloy
|
OWL2/OWL22CommonLogic.hs
|
gpl-2.0
|
-- | mapping of individual list
mapComIndivList :: Sign -> SameOrDifferent -> Maybe Individual -> [Individual]
-> Result [SENTENCE]
mapComIndivList cSig sod mi inds = do
fs <- mapM (mapIndivIRI cSig) inds
il <- case mi of
Nothing -> return $ comPairs fs fs
Just i -> fmap (`mkPairs` fs) $ mapIndivIRI cSig i
let sntLst = map (\ (x, y) -> case sod of
Same -> mkAE x y
Different -> mkBN $ mkAE x y) il
return [mkBC sntLst]
| 508
|
mapComIndivList :: Sign -> SameOrDifferent -> Maybe Individual -> [Individual]
-> Result [SENTENCE]
mapComIndivList cSig sod mi inds = do
fs <- mapM (mapIndivIRI cSig) inds
il <- case mi of
Nothing -> return $ comPairs fs fs
Just i -> fmap (`mkPairs` fs) $ mapIndivIRI cSig i
let sntLst = map (\ (x, y) -> case sod of
Same -> mkAE x y
Different -> mkBN $ mkAE x y) il
return [mkBC sntLst]
| 476
|
mapComIndivList cSig sod mi inds = do
fs <- mapM (mapIndivIRI cSig) inds
il <- case mi of
Nothing -> return $ comPairs fs fs
Just i -> fmap (`mkPairs` fs) $ mapIndivIRI cSig i
let sntLst = map (\ (x, y) -> case sod of
Same -> mkAE x y
Different -> mkBN $ mkAE x y) il
return [mkBC sntLst]
| 360
| true
| true
| 0
| 17
| 168
| 190
| 93
| 97
| null | null |
uriba/BioSite
|
devel.hs
|
bsd-2-clause
|
loop :: IO ()
loop = do
threadDelay 100000
e <- doesFileExist "dist/devel-terminate"
if e then terminateDevel else loop
| 125
|
loop :: IO ()
loop = do
threadDelay 100000
e <- doesFileExist "dist/devel-terminate"
if e then terminateDevel else loop
| 125
|
loop = do
threadDelay 100000
e <- doesFileExist "dist/devel-terminate"
if e then terminateDevel else loop
| 111
| false
| true
| 0
| 8
| 24
| 43
| 20
| 23
| null | null |
bos/text
|
benchmarks/haskell/Benchmarks/Concat.hs
|
bsd-2-clause
|
append4 x1 x2 x3 x4 = x1 `append` x2 `append` x3 `append` x4
| 60
|
append4 x1 x2 x3 x4 = x1 `append` x2 `append` x3 `append` x4
| 60
|
append4 x1 x2 x3 x4 = x1 `append` x2 `append` x3 `append` x4
| 60
| false
| false
| 1
| 7
| 12
| 42
| 20
| 22
| null | null |
nevrenato/HetsAlloy
|
CspCASL/Morphism.hs
|
gpl-2.0
|
-- * application of morphisms to sentences
-- | Apply a Signature Morphism to a CspCASL Sentence
mapSen :: CspCASLMorphism -> CspSen -> CspSen
mapSen mor sen =
if CASL_Morphism.isInclusionMorphism
CASL_Morphism.isInclusionMorphismExtension mor
then sen
else case sen of
ProcessEq procName fqVarList commAlpha proc ->
let {- Map the morphism over all the parts of the process
equation -}
newProcName = mapProcessName mor procName
newFqVarList = mapFQProcVarList mor fqVarList
newCommAlpha = mapCommAlpha mor commAlpha
newProc = mapProc mor proc
in ProcessEq newProcName newFqVarList
newCommAlpha newProc
-- | Apply a signature morphism to a Fully Qualified Process Variable List
| 871
|
mapSen :: CspCASLMorphism -> CspSen -> CspSen
mapSen mor sen =
if CASL_Morphism.isInclusionMorphism
CASL_Morphism.isInclusionMorphismExtension mor
then sen
else case sen of
ProcessEq procName fqVarList commAlpha proc ->
let {- Map the morphism over all the parts of the process
equation -}
newProcName = mapProcessName mor procName
newFqVarList = mapFQProcVarList mor fqVarList
newCommAlpha = mapCommAlpha mor commAlpha
newProc = mapProc mor proc
in ProcessEq newProcName newFqVarList
newCommAlpha newProc
-- | Apply a signature morphism to a Fully Qualified Process Variable List
| 773
|
mapSen mor sen =
if CASL_Morphism.isInclusionMorphism
CASL_Morphism.isInclusionMorphismExtension mor
then sen
else case sen of
ProcessEq procName fqVarList commAlpha proc ->
let {- Map the morphism over all the parts of the process
equation -}
newProcName = mapProcessName mor procName
newFqVarList = mapFQProcVarList mor fqVarList
newCommAlpha = mapCommAlpha mor commAlpha
newProc = mapProc mor proc
in ProcessEq newProcName newFqVarList
newCommAlpha newProc
-- | Apply a signature morphism to a Fully Qualified Process Variable List
| 727
| true
| true
| 0
| 13
| 290
| 119
| 60
| 59
| null | null |
fpco/statistics
|
Statistics/Regression.hs
|
bsd-2-clause
|
rSquare :: Matrix -- ^ Predictors (regressors).
-> Vector -- ^ Responders.
-> Vector -- ^ Regression coefficients.
-> Double
rSquare pred resp coeff = 1 - r / t
where
r = sum $ flip U.imap resp $ \i x -> square (x - p i)
t = sum $ flip U.map resp $ \x -> square (x - mean resp)
p i = sum . flip U.imap coeff $ \j -> (* unsafeIndex pred i j)
-- | Bootstrap a regression function. Returns both the results of the
-- regression and the requested confidence interval values.
| 556
|
rSquare :: Matrix -- ^ Predictors (regressors).
-> Vector -- ^ Responders.
-> Vector -- ^ Regression coefficients.
-> Double
rSquare pred resp coeff = 1 - r / t
where
r = sum $ flip U.imap resp $ \i x -> square (x - p i)
t = sum $ flip U.map resp $ \x -> square (x - mean resp)
p i = sum . flip U.imap coeff $ \j -> (* unsafeIndex pred i j)
-- | Bootstrap a regression function. Returns both the results of the
-- regression and the requested confidence interval values.
| 556
|
rSquare pred resp coeff = 1 - r / t
where
r = sum $ flip U.imap resp $ \i x -> square (x - p i)
t = sum $ flip U.map resp $ \x -> square (x - mean resp)
p i = sum . flip U.imap coeff $ \j -> (* unsafeIndex pred i j)
-- | Bootstrap a regression function. Returns both the results of the
-- regression and the requested confidence interval values.
| 365
| false
| true
| 0
| 10
| 183
| 163
| 84
| 79
| null | null |
brendanhay/gogol
|
gogol-pubsub/gen/Network/Google/Resource/PubSub/Projects/Subscriptions/Detach.hs
|
mpl-2.0
|
-- | OAuth access token.
psd1AccessToken :: Lens' ProjectsSubscriptionsDetach (Maybe Text)
psd1AccessToken
= lens _psd1AccessToken
(\ s a -> s{_psd1AccessToken = a})
| 173
|
psd1AccessToken :: Lens' ProjectsSubscriptionsDetach (Maybe Text)
psd1AccessToken
= lens _psd1AccessToken
(\ s a -> s{_psd1AccessToken = a})
| 148
|
psd1AccessToken
= lens _psd1AccessToken
(\ s a -> s{_psd1AccessToken = a})
| 82
| true
| true
| 0
| 9
| 29
| 48
| 25
| 23
| null | null |
rethab/combinatorrent
|
src/Process/PieceMgr.hs
|
bsd-2-clause
|
createPieceDb :: MonadIO m => PiecesDoneMap -> PieceMap -> m ST
createPieceDb mmap pmap = do
return $ ST [] (M.map f mmap) S.empty pmap False PendS.empty 0 (Tracer.new 50)
where f False = Pending
f True = Done
-- | The call @completePiece db pn@ will mark that the piece @pn@ is completed
| 304
|
createPieceDb :: MonadIO m => PiecesDoneMap -> PieceMap -> m ST
createPieceDb mmap pmap = do
return $ ST [] (M.map f mmap) S.empty pmap False PendS.empty 0 (Tracer.new 50)
where f False = Pending
f True = Done
-- | The call @completePiece db pn@ will mark that the piece @pn@ is completed
| 304
|
createPieceDb mmap pmap = do
return $ ST [] (M.map f mmap) S.empty pmap False PendS.empty 0 (Tracer.new 50)
where f False = Pending
f True = Done
-- | The call @completePiece db pn@ will mark that the piece @pn@ is completed
| 240
| false
| true
| 1
| 11
| 69
| 102
| 49
| 53
| null | null |
Helium4Haskell/helium
|
src/Helium/Syntax/UHA_Range.hs
|
gpl-3.0
|
getLHSRange :: LeftHandSide -> Range
getLHSRange lhs = case lhs of
LeftHandSide_Function r _ _ -> r
LeftHandSide_Infix r _ _ _ -> r
LeftHandSide_Parenthesized r _ _ -> r
| 189
|
getLHSRange :: LeftHandSide -> Range
getLHSRange lhs = case lhs of
LeftHandSide_Function r _ _ -> r
LeftHandSide_Infix r _ _ _ -> r
LeftHandSide_Parenthesized r _ _ -> r
| 189
|
getLHSRange lhs = case lhs of
LeftHandSide_Function r _ _ -> r
LeftHandSide_Infix r _ _ _ -> r
LeftHandSide_Parenthesized r _ _ -> r
| 152
| false
| true
| 4
| 5
| 49
| 61
| 30
| 31
| null | null |
ellis/OnTopOfThings
|
old-20150308/src/OnTopOfThings/Parsers/CardParser.hs
|
gpl-3.0
|
parseNumberList :: String -> Validation [String]
parseNumberList s = case parse pmain "NumberList" s of
Left _ -> Left ["Couldn't parse ID list: "++s]
Right l -> Right l
| 173
|
parseNumberList :: String -> Validation [String]
parseNumberList s = case parse pmain "NumberList" s of
Left _ -> Left ["Couldn't parse ID list: "++s]
Right l -> Right l
| 173
|
parseNumberList s = case parse pmain "NumberList" s of
Left _ -> Left ["Couldn't parse ID list: "++s]
Right l -> Right l
| 124
| false
| true
| 4
| 9
| 32
| 65
| 31
| 34
| null | null |
liamoc/tea-hs
|
Tea/Input.hs
|
bsd-3-clause
|
sdlKey SDL.SDLK_COMMA = KeyComma
| 39
|
sdlKey SDL.SDLK_COMMA = KeyComma
| 39
|
sdlKey SDL.SDLK_COMMA = KeyComma
| 39
| false
| false
| 0
| 6
| 10
| 11
| 5
| 6
| null | null |
brendanhay/gogol
|
gogol-iap/gen/Network/Google/IAP/Types/Product.hs
|
mpl-2.0
|
-- | Identifies an instance of the type. ID format varies by type. The ID
-- format is defined in the IAM .service file that defines the type, either
-- in path_mapping or in a comment.
pnId :: Lens' PolicyName (Maybe Text)
pnId = lens _pnId (\ s a -> s{_pnId = a})
| 265
|
pnId :: Lens' PolicyName (Maybe Text)
pnId = lens _pnId (\ s a -> s{_pnId = a})
| 79
|
pnId = lens _pnId (\ s a -> s{_pnId = a})
| 41
| true
| true
| 0
| 9
| 52
| 48
| 27
| 21
| null | null |
pfcuttle/twentyfour-2013
|
src/scotty/Main.hs
|
bsd-3-clause
|
chrstmsly :: ScottyM ()
chrstmsly = do
get "/" showLandingPage
post "/register" register
post "/register" registrationFailure
| 137
|
chrstmsly :: ScottyM ()
chrstmsly = do
get "/" showLandingPage
post "/register" register
post "/register" registrationFailure
| 137
|
chrstmsly = do
get "/" showLandingPage
post "/register" register
post "/register" registrationFailure
| 113
| false
| true
| 0
| 7
| 27
| 40
| 17
| 23
| null | null |
mwu-tow/cuda
|
examples/src/bandwidthTest/BandwidthTest.hs
|
bsd-3-clause
|
bandwidth :: CopyMode -> MemoryMode -> Int -> IO Double
bandwidth HostToDevice List n =
bench n (CUDA.withListArray [1..n] (\_ -> return ()))
| 148
|
bandwidth :: CopyMode -> MemoryMode -> Int -> IO Double
bandwidth HostToDevice List n =
bench n (CUDA.withListArray [1..n] (\_ -> return ()))
| 147
|
bandwidth HostToDevice List n =
bench n (CUDA.withListArray [1..n] (\_ -> return ()))
| 91
| false
| true
| 0
| 11
| 29
| 66
| 33
| 33
| null | null |
christiaanb/clash
|
clash/CLasH/Utils/Pretty.hs
|
bsd-3-clause
|
encode_ch '\\' = "zr"
| 21
|
encode_ch '\\' = "zr"
| 21
|
encode_ch '\\' = "zr"
| 21
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
kawu/tag-vanilla
|
src/NLP/TAG/Vanilla/Tests.hs
|
bsd-2-clause
|
-- | Compile the first grammar.
mkGram4 :: IO WeightedGram
mkGram4 = W.compileWeights $
map Left
[ make1, make2, a', cat
, drink, catDrink ] ++
map Right [almostW]
| 187
|
mkGram4 :: IO WeightedGram
mkGram4 = W.compileWeights $
map Left
[ make1, make2, a', cat
, drink, catDrink ] ++
map Right [almostW]
| 155
|
mkGram4 = W.compileWeights $
map Left
[ make1, make2, a', cat
, drink, catDrink ] ++
map Right [almostW]
| 128
| true
| true
| 3
| 6
| 52
| 58
| 31
| 27
| null | null |
hesiod/units
|
Tests/PhysicalConstants.hs
|
bsd-3-clause
|
protonMass :: DefaultConvertibleLCSU_D D.Mass l => Mass l Double
protonMass = constant $ 1.67262178e-24 % Gram
| 110
|
protonMass :: DefaultConvertibleLCSU_D D.Mass l => Mass l Double
protonMass = constant $ 1.67262178e-24 % Gram
| 110
|
protonMass = constant $ 1.67262178e-24 % Gram
| 45
| false
| true
| 3
| 8
| 15
| 43
| 18
| 25
| null | null |
kaoskorobase/mescaline
|
lib/mescaline/Mescaline/FeatureSpace/Model.hs
|
gpl-3.0
|
numRegions :: FeatureSpace -> Int
numRegions = Map.size . regionMap
| 67
|
numRegions :: FeatureSpace -> Int
numRegions = Map.size . regionMap
| 67
|
numRegions = Map.size . regionMap
| 33
| false
| true
| 1
| 7
| 9
| 29
| 12
| 17
| null | null |
akiomik/dtx2midi
|
src/DTX2MIDI.hs
|
bsd-3-clause
|
-- | 疎になっている小節のオブジェクトを休符で補完する
objectCompletion :: [DTX.Key] -> [DTX.Object]
objectCompletion keys =
map (\key -> DTX.Object key (DTX.HiHatClose ["00"])) $ keyCompletion keys \\ keys
| 183
|
objectCompletion :: [DTX.Key] -> [DTX.Object]
objectCompletion keys =
map (\key -> DTX.Object key (DTX.HiHatClose ["00"])) $ keyCompletion keys \\ keys
| 153
|
objectCompletion keys =
map (\key -> DTX.Object key (DTX.HiHatClose ["00"])) $ keyCompletion keys \\ keys
| 107
| true
| true
| 0
| 12
| 24
| 69
| 36
| 33
| null | null |
brendanhay/gogol
|
gogol-firestore/gen/Network/Google/FireStore/Types/Product.hs
|
mpl-2.0
|
-- | The collection ID. When set, selects only collections with this ID.
csCollectionId :: Lens' CollectionSelector (Maybe Text)
csCollectionId
= lens _csCollectionId
(\ s a -> s{_csCollectionId = a})
| 208
|
csCollectionId :: Lens' CollectionSelector (Maybe Text)
csCollectionId
= lens _csCollectionId
(\ s a -> s{_csCollectionId = a})
| 135
|
csCollectionId
= lens _csCollectionId
(\ s a -> s{_csCollectionId = a})
| 79
| true
| true
| 0
| 8
| 37
| 49
| 25
| 24
| null | null |
GaloisInc/sk-dev-platform
|
user/sklite/tests/ConfigParsingTests.hs
|
bsd-3-clause
|
unidirChannel :: String
unidirChannel =
"<layout bandwidth=\"70\" baseDir=\"foo\">\n\
\ <channel name=\"chan\" from=\"c1\" to=\"c2\" msgsize=\"1024\" slots=\"4\" />\n\
\</layout>"
| 192
|
unidirChannel :: String
unidirChannel =
"<layout bandwidth=\"70\" baseDir=\"foo\">\n\
\ <channel name=\"chan\" from=\"c1\" to=\"c2\" msgsize=\"1024\" slots=\"4\" />\n\
\</layout>"
| 192
|
unidirChannel =
"<layout bandwidth=\"70\" baseDir=\"foo\">\n\
\ <channel name=\"chan\" from=\"c1\" to=\"c2\" msgsize=\"1024\" slots=\"4\" />\n\
\</layout>"
| 168
| false
| true
| 0
| 4
| 29
| 11
| 6
| 5
| null | null |
brendanhay/gogol
|
gogol-servicemanagement/gen/Network/Google/Resource/ServiceManagement/Services/Rollouts/List.hs
|
mpl-2.0
|
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
srlUploadProtocol :: Lens' ServicesRolloutsList (Maybe Text)
srlUploadProtocol
= lens _srlUploadProtocol
(\ s a -> s{_srlUploadProtocol = a})
| 211
|
srlUploadProtocol :: Lens' ServicesRolloutsList (Maybe Text)
srlUploadProtocol
= lens _srlUploadProtocol
(\ s a -> s{_srlUploadProtocol = a})
| 149
|
srlUploadProtocol
= lens _srlUploadProtocol
(\ s a -> s{_srlUploadProtocol = a})
| 88
| true
| true
| 0
| 9
| 33
| 48
| 25
| 23
| null | null |
andreagenso/java2scala
|
test/J2s/Scanner/Test.hs
|
apache-2.0
|
tss85_1 = scanner (path ++ "workspaceclipse_haskell/java2scala/test/J2s/Parser/85typeDeclaration1.java")
| 104
|
tss85_1 = scanner (path ++ "workspaceclipse_haskell/java2scala/test/J2s/Parser/85typeDeclaration1.java")
| 104
|
tss85_1 = scanner (path ++ "workspaceclipse_haskell/java2scala/test/J2s/Parser/85typeDeclaration1.java")
| 104
| false
| false
| 1
| 7
| 5
| 20
| 8
| 12
| null | null |
shingoOKAWA/hsarg-haskell
|
src/DSL/Structured/Standard.hs
|
bsd-3-clause
|
-- * "Scintilla"
-- | For a proposition to satisfy the weakest proof standard, scintilla of
-- evidence, there should be at least one applicable argument in the model.
scintilla :: Proof
scintilla model@(Strct (thds, _, _)) prop =
any (applicable model) (rationals prop thds)
| 281
|
scintilla :: Proof
scintilla model@(Strct (thds, _, _)) prop =
any (applicable model) (rationals prop thds)
| 111
|
scintilla model@(Strct (thds, _, _)) prop =
any (applicable model) (rationals prop thds)
| 92
| true
| true
| 0
| 9
| 50
| 56
| 31
| 25
| null | null |
ml9951/ghc
|
compiler/typecheck/TcGenDeriv.hs
|
bsd-3-clause
|
dataCast2_RDR = varQual_RDR gENERICS (fsLit "dataCast2")
| 58
|
dataCast2_RDR = varQual_RDR gENERICS (fsLit "dataCast2")
| 58
|
dataCast2_RDR = varQual_RDR gENERICS (fsLit "dataCast2")
| 58
| false
| false
| 0
| 7
| 7
| 17
| 8
| 9
| null | null |
ddssff/pandoc
|
src/Text/Pandoc/Parsing.hs
|
gpl-2.0
|
defaultNum :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)
defaultNum = do
char '#'
return (DefaultStyle, 1)
-- | Parses a lowercase letter and returns (LowerAlpha, number).
| 190
|
defaultNum :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)
defaultNum = do
char '#'
return (DefaultStyle, 1)
-- | Parses a lowercase letter and returns (LowerAlpha, number).
| 190
|
defaultNum = do
char '#'
return (DefaultStyle, 1)
-- | Parses a lowercase letter and returns (LowerAlpha, number).
| 119
| false
| true
| 0
| 9
| 35
| 62
| 29
| 33
| null | null |
daleooo/barrelfish
|
hake/ARMv7.hs
|
mit
|
archFamily = "arm"
| 18
|
archFamily = "arm"
| 18
|
archFamily = "arm"
| 18
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
brendanhay/numbersd
|
test/Properties/Series.hs
|
mpl-2.0
|
isUpdateAfterEnd :: SeriesUpdate -> Bool
isUpdateAfterEnd SeriesUpdate{..} =
(fromIntegral updateInputTime :: Int) >= fromIntegral updateInputEnd + updateInputStep
| 165
|
isUpdateAfterEnd :: SeriesUpdate -> Bool
isUpdateAfterEnd SeriesUpdate{..} =
(fromIntegral updateInputTime :: Int) >= fromIntegral updateInputEnd + updateInputStep
| 165
|
isUpdateAfterEnd SeriesUpdate{..} =
(fromIntegral updateInputTime :: Int) >= fromIntegral updateInputEnd + updateInputStep
| 124
| false
| true
| 0
| 8
| 18
| 44
| 22
| 22
| null | null |
jgm/pandoc-citeproc
|
src/Text/CSL/Pandoc.hs
|
bsd-3-clause
|
pBalancedBraces :: [(Char, Char)]
-> Parsec [Inline] st (Bool, Text)
-> Parsec [Inline] st (Bool, Text)
pBalancedBraces braces p = try $ do
ss <- many1 surround
return $ anyWereDigitLike ss
where
except = notFollowedBy pBraces >> p
-- outer and inner
surround = foldl (\a (open, close) -> sur open close except <|> a)
except
braces
isc c = stringify <$> pMatchChar [c] (== c)
sur c c' m = try $ do
(d, mid) <- between (isc c) (isc c') (option (False, "") m)
return (d, T.cons c . flip T.snoc c' $ mid)
flattened = concatMap (\(o, c) -> [o, c]) braces
pBraces = pMatchChar "braces" (`elem` flattened)
-- YES 1, 1.2, 1.2.3
-- NO 1., 1.2. a.6
-- can't use sepBy because we want to leave trailing .s
| 847
|
pBalancedBraces :: [(Char, Char)]
-> Parsec [Inline] st (Bool, Text)
-> Parsec [Inline] st (Bool, Text)
pBalancedBraces braces p = try $ do
ss <- many1 surround
return $ anyWereDigitLike ss
where
except = notFollowedBy pBraces >> p
-- outer and inner
surround = foldl (\a (open, close) -> sur open close except <|> a)
except
braces
isc c = stringify <$> pMatchChar [c] (== c)
sur c c' m = try $ do
(d, mid) <- between (isc c) (isc c') (option (False, "") m)
return (d, T.cons c . flip T.snoc c' $ mid)
flattened = concatMap (\(o, c) -> [o, c]) braces
pBraces = pMatchChar "braces" (`elem` flattened)
-- YES 1, 1.2, 1.2.3
-- NO 1., 1.2. a.6
-- can't use sepBy because we want to leave trailing .s
| 847
|
pBalancedBraces braces p = try $ do
ss <- many1 surround
return $ anyWereDigitLike ss
where
except = notFollowedBy pBraces >> p
-- outer and inner
surround = foldl (\a (open, close) -> sur open close except <|> a)
except
braces
isc c = stringify <$> pMatchChar [c] (== c)
sur c c' m = try $ do
(d, mid) <- between (isc c) (isc c') (option (False, "") m)
return (d, T.cons c . flip T.snoc c' $ mid)
flattened = concatMap (\(o, c) -> [o, c]) braces
pBraces = pMatchChar "braces" (`elem` flattened)
-- YES 1, 1.2, 1.2.3
-- NO 1., 1.2. a.6
-- can't use sepBy because we want to leave trailing .s
| 711
| false
| true
| 5
| 14
| 283
| 313
| 166
| 147
| null | null |
IUdalov/crossword-sketch
|
src/Dictionary.hs
|
gpl-3.0
|
-- common ---------------------------------------------------------------------
ind :: Dictionary -> Int -> SubDictionary
ind d n = if M.member n d then d M.! n else []
| 168
|
ind :: Dictionary -> Int -> SubDictionary
ind d n = if M.member n d then d M.! n else []
| 88
|
ind d n = if M.member n d then d M.! n else []
| 46
| true
| true
| 0
| 7
| 23
| 48
| 25
| 23
| null | null |
sordina/prettybraces
|
src/Main.hs
|
mit
|
nonBracket :: [Braces] -> Parsec String String
nonBracket bs = untilP $ choice $ map string bStrings
where
bStrings = bs >>= \(l,r) -> [l,r]
| 144
|
nonBracket :: [Braces] -> Parsec String String
nonBracket bs = untilP $ choice $ map string bStrings
where
bStrings = bs >>= \(l,r) -> [l,r]
| 144
|
nonBracket bs = untilP $ choice $ map string bStrings
where
bStrings = bs >>= \(l,r) -> [l,r]
| 97
| false
| true
| 0
| 7
| 28
| 68
| 36
| 32
| null | null |
TikhonJelvis/array-forth
|
test/Language/ArrayForth/Test.hs
|
gpl-3.0
|
isValid (Jump2 a b addr) = not (isJump a) && isJump b
| 55
|
isValid (Jump2 a b addr) = not (isJump a) && isJump b
| 55
|
isValid (Jump2 a b addr) = not (isJump a) && isJump b
| 55
| false
| false
| 0
| 8
| 13
| 35
| 16
| 19
| null | null |
apyrgio/snf-ganeti
|
src/Ganeti/HTools/Program/Hspace.hs
|
bsd-2-clause
|
printResults False ini_nl fin_nl _ allocs sreason = do
putStrLn "Normal (fixed-size) allocation results:"
printf " - %3d instances allocated\n" allocs :: IO ()
printFRScores ini_nl fin_nl sreason
-- | Prints the final @OK@ marker in machine readable output.
| 265
|
printResults False ini_nl fin_nl _ allocs sreason = do
putStrLn "Normal (fixed-size) allocation results:"
printf " - %3d instances allocated\n" allocs :: IO ()
printFRScores ini_nl fin_nl sreason
-- | Prints the final @OK@ marker in machine readable output.
| 265
|
printResults False ini_nl fin_nl _ allocs sreason = do
putStrLn "Normal (fixed-size) allocation results:"
printf " - %3d instances allocated\n" allocs :: IO ()
printFRScores ini_nl fin_nl sreason
-- | Prints the final @OK@ marker in machine readable output.
| 265
| false
| false
| 0
| 8
| 46
| 52
| 23
| 29
| null | null |
beni55/ghcjs
|
src/Gen2/Prim.hs
|
mit
|
genPrim d t PopCntOp [r] [x] = genPrim d t PopCnt32Op [r] [x]
| 72
|
genPrim d t PopCntOp [r] [x] = genPrim d t PopCnt32Op [r] [x]
| 72
|
genPrim d t PopCntOp [r] [x] = genPrim d t PopCnt32Op [r] [x]
| 72
| false
| false
| 0
| 6
| 23
| 40
| 21
| 19
| null | null |
kmilner/tamarin-prover
|
src/Web/Types.hs
|
gpl-3.0
|
getEitherTheoryOrigin :: EitherTheoryInfo -> TheoryOrigin
getEitherTheoryOrigin (Trace i) = (tiOrigin i)
| 105
|
getEitherTheoryOrigin :: EitherTheoryInfo -> TheoryOrigin
getEitherTheoryOrigin (Trace i) = (tiOrigin i)
| 105
|
getEitherTheoryOrigin (Trace i) = (tiOrigin i)
| 47
| false
| true
| 0
| 7
| 11
| 30
| 15
| 15
| null | null |
Lexer747/Haskell-Fractals
|
Core/CoreIO.hs
|
gpl-3.0
|
-- |A function which takes a FullFigure and writes it to a file so it is viewable
-- useage: publishFullFigure figureToView => ()
publishFullFigure :: FullFigure -> IO ()
publishFullFigure fig = writeFile "Output.svg" $ writeFullFigure fig
| 239
|
publishFullFigure :: FullFigure -> IO ()
publishFullFigure fig = writeFile "Output.svg" $ writeFullFigure fig
| 109
|
publishFullFigure fig = writeFile "Output.svg" $ writeFullFigure fig
| 68
| true
| true
| 0
| 7
| 36
| 35
| 17
| 18
| null | null |
brendanhay/gogol
|
gogol-analyticsreporting/gen/Network/Google/AnalyticsReporting/Types/Product.hs
|
mpl-2.0
|
-- | Required. The Analytics [view
-- ID](https:\/\/support.google.com\/analytics\/answer\/1009618) from which
-- to retrieve data. Every
-- [SearchUserActivityRequest](#SearchUserActivityRequest) must contain the
-- \`viewId\`.
suarViewId :: Lens' SearchUserActivityRequest (Maybe Text)
suarViewId
= lens _suarViewId (\ s a -> s{_suarViewId = a})
| 349
|
suarViewId :: Lens' SearchUserActivityRequest (Maybe Text)
suarViewId
= lens _suarViewId (\ s a -> s{_suarViewId = a})
| 120
|
suarViewId
= lens _suarViewId (\ s a -> s{_suarViewId = a})
| 61
| true
| true
| 2
| 9
| 40
| 59
| 29
| 30
| null | null |
shlevy/ghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
emitPrimOp dflags res WriteByteArrayOp_Addr args = doWriteByteArrayOp Nothing (bWord dflags) res args
| 113
|
emitPrimOp dflags res WriteByteArrayOp_Addr args = doWriteByteArrayOp Nothing (bWord dflags) res args
| 113
|
emitPrimOp dflags res WriteByteArrayOp_Addr args = doWriteByteArrayOp Nothing (bWord dflags) res args
| 113
| false
| false
| 0
| 7
| 23
| 34
| 14
| 20
| null | null |
cernat-catalin/haskellGame
|
src/GMainLoop/Client.hs
|
bsd-3-clause
|
mainLoop :: ClientState -> ShaderResources -> GLFW.Window -> IO ()
mainLoop clientState@ClientState{..} shaderResources window = do
-- logInfo (printf "World = %s" (show world))
threadDelay 14000 -- 0.014 sec
-- Process input messages and send new position
menuIsOn_ <- atomically $ readTVar menuIsOn
clientState22 <- case menuIsOn_ of
True -> do
_ <- processWorldInput clientState
_ <- processMousePos clientState window
return clientState
False -> do
clientState1 <- processWorldInput clientState
let clientState21 = processKeysState clientState1
if (space keysState) == True then processFireEvent clientState else return ()
processMousePos clientState21 window
sendPositionUpdate clientState22
-- Process server world updates
world' <- serverUpdateWorld clientState22
let clientState3 = clientState22 { world = world' }
-- Draw world
drawWorld clientState3 shaderResources window
shouldQuit_ <- atomically $ readTVar shouldQuit
unless shouldQuit_ $ do
mainLoop clientState3 shaderResources window
| 1,086
|
mainLoop :: ClientState -> ShaderResources -> GLFW.Window -> IO ()
mainLoop clientState@ClientState{..} shaderResources window = do
-- logInfo (printf "World = %s" (show world))
threadDelay 14000 -- 0.014 sec
-- Process input messages and send new position
menuIsOn_ <- atomically $ readTVar menuIsOn
clientState22 <- case menuIsOn_ of
True -> do
_ <- processWorldInput clientState
_ <- processMousePos clientState window
return clientState
False -> do
clientState1 <- processWorldInput clientState
let clientState21 = processKeysState clientState1
if (space keysState) == True then processFireEvent clientState else return ()
processMousePos clientState21 window
sendPositionUpdate clientState22
-- Process server world updates
world' <- serverUpdateWorld clientState22
let clientState3 = clientState22 { world = world' }
-- Draw world
drawWorld clientState3 shaderResources window
shouldQuit_ <- atomically $ readTVar shouldQuit
unless shouldQuit_ $ do
mainLoop clientState3 shaderResources window
| 1,086
|
mainLoop clientState@ClientState{..} shaderResources window = do
-- logInfo (printf "World = %s" (show world))
threadDelay 14000 -- 0.014 sec
-- Process input messages and send new position
menuIsOn_ <- atomically $ readTVar menuIsOn
clientState22 <- case menuIsOn_ of
True -> do
_ <- processWorldInput clientState
_ <- processMousePos clientState window
return clientState
False -> do
clientState1 <- processWorldInput clientState
let clientState21 = processKeysState clientState1
if (space keysState) == True then processFireEvent clientState else return ()
processMousePos clientState21 window
sendPositionUpdate clientState22
-- Process server world updates
world' <- serverUpdateWorld clientState22
let clientState3 = clientState22 { world = world' }
-- Draw world
drawWorld clientState3 shaderResources window
shouldQuit_ <- atomically $ readTVar shouldQuit
unless shouldQuit_ $ do
mainLoop clientState3 shaderResources window
| 1,019
| false
| true
| 20
| 9
| 215
| 211
| 116
| 95
| null | null |
rukokarasu/squigly-trace
|
src/V3.hs
|
mit
|
cross :: V3 -> V3 -> V3
cross (V3 a b c) (V3 d e f) = V3 (b*f-c*e) (c*d-a*f) (a*e-b*d)
| 86
|
cross :: V3 -> V3 -> V3
cross (V3 a b c) (V3 d e f) = V3 (b*f-c*e) (c*d-a*f) (a*e-b*d)
| 86
|
cross (V3 a b c) (V3 d e f) = V3 (b*f-c*e) (c*d-a*f) (a*e-b*d)
| 62
| false
| true
| 0
| 9
| 20
| 96
| 49
| 47
| null | null |
unisonweb/platform
|
codebase2/util/U/Util/Relation.hs
|
mit
|
---------------------------------------------------------------
-- |
-- This fragment provided by:
--
-- @
-- \ Module : Data.Map
-- \ Copyright : (c) Daan Leijen 2002
-- \ (c) Andriy Palamarchuk 2008
-- \ License : BSD-style
-- \ Maintainer : libraries\@haskell.org
-- \ Stability : provisional
-- \ Portability : portable
-- @
--
--
foldlStrict :: (a -> b -> a) -> a -> [b] -> a
foldlStrict f z xs = case xs of
[] -> z
(x : xx) -> let z' = f z x in seq z' (foldlStrict f z' xx)
---------------------------------------------------------------
-- | Union a list of relations using the 'empty' relation.
| 655
|
foldlStrict :: (a -> b -> a) -> a -> [b] -> a
foldlStrict f z xs = case xs of
[] -> z
(x : xx) -> let z' = f z x in seq z' (foldlStrict f z' xx)
---------------------------------------------------------------
-- | Union a list of relations using the 'empty' relation.
| 278
|
foldlStrict f z xs = case xs of
[] -> z
(x : xx) -> let z' = f z x in seq z' (foldlStrict f z' xx)
---------------------------------------------------------------
-- | Union a list of relations using the 'empty' relation.
| 232
| true
| true
| 2
| 8
| 159
| 113
| 66
| 47
| null | null |
cocreature/leksah
|
src/IDE/Debug.hs
|
gpl-2.0
|
debugStepExpr :: Maybe Text -> DebugAction
debugStepExpr maybeText = do
(debugPackage, _) <- ask
case maybeText of
Just text -> debugCommand (":step " <> stripComments text) (logOutputForHistoricContextDefault debugPackage)
Nothing -> lift $ ideMessage Normal "Please select an expression in the editor"
| 329
|
debugStepExpr :: Maybe Text -> DebugAction
debugStepExpr maybeText = do
(debugPackage, _) <- ask
case maybeText of
Just text -> debugCommand (":step " <> stripComments text) (logOutputForHistoricContextDefault debugPackage)
Nothing -> lift $ ideMessage Normal "Please select an expression in the editor"
| 329
|
debugStepExpr maybeText = do
(debugPackage, _) <- ask
case maybeText of
Just text -> debugCommand (":step " <> stripComments text) (logOutputForHistoricContextDefault debugPackage)
Nothing -> lift $ ideMessage Normal "Please select an expression in the editor"
| 286
| false
| true
| 0
| 13
| 66
| 86
| 41
| 45
| null | null |
orblivion/random-chain
|
Main.hs
|
mit
|
renderToken :: Token -> String
renderToken (Word str) = str ++ " "
| 66
|
renderToken :: Token -> String
renderToken (Word str) = str ++ " "
| 66
|
renderToken (Word str) = str ++ " "
| 35
| false
| true
| 0
| 7
| 12
| 28
| 14
| 14
| null | null |
scast/bigbrother
|
src/ParserTypes.hs
|
gpl-2.0
|
getPos (Field _ e) = (line e, column e)
| 39
|
getPos (Field _ e) = (line e, column e)
| 39
|
getPos (Field _ e) = (line e, column e)
| 39
| false
| false
| 0
| 7
| 8
| 29
| 14
| 15
| null | null |
alanz/hroq
|
src/Data/Concurrent/Queue/Roq/Consumer.hs
|
bsd-3-clause
|
mycall ::
(Typeable b, Typeable a, Binary b, Binary a)
=> ConsumerName -> a -> Process b
mycall consumerName op = do
sid <- Data.Concurrent.Queue.Roq.Consumer.getPid consumerName
call sid op
| 198
|
mycall ::
(Typeable b, Typeable a, Binary b, Binary a)
=> ConsumerName -> a -> Process b
mycall consumerName op = do
sid <- Data.Concurrent.Queue.Roq.Consumer.getPid consumerName
call sid op
| 198
|
mycall consumerName op = do
sid <- Data.Concurrent.Queue.Roq.Consumer.getPid consumerName
call sid op
| 105
| false
| true
| 0
| 9
| 36
| 78
| 39
| 39
| null | null |
andorp/hs-bluesnap
|
src/Bluesnap/API/Request.hs
|
gpl-3.0
|
elementCart_params :: XMLParser Cart_params
elementCart_params = parseSchemaType "cart-params"
| 94
|
elementCart_params :: XMLParser Cart_params
elementCart_params = parseSchemaType "cart-params"
| 94
|
elementCart_params = parseSchemaType "cart-params"
| 50
| false
| true
| 0
| 5
| 7
| 17
| 8
| 9
| null | null |
wavewave/evchain
|
lib/HEP/Automation/EventChain/Process.hs
|
gpl-3.0
|
-- |
mkOccNum :: ParticleID -> HM.HashMap (ParticleID,PDGID) Int -> [(PDGID,Int)]
mkOccNum pid = map (\((_,pdg),n)->(pdg,n))
. HM.toList
. HM.filterWithKey (\(i,_) _ -> i == pid)
| 211
|
mkOccNum :: ParticleID -> HM.HashMap (ParticleID,PDGID) Int -> [(PDGID,Int)]
mkOccNum pid = map (\((_,pdg),n)->(pdg,n))
. HM.toList
. HM.filterWithKey (\(i,_) _ -> i == pid)
| 205
|
mkOccNum pid = map (\((_,pdg),n)->(pdg,n))
. HM.toList
. HM.filterWithKey (\(i,_) _ -> i == pid)
| 128
| true
| true
| 2
| 10
| 58
| 117
| 63
| 54
| null | null |
homam/xml-parsing-haskell
|
src/Lib.hs
|
bsd-3-clause
|
parseTranslationXml :: [X.Content] -> M.Map String (M.Map String String)
parseTranslationXml = M.unions . map (go 0 M.empty) where
go :: Int -> M.Map String (M.Map String String) -> X.Content -> M.Map String (M.Map String String)
go 0 dic (X.Elem d) = M.unions $ map (go 1 dic) (X.elContent d)
go 1 dic (X.Elem d) = M.insert (X.qName $ X.elName d) (M.unions $ map (go2 M.empty) (X.elContent d)) dic
go _ dic _ = dic
go2 :: M.Map String String -> X.Content -> M.Map String String
go2 dic (X.Elem d) = M.insert (X.qName $ X.elName d) (X.showContent $ head $ X.elContent d) dic
go2 dic _ = dic
-- go 2 dic _
| 624
|
parseTranslationXml :: [X.Content] -> M.Map String (M.Map String String)
parseTranslationXml = M.unions . map (go 0 M.empty) where
go :: Int -> M.Map String (M.Map String String) -> X.Content -> M.Map String (M.Map String String)
go 0 dic (X.Elem d) = M.unions $ map (go 1 dic) (X.elContent d)
go 1 dic (X.Elem d) = M.insert (X.qName $ X.elName d) (M.unions $ map (go2 M.empty) (X.elContent d)) dic
go _ dic _ = dic
go2 :: M.Map String String -> X.Content -> M.Map String String
go2 dic (X.Elem d) = M.insert (X.qName $ X.elName d) (X.showContent $ head $ X.elContent d) dic
go2 dic _ = dic
-- go 2 dic _
| 624
|
parseTranslationXml = M.unions . map (go 0 M.empty) where
go :: Int -> M.Map String (M.Map String String) -> X.Content -> M.Map String (M.Map String String)
go 0 dic (X.Elem d) = M.unions $ map (go 1 dic) (X.elContent d)
go 1 dic (X.Elem d) = M.insert (X.qName $ X.elName d) (M.unions $ map (go2 M.empty) (X.elContent d)) dic
go _ dic _ = dic
go2 :: M.Map String String -> X.Content -> M.Map String String
go2 dic (X.Elem d) = M.insert (X.qName $ X.elName d) (X.showContent $ head $ X.elContent d) dic
go2 dic _ = dic
-- go 2 dic _
| 551
| false
| true
| 0
| 13
| 131
| 342
| 169
| 173
| null | null |
brendanhay/gogol
|
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
|
mpl-2.0
|
-- | The title for the rule.
rrTitle :: Lens' RepricingRule (Maybe Text)
rrTitle = lens _rrTitle (\ s a -> s{_rrTitle = a})
| 123
|
rrTitle :: Lens' RepricingRule (Maybe Text)
rrTitle = lens _rrTitle (\ s a -> s{_rrTitle = a})
| 94
|
rrTitle = lens _rrTitle (\ s a -> s{_rrTitle = a})
| 50
| true
| true
| 0
| 9
| 23
| 46
| 25
| 21
| null | null |
FunctionalThinking/ninety-nine
|
src/Graph.hs
|
mit
|
paths' :: Eq a => a -> a -> [(a,a)] -> [[a]]
paths' start end edges
| start == end = [[start]]
| otherwise = map (start:) subsolution
where subsolution = concatMap (\n -> paths' n end subgraph) (neighbors start edges)
subgraph = deleteNode start edges
| 270
|
paths' :: Eq a => a -> a -> [(a,a)] -> [[a]]
paths' start end edges
| start == end = [[start]]
| otherwise = map (start:) subsolution
where subsolution = concatMap (\n -> paths' n end subgraph) (neighbors start edges)
subgraph = deleteNode start edges
| 270
|
paths' start end edges
| start == end = [[start]]
| otherwise = map (start:) subsolution
where subsolution = concatMap (\n -> paths' n end subgraph) (neighbors start edges)
subgraph = deleteNode start edges
| 225
| false
| true
| 2
| 10
| 64
| 130
| 68
| 62
| null | null |
kim/amazonka
|
amazonka-cloudwatch/gen/Network/AWS/CloudWatch/Types.hs
|
mpl-2.0
|
-- | The number of samples used for the statistic set.
ssSampleCount :: Lens' StatisticSet Double
ssSampleCount = lens _ssSampleCount (\s a -> s { _ssSampleCount = a })
| 168
|
ssSampleCount :: Lens' StatisticSet Double
ssSampleCount = lens _ssSampleCount (\s a -> s { _ssSampleCount = a })
| 113
|
ssSampleCount = lens _ssSampleCount (\s a -> s { _ssSampleCount = a })
| 70
| true
| true
| 1
| 9
| 28
| 45
| 22
| 23
| null | null |
Lythimus/lptv
|
sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Parsing.hs
|
gpl-2.0
|
lowerRoman :: GenParser Char st (ListNumberStyle, Int)
lowerRoman = do
num <- romanNumeral False
return (LowerRoman, num)
-- | Parses a decimal numeral and returns (Decimal, number).
| 187
|
lowerRoman :: GenParser Char st (ListNumberStyle, Int)
lowerRoman = do
num <- romanNumeral False
return (LowerRoman, num)
-- | Parses a decimal numeral and returns (Decimal, number).
| 187
|
lowerRoman = do
num <- romanNumeral False
return (LowerRoman, num)
-- | Parses a decimal numeral and returns (Decimal, number).
| 132
| false
| true
| 0
| 8
| 31
| 47
| 24
| 23
| null | null |
arybczak/happstack-server
|
attic/Examples/MultimasterTest2.hs
|
bsd-3-clause
|
rootState :: Proxy MyState
rootState = Proxy
| 44
|
rootState :: Proxy MyState
rootState = Proxy
| 44
|
rootState = Proxy
| 17
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
ctford/Idris-Elba-dev
|
src/Idris/Core/ProofState.hs
|
bsd-3-clause
|
match_fill _ _ _ _ = fail "Can't fill here."
| 44
|
match_fill _ _ _ _ = fail "Can't fill here."
| 44
|
match_fill _ _ _ _ = fail "Can't fill here."
| 44
| false
| false
| 1
| 5
| 9
| 18
| 7
| 11
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.