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
jrgdiz/tese
src/MB.hs
mit
a_treleasebySingerLastSong :: IOSArrow Artist (Artist, Album, Date) a_treleasebySingerLastSong = a_treleasebySingerLastSingle
125
a_treleasebySingerLastSong :: IOSArrow Artist (Artist, Album, Date) a_treleasebySingerLastSong = a_treleasebySingerLastSingle
125
a_treleasebySingerLastSong = a_treleasebySingerLastSingle
57
false
true
0
6
9
25
14
11
null
null
nikki-and-the-robots/nikki
src/Base/Types.hs
lgpl-3.0
sort_ :: Object_ -> Sort_ sort_ (Object_ sort _) = Sort_ sort
61
sort_ :: Object_ -> Sort_ sort_ (Object_ sort _) = Sort_ sort
61
sort_ (Object_ sort _) = Sort_ sort
35
false
true
0
7
11
29
14
15
null
null
DanielWaterworth/Idris-dev
src/Idris/Output.hs
bsd-3-clause
-- | Show an error with semantic highlighting ihRenderError :: Handle -> Doc OutputAnnotation -> Idris () ihRenderError h e = do ist <- getIState case idris_outputmode ist of RawOutput -> consoleDisplayAnnotated h e IdeSlave n -> do (str, spans) <- fmap displaySpans . iRender . fmap (fancifyAnnots ist) $ e let good = [SymbolAtom "error", toSExp str, toSExp spans] runIO . hPutStrLn h $ convSExp "return" good n
695
ihRenderError :: Handle -> Doc OutputAnnotation -> Idris () ihRenderError h e = do ist <- getIState case idris_outputmode ist of RawOutput -> consoleDisplayAnnotated h e IdeSlave n -> do (str, spans) <- fmap displaySpans . iRender . fmap (fancifyAnnots ist) $ e let good = [SymbolAtom "error", toSExp str, toSExp spans] runIO . hPutStrLn h $ convSExp "return" good n
649
ihRenderError h e = do ist <- getIState case idris_outputmode ist of RawOutput -> consoleDisplayAnnotated h e IdeSlave n -> do (str, spans) <- fmap displaySpans . iRender . fmap (fancifyAnnots ist) $ e let good = [SymbolAtom "error", toSExp str, toSExp spans] runIO . hPutStrLn h $ convSExp "return" good n
589
true
true
0
19
351
161
73
88
null
null
nushio3/ghc
compiler/basicTypes/VarEnv.hs
bsd-3-clause
alterVarEnv = alterUFM
27
alterVarEnv = alterUFM
27
alterVarEnv = alterUFM
27
false
false
0
4
7
6
3
3
null
null
schell/lamdu
test/AnnotatedExpr.hs
gpl-3.0
addAnnotation :: String -> AnnotationM Int addAnnotation msg = do count <- Lens.use Lens._1 Lens._1 += 1 Lens._2 %= (msg :) pure count
142
addAnnotation :: String -> AnnotationM Int addAnnotation msg = do count <- Lens.use Lens._1 Lens._1 += 1 Lens._2 %= (msg :) pure count
142
addAnnotation msg = do count <- Lens.use Lens._1 Lens._1 += 1 Lens._2 %= (msg :) pure count
99
false
true
0
10
30
68
30
38
null
null
mocnik-science/chorale
src/Chorale/Common.hs
mit
-- | uses an endomorphism parametrised by a 'Just' value onJustUse :: (a -> b -> b) -> Maybe a -> b -> b onJustUse f = \case (Just b) -> f b _ -> id -- --== EITHER OPERATIONS -- | maps a 'Left' value
209
onJustUse :: (a -> b -> b) -> Maybe a -> b -> b onJustUse f = \case (Just b) -> f b _ -> id -- --== EITHER OPERATIONS -- | maps a 'Left' value
152
onJustUse f = \case (Just b) -> f b _ -> id -- --== EITHER OPERATIONS -- | maps a 'Left' value
104
true
true
0
9
55
66
34
32
null
null
ttylec/QLogic
src/QLogic/GeneralBoxes.hs
gpl-3.0
equalP :: (Ord (s Box), System s) => BMC s -> Question (s Box) -> Question (s Box) -> Bool equalP BMC{boxVarsMap = bvm, nsLinFunc = nsc, nsrankValue = nsrank} p q = rank cmatrix == nsrank where pl = toLinearFunc p ql = toLinearFunc q cmatrix = coefficientMatrix bvm $ (pl ^-^ ql):nsc
301
equalP :: (Ord (s Box), System s) => BMC s -> Question (s Box) -> Question (s Box) -> Bool equalP BMC{boxVarsMap = bvm, nsLinFunc = nsc, nsrankValue = nsrank} p q = rank cmatrix == nsrank where pl = toLinearFunc p ql = toLinearFunc q cmatrix = coefficientMatrix bvm $ (pl ^-^ ql):nsc
301
equalP BMC{boxVarsMap = bvm, nsLinFunc = nsc, nsrankValue = nsrank} p q = rank cmatrix == nsrank where pl = toLinearFunc p ql = toLinearFunc q cmatrix = coefficientMatrix bvm $ (pl ^-^ ql):nsc
208
false
true
10
12
71
156
73
83
null
null
AaronFriel/eff-experiments
dep/cxmonad/src/Control/Monad/Cx/Rebound.hs
bsd-3-clause
join :: CxMonad m => m i j (m j k a) -> m i k a join = ijoin
60
join :: CxMonad m => m i j (m j k a) -> m i k a join = ijoin
60
join = ijoin
12
false
true
0
9
19
46
22
24
null
null
mwotton/ctkl
src/Text/CTK/Pretty.hs
bsd-3-clause
catsep hcomb docs = fitunion (foldr hcomb empty docs) (foldr ($$) empty docs) where -- -- given two documents, where the first one is a horizontal -- composition, we only choose a single line alternative (if at -- all present) from the first document -- fitunion :: Doc -> Doc -> Doc fitunion (Nest m (Text s : _)) (Nest _ alts) = Nest m (Text s : alts) fitunion _ doc = doc -- select the best layout from a document and return it in string form -- (EXPORTED) -- -- * given are the overall width and the ribbon ration, ie, the number of -- times the ribbon fits into a line (the ribbon is the number of -- characters on a line excluding leading and trailing white spaces) --
801
catsep hcomb docs = fitunion (foldr hcomb empty docs) (foldr ($$) empty docs) where -- -- given two documents, where the first one is a horizontal -- composition, we only choose a single line alternative (if at -- all present) from the first document -- fitunion :: Doc -> Doc -> Doc fitunion (Nest m (Text s : _)) (Nest _ alts) = Nest m (Text s : alts) fitunion _ doc = doc -- select the best layout from a document and return it in string form -- (EXPORTED) -- -- * given are the overall width and the ribbon ration, ie, the number of -- times the ribbon fits into a line (the ribbon is the number of -- characters on a line excluding leading and trailing white spaces) --
801
catsep hcomb docs = fitunion (foldr hcomb empty docs) (foldr ($$) empty docs) where -- -- given two documents, where the first one is a horizontal -- composition, we only choose a single line alternative (if at -- all present) from the first document -- fitunion :: Doc -> Doc -> Doc fitunion (Nest m (Text s : _)) (Nest _ alts) = Nest m (Text s : alts) fitunion _ doc = doc -- select the best layout from a document and return it in string form -- (EXPORTED) -- -- * given are the overall width and the ribbon ration, ie, the number of -- times the ribbon fits into a line (the ribbon is the number of -- characters on a line excluding leading and trailing white spaces) --
801
false
false
2
13
258
135
69
66
null
null
jbracker/supermonad-plugin
examples/monad/hmtc/supermonad/Type.hs
bsd-3-clause
retType _ = SomeType
28
retType _ = SomeType
28
retType _ = SomeType
28
false
false
0
4
11
10
4
6
null
null
Fermat/FCR
src/Fcr/Syntax.hs
gpl-3.0
freeVar' (PApp f1 f2) = (freeVar' f1) `S.union` (freeVar' f2)
61
freeVar' (PApp f1 f2) = (freeVar' f1) `S.union` (freeVar' f2)
61
freeVar' (PApp f1 f2) = (freeVar' f1) `S.union` (freeVar' f2)
61
false
false
0
7
9
37
19
18
null
null
dimara/ganeti
src/Ganeti/Utils.hs
bsd-2-clause
exitIfBad _ (Ok v) = return v
29
exitIfBad _ (Ok v) = return v
29
exitIfBad _ (Ok v) = return v
29
false
false
0
7
6
20
9
11
null
null
et4te/zero
src-shared/Zero/Crypto.hs
bsd-3-clause
toPublicText :: SecretKey -> Text toPublicText key = T.pack $ B8.unpack $ BA.convert $ toPublic key
101
toPublicText :: SecretKey -> Text toPublicText key = T.pack $ B8.unpack $ BA.convert $ toPublic key
101
toPublicText key = T.pack $ B8.unpack $ BA.convert $ toPublic key
67
false
true
0
8
17
39
19
20
null
null
Ongy/monky
Monky/Examples/Battery.hs
lgpl-3.0
-- |Version of 'getBatteryHandle' that defaults to "BAT0" getBatteryHandle' :: String -> IO BatteryH getBatteryHandle' = fmap BH . B.getBatteryHandle'
150
getBatteryHandle' :: String -> IO BatteryH getBatteryHandle' = fmap BH . B.getBatteryHandle'
92
getBatteryHandle' = fmap BH . B.getBatteryHandle'
49
true
true
0
6
19
28
14
14
null
null
gcampax/ghc
compiler/typecheck/TcGenDeriv.hs
bsd-3-clause
eqFloat_RDR = varQual_RDR gHC_PRIM (fsLit "eqFloat#")
57
eqFloat_RDR = varQual_RDR gHC_PRIM (fsLit "eqFloat#")
57
eqFloat_RDR = varQual_RDR gHC_PRIM (fsLit "eqFloat#")
57
false
false
1
7
9
20
8
12
null
null
gridaphobe/liquid-fixpoint
src/Language/Fixpoint/SortCheck.hs
bsd-3-clause
checkExpr _ (ESym _) = return strSort
43
checkExpr _ (ESym _) = return strSort
43
checkExpr _ (ESym _) = return strSort
43
false
false
1
6
12
22
9
13
null
null
alexander-at-github/eta
compiler/ETA/Core/CoreArity.hs
bsd-3-clause
arityApp (ATop []) _ = ATop []
38
arityApp (ATop []) _ = ATop []
38
arityApp (ATop []) _ = ATop []
38
false
false
0
8
14
24
11
13
null
null
FranklinChen/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
showDeclImp o (PImplementation _ _ _ _ cs _ acc _ n _ _ _ t _ ds) = text "implementation" <+> text (show cs) <+> text (show n) <+> prettyImp o t <> line <> showDecls o ds
173
showDeclImp o (PImplementation _ _ _ _ cs _ acc _ n _ _ _ t _ ds) = text "implementation" <+> text (show cs) <+> text (show n) <+> prettyImp o t <> line <> showDecls o ds
173
showDeclImp o (PImplementation _ _ _ _ cs _ acc _ n _ _ _ t _ ds) = text "implementation" <+> text (show cs) <+> text (show n) <+> prettyImp o t <> line <> showDecls o ds
173
false
false
0
12
41
96
45
51
null
null
rahulmutt/ghcvm
tests/suite/typecheck/compile/T7541.hs
bsd-3-clause
f :: Constrained String String () -- Weird test case: (Eq String, Eq String) is simplifiable f = undefined
106
f :: Constrained String String () f = undefined
47
f = undefined
13
true
true
1
6
18
25
11
14
null
null
olsner/ghc
testsuite/tests/unboxedsums/unboxedsums11.hs
bsd-3-clause
showTy :: Ty -> String showTy (# _ | #) = "(# _ | #)"
54
showTy :: Ty -> String showTy (# _ | #) = "(# _ | #)"
54
showTy (# _ | #) = "(# _ | #)"
31
false
true
0
6
15
21
11
10
null
null
brendanhay/gogol
gogol-pubsub/gen/Network/Google/Resource/PubSub/Projects/Snapshots/Get.hs
mpl-2.0
-- | Creates a value of 'ProjectsSnapshotsGet' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'psgsXgafv' -- -- * 'psgsSnapshot' -- -- * 'psgsUploadProtocol' -- -- * 'psgsAccessToken' -- -- * 'psgsUploadType' -- -- * 'psgsCallback' projectsSnapshotsGet :: Text -- ^ 'psgsSnapshot' -> ProjectsSnapshotsGet projectsSnapshotsGet pPsgsSnapshot_ = ProjectsSnapshotsGet' { _psgsXgafv = Nothing , _psgsSnapshot = pPsgsSnapshot_ , _psgsUploadProtocol = Nothing , _psgsAccessToken = Nothing , _psgsUploadType = Nothing , _psgsCallback = Nothing }
661
projectsSnapshotsGet :: Text -- ^ 'psgsSnapshot' -> ProjectsSnapshotsGet projectsSnapshotsGet pPsgsSnapshot_ = ProjectsSnapshotsGet' { _psgsXgafv = Nothing , _psgsSnapshot = pPsgsSnapshot_ , _psgsUploadProtocol = Nothing , _psgsAccessToken = Nothing , _psgsUploadType = Nothing , _psgsCallback = Nothing }
343
projectsSnapshotsGet pPsgsSnapshot_ = ProjectsSnapshotsGet' { _psgsXgafv = Nothing , _psgsSnapshot = pPsgsSnapshot_ , _psgsUploadProtocol = Nothing , _psgsAccessToken = Nothing , _psgsUploadType = Nothing , _psgsCallback = Nothing }
262
true
true
0
7
128
81
52
29
null
null
nikki-and-the-robots/nikki
src/Physics/Chipmunk/StickyEdges.hs
lgpl-3.0
moveRightSide a b | -- rectangles overlap, one horizontal side is flush --> expand rect, form an L-shaped thing x (end a) >= x (start b) && x (end a) < x (end b) && ((y (start a) > y (start b) && -- downside is flush y (end a) == y (end b)) || (y (start a) == y (start b) && -- upside is flush y (end a) < y (end b))) = Just [modifyWidth (+ (x (end b) - x (end a))) a, b]
406
moveRightSide a b | -- rectangles overlap, one horizontal side is flush --> expand rect, form an L-shaped thing x (end a) >= x (start b) && x (end a) < x (end b) && ((y (start a) > y (start b) && -- downside is flush y (end a) == y (end b)) || (y (start a) == y (start b) && -- upside is flush y (end a) < y (end b))) = Just [modifyWidth (+ (x (end b) - x (end a))) a, b]
406
moveRightSide a b | -- rectangles overlap, one horizontal side is flush --> expand rect, form an L-shaped thing x (end a) >= x (start b) && x (end a) < x (end b) && ((y (start a) > y (start b) && -- downside is flush y (end a) == y (end b)) || (y (start a) == y (start b) && -- upside is flush y (end a) < y (end b))) = Just [modifyWidth (+ (x (end b) - x (end a))) a, b]
406
false
false
0
17
121
224
108
116
null
null
input-output-hk/pos-haskell-prototype
chain/bench/block-bench.hs
mit
-- | Make a TestSubject using a seed for a PRNG and size. testSubject :: Int -- ^ Seed -> Int -- ^ Size -> TestSubject testSubject seed size = let block :: MainBlock block = generateMainBlock pm seed size tsBlock = withSerialized block tsHeader = withSerialized (block ^. gbHeader) tsBodyProof = withSerialized (block ^. gbBodyProof) tsConsensus = withSerialized (block ^. gbConsensus) tsExtraHeader = withSerialized (block ^. gbHeader . gbhExtra) tsBody = withSerialized (block ^. gbBody) tsTxPayload = withSerialized (block ^. mainBlockTxPayload) tsSscPayload = withSerialized (block ^. mainBlockSscPayload) tsDlgPayload = withSerialized (block ^. mainBlockDlgPayload) tsUpdPayload = withSerialized (block ^. mainBlockUpdatePayload) tsExtraBody = withSerialized (block ^. gbExtra) in TestSubject {..}
894
testSubject :: Int -- ^ Seed -> Int -- ^ Size -> TestSubject testSubject seed size = let block :: MainBlock block = generateMainBlock pm seed size tsBlock = withSerialized block tsHeader = withSerialized (block ^. gbHeader) tsBodyProof = withSerialized (block ^. gbBodyProof) tsConsensus = withSerialized (block ^. gbConsensus) tsExtraHeader = withSerialized (block ^. gbHeader . gbhExtra) tsBody = withSerialized (block ^. gbBody) tsTxPayload = withSerialized (block ^. mainBlockTxPayload) tsSscPayload = withSerialized (block ^. mainBlockSscPayload) tsDlgPayload = withSerialized (block ^. mainBlockDlgPayload) tsUpdPayload = withSerialized (block ^. mainBlockUpdatePayload) tsExtraBody = withSerialized (block ^. gbExtra) in TestSubject {..}
836
testSubject seed size = let block :: MainBlock block = generateMainBlock pm seed size tsBlock = withSerialized block tsHeader = withSerialized (block ^. gbHeader) tsBodyProof = withSerialized (block ^. gbBodyProof) tsConsensus = withSerialized (block ^. gbConsensus) tsExtraHeader = withSerialized (block ^. gbHeader . gbhExtra) tsBody = withSerialized (block ^. gbBody) tsTxPayload = withSerialized (block ^. mainBlockTxPayload) tsSscPayload = withSerialized (block ^. mainBlockSscPayload) tsDlgPayload = withSerialized (block ^. mainBlockDlgPayload) tsUpdPayload = withSerialized (block ^. mainBlockUpdatePayload) tsExtraBody = withSerialized (block ^. gbExtra) in TestSubject {..}
763
true
true
0
12
200
217
115
102
null
null
sixears/getopt
src/Console/Getopt.hs
mit
err_reqkeyval :: String -> String err_reqkeyval = printf "option '%s' requires a key & a value"
95
err_reqkeyval :: String -> String err_reqkeyval = printf "option '%s' requires a key & a value"
95
err_reqkeyval = printf "option '%s' requires a key & a value"
61
false
true
0
5
15
18
9
9
null
null
tjakway/ghcjvm
compiler/simplCore/SetLevels.hs
bsd-3-clause
isTopLvl _ = False
28
isTopLvl _ = False
28
isTopLvl _ = False
28
false
false
0
5
13
9
4
5
null
null
rimmington/cabal
cabal-install/Distribution/Client/IndexUtils.hs
bsd-3-clause
-- | It is not necessary to call this, as the cache will be updated when the -- index is read normally. However you can do the work earlier if you like. -- updateRepoIndexCache :: Verbosity -> Repo -> IO () updateRepoIndexCache verbosity repo = whenCacheOutOfDate indexFile cacheFile $ do updatePackageIndexCacheFile verbosity indexFile cacheFile where indexFile = repoLocalDir repo </> "00-index.tar" cacheFile = repoLocalDir repo </> "00-index.cache"
472
updateRepoIndexCache :: Verbosity -> Repo -> IO () updateRepoIndexCache verbosity repo = whenCacheOutOfDate indexFile cacheFile $ do updatePackageIndexCacheFile verbosity indexFile cacheFile where indexFile = repoLocalDir repo </> "00-index.tar" cacheFile = repoLocalDir repo </> "00-index.cache"
316
updateRepoIndexCache verbosity repo = whenCacheOutOfDate indexFile cacheFile $ do updatePackageIndexCacheFile verbosity indexFile cacheFile where indexFile = repoLocalDir repo </> "00-index.tar" cacheFile = repoLocalDir repo </> "00-index.cache"
265
true
true
0
8
86
78
38
40
null
null
spechub/Hets
Isabelle/IsaParse.hs
gpl-2.0
isaString :: Parser String isaString = genString '"'
52
isaString :: Parser String isaString = genString '"'
52
isaString = genString '"'
25
false
true
0
5
7
17
8
9
null
null
andorp/bead
src/Bead/View/DataBridge.hs
bsd-3-clause
delUserFromGroupKeyPrm :: Parameter GroupKey delUserFromGroupKeyPrm = customGroupKeyPrm groupKeyParamName
105
delUserFromGroupKeyPrm :: Parameter GroupKey delUserFromGroupKeyPrm = customGroupKeyPrm groupKeyParamName
105
delUserFromGroupKeyPrm = customGroupKeyPrm groupKeyParamName
60
false
true
0
5
7
17
8
9
null
null
jyrimatti/alava
src-lib/SimpleParser.hs
mit
getPos :: Term -> (Term -> Term) getPos (Pos pos _) = Pos pos
68
getPos :: Term -> (Term -> Term) getPos (Pos pos _) = Pos pos
68
getPos (Pos pos _) = Pos pos
35
false
true
0
7
20
36
18
18
null
null
OS2World/DEV-UTIL-HUGS
oldlib/UnbalancedSet.hs
bsd-3-clause
single x = T E x E
18
single x = T E x E
18
single x = T E x E
18
false
false
0
5
6
16
7
9
null
null
Oregu/featherweight
Example.hs
mit
sixes x = disj (x === LVal 6) (sixes x)
39
sixes x = disj (x === LVal 6) (sixes x)
39
sixes x = disj (x === LVal 6) (sixes x)
39
false
false
0
8
9
30
14
16
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_KIX_FUNCTIONS :: Int wxSTC_KIX_FUNCTIONS = 8
50
wxSTC_KIX_FUNCTIONS :: Int wxSTC_KIX_FUNCTIONS = 8
50
wxSTC_KIX_FUNCTIONS = 8
23
false
true
0
6
5
18
7
11
null
null
TOSPIO/netmosphere-core
dist/build/autogen/Paths_netmosphere_core.hs
mit
libdir = "/home/kj/.cabal/lib/x86_64-linux-ghc-7.10.2/netmosphere-core-0.0.1.0-IoCYH4AXHKu5r2EaEgBuch"
106
libdir = "/home/kj/.cabal/lib/x86_64-linux-ghc-7.10.2/netmosphere-core-0.0.1.0-IoCYH4AXHKu5r2EaEgBuch"
106
libdir = "/home/kj/.cabal/lib/x86_64-linux-ghc-7.10.2/netmosphere-core-0.0.1.0-IoCYH4AXHKu5r2EaEgBuch"
106
false
false
0
4
6
6
3
3
null
null
qrilka/xlsx
src/Codec/Xlsx/Types/Drawing/Common.hs
mit
-- | Add DrawingML namespace to name a_ :: Text -> Name a_ x = Name {nameLocalName = x, nameNamespace = Just drawingNs, namePrefix = Just "a"}
144
a_ :: Text -> Name a_ x = Name {nameLocalName = x, nameNamespace = Just drawingNs, namePrefix = Just "a"}
107
a_ x = Name {nameLocalName = x, nameNamespace = Just drawingNs, namePrefix = Just "a"}
88
true
true
0
8
28
54
27
27
null
null
dmwit/sgf
Data/SGF/Parse.hs
bsd-3-clause
-- TODO nodeHex = nodeOther
37
nodeHex = nodeOther
29
nodeHex = nodeOther
29
true
false
0
4
14
7
4
3
null
null
olorin/amazonka
amazonka-redshift/gen/Network/AWS/Redshift/Types/Product.hs
mpl-2.0
-- | The master user name for the cluster. This name is used to connect to -- the database that is specified in __DBName__. cMasterUsername :: Lens' Cluster (Maybe Text) cMasterUsername = lens _cMasterUsername (\ s a -> s{_cMasterUsername = a})
244
cMasterUsername :: Lens' Cluster (Maybe Text) cMasterUsername = lens _cMasterUsername (\ s a -> s{_cMasterUsername = a})
120
cMasterUsername = lens _cMasterUsername (\ s a -> s{_cMasterUsername = a})
74
true
true
0
9
40
47
26
21
null
null
thalerjonathan/phd
coding/learning/haskell/grahambook/Code_Solutions/expression.hs
gpl-3.0
eval :: String -> Int eval xs = case (parse expr xs) of [(n,[])] -> n [(_,out)] -> error ("Unused input " ++ out) [] -> error "Invalid input"
188
eval :: String -> Int eval xs = case (parse expr xs) of [(n,[])] -> n [(_,out)] -> error ("Unused input " ++ out) [] -> error "Invalid input"
188
eval xs = case (parse expr xs) of [(n,[])] -> n [(_,out)] -> error ("Unused input " ++ out) [] -> error "Invalid input"
166
false
true
0
10
75
86
45
41
null
null
girving/games
Util.hs
bsd-3-clause
left _ (Right b) = Right b
26
left _ (Right b) = Right b
26
left _ (Right b) = Right b
26
false
false
0
7
6
20
9
11
null
null
Happy0/snowdrift
Handler/Project.hs
agpl-3.0
makeProjectCommentTreeWidget :: Maybe (Entity User) -> ProjectId -> Text -> Entity Comment -> CommentMods -> Handler MaxDepth -> Bool -> Widget -> Handler (Widget, Tree (Entity Comment)) makeProjectCommentTreeWidget a b c d e f g h = do (widget, [tree]) <- makeProjectCommentForestWidget a b c [d] e f g h return (widget, tree)
407
makeProjectCommentTreeWidget :: Maybe (Entity User) -> ProjectId -> Text -> Entity Comment -> CommentMods -> Handler MaxDepth -> Bool -> Widget -> Handler (Widget, Tree (Entity Comment)) makeProjectCommentTreeWidget a b c d e f g h = do (widget, [tree]) <- makeProjectCommentForestWidget a b c [d] e f g h return (widget, tree)
407
makeProjectCommentTreeWidget a b c d e f g h = do (widget, [tree]) <- makeProjectCommentForestWidget a b c [d] e f g h return (widget, tree)
148
false
true
0
17
132
141
70
71
null
null
nkarag/haskell-CSVDB
src/Data/RTable.hs
bsd-3-clause
-- | prints an RTable with an RTuple format specification printfRTable :: RTupleFormat -> RTable -> IO() printfRTable rtupFmt rtab = -- undefined if isRTabEmpty rtab then do putStrLn "-------------------------------------------" putStrLn " 0 rows returned" putStrLn "-------------------------------------------" else do -- find the max value-length for each column, this will be the width of the box for this column let listOfLengths = getMaxLengthPerColumnFmt rtupFmt rtab --debug --putStrLn $ "List of Lengths: " ++ show listOfLengths printContLineFmt rtupFmt listOfLengths '-' rtab -- print the Header printRTableHeaderFmt rtupFmt listOfLengths rtab -- print the body printRTabBodyFmt rtupFmt listOfLengths $ V.toList rtab -- print number of rows returned let numrows = V.length rtab if numrows == 1 then putStrLn $ "\n"++ (show $ numrows) ++ " row returned" else putStrLn $ "\n"++ (show $ numrows) ++ " rows returned" printContLineFmt rtupFmt listOfLengths '-' rtab where -- [Int] a List of width per column to be used in the box definition printRTabBodyFmt :: RTupleFormat -> [Int] -> [RTuple] -> IO() printRTabBodyFmt _ _ [] = putStrLn "" printRTabBodyFmt rtupf ws (rtup : rest) = do printRTupleFmt rtupf ws rtup printRTabBodyFmt rtupf ws rest -- | printRTable : Print the input RTable on screen
1,931
printfRTable :: RTupleFormat -> RTable -> IO() printfRTable rtupFmt rtab = -- undefined if isRTabEmpty rtab then do putStrLn "-------------------------------------------" putStrLn " 0 rows returned" putStrLn "-------------------------------------------" else do -- find the max value-length for each column, this will be the width of the box for this column let listOfLengths = getMaxLengthPerColumnFmt rtupFmt rtab --debug --putStrLn $ "List of Lengths: " ++ show listOfLengths printContLineFmt rtupFmt listOfLengths '-' rtab -- print the Header printRTableHeaderFmt rtupFmt listOfLengths rtab -- print the body printRTabBodyFmt rtupFmt listOfLengths $ V.toList rtab -- print number of rows returned let numrows = V.length rtab if numrows == 1 then putStrLn $ "\n"++ (show $ numrows) ++ " row returned" else putStrLn $ "\n"++ (show $ numrows) ++ " rows returned" printContLineFmt rtupFmt listOfLengths '-' rtab where -- [Int] a List of width per column to be used in the box definition printRTabBodyFmt :: RTupleFormat -> [Int] -> [RTuple] -> IO() printRTabBodyFmt _ _ [] = putStrLn "" printRTabBodyFmt rtupf ws (rtup : rest) = do printRTupleFmt rtupf ws rtup printRTabBodyFmt rtupf ws rest -- | printRTable : Print the input RTable on screen
1,871
printfRTable rtupFmt rtab = -- undefined if isRTabEmpty rtab then do putStrLn "-------------------------------------------" putStrLn " 0 rows returned" putStrLn "-------------------------------------------" else do -- find the max value-length for each column, this will be the width of the box for this column let listOfLengths = getMaxLengthPerColumnFmt rtupFmt rtab --debug --putStrLn $ "List of Lengths: " ++ show listOfLengths printContLineFmt rtupFmt listOfLengths '-' rtab -- print the Header printRTableHeaderFmt rtupFmt listOfLengths rtab -- print the body printRTabBodyFmt rtupFmt listOfLengths $ V.toList rtab -- print number of rows returned let numrows = V.length rtab if numrows == 1 then putStrLn $ "\n"++ (show $ numrows) ++ " row returned" else putStrLn $ "\n"++ (show $ numrows) ++ " rows returned" printContLineFmt rtupFmt listOfLengths '-' rtab where -- [Int] a List of width per column to be used in the box definition printRTabBodyFmt :: RTupleFormat -> [Int] -> [RTuple] -> IO() printRTabBodyFmt _ _ [] = putStrLn "" printRTabBodyFmt rtupf ws (rtup : rest) = do printRTupleFmt rtupf ws rtup printRTabBodyFmt rtupf ws rest -- | printRTable : Print the input RTable on screen
1,824
true
true
0
12
826
286
139
147
null
null
leonardi-tutorials/tutorial-haskell
Main.hs
apache-2.0
resultadoDeVerificacao_Falso = ehMultiploDeCincoOuTres(7)
57
resultadoDeVerificacao_Falso = ehMultiploDeCincoOuTres(7)
57
resultadoDeVerificacao_Falso = ehMultiploDeCincoOuTres(7)
57
false
false
0
6
2
12
6
6
null
null
imrehg/rwhaskell
ch04/ex01.hs
mit
safeLast :: [a] -> Maybe a safeLast [] = Nothing
48
safeLast :: [a] -> Maybe a safeLast [] = Nothing
48
safeLast [] = Nothing
21
false
true
0
6
9
26
13
13
null
null
sdemos/prolog
src/Prolog/Parser.hs
mit
pterm = FPred <$> ident <*> parens pexps
40
pterm = FPred <$> ident <*> parens pexps
40
pterm = FPred <$> ident <*> parens pexps
40
false
false
3
6
7
21
8
13
null
null
dbp/snaplet-wordpress
spec/Main.hs
bsd-3-clause
wpCustomAggregateTests = do describe "<wpCustomAggregate>" $ do it "should be able to display a 'meta' section for whole aggregate" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \ and some meta\ \ </wpCustomMeta>\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar and some meta" it "should be able to conditionally display if there are more pages" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"1\">\ \<wpHasMorePages>\ \There are more pages\ \</wpHasMorePages>\ \ </wpCustomMeta>\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar There are more pages" it "should be able to conditionally display if no more pages" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"478\">\ \<wpNoMorePages>\ \No more pages\ \</wpNoMorePages>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar No more pages" it "should be able to show the number of pages" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \<wpTotalPages />\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar 478" it "should be able to show the number of items" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \<wpTotalItems />\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar 7337" it "should be able to display based on number pages (many pages, first page)" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"1\">\ \<wpHasMultiplePages>Has Multiple</wpHasMultiplePages>\ \<wpHasSinglePage>Has Single</wpHasSinglePage>\ \<wpHasNoPreviousPages>Has No Previous Pages</wpHasNoPreviousPages>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar Has Multiple Has No Previous Pages" it "should be able to display based on number pages (many pages, second page)" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"2\">\ \<wpHasMultiplePages>Has Multiple</wpHasMultiplePages>\ \<wpHasPreviousPages>Has Previous Pages</wpHasPreviousPages>\ \<wpHasNoPreviousPages>Has No Previous Pages</wpHasNoPreviousPages>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar Has Multiple Has Previous Pages" it "should be able to display based on number pages (single pages)" $ do "<wpCustomAggregate endpoint=\"single-page\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \<wpHasMultiplePages>Has Multiple</wpHasMultiplePages>\ \<wpHasSinglePage>Has Single</wpHasSinglePage>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar Has Single"
3,543
wpCustomAggregateTests = do describe "<wpCustomAggregate>" $ do it "should be able to display a 'meta' section for whole aggregate" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \ and some meta\ \ </wpCustomMeta>\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar and some meta" it "should be able to conditionally display if there are more pages" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"1\">\ \<wpHasMorePages>\ \There are more pages\ \</wpHasMorePages>\ \ </wpCustomMeta>\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar There are more pages" it "should be able to conditionally display if no more pages" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"478\">\ \<wpNoMorePages>\ \No more pages\ \</wpNoMorePages>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar No more pages" it "should be able to show the number of pages" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \<wpTotalPages />\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar 478" it "should be able to show the number of items" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \<wpTotalItems />\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar 7337" it "should be able to display based on number pages (many pages, first page)" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"1\">\ \<wpHasMultiplePages>Has Multiple</wpHasMultiplePages>\ \<wpHasSinglePage>Has Single</wpHasSinglePage>\ \<wpHasNoPreviousPages>Has No Previous Pages</wpHasNoPreviousPages>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar Has Multiple Has No Previous Pages" it "should be able to display based on number pages (many pages, second page)" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"2\">\ \<wpHasMultiplePages>Has Multiple</wpHasMultiplePages>\ \<wpHasPreviousPages>Has Previous Pages</wpHasPreviousPages>\ \<wpHasNoPreviousPages>Has No Previous Pages</wpHasNoPreviousPages>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar Has Multiple Has Previous Pages" it "should be able to display based on number pages (single pages)" $ do "<wpCustomAggregate endpoint=\"single-page\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \<wpHasMultiplePages>Has Multiple</wpHasMultiplePages>\ \<wpHasSinglePage>Has Single</wpHasSinglePage>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar Has Single"
3,543
wpCustomAggregateTests = do describe "<wpCustomAggregate>" $ do it "should be able to display a 'meta' section for whole aggregate" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \ and some meta\ \ </wpCustomMeta>\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar and some meta" it "should be able to conditionally display if there are more pages" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"1\">\ \<wpHasMorePages>\ \There are more pages\ \</wpHasMorePages>\ \ </wpCustomMeta>\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar There are more pages" it "should be able to conditionally display if no more pages" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"478\">\ \<wpNoMorePages>\ \No more pages\ \</wpNoMorePages>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar No more pages" it "should be able to show the number of pages" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \<wpTotalPages />\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar 478" it "should be able to show the number of items" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \<wpTotalItems />\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar 7337" it "should be able to display based on number pages (many pages, first page)" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"1\">\ \<wpHasMultiplePages>Has Multiple</wpHasMultiplePages>\ \<wpHasSinglePage>Has Single</wpHasSinglePage>\ \<wpHasNoPreviousPages>Has No Previous Pages</wpHasNoPreviousPages>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar Has Multiple Has No Previous Pages" it "should be able to display based on number pages (many pages, second page)" $ do "<wpCustomAggregate endpoint=\"many-pages\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta page=\"2\">\ \<wpHasMultiplePages>Has Multiple</wpHasMultiplePages>\ \<wpHasPreviousPages>Has Previous Pages</wpHasPreviousPages>\ \<wpHasNoPreviousPages>Has No Previous Pages</wpHasNoPreviousPages>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar Has Multiple Has Previous Pages" it "should be able to display based on number pages (single pages)" $ do "<wpCustomAggregate endpoint=\"single-page\">\ \ <wpCustomItem><wpTitle><wpRendered /></wpTitle></wpCustomItem>\ \ <wpCustomMeta>\ \<wpHasMultiplePages>Has Multiple</wpHasMultiplePages>\ \<wpHasSinglePage>Has Single</wpHasSinglePage>\ \ <wpCustomMeta >\ \</wpCustomAggregate>" `shouldRender` "<i>Foo</i> bar Has Single"
3,543
false
false
0
13
767
168
79
89
null
null
dysinger/amazonka
amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/Types.hs
mpl-2.0
-- | The Amazon Resource Name (ARN) for the pipeline. pArn :: Lens' Pipeline (Maybe Text) pArn = lens _pArn (\s a -> s { _pArn = a })
133
pArn :: Lens' Pipeline (Maybe Text) pArn = lens _pArn (\s a -> s { _pArn = a })
79
pArn = lens _pArn (\s a -> s { _pArn = a })
43
true
true
0
9
28
46
25
21
null
null
forsyde/forsyde-atom
src/ForSyDe/Atom/Skel/Vector/DSP.hs
bsd-3-clause
duals :: Vector a -> (Vector a, Vector a) duals v = (V.take k v, V.drop k v) where k = V.length v `div` 2 -- | concatenates a previously split vector. See also 'duals'
174
duals :: Vector a -> (Vector a, Vector a) duals v = (V.take k v, V.drop k v) where k = V.length v `div` 2 -- | concatenates a previously split vector. See also 'duals'
174
duals v = (V.take k v, V.drop k v) where k = V.length v `div` 2 -- | concatenates a previously split vector. See also 'duals'
129
false
true
0
7
41
73
37
36
null
null
spinda/liquidhaskell
src/Language/Haskell/Liquid/Desugar710/Check.hs
bsd-3-clause
need_default_case :: [Pat Id] -> [DataCon] -> [(EqnNo, EquationInfo)] -> ([ExhaustivePat],EqnSet) need_default_case used_cons unused_cons qs | null default_eqns = (pats_default_no_eqns,indexs) | otherwise = (pats_default,indexs_default) where (pats,indexs) = no_need_default_case used_cons qs default_eqns = -- ASSERT2( okGroup qs, pprGroup qs ) [remove_var q | q <- qs, is_var (firstPatN q)] (pats',indexs') = check' default_eqns pats_default = [(make_whole_con c:ps,constraints) | c <- unused_cons, (ps,constraints) <- pats'] ++ pats new_wilds = {- ASSERT( not (null qs) ) -} make_row_vars_for_constructor (head qs) pats_default_no_eqns = [(make_whole_con c:new_wilds,[]) | c <- unused_cons] ++ pats indexs_default = unionUniqSets indexs' indexs
882
need_default_case :: [Pat Id] -> [DataCon] -> [(EqnNo, EquationInfo)] -> ([ExhaustivePat],EqnSet) need_default_case used_cons unused_cons qs | null default_eqns = (pats_default_no_eqns,indexs) | otherwise = (pats_default,indexs_default) where (pats,indexs) = no_need_default_case used_cons qs default_eqns = -- ASSERT2( okGroup qs, pprGroup qs ) [remove_var q | q <- qs, is_var (firstPatN q)] (pats',indexs') = check' default_eqns pats_default = [(make_whole_con c:ps,constraints) | c <- unused_cons, (ps,constraints) <- pats'] ++ pats new_wilds = {- ASSERT( not (null qs) ) -} make_row_vars_for_constructor (head qs) pats_default_no_eqns = [(make_whole_con c:new_wilds,[]) | c <- unused_cons] ++ pats indexs_default = unionUniqSets indexs' indexs
882
need_default_case used_cons unused_cons qs | null default_eqns = (pats_default_no_eqns,indexs) | otherwise = (pats_default,indexs_default) where (pats,indexs) = no_need_default_case used_cons qs default_eqns = -- ASSERT2( okGroup qs, pprGroup qs ) [remove_var q | q <- qs, is_var (firstPatN q)] (pats',indexs') = check' default_eqns pats_default = [(make_whole_con c:ps,constraints) | c <- unused_cons, (ps,constraints) <- pats'] ++ pats new_wilds = {- ASSERT( not (null qs) ) -} make_row_vars_for_constructor (head qs) pats_default_no_eqns = [(make_whole_con c:new_wilds,[]) | c <- unused_cons] ++ pats indexs_default = unionUniqSets indexs' indexs
784
false
true
1
11
226
259
140
119
null
null
pepeiborra/muterm-framework
MuTerm/Framework/GraphViz.hs
bsd-3-clause
compoundNode n1 n2 = CompoundNode n1 n2
39
compoundNode n1 n2 = CompoundNode n1 n2
39
compoundNode n1 n2 = CompoundNode n1 n2
39
false
false
1
5
6
20
7
13
null
null
nominolo/union-find
src/Data/UnionFind/IO.hs
bsd-3-clause
-- | /O(1)/. Create a fresh point and return it. A fresh point is in -- the equivalence class that contains only itself. fresh :: a -> IO (Point a) fresh desc = do info <- newIORef (MkInfo { weight = 1, descr = desc }) l <- newIORef (Info info) return (Pt l) -- | /O(1)/. @repr point@ returns the representative point of -- @point@'s equivalence class. -- -- This method performs the path compresssion.
410
fresh :: a -> IO (Point a) fresh desc = do info <- newIORef (MkInfo { weight = 1, descr = desc }) l <- newIORef (Info info) return (Pt l) -- | /O(1)/. @repr point@ returns the representative point of -- @point@'s equivalence class. -- -- This method performs the path compresssion.
288
fresh desc = do info <- newIORef (MkInfo { weight = 1, descr = desc }) l <- newIORef (Info info) return (Pt l) -- | /O(1)/. @repr point@ returns the representative point of -- @point@'s equivalence class. -- -- This method performs the path compresssion.
261
true
true
0
11
83
88
46
42
null
null
tjakway/ghcjvm
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
genLit _ (CmmFloat r w) = return (LMLitVar $ LMFloatLit (fromRational r) (widthToLlvmFloat w), nilOL, [])
121
genLit _ (CmmFloat r w) = return (LMLitVar $ LMFloatLit (fromRational r) (widthToLlvmFloat w), nilOL, [])
121
genLit _ (CmmFloat r w) = return (LMLitVar $ LMFloatLit (fromRational r) (widthToLlvmFloat w), nilOL, [])
121
false
false
1
10
31
56
27
29
null
null
dylanmc/cryptol
src/Cryptol/TypeCheck/Solver/Selector.hs
bsd-3-clause
tupleType :: Int -> InferM Type tupleType n = do fields <- mapM (\x -> newType (ordinal x <+> text "tuple field") KType) [ 1 .. n ] return (tTuple fields)
181
tupleType :: Int -> InferM Type tupleType n = do fields <- mapM (\x -> newType (ordinal x <+> text "tuple field") KType) [ 1 .. n ] return (tTuple fields)
181
tupleType n = do fields <- mapM (\x -> newType (ordinal x <+> text "tuple field") KType) [ 1 .. n ] return (tTuple fields)
149
false
true
0
15
57
82
38
44
null
null
hmac/whist-hs
src/Card.hs
bsd-3-clause
invert = map (\(k, v) -> (v, k))
32
invert = map (\(k, v) -> (v, k))
32
invert = map (\(k, v) -> (v, k))
32
false
false
0
8
7
29
17
12
null
null
ezyang/ghc
compiler/simplCore/SimplEnv.hs
bsd-3-clause
seqTyVar :: TyVar -> () seqTyVar b = b `seq` ()
47
seqTyVar :: TyVar -> () seqTyVar b = b `seq` ()
47
seqTyVar b = b `seq` ()
23
false
true
0
8
10
36
17
19
null
null
Andrey-Sisoyev/PCLT-DB
Data/MyHelpers_.hs
lgpl-2.1
putStrLn_paged :: Int -> String -> IO () putStrLn_paged page_size s = f $ lines s where f lines_list = let (to_print, to_next_itera) = splitAt page_size lines_list in do putStrLn (concat $ intersperse "\n" to_print) case null to_next_itera of True -> return () False -> f to_next_itera << hGetChar stdin << putStrLn "\n-------Press any key to continue...-------"
491
putStrLn_paged :: Int -> String -> IO () putStrLn_paged page_size s = f $ lines s where f lines_list = let (to_print, to_next_itera) = splitAt page_size lines_list in do putStrLn (concat $ intersperse "\n" to_print) case null to_next_itera of True -> return () False -> f to_next_itera << hGetChar stdin << putStrLn "\n-------Press any key to continue...-------"
491
putStrLn_paged page_size s = f $ lines s where f lines_list = let (to_print, to_next_itera) = splitAt page_size lines_list in do putStrLn (concat $ intersperse "\n" to_print) case null to_next_itera of True -> return () False -> f to_next_itera << hGetChar stdin << putStrLn "\n-------Press any key to continue...-------"
450
false
true
1
15
185
140
61
79
null
null
expipiplus1/spir-v
Language/SpirV/OpCode.hs
mit
instructionSize OpCopyMemory = Fixed 3
38
instructionSize OpCopyMemory = Fixed 3
38
instructionSize OpCopyMemory = Fixed 3
38
false
false
0
5
4
12
5
7
null
null
thoughtpolice/ghc-prim-compat
src/GHC/Exts/Compat.hs
bsd-3-clause
(>##) :: Double# -> Double# -> Bool (>##) a b = isTrue# (a E.>## b)
68
(>##) :: Double# -> Double# -> Bool (>##) a b = isTrue# (a E.>## b)
68
(>##) a b = isTrue# (a E.>## b)
31
false
true
0
7
15
40
22
18
null
null
michaelbeaumont/pandoc
src/Text/Pandoc/SelfContained.hs
gpl-2.0
pCSSOther :: ParsecT ByteString () IO ByteString pCSSOther = do (B.pack <$> P.many1 (P.noneOf "u/ \n\r\t")) <|> (B.singleton <$> P.char 'u') <|> (B.singleton <$> P.char '/')
183
pCSSOther :: ParsecT ByteString () IO ByteString pCSSOther = do (B.pack <$> P.many1 (P.noneOf "u/ \n\r\t")) <|> (B.singleton <$> P.char 'u') <|> (B.singleton <$> P.char '/')
183
pCSSOther = do (B.pack <$> P.many1 (P.noneOf "u/ \n\r\t")) <|> (B.singleton <$> P.char 'u') <|> (B.singleton <$> P.char '/')
134
false
true
0
14
35
83
41
42
null
null
brownplt/strobe-old
src/BrownPLT/TypedJS/LocalVars.hs
bsd-2-clause
topLevel :: TopLevel SourcePos -> Locals () topLevel tl = case tl of TopLevelStmt s -> stmt s ExternalFieldStmt _ (Id _ brand) (Id _ field) e -> bindField brand field e ConstructorStmt _ brand _ ty _ _ -> bindConstr brand ty ImportConstrStmt _ brand _ ty -> bindConstr (unId brand) ty ImportStmt _ name _ ty -> bind (unId name) ty
340
topLevel :: TopLevel SourcePos -> Locals () topLevel tl = case tl of TopLevelStmt s -> stmt s ExternalFieldStmt _ (Id _ brand) (Id _ field) e -> bindField brand field e ConstructorStmt _ brand _ ty _ _ -> bindConstr brand ty ImportConstrStmt _ brand _ ty -> bindConstr (unId brand) ty ImportStmt _ name _ ty -> bind (unId name) ty
340
topLevel tl = case tl of TopLevelStmt s -> stmt s ExternalFieldStmt _ (Id _ brand) (Id _ field) e -> bindField brand field e ConstructorStmt _ brand _ ty _ _ -> bindConstr brand ty ImportConstrStmt _ brand _ ty -> bindConstr (unId brand) ty ImportStmt _ name _ ty -> bind (unId name) ty
296
false
true
0
10
72
156
72
84
null
null
damoxc/ganeti
src/Ganeti/HTools/Backend/Text.hs
gpl-2.0
-- | Serialize a single instance. serializeInstance :: Node.List -- ^ The node list (needed for -- node names) -> Instance.Instance -- ^ The instance to be serialised -> String serializeInstance nl inst = let iname = Instance.name inst pnode = Container.nameOf nl (Instance.pNode inst) sidx = Instance.sNode inst snode = (if sidx == Node.noSecondary then "" else Container.nameOf nl sidx) in printf "%s|%d|%d|%d|%s|%s|%s|%s|%s|%s|%d" iname (Instance.mem inst) (Instance.dsk inst) (Instance.vcpus inst) (instanceStatusToRaw (Instance.runSt inst)) (if Instance.autoBalance inst then "Y" else "N") pnode snode (diskTemplateToRaw (Instance.diskTemplate inst)) (intercalate "," (Instance.allTags inst)) (Instance.spindleUse inst)
898
serializeInstance :: Node.List -- ^ The node list (needed for -- node names) -> Instance.Instance -- ^ The instance to be serialised -> String serializeInstance nl inst = let iname = Instance.name inst pnode = Container.nameOf nl (Instance.pNode inst) sidx = Instance.sNode inst snode = (if sidx == Node.noSecondary then "" else Container.nameOf nl sidx) in printf "%s|%d|%d|%d|%s|%s|%s|%s|%s|%s|%d" iname (Instance.mem inst) (Instance.dsk inst) (Instance.vcpus inst) (instanceStatusToRaw (Instance.runSt inst)) (if Instance.autoBalance inst then "Y" else "N") pnode snode (diskTemplateToRaw (Instance.diskTemplate inst)) (intercalate "," (Instance.allTags inst)) (Instance.spindleUse inst)
864
serializeInstance nl inst = let iname = Instance.name inst pnode = Container.nameOf nl (Instance.pNode inst) sidx = Instance.sNode inst snode = (if sidx == Node.noSecondary then "" else Container.nameOf nl sidx) in printf "%s|%d|%d|%d|%s|%s|%s|%s|%s|%s|%d" iname (Instance.mem inst) (Instance.dsk inst) (Instance.vcpus inst) (instanceStatusToRaw (Instance.runSt inst)) (if Instance.autoBalance inst then "Y" else "N") pnode snode (diskTemplateToRaw (Instance.diskTemplate inst)) (intercalate "," (Instance.allTags inst)) (Instance.spindleUse inst)
638
true
true
0
12
265
224
115
109
null
null
vipo/marathon-baton
src/Baton/Runner.hs
bsd-3-clause
run :: Configuration -- ^ configuration -> (String, DockerImage) -- ^ docker app -> IO String -- ^ uuid of run run conf (n, DockerImage i r t) = do uuid <- fmap toString nextRandom let dir = workingDir conf ++ "/run/" ++ uuid createDirectoryIfMissing True dir writeStatus dir "Running" stdout <- openFile (dir ++ "/stdout.txt") WriteMode hSetBuffering stdout NoBuffering stderr <- openFile (dir ++ "/stderr.txt") WriteMode hSetBuffering stderr NoBuffering (_, _, _, ph) <- createProcess (proc (pathToExecutable conf) [n, r ++ "/" ++ i, t]) { std_out = UseHandle stdout , std_err = UseHandle stderr , cwd = Just dir } forkIO $ waitForCompletion dir ph return uuid
750
run :: Configuration -- ^ configuration -> (String, DockerImage) -- ^ docker app -> IO String run conf (n, DockerImage i r t) = do uuid <- fmap toString nextRandom let dir = workingDir conf ++ "/run/" ++ uuid createDirectoryIfMissing True dir writeStatus dir "Running" stdout <- openFile (dir ++ "/stdout.txt") WriteMode hSetBuffering stdout NoBuffering stderr <- openFile (dir ++ "/stderr.txt") WriteMode hSetBuffering stderr NoBuffering (_, _, _, ph) <- createProcess (proc (pathToExecutable conf) [n, r ++ "/" ++ i, t]) { std_out = UseHandle stdout , std_err = UseHandle stderr , cwd = Just dir } forkIO $ waitForCompletion dir ph return uuid
721
run conf (n, DockerImage i r t) = do uuid <- fmap toString nextRandom let dir = workingDir conf ++ "/run/" ++ uuid createDirectoryIfMissing True dir writeStatus dir "Running" stdout <- openFile (dir ++ "/stdout.txt") WriteMode hSetBuffering stdout NoBuffering stderr <- openFile (dir ++ "/stderr.txt") WriteMode hSetBuffering stderr NoBuffering (_, _, _, ph) <- createProcess (proc (pathToExecutable conf) [n, r ++ "/" ++ i, t]) { std_out = UseHandle stdout , std_err = UseHandle stderr , cwd = Just dir } forkIO $ waitForCompletion dir ph return uuid
611
true
true
0
15
196
256
124
132
null
null
rueshyna/gogol
gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Operations/List.hs
mpl-2.0
-- | V1 error format. olXgafv :: Lens' OperationsList (Maybe Xgafv) olXgafv = lens _olXgafv (\ s a -> s{_olXgafv = a})
118
olXgafv :: Lens' OperationsList (Maybe Xgafv) olXgafv = lens _olXgafv (\ s a -> s{_olXgafv = a})
96
olXgafv = lens _olXgafv (\ s a -> s{_olXgafv = a})
50
true
true
1
9
21
51
25
26
null
null
psibi/persistent
persistent/Database/Persist/Sql/Run.hs
mit
runSqlPersistM :: (IsSqlBackend backend) => ReaderT backend (NoLoggingT (ResourceT IO)) a -> backend -> IO a runSqlPersistM x conn = runResourceT $ runNoLoggingT $ runSqlConn x conn
189
runSqlPersistM :: (IsSqlBackend backend) => ReaderT backend (NoLoggingT (ResourceT IO)) a -> backend -> IO a runSqlPersistM x conn = runResourceT $ runNoLoggingT $ runSqlConn x conn
189
runSqlPersistM x conn = runResourceT $ runNoLoggingT $ runSqlConn x conn
72
false
true
2
12
34
73
34
39
null
null
Frefreak/Gideon
src/SDEDrill.hs
bsd-3-clause
genStationsSystemMap :: IO () genStationsSystemMap = do dest <- allStationsJson yml <- staStationsYaml Just (val :: Value) <- Y.decodeFile yml let maps = foldr genHM HM.empty (val ^. _Array) genHM o = let sysID = showSci $ o ^?! key "solarSystemID" . _Number staID = showSci $ o ^?! key "stationID" . _Number in HM.insertWith (++) sysID [staID] LBS.writeFile dest $ encodePretty maps
451
genStationsSystemMap :: IO () genStationsSystemMap = do dest <- allStationsJson yml <- staStationsYaml Just (val :: Value) <- Y.decodeFile yml let maps = foldr genHM HM.empty (val ^. _Array) genHM o = let sysID = showSci $ o ^?! key "solarSystemID" . _Number staID = showSci $ o ^?! key "stationID" . _Number in HM.insertWith (++) sysID [staID] LBS.writeFile dest $ encodePretty maps
451
genStationsSystemMap = do dest <- allStationsJson yml <- staStationsYaml Just (val :: Value) <- Y.decodeFile yml let maps = foldr genHM HM.empty (val ^. _Array) genHM o = let sysID = showSci $ o ^?! key "solarSystemID" . _Number staID = showSci $ o ^?! key "stationID" . _Number in HM.insertWith (++) sysID [staID] LBS.writeFile dest $ encodePretty maps
421
false
true
0
16
130
160
76
84
null
null
sgillespie/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
readList_RDR, readListDefault_RDR, readListPrec_RDR, readListPrecDefault_RDR, readPrec_RDR, parens_RDR, choose_RDR, lexP_RDR, expectP_RDR :: RdrName readList_RDR = varQual_RDR gHC_READ (fsLit "readList")
218
readList_RDR, readListDefault_RDR, readListPrec_RDR, readListPrecDefault_RDR, readPrec_RDR, parens_RDR, choose_RDR, lexP_RDR, expectP_RDR :: RdrName readList_RDR = varQual_RDR gHC_READ (fsLit "readList")
218
readList_RDR = varQual_RDR gHC_READ (fsLit "readList")
65
false
true
0
7
31
38
27
11
null
null
brendanhay/gogol
gogol-accesscontextmanager/gen/Network/Google/AccessContextManager/Types/Product.hs
mpl-2.0
-- | List of the Service Perimeter instances. lsprServicePerimeters :: Lens' ListServicePerimetersResponse [ServicePerimeter] lsprServicePerimeters = lens _lsprServicePerimeters (\ s a -> s{_lsprServicePerimeters = a}) . _Default . _Coerce
259
lsprServicePerimeters :: Lens' ListServicePerimetersResponse [ServicePerimeter] lsprServicePerimeters = lens _lsprServicePerimeters (\ s a -> s{_lsprServicePerimeters = a}) . _Default . _Coerce
213
lsprServicePerimeters = lens _lsprServicePerimeters (\ s a -> s{_lsprServicePerimeters = a}) . _Default . _Coerce
133
true
true
2
8
47
57
28
29
null
null
matonix/BTScraper
src/Python.hs
bsd-3-clause
histories :: Scraper ByteString [PythonHistory] histories = chroots ("table" @: [hasClass "table-striped"] // "tr") $ texts "td"
128
histories :: Scraper ByteString [PythonHistory] histories = chroots ("table" @: [hasClass "table-striped"] // "tr") $ texts "td"
128
histories = chroots ("table" @: [hasClass "table-striped"] // "tr") $ texts "td"
80
false
true
0
11
16
46
23
23
null
null
orclev/CBOR
src/Data/Binary/CBOR.hs
lgpl-3.0
putCBOR (CBOR_Double x) = putHeaderBlock 7 27 >> putFloat64be x
63
putCBOR (CBOR_Double x) = putHeaderBlock 7 27 >> putFloat64be x
63
putCBOR (CBOR_Double x) = putHeaderBlock 7 27 >> putFloat64be x
63
false
false
0
6
9
28
12
16
null
null
phischu/fragnix
tests/packages/scotty/Network.HTTP2.Types.hs
bsd-3-clause
framePayloadToFrameTypeId (GoAwayFrame _ _ _) = FrameGoAway
62
framePayloadToFrameTypeId (GoAwayFrame _ _ _) = FrameGoAway
62
framePayloadToFrameTypeId (GoAwayFrame _ _ _) = FrameGoAway
62
false
false
0
7
9
19
9
10
null
null
Refefer/fido
app/Main.hs
bsd-3-clause
plain :: L.ByteString -> Response plain a = responseLBS status200 textPlain a
77
plain :: L.ByteString -> Response plain a = responseLBS status200 textPlain a
77
plain a = responseLBS status200 textPlain a
43
false
true
0
7
11
33
14
19
null
null
UweSchmidt/ppl2
src/PPL2.hs
mit
voidex e = void' `ass` e
26
voidex e = void' `ass` e
26
voidex e = void' `ass` e
26
false
false
0
5
7
15
8
7
null
null
ml9951/ThreadScope
GUI/Main.hs
bsd-3-clause
getEvent :: Chan Event -> IO Event getEvent = Chan.readChan
60
getEvent :: Chan Event -> IO Event getEvent = Chan.readChan
60
getEvent = Chan.readChan
24
false
true
0
7
10
29
12
17
null
null
olorin/amazonka
amazonka-cloudformation/test/Test/AWS/Gen/CloudFormation.hs
mpl-2.0
testEstimateTemplateCost :: EstimateTemplateCost -> TestTree testEstimateTemplateCost = req "EstimateTemplateCost" "fixture/EstimateTemplateCost.yaml"
158
testEstimateTemplateCost :: EstimateTemplateCost -> TestTree testEstimateTemplateCost = req "EstimateTemplateCost" "fixture/EstimateTemplateCost.yaml"
158
testEstimateTemplateCost = req "EstimateTemplateCost" "fixture/EstimateTemplateCost.yaml"
97
false
true
0
5
17
20
10
10
null
null
alios/clearingstelle
Handler/Clearingstelle.hs
bsd-3-clause
getCreateKeysetR :: Text -> Handler RepHtml getCreateKeysetR dom = withRole dom AdminRole $ \domid uuid -> defaultLayout $ do setTitle "clearingstelle - create keyset" $(widgetFile "createkeyset")
200
getCreateKeysetR :: Text -> Handler RepHtml getCreateKeysetR dom = withRole dom AdminRole $ \domid uuid -> defaultLayout $ do setTitle "clearingstelle - create keyset" $(widgetFile "createkeyset")
200
getCreateKeysetR dom = withRole dom AdminRole $ \domid uuid -> defaultLayout $ do setTitle "clearingstelle - create keyset" $(widgetFile "createkeyset")
156
false
true
0
12
29
57
26
31
null
null
trenta3/zeno-0.2.0.1
src/Zeno/Type.hs
mit
flattenForAllType ty = ([], ty)
31
flattenForAllType ty = ([], ty)
31
flattenForAllType ty = ([], ty)
31
false
false
0
6
4
17
9
8
null
null
adbrowne/dynamodb-eventstore
dynamodb-eventstore-web/src/DynamoDbEventStore/Webserver.hs
mit
eventStartPositionToMaybeInt64 (Just EventStartHead) = Nothing
62
eventStartPositionToMaybeInt64 (Just EventStartHead) = Nothing
62
eventStartPositionToMaybeInt64 (Just EventStartHead) = Nothing
62
false
false
0
7
4
15
7
8
null
null
IreneKnapp/Faction
libfaction/Distribution/Simple/Utils.hs
bsd-3-clause
matchDirFileGlob :: FilePath -> FilePath -> IO [FilePath] matchDirFileGlob dir filepath = case parseFileGlob filepath of Nothing -> die $ "invalid file glob '" ++ filepath ++ "'. Wildcards '*' are only allowed in place of the file" ++ " name, not in the directory name or file extension." ++ " If a wildcard is used it must be with an file extension." Just (NoGlob filepath') -> return [filepath'] Just (FileGlob dir' ext) -> do files <- getDirectoryContents (dir </> dir') case [ dir' </> file | file <- files , let (name, ext') = splitExtensions file , not (null name) && ext' == ext ] of [] -> die $ "filepath wildcard '" ++ filepath ++ "' does not match any files." matches -> return matches ---------------------------------------- -- Copying and installing files and dirs -- | Same as 'createDirectoryIfMissing' but logs at higher verbosity levels. --
993
matchDirFileGlob :: FilePath -> FilePath -> IO [FilePath] matchDirFileGlob dir filepath = case parseFileGlob filepath of Nothing -> die $ "invalid file glob '" ++ filepath ++ "'. Wildcards '*' are only allowed in place of the file" ++ " name, not in the directory name or file extension." ++ " If a wildcard is used it must be with an file extension." Just (NoGlob filepath') -> return [filepath'] Just (FileGlob dir' ext) -> do files <- getDirectoryContents (dir </> dir') case [ dir' </> file | file <- files , let (name, ext') = splitExtensions file , not (null name) && ext' == ext ] of [] -> die $ "filepath wildcard '" ++ filepath ++ "' does not match any files." matches -> return matches ---------------------------------------- -- Copying and installing files and dirs -- | Same as 'createDirectoryIfMissing' but logs at higher verbosity levels. --
993
matchDirFileGlob dir filepath = case parseFileGlob filepath of Nothing -> die $ "invalid file glob '" ++ filepath ++ "'. Wildcards '*' are only allowed in place of the file" ++ " name, not in the directory name or file extension." ++ " If a wildcard is used it must be with an file extension." Just (NoGlob filepath') -> return [filepath'] Just (FileGlob dir' ext) -> do files <- getDirectoryContents (dir </> dir') case [ dir' </> file | file <- files , let (name, ext') = splitExtensions file , not (null name) && ext' == ext ] of [] -> die $ "filepath wildcard '" ++ filepath ++ "' does not match any files." matches -> return matches ---------------------------------------- -- Copying and installing files and dirs -- | Same as 'createDirectoryIfMissing' but logs at higher verbosity levels. --
935
false
true
3
15
282
215
106
109
null
null
Shakadak/ft_turing
src/Machine.hs
mit
moveHead RIGHT = right
22
moveHead RIGHT = right
22
moveHead RIGHT = right
22
false
false
0
5
3
9
4
5
null
null
pmlodawski/ghc-session
src/Language/Haskell/Session/Binding.hs
mit
dropDot :: String -> String dropDot = reverse . List.takeWhile (/= '.') . reverse
81
dropDot :: String -> String dropDot = reverse . List.takeWhile (/= '.') . reverse
81
dropDot = reverse . List.takeWhile (/= '.') . reverse
53
false
true
0
8
13
39
18
21
null
null
DavidAlphaFox/ghc
utils/haddock/haddock-library/src/Documentation/Haddock/Doc.hs
bsd-3-clause
docAppend d1 d2 = DocAppend d1 d2
33
docAppend d1 d2 = DocAppend d1 d2
33
docAppend d1 d2 = DocAppend d1 d2
33
false
false
1
5
6
20
7
13
null
null
SimSaladin/rnfssp
rnfssp-market/MarketSub.hs
bsd-3-clause
postMarketAddListingR :: Text -> Handler Html postMarketAddListingR kind = do kind' <- case kind of "sell" -> return True "buy" -> return True _ -> notFound ((res, _), _) <- lift $ runFormPost $ listingForm kind' handleItem res
296
postMarketAddListingR :: Text -> Handler Html postMarketAddListingR kind = do kind' <- case kind of "sell" -> return True "buy" -> return True _ -> notFound ((res, _), _) <- lift $ runFormPost $ listingForm kind' handleItem res
296
postMarketAddListingR kind = do kind' <- case kind of "sell" -> return True "buy" -> return True _ -> notFound ((res, _), _) <- lift $ runFormPost $ listingForm kind' handleItem res
250
false
true
0
12
106
96
45
51
null
null
neothemachine/monadiccp
src/Data/Expr/Util.hs
bsd-3-clause
walk x@(Mult a b) f = walker x f ([a,b],[],[])
46
walk x@(Mult a b) f = walker x f ([a,b],[],[])
46
walk x@(Mult a b) f = walker x f ([a,b],[],[])
46
false
false
0
8
9
48
26
22
null
null
jbddc/sdc-graph
src/PrefAttachment.hs
bsd-3-clause
runPrefAttachment num = let graph = createGraph num in loop graph 0
77
runPrefAttachment num = let graph = createGraph num in loop graph 0
77
runPrefAttachment num = let graph = createGraph num in loop graph 0
77
false
false
1
9
21
33
12
21
null
null
christiaanb/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
-- Not used at runtime matchContextErrString PatSyn = panic "matchContextErrString"
103
matchContextErrString PatSyn = panic "matchContextErrString"
80
matchContextErrString PatSyn = panic "matchContextErrString"
80
true
false
0
5
29
14
6
8
null
null
nikki-and-the-robots/nikki
src/Base/Application/Sound.hs
lgpl-3.0
kSoundVolume :: Configuration -> Maybe Float mkSoundVolume config = Just (globalSoundVolume * config ^. sound_volume)
118
mkSoundVolume :: Configuration -> Maybe Float mkSoundVolume config = Just (globalSoundVolume * config ^. sound_volume)
118
mkSoundVolume config = Just (globalSoundVolume * config ^. sound_volume)
72
false
true
0
8
15
35
17
18
null
null
tonyday567/sfold
sfold/src/SFold/Examples.hs
mit
flush' :: X -> X flush' (X x) = if fst x == 0 then X (0, snd x) else X (0, snd x ++ [fst x])
102
flush' :: X -> X flush' (X x) = if fst x == 0 then X (0, snd x) else X (0, snd x ++ [fst x])
102
flush' (X x) = if fst x == 0 then X (0, snd x) else X (0, snd x ++ [fst x])
85
false
true
0
10
36
73
37
36
null
null
AlexanderPankiv/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
divModIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divModInteger") divModIntegerIdKey
95
divModIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divModInteger") divModIntegerIdKey
95
divModIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divModInteger") divModIntegerIdKey
95
false
false
0
7
14
19
9
10
null
null
pparkkin/eta
compiler/ETA/CodeGen/Prim.hs
bsd-3-clause
nopOp JBool2IntOp = True
25
nopOp JBool2IntOp = True
25
nopOp JBool2IntOp = True
25
false
false
0
5
4
9
4
5
null
null
abhin4v/ringo
ringo-core/src/Ringo/Utils.hs
mit
first :: (a -> a') -> (a, b) -> (a', b) first = Arrow.first
59
first :: (a -> a') -> (a, b) -> (a', b) first = Arrow.first
59
first = Arrow.first
19
false
true
0
7
13
40
23
17
null
null
aelve/hslibs
src/Guide/Views.hs
bsd-3-clause
-- | Include all the necessary things into a page – header, footer, etc. wrapPage :: (MonadIO m, MonadReader Config m) => Text -- ^ Page title -> HtmlT m () -> HtmlT m () wrapPage pageTitle' page = doctypehtml_ $ do head_ $ do title_ (toHtml pageTitle') meta_ [name_ "viewport", content_ "width=device-width, initial-scale=1.0, user-scalable=yes"] link_ [rel_ "icon", href_ "/favicon.ico"] googleToken <- _googleToken <$> lift ask unless (T.null googleToken) $ meta_ [name_ "google-site-verification", content_ googleToken] -- Report all Javascript errors with alerts script_ [text| window.onerror = function (msg, url, lineNo, columnNo, error) { alert("Error in "+url+" at "+lineNo+":"+columnNo+": "+msg+ "\n\n"+ "========== Please report it! =========="+ "\n\n"+ "https://github.com/aelve/guide/issues"); return false; }; |] includeJS "/js/bundle.js" -- for modal dialogs includeJS "/magnific-popup.js" includeCSS "/magnific-popup.css" -- See Note [autosize] includeJS "/autosize.js" onPageLoad (JS "autosize($('textarea'));") -- The order is important – markup.css overrides some rules from -- highlight.css (e.g. div.sourceCode), css.css overrides the rule for -- a.anchor from markup.css. -- -- TODO: maybe use !important or something instead? includeCSS "/highlight.css" includeCSS "/markup.css" includeCSS "/css.css" includeCSS "/loader.css" -- Include definitions of all Javascript functions that we have defined -- in this file. (This isn't an actual file, so don't look for it in the -- static folder – it's generated and served in 'otherMethods'.) includeJS "/js.js" -- CSS that makes 'shown' and 'noScriptShown' work; -- see Note [show-hide] noscript_ $ style_ [text| .section:not(.noscript-shown) {display:none;} |] script_ [text| var sheet = document.createElement('style'); sheet.innerHTML = '.section:not(.shown) {display:none;}'; // “head” instead of “body” because body isn't loaded yet document.head.appendChild(sheet); |] body_ $ do script_ $ fromJS $ JS.createAjaxIndicator () div_ [id_ "main"] $ page div_ [id_ "footer"] $ do mapM_ (div_ [class_ "footer-item"]) $ [ do "made by " mkLink "Artyom" "https://artyom.me" , do mkLink "source" "https://github.com/aelve/guide" "/" mkLink "issue tracker" "https://github.com/aelve/guide/issues" , mkLink "rules" "/unwritten-rules" , mkLink "donate" "/donate" , do "licensed under " mkLink "CC+ BY-SA 4.0" "/license" ] -- | Render the search box.
2,843
wrapPage :: (MonadIO m, MonadReader Config m) => Text -- ^ Page title -> HtmlT m () -> HtmlT m () wrapPage pageTitle' page = doctypehtml_ $ do head_ $ do title_ (toHtml pageTitle') meta_ [name_ "viewport", content_ "width=device-width, initial-scale=1.0, user-scalable=yes"] link_ [rel_ "icon", href_ "/favicon.ico"] googleToken <- _googleToken <$> lift ask unless (T.null googleToken) $ meta_ [name_ "google-site-verification", content_ googleToken] -- Report all Javascript errors with alerts script_ [text| window.onerror = function (msg, url, lineNo, columnNo, error) { alert("Error in "+url+" at "+lineNo+":"+columnNo+": "+msg+ "\n\n"+ "========== Please report it! =========="+ "\n\n"+ "https://github.com/aelve/guide/issues"); return false; }; |] includeJS "/js/bundle.js" -- for modal dialogs includeJS "/magnific-popup.js" includeCSS "/magnific-popup.css" -- See Note [autosize] includeJS "/autosize.js" onPageLoad (JS "autosize($('textarea'));") -- The order is important – markup.css overrides some rules from -- highlight.css (e.g. div.sourceCode), css.css overrides the rule for -- a.anchor from markup.css. -- -- TODO: maybe use !important or something instead? includeCSS "/highlight.css" includeCSS "/markup.css" includeCSS "/css.css" includeCSS "/loader.css" -- Include definitions of all Javascript functions that we have defined -- in this file. (This isn't an actual file, so don't look for it in the -- static folder – it's generated and served in 'otherMethods'.) includeJS "/js.js" -- CSS that makes 'shown' and 'noScriptShown' work; -- see Note [show-hide] noscript_ $ style_ [text| .section:not(.noscript-shown) {display:none;} |] script_ [text| var sheet = document.createElement('style'); sheet.innerHTML = '.section:not(.shown) {display:none;}'; // “head” instead of “body” because body isn't loaded yet document.head.appendChild(sheet); |] body_ $ do script_ $ fromJS $ JS.createAjaxIndicator () div_ [id_ "main"] $ page div_ [id_ "footer"] $ do mapM_ (div_ [class_ "footer-item"]) $ [ do "made by " mkLink "Artyom" "https://artyom.me" , do mkLink "source" "https://github.com/aelve/guide" "/" mkLink "issue tracker" "https://github.com/aelve/guide/issues" , mkLink "rules" "/unwritten-rules" , mkLink "donate" "/donate" , do "licensed under " mkLink "CC+ BY-SA 4.0" "/license" ] -- | Render the search box.
2,770
wrapPage pageTitle' page = doctypehtml_ $ do head_ $ do title_ (toHtml pageTitle') meta_ [name_ "viewport", content_ "width=device-width, initial-scale=1.0, user-scalable=yes"] link_ [rel_ "icon", href_ "/favicon.ico"] googleToken <- _googleToken <$> lift ask unless (T.null googleToken) $ meta_ [name_ "google-site-verification", content_ googleToken] -- Report all Javascript errors with alerts script_ [text| window.onerror = function (msg, url, lineNo, columnNo, error) { alert("Error in "+url+" at "+lineNo+":"+columnNo+": "+msg+ "\n\n"+ "========== Please report it! =========="+ "\n\n"+ "https://github.com/aelve/guide/issues"); return false; }; |] includeJS "/js/bundle.js" -- for modal dialogs includeJS "/magnific-popup.js" includeCSS "/magnific-popup.css" -- See Note [autosize] includeJS "/autosize.js" onPageLoad (JS "autosize($('textarea'));") -- The order is important – markup.css overrides some rules from -- highlight.css (e.g. div.sourceCode), css.css overrides the rule for -- a.anchor from markup.css. -- -- TODO: maybe use !important or something instead? includeCSS "/highlight.css" includeCSS "/markup.css" includeCSS "/css.css" includeCSS "/loader.css" -- Include definitions of all Javascript functions that we have defined -- in this file. (This isn't an actual file, so don't look for it in the -- static folder – it's generated and served in 'otherMethods'.) includeJS "/js.js" -- CSS that makes 'shown' and 'noScriptShown' work; -- see Note [show-hide] noscript_ $ style_ [text| .section:not(.noscript-shown) {display:none;} |] script_ [text| var sheet = document.createElement('style'); sheet.innerHTML = '.section:not(.shown) {display:none;}'; // “head” instead of “body” because body isn't loaded yet document.head.appendChild(sheet); |] body_ $ do script_ $ fromJS $ JS.createAjaxIndicator () div_ [id_ "main"] $ page div_ [id_ "footer"] $ do mapM_ (div_ [class_ "footer-item"]) $ [ do "made by " mkLink "Artyom" "https://artyom.me" , do mkLink "source" "https://github.com/aelve/guide" "/" mkLink "issue tracker" "https://github.com/aelve/guide/issues" , mkLink "rules" "/unwritten-rules" , mkLink "donate" "/donate" , do "licensed under " mkLink "CC+ BY-SA 4.0" "/license" ] -- | Render the search box.
2,635
true
true
0
19
751
427
198
229
null
null
zjhmale/HMF
src/Ranked/Type.hs
bsd-3-clause
idNameMapReset :: Infer () idNameMapReset = writeIORef idNameMap M.empty
72
idNameMapReset :: Infer () idNameMapReset = writeIORef idNameMap M.empty
72
idNameMapReset = writeIORef idNameMap M.empty
45
false
true
0
7
8
29
12
17
null
null
yjwen/hada
test/Prim.hs
lgpl-3.0
plusOne64 :: Int64 -> Int64 plusOne64 = (+1)
44
plusOne64 :: Int64 -> Int64 plusOne64 = (+1)
44
plusOne64 = (+1)
16
false
true
0
7
7
26
12
14
null
null
kosmoskatten/linx-gateway
src/Network/Linx/Gateway/Message.hs
mit
-- | Make a 'DestroyRequest' message. mkDestroyRequest :: Pid -> Message mkDestroyRequest pid' = let payload = DestroyRequest pid' in Message (header payload) payload
170
mkDestroyRequest :: Pid -> Message mkDestroyRequest pid' = let payload = DestroyRequest pid' in Message (header payload) payload
132
mkDestroyRequest pid' = let payload = DestroyRequest pid' in Message (header payload) payload
97
true
true
0
9
27
44
21
23
null
null
darnuria/Yasc
Evaluation.hs
mit
eqv [String arg1, String arg2] = return (Bool (arg1 == arg2))
69
eqv [String arg1, String arg2] = return (Bool (arg1 == arg2))
69
eqv [String arg1, String arg2] = return (Bool (arg1 == arg2))
69
false
false
0
9
18
38
18
20
null
null
phischu/fragnix
builtins/base/GHC.Show.hs
bsd-3-clause
showMultiLineString :: String -> [String] -- | Like 'showLitString' (expand escape characters using Haskell -- escape conventions), but -- * break the string into multiple lines -- * wrap the entire thing in double quotes -- Example: @showMultiLineString "hello\ngoodbye\nblah"@ -- returns @["\"hello\\n\\", "\\goodbye\n\\", "\\blah\""]@ showMultiLineString str = go '\"' str where go ch s = case break (== '\n') s of (l, _:s'@(_:_)) -> (ch : showLitString l "\\n\\") : go '\\' s' (l, "\n") -> [ch : showLitString l "\\n\""] (l, _) -> [ch : showLitString l "\""]
640
showMultiLineString :: String -> [String] showMultiLineString str = go '\"' str where go ch s = case break (== '\n') s of (l, _:s'@(_:_)) -> (ch : showLitString l "\\n\\") : go '\\' s' (l, "\n") -> [ch : showLitString l "\\n\""] (l, _) -> [ch : showLitString l "\""]
337
showMultiLineString str = go '\"' str where go ch s = case break (== '\n') s of (l, _:s'@(_:_)) -> (ch : showLitString l "\\n\\") : go '\\' s' (l, "\n") -> [ch : showLitString l "\\n\""] (l, _) -> [ch : showLitString l "\""]
295
true
true
1
12
166
164
84
80
null
null
mettekou/ghc
compiler/typecheck/TcEvidence.hs
bsd-3-clause
mk_co_app_fn :: (a -> HsWrapper) -> [a] -> HsWrapper -- For applications, the *first* argument must -- come *last* in the composition sequence mk_co_app_fn f as = foldr (\x wrap -> wrap <.> f x) WpHole as
204
mk_co_app_fn :: (a -> HsWrapper) -> [a] -> HsWrapper mk_co_app_fn f as = foldr (\x wrap -> wrap <.> f x) WpHole as
114
mk_co_app_fn f as = foldr (\x wrap -> wrap <.> f x) WpHole as
61
true
true
0
9
36
60
32
28
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxTEXT_ATTR_OUTLINE_LEVEL :: Int wxTEXT_ATTR_OUTLINE_LEVEL = 0x01000000
85
wxTEXT_ATTR_OUTLINE_LEVEL :: Int wxTEXT_ATTR_OUTLINE_LEVEL = 0x01000000
85
wxTEXT_ATTR_OUTLINE_LEVEL = 0x01000000
45
false
true
0
4
19
11
6
5
null
null
andorp/hs-bluesnap
src/Bluesnap/API/Response.hs
gpl-3.0
elementSubscription_trial_period :: XMLParser Xsd.XsdString elementSubscription_trial_period = parseSchemaType "subscription-trial-period"
138
elementSubscription_trial_period :: XMLParser Xsd.XsdString elementSubscription_trial_period = parseSchemaType "subscription-trial-period"
138
elementSubscription_trial_period = parseSchemaType "subscription-trial-period"
78
false
true
0
6
7
19
9
10
null
null
changlinli/nikki
src/Graphics/Qt/CPPWrapper.hs
lgpl-3.0
saveQPixmap :: ForeignPtr QPixmap -> String -> QtInt -> IO () saveQPixmap fp file quality = withForeignPtr fp $ \ ptr -> withCString file $ \ cfile -> cppSaveQPixmap ptr cfile quality
195
saveQPixmap :: ForeignPtr QPixmap -> String -> QtInt -> IO () saveQPixmap fp file quality = withForeignPtr fp $ \ ptr -> withCString file $ \ cfile -> cppSaveQPixmap ptr cfile quality
195
saveQPixmap fp file quality = withForeignPtr fp $ \ ptr -> withCString file $ \ cfile -> cppSaveQPixmap ptr cfile quality
133
false
true
0
9
43
69
33
36
null
null
m-alvarez/jhc
src/FrontEnd/Lex/Fixity.hs
mit
shunt :: (Show t, Show e,Monad m) => ShuntSpec m t e -- specification -> [t] -- token stream -> m e shunt ShuntSpec { .. } xs = f initialState xs where f S { output = [e], stack = [] } [] = return e f S { output = [], stack = [] } [] = emptyInput f s@S { .. } (t:ts) = lookupToken t >>= \x -> case (x,lastWasOp) of (Left o,True) -> f s { output = o:output, lastWasOp = False } ts (Left o,False) -> op s { lastWasOp = True } (Nothing,appPrec) Nothing (t:ts) (Right p@(Prefix,_),False) -> op s { lastWasOp = True } (Nothing,appPrec) Nothing (t:ts) (Right p,False) -> op s { lastWasOp = True } (Just t,p) Nothing ts (Right p@(Prefix,_),True) -> op s (Just t,p) Nothing ts (Right p@(_,n),True) -> do mn <- lookupUnary t let Just n' = mplus mn (Just n) op s (Just t,(Prefix,n')) Nothing ts f s@S { output = (x:os) , stack = (t,(Prefix,_)):ss } [] = do ne <- apop t [x] f s { output = ne:os, stack = ss } [] f s@S { output = (x:y:os) , stack = (t,_):ss } [] = do ne <- apop t [y,x] f s { output = ne:os, stack = ss } [] f s@S { output = [e], stack = (Just t,_):ss } [] = do ne <- trailingOps e t -- (catMaybes $ map fst stack) f s { output = [ne], stack = ss } [] f s [] = error $ show s op s@S { .. } o@(_,prec) me ts = g s where g s@S { stack = [] } = f (addOut s { stack = [o] }) ts g s@S { stack = (t,prec'@(Prefix,_)):ss, output = (x:rs) } | prec' `gt` prec = do ne <- apop t [x] g s { stack = ss, output = ne:rs } g s@S { stack = (t,prec'@(N,_)):ss, output = (x:y:rs) } | prec' == prec = do equalFixity prec [t] g s@S { stack = (t,prec'):ss, output = (x:y:rs) } | prec' `gt` prec = do ne <- apop t [y,x] g s { stack = ss, output = ne:rs } g s@S { .. } = f (addOut s { stack = o:stack }) ts addOut s@S { ..} = case me of Just e -> s { output = e:output } Nothing -> s apop t [x,y] = case t of Nothing -> application x y Just t' -> operator t' [x,y] apop t xs = operator t' xs where Just t' = t _ `gt` (Prefix,_) = False (Prefix,x) `gt` (_,y) = x >= y (L,x) `gt` (_,y) = x >= y (_,x) `gt` (_,y) = x > y
2,420
shunt :: (Show t, Show e,Monad m) => ShuntSpec m t e -- specification -> [t] -- token stream -> m e shunt ShuntSpec { .. } xs = f initialState xs where f S { output = [e], stack = [] } [] = return e f S { output = [], stack = [] } [] = emptyInput f s@S { .. } (t:ts) = lookupToken t >>= \x -> case (x,lastWasOp) of (Left o,True) -> f s { output = o:output, lastWasOp = False } ts (Left o,False) -> op s { lastWasOp = True } (Nothing,appPrec) Nothing (t:ts) (Right p@(Prefix,_),False) -> op s { lastWasOp = True } (Nothing,appPrec) Nothing (t:ts) (Right p,False) -> op s { lastWasOp = True } (Just t,p) Nothing ts (Right p@(Prefix,_),True) -> op s (Just t,p) Nothing ts (Right p@(_,n),True) -> do mn <- lookupUnary t let Just n' = mplus mn (Just n) op s (Just t,(Prefix,n')) Nothing ts f s@S { output = (x:os) , stack = (t,(Prefix,_)):ss } [] = do ne <- apop t [x] f s { output = ne:os, stack = ss } [] f s@S { output = (x:y:os) , stack = (t,_):ss } [] = do ne <- apop t [y,x] f s { output = ne:os, stack = ss } [] f s@S { output = [e], stack = (Just t,_):ss } [] = do ne <- trailingOps e t -- (catMaybes $ map fst stack) f s { output = [ne], stack = ss } [] f s [] = error $ show s op s@S { .. } o@(_,prec) me ts = g s where g s@S { stack = [] } = f (addOut s { stack = [o] }) ts g s@S { stack = (t,prec'@(Prefix,_)):ss, output = (x:rs) } | prec' `gt` prec = do ne <- apop t [x] g s { stack = ss, output = ne:rs } g s@S { stack = (t,prec'@(N,_)):ss, output = (x:y:rs) } | prec' == prec = do equalFixity prec [t] g s@S { stack = (t,prec'):ss, output = (x:y:rs) } | prec' `gt` prec = do ne <- apop t [y,x] g s { stack = ss, output = ne:rs } g s@S { .. } = f (addOut s { stack = o:stack }) ts addOut s@S { ..} = case me of Just e -> s { output = e:output } Nothing -> s apop t [x,y] = case t of Nothing -> application x y Just t' -> operator t' [x,y] apop t xs = operator t' xs where Just t' = t _ `gt` (Prefix,_) = False (Prefix,x) `gt` (_,y) = x >= y (L,x) `gt` (_,y) = x >= y (_,x) `gt` (_,y) = x > y
2,419
shunt ShuntSpec { .. } xs = f initialState xs where f S { output = [e], stack = [] } [] = return e f S { output = [], stack = [] } [] = emptyInput f s@S { .. } (t:ts) = lookupToken t >>= \x -> case (x,lastWasOp) of (Left o,True) -> f s { output = o:output, lastWasOp = False } ts (Left o,False) -> op s { lastWasOp = True } (Nothing,appPrec) Nothing (t:ts) (Right p@(Prefix,_),False) -> op s { lastWasOp = True } (Nothing,appPrec) Nothing (t:ts) (Right p,False) -> op s { lastWasOp = True } (Just t,p) Nothing ts (Right p@(Prefix,_),True) -> op s (Just t,p) Nothing ts (Right p@(_,n),True) -> do mn <- lookupUnary t let Just n' = mplus mn (Just n) op s (Just t,(Prefix,n')) Nothing ts f s@S { output = (x:os) , stack = (t,(Prefix,_)):ss } [] = do ne <- apop t [x] f s { output = ne:os, stack = ss } [] f s@S { output = (x:y:os) , stack = (t,_):ss } [] = do ne <- apop t [y,x] f s { output = ne:os, stack = ss } [] f s@S { output = [e], stack = (Just t,_):ss } [] = do ne <- trailingOps e t -- (catMaybes $ map fst stack) f s { output = [ne], stack = ss } [] f s [] = error $ show s op s@S { .. } o@(_,prec) me ts = g s where g s@S { stack = [] } = f (addOut s { stack = [o] }) ts g s@S { stack = (t,prec'@(Prefix,_)):ss, output = (x:rs) } | prec' `gt` prec = do ne <- apop t [x] g s { stack = ss, output = ne:rs } g s@S { stack = (t,prec'@(N,_)):ss, output = (x:y:rs) } | prec' == prec = do equalFixity prec [t] g s@S { stack = (t,prec'):ss, output = (x:y:rs) } | prec' `gt` prec = do ne <- apop t [y,x] g s { stack = ss, output = ne:rs } g s@S { .. } = f (addOut s { stack = o:stack }) ts addOut s@S { ..} = case me of Just e -> s { output = e:output } Nothing -> s apop t [x,y] = case t of Nothing -> application x y Just t' -> operator t' [x,y] apop t xs = operator t' xs where Just t' = t _ `gt` (Prefix,_) = False (Prefix,x) `gt` (_,y) = x >= y (L,x) `gt` (_,y) = x >= y (_,x) `gt` (_,y) = x > y
2,291
false
true
16
17
884
1,466
775
691
null
null
Happstack/ixset
src/Data/IxSet.hs
bsd-3-clause
-- | Returns the subset with an index equal to the provided key. The -- set must be indexed over key type, doing otherwise results in -- runtime error. getEQ :: (Indexable a, Typeable a, Ord a, Typeable k) => k -> IxSet a -> IxSet a getEQ = getOrd EQ
257
getEQ :: (Indexable a, Typeable a, Ord a, Typeable k) => k -> IxSet a -> IxSet a getEQ = getOrd EQ
104
getEQ = getOrd EQ
17
true
true
0
9
57
63
31
32
null
null