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
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter14.hsproj/Addition.hs
mit
runQc :: IO () runQc = quickCheck prop_additionGreater
54
runQc :: IO () runQc = quickCheck prop_additionGreater
54
runQc = quickCheck prop_additionGreater
39
false
true
0
7
7
25
10
15
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/playpen/zillow/src/Lib.hs
unlicense
getPageLinks :: Text -> [[Tag Text]] getPageLinks = textParseTags "<ol class=zsg-pagination>"
93
getPageLinks :: Text -> [[Tag Text]] getPageLinks = textParseTags "<ol class=zsg-pagination>"
93
getPageLinks = textParseTags "<ol class=zsg-pagination>"
56
false
true
0
8
10
27
14
13
null
null
gcampax/ghc
utils/genprimopcode/Main.hs
bsd-3-clause
tvsIn :: Ty -> [TyVar] tvsIn (TyF t1 t2) = tvsIn t1 ++ tvsIn t2
66
tvsIn :: Ty -> [TyVar] tvsIn (TyF t1 t2) = tvsIn t1 ++ tvsIn t2
66
tvsIn (TyF t1 t2) = tvsIn t1 ++ tvsIn t2
43
false
true
0
9
17
44
20
24
null
null
JPMoresmau/HJVM
src/Language/Java/JVM/SignatureParser.hs
bsd-3-clause
signature :: ParsecT String u Identity JSignature signature = do char '(' params<-many typeSignature char ')' ret<-choice [(do t<-typeSignature return $ Just t),(do char 'V' return Nothing)] return $ JSignature param...
325
signature :: ParsecT String u Identity JSignature signature = do char '(' params<-many typeSignature char ')' ret<-choice [(do t<-typeSignature return $ Just t),(do char 'V' return Nothing)] return $ JSignature param...
325
signature = do char '(' params<-many typeSignature char ')' ret<-choice [(do t<-typeSignature return $ Just t),(do char 'V' return Nothing)] return $ JSignature params ret
275
false
true
1
15
135
112
46
66
null
null
brsunter/AdventOfCodeHaskell
src/Day2/Day2.hs
mit
totalRibbonLength :: [Dimensions] -> Integer totalRibbonLength = foldl' (\acc x -> acc + ribbonLength x) 0
106
totalRibbonLength :: [Dimensions] -> Integer totalRibbonLength = foldl' (\acc x -> acc + ribbonLength x) 0
106
totalRibbonLength = foldl' (\acc x -> acc + ribbonLength x) 0
61
false
true
0
9
15
46
22
24
null
null
soenkehahn/edith
Edith/Core.hs
agpl-3.0
(=%:) :: Event -> (Edith (), Maybe Handler) -> Handler e =%: action = Handler $ \ event -> if event == e then Just action else Nothing
138
(=%:) :: Event -> (Edith (), Maybe Handler) -> Handler e =%: action = Handler $ \ event -> if event == e then Just action else Nothing
138
e =%: action = Handler $ \ event -> if event == e then Just action else Nothing
83
false
true
0
10
31
66
34
32
null
null
spockwangs/scheme.in.haskell
list6.4.hs
unlicense
show (List contents) = "(" ++ unwordsList contents ++ ")"
57
show (List contents) = "(" ++ unwordsList contents ++ ")"
57
show (List contents) = "(" ++ unwordsList contents ++ ")"
57
false
false
0
7
9
27
12
15
null
null
Hodapp87/ivory
ivory-eval/src/Ivory/Eval.hs
bsd-3-clause
(Uint8 x) `div` (Uint8 y) = Uint8 (x `Prelude.div` y)
56
(Uint8 x) `div` (Uint8 y) = Uint8 (x `Prelude.div` y)
56
(Uint8 x) `div` (Uint8 y) = Uint8 (x `Prelude.div` y)
56
false
false
0
7
12
40
21
19
null
null
nevrenato/Hets_Fork
CASL/SimplifySen.hs
gpl-2.0
simplifyCASLTerm :: Sign () e -> TERM () -> TERM () simplifyCASLTerm = simplifyTerm dummyMin dummy
98
simplifyCASLTerm :: Sign () e -> TERM () -> TERM () simplifyCASLTerm = simplifyTerm dummyMin dummy
98
simplifyCASLTerm = simplifyTerm dummyMin dummy
46
false
true
0
8
15
41
19
22
null
null
DanielSchuessler/hstri
QuadCoordinates/SolSetConversion.hs
gpl-3.0
ppVertexStep r = text "Outer loop: Vertex" <+> pretty (vsr_vertex r) <> line <> indent 2 body where maxWidth = maxColumnWidth r body = partials <> prettyVI (vsr_neglink r) <> text " := Negative vertex link" <> line <> (vsep (map (ppTriS...
750
ppVertexStep r = text "Outer loop: Vertex" <+> pretty (vsr_vertex r) <> line <> indent 2 body where maxWidth = maxColumnWidth r body = partials <> prettyVI (vsr_neglink r) <> text " := Negative vertex link" <> line <> (vsep (map (ppTriS...
750
ppVertexStep r = text "Outer loop: Vertex" <+> pretty (vsr_vertex r) <> line <> indent 2 body where maxWidth = maxColumnWidth r body = partials <> prettyVI (vsr_neglink r) <> text " := Negative vertex link" <> line <> (vsep (map (ppTriS...
750
false
false
2
19
336
216
103
113
null
null
pparkkin/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpFixity _ = Nothing
24
primOpFixity _ = Nothing
24
primOpFixity _ = Nothing
24
false
false
0
5
3
9
4
5
null
null
lorcanmcdonald/mars
src/Client/Main.hs
bsd-3-clause
main :: IO () main = execParser opts >>= runWithOptions where opts = info optParser mempty optParser = Mars <$> argument str (metavar "filename") <*> switch ( short 'n' <> long "noninteractive" <> help "Force noninteractive mode" )
311
main :: IO () main = execParser opts >>= runWithOptions where opts = info optParser mempty optParser = Mars <$> argument str (metavar "filename") <*> switch ( short 'n' <> long "noninteractive" <> help "Force noninteractive mode" )
311
main = execParser opts >>= runWithOptions where opts = info optParser mempty optParser = Mars <$> argument str (metavar "filename") <*> switch ( short 'n' <> long "noninteractive" <> help "Force noninteractive mode" )
297
false
true
6
9
117
96
42
54
null
null
bitemyapp/ballast
src/Ballast/Types.hs
bsd-3-clause
orderStatusParamToBS8 OrderTracked = "tracked"
48
orderStatusParamToBS8 OrderTracked = "tracked"
48
orderStatusParamToBS8 OrderTracked = "tracked"
48
false
false
0
5
5
9
4
5
null
null
oldmanmike/minecraftctl
minecraftctl.hs
bsd-3-clause
setupNewServer :: String -> Maybe Int -> Maybe FilePath -> Maybe String -> Maybe String -> IO () setupNewServer n maybeP maybeR maybeW maybeV = do putStrLn "Welcome to Open Sandbox's Interactive Server Setup!" putStrLn "Please provide the following:" p <- promptInt "Port: " maybeP r <- prompt "Server Pa...
1,729
setupNewServer :: String -> Maybe Int -> Maybe FilePath -> Maybe String -> Maybe String -> IO () setupNewServer n maybeP maybeR maybeW maybeV = do putStrLn "Welcome to Open Sandbox's Interactive Server Setup!" putStrLn "Please provide the following:" p <- promptInt "Port: " maybeP r <- prompt "Server Pa...
1,729
setupNewServer n maybeP maybeR maybeW maybeV = do putStrLn "Welcome to Open Sandbox's Interactive Server Setup!" putStrLn "Please provide the following:" p <- promptInt "Port: " maybeP r <- prompt "Server Path (eg. /srv/minecraft): " maybeR w <- prompt "World Name: " maybeW v <- prompt "Version:...
1,632
false
true
0
15
354
502
222
280
null
null
ibabushkin/morgue
src/Data/Morgue/Options.hs
bsd-3-clause
setFormat "pango" opts@RunWith{} = opts { optFormat = Pango }
61
setFormat "pango" opts@RunWith{} = opts { optFormat = Pango }
61
setFormat "pango" opts@RunWith{} = opts { optFormat = Pango }
61
false
false
0
7
9
26
14
12
null
null
sboosali/commands-frontend-DragonNaturallySpeaking
sources/Commands/Mixins/DNS13OSX9/Derived.hs
bsd-3-clause
{-| manually construct a special rule, with separate recognizer and parser. it has two independent right-hand sides: one for recognizing and one for parsing. -} complexGrammar :: Name -> DNSEarleyRHS a -> DNSEarleyRHS a -> DNSEarleyRHS a complexGrammar n p r = genericGrammar n $ liftTree p r
294
complexGrammar :: Name -> DNSEarleyRHS a -> DNSEarleyRHS a -> DNSEarleyRHS a complexGrammar n p r = genericGrammar n $ liftTree p r
131
complexGrammar n p r = genericGrammar n $ liftTree p r
54
true
true
0
8
49
52
24
28
null
null
zenhack/haskell-capnp
cmd/capnpc-haskell/Trans/RawToHaskell.hs
mit
declToDecls _thisMod Raw.Enum{typeCtor, dataCtors} = let listCtor = Name.mkSub typeCtor "List_" unknownCtor = Name.mkSub typeCtor "unknown'" in [ DcData Data { dataName = Name.localToUnQ typeCtor , dataNewtype = False , dataInstance = False , typeArgs = [] , d...
3,995
declToDecls _thisMod Raw.Enum{typeCtor, dataCtors} = let listCtor = Name.mkSub typeCtor "List_" unknownCtor = Name.mkSub typeCtor "unknown'" in [ DcData Data { dataName = Name.localToUnQ typeCtor , dataNewtype = False , dataInstance = False , typeArgs = [] , d...
3,995
declToDecls _thisMod Raw.Enum{typeCtor, dataCtors} = let listCtor = Name.mkSub typeCtor "List_" unknownCtor = Name.mkSub typeCtor "unknown'" in [ DcData Data { dataName = Name.localToUnQ typeCtor , dataNewtype = False , dataInstance = False , typeArgs = [] , d...
3,995
false
false
2
21
1,990
969
499
470
null
null
vTurbine/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
deAnnotate' (AnnLit lit) = Lit lit
43
deAnnotate' (AnnLit lit) = Lit lit
43
deAnnotate' (AnnLit lit) = Lit lit
43
false
false
0
7
14
18
8
10
null
null
Ferdinand-vW/Wlp-verification-engine
src/Verification.hs
gpl-3.0
implPrint :: String -> Expr -> Expr -> IO () implPrint s e1 e2 = do let str = "\n--------------------------\n" ++ s ++ "\n" ++ pp e1 ++ "\n" ++ ".==>\n" ++ pp e2 ++ "\n" ++ "-----------------------\n" appendFile "Output.txt" str
293
implPrint :: String -> Expr -> Expr -> IO () implPrint s e1 e2 = do let str = "\n--------------------------\n" ++ s ++ "\n" ++ pp e1 ++ "\n" ++ ".==>\n" ++ pp e2 ++ "\n" ++ "-----------------------\n" appendFile "Output.txt" str
293
implPrint s e1 e2 = do let str = "\n--------------------------\n" ++ s ++ "\n" ++ pp e1 ++ "\n" ++ ".==>\n" ++ pp e2 ++ "\n" ++ "-----------------------\n" appendFile "Output.txt" str
248
false
true
0
18
105
95
43
52
null
null
spechub/Hets
OWL2/XMLConversion.hs
gpl-2.0
-- | the reverse of @properFacet@ in "OWL2.XML" correctFacet :: ConstrainingFacet -> ConstrainingFacet correctFacet c = case getPredefName c of ">" -> facetToIRINoSign MAXEXCLUSIVE "<" -> facetToIRINoSign MINEXCLUSIVE ">=" -> facetToIRINoSign MAXINCLUSIVE "<=" -> facetToIRINoSign MININCLUSIVE _ -> c...
368
correctFacet :: ConstrainingFacet -> ConstrainingFacet correctFacet c = case getPredefName c of ">" -> facetToIRINoSign MAXEXCLUSIVE "<" -> facetToIRINoSign MINEXCLUSIVE ">=" -> facetToIRINoSign MAXINCLUSIVE "<=" -> facetToIRINoSign MININCLUSIVE _ -> c -- | sets either a literal datatype or a facet
320
correctFacet c = case getPredefName c of ">" -> facetToIRINoSign MAXEXCLUSIVE "<" -> facetToIRINoSign MINEXCLUSIVE ">=" -> facetToIRINoSign MAXINCLUSIVE "<=" -> facetToIRINoSign MININCLUSIVE _ -> c -- | sets either a literal datatype or a facet
265
true
true
0
8
69
69
33
36
null
null
tittoassini/typed
src/Data/These.hs
bsd-3-clause
{- Eliminator function >>> both ((:[]) . not) ((:[]) . (>0)) $ These False (3::Int) [True,True] >>> both ((:[]) . not) (:[]) $ This False [True] -} both :: Semigroup a => (t1 -> a) -> (t2 -> a) -> These t1 t2 -> a both f _ (This a) = f a
242
both :: Semigroup a => (t1 -> a) -> (t2 -> a) -> These t1 t2 -> a both f _ (This a) = f a
92
both f _ (This a) = f a
26
true
true
0
9
57
66
33
33
null
null
mtolly/rail
src/Language/Rail/Generate.hs
gpl-3.0
-- | Makes a bridge between the two rows at the lowest possible odd column. newBridge :: Row -> Row -> [Bridge] -> Bridge newBridge sr dr bs = let overCols = [ c | (_, _, c) <- overlapping sr dr bs ] in (sr, dr, head [ c | c <- [1, 3 ..], notElem c overCols ])
264
newBridge :: Row -> Row -> [Bridge] -> Bridge newBridge sr dr bs = let overCols = [ c | (_, _, c) <- overlapping sr dr bs ] in (sr, dr, head [ c | c <- [1, 3 ..], notElem c overCols ])
188
newBridge sr dr bs = let overCols = [ c | (_, _, c) <- overlapping sr dr bs ] in (sr, dr, head [ c | c <- [1, 3 ..], notElem c overCols ])
142
true
true
0
12
63
111
60
51
null
null
kaoskorobase/mescaline
tools/sampler/Mescaline/Sampler/Looper.hs
gpl-3.0
looper :: Show e => Looper e -> IO () looper l = do evt <- readChan (input l) print evt case state l of Idle -> do case evt of (t, ERecord) -> do let l' = l { state = Recording , loopStart = t ...
3,112
looper :: Show e => Looper e -> IO () looper l = do evt <- readChan (input l) print evt case state l of Idle -> do case evt of (t, ERecord) -> do let l' = l { state = Recording , loopStart = t ...
3,112
looper l = do evt <- readChan (input l) print evt case state l of Idle -> do case evt of (t, ERecord) -> do let l' = l { state = Recording , loopStart = t , events = Map.singleton 0 Nothing ...
3,074
false
true
0
25
1,789
913
449
464
null
null
pshendry/project-euler-solutions
0026/solution.hs
mit
solve :: Int solve = fst $ maximumBy (\(_,x) (_,y) -> compare x y) $ map (\(n,x) -> (n,multOrder x 10)) $ filter (\(_,x) -> gcd x 10 == 1) $ zip [2..999] [2..999]
162
solve :: Int solve = fst $ maximumBy (\(_,x) (_,y) -> compare x y) $ map (\(n,x) -> (n,multOrder x 10)) $ filter (\(_,x) -> gcd x 10 == 1) $ zip [2..999] [2..999]
162
solve = fst $ maximumBy (\(_,x) (_,y) -> compare x y) $ map (\(n,x) -> (n,multOrder x 10)) $ filter (\(_,x) -> gcd x 10 == 1) $ zip [2..999] [2..999]
149
false
true
0
12
33
132
70
62
null
null
pparkkin/eta
compiler/ETA/BasicTypes/Module.hs
bsd-3-clause
stableUnitIdCmp :: UnitId -> UnitId -> Ordering -- ^ Compares package ids lexically, rather than by their 'Unique's stableUnitIdCmp p1 p2 = unitIdFS p1 `compare` unitIdFS p2
173
stableUnitIdCmp :: UnitId -> UnitId -> Ordering stableUnitIdCmp p1 p2 = unitIdFS p1 `compare` unitIdFS p2
105
stableUnitIdCmp p1 p2 = unitIdFS p1 `compare` unitIdFS p2
57
true
true
0
6
26
41
20
21
null
null
mrak/coreutils.hs
src/tr/Tr.hs
mit
delete :: DeleteSet -> Pipe Char Char IO () delete s = P.filter (\w -> not (s ! toIx w))
88
delete :: DeleteSet -> Pipe Char Char IO () delete s = P.filter (\w -> not (s ! toIx w))
88
delete s = P.filter (\w -> not (s ! toIx w))
44
false
true
0
11
19
59
28
31
null
null
TomMD/cryptol
sbv/Data/SBV/SMT/SMTLib.hs
bsd-3-clause
addNonEqConstraints :: RoundingMode -> [(Quantifier, NamedSymVar)] -> [[(String, CW)]] -> SMTLibPgm -> Maybe String addNonEqConstraints rm _qinps cs p@(SMTLibPgm SMTLib1 _) = SMT1.addNonEqConstraints rm cs p
207
addNonEqConstraints :: RoundingMode -> [(Quantifier, NamedSymVar)] -> [[(String, CW)]] -> SMTLibPgm -> Maybe String addNonEqConstraints rm _qinps cs p@(SMTLibPgm SMTLib1 _) = SMT1.addNonEqConstraints rm cs p
207
addNonEqConstraints rm _qinps cs p@(SMTLibPgm SMTLib1 _) = SMT1.addNonEqConstraints rm cs p
91
false
true
0
10
25
86
44
42
null
null
badp/ganeti
src/Ganeti/OpParams.hs
gpl-2.0
pOobCommand :: Field pOobCommand = withDoc "OOB command to run" $ simpleField "command" [t| OobCommand |]
109
pOobCommand :: Field pOobCommand = withDoc "OOB command to run" $ simpleField "command" [t| OobCommand |]
109
pOobCommand = withDoc "OOB command to run" $ simpleField "command" [t| OobCommand |]
88
false
true
0
6
19
27
15
12
null
null
nuttycom/haskoin
tests/Network/Haskoin/Binary/Tests.hs
unlicense
metaBinary :: (Binary a, Eq a) => a -> Bool metaBinary x = decode' (encode' x) == x
83
metaBinary :: (Binary a, Eq a) => a -> Bool metaBinary x = decode' (encode' x) == x
83
metaBinary x = decode' (encode' x) == x
39
false
true
0
8
17
46
23
23
null
null
CDSoft/pp
src/Environment.hs
gpl-3.0
-- defaultMacroChars is the list of characters used to execute a macro defaultMacroChars :: Chars defaultMacroChars = ['!']
123
defaultMacroChars :: Chars defaultMacroChars = ['!']
52
defaultMacroChars = ['!']
25
true
true
0
6
17
22
10
12
null
null
facebookincubator/duckling
Duckling/Rules/PL.hs
bsd-3-clause
langRules (Seal TimeGrain) = TimeGrain.rules
44
langRules (Seal TimeGrain) = TimeGrain.rules
44
langRules (Seal TimeGrain) = TimeGrain.rules
44
false
false
0
7
4
17
8
9
null
null
eiel/haskell-chatwork
src/Web/ChatWork.hs
bsd-3-clause
myStatus :: ByteString -> IO (ChatWorkAPI MyStatus) myStatus token = get token My.statusEndpoint
96
myStatus :: ByteString -> IO (ChatWorkAPI MyStatus) myStatus token = get token My.statusEndpoint
96
myStatus token = get token My.statusEndpoint
44
false
true
0
9
12
40
17
23
null
null
ods94065/sdl2-image
examples/ShowImageMetadata.hs
bsd-3-clause
initApp :: AppM () initApp = do initializedFlags <- liftIO $ init cFlags when (initializedFlags /= cFlags) $ throwError "Error: SDL_image failed to load." where cFlags = initFlagsToC [InitPNG]
202
initApp :: AppM () initApp = do initializedFlags <- liftIO $ init cFlags when (initializedFlags /= cFlags) $ throwError "Error: SDL_image failed to load." where cFlags = initFlagsToC [InitPNG]
202
initApp = do initializedFlags <- liftIO $ init cFlags when (initializedFlags /= cFlags) $ throwError "Error: SDL_image failed to load." where cFlags = initFlagsToC [InitPNG]
183
false
true
1
10
38
72
31
41
null
null
NorfairKing/the-notes
src/DataMining/ApproximateRetrieval.hs
gpl-2.0
nearDuplicate :: Note nearDuplicate = subsection "Near Duplicate Detection" $ do s ["Given a set of items ", m v, " in a pseudometric space ", m toppms, " an item ", m w', " in ", m v, " and a distance ", m (e ∈ realsp), ", find all the items ", m w, " closer than ", m e, " to " , m w'] s ["For arbitrary pseud...
651
nearDuplicate :: Note nearDuplicate = subsection "Near Duplicate Detection" $ do s ["Given a set of items ", m v, " in a pseudometric space ", m toppms, " an item ", m w', " in ", m v, " and a distance ", m (e ∈ realsp), ", find all the items ", m w, " closer than ", m e, " to " , m w'] s ["For arbitrary pseud...
651
nearDuplicate = subsection "Near Duplicate Detection" $ do s ["Given a set of items ", m v, " in a pseudometric space ", m toppms, " an item ", m w', " in ", m v, " and a distance ", m (e ∈ realsp), ", find all the items ", m w, " closer than ", m e, " to " , m w'] s ["For arbitrary pseudometric spaces, this c...
629
false
true
4
12
160
166
78
88
null
null
unknownloner/calccomp
FORTH/Stdlib.hs
mit
wasm "2-" = rtni [asm| pop hl dec hl dec hl push hl |]
70
wasm "2-" = rtni [asm| pop hl dec hl dec hl push hl |]
70
wasm "2-" = rtni [asm| pop hl dec hl dec hl push hl |]
70
false
false
0
5
29
17
9
8
null
null
scottgw/demonL
Language/DemonL/Yices.hs
bsd-3-clause
binYices Mul = (:*:)
20
binYices Mul = (:*:)
20
binYices Mul = (:*:)
20
false
false
0
5
3
11
6
5
null
null
nshimaza/cisco-spark-api
webex-teams-api/src/Network/WebexTeams/Types.hs
mit
-- | URL path for organizations API. organizationsPath :: ByteString organizationsPath = "organizations"
104
organizationsPath :: ByteString organizationsPath = "organizations"
67
organizationsPath = "organizations"
35
true
true
0
4
12
12
7
5
null
null
mainland/dph
dph-lifted-boxed/Data/Array/Parallel/Lifted/Combinators.hs
bsd-3-clause
-- | crossMapPP :: (PA a, PA b) => PArray a :-> (a :-> PArray b) :-> PArray (a, b) crossMapPP = closure2' crossMapPP_v crossMapPP_l where {-# INLINE crossMapPP_v #-} crossMapPP_v _ _ = error "crossMapP: not implemented" {-# INLINE crossMapPP_l #-} cros...
387
crossMapPP :: (PA a, PA b) => PArray a :-> (a :-> PArray b) :-> PArray (a, b) crossMapPP = closure2' crossMapPP_v crossMapPP_l where {-# INLINE crossMapPP_v #-} crossMapPP_v _ _ = error "crossMapP: not implemented" {-# INLINE crossMapPP_l #-} crossMapPP_...
380
crossMapPP = closure2' crossMapPP_v crossMapPP_l where {-# INLINE crossMapPP_v #-} crossMapPP_v _ _ = error "crossMapP: not implemented" {-# INLINE crossMapPP_l #-} crossMapPP_l _ _ = error "crossMapP: not implemented"
286
true
true
2
11
135
99
48
51
null
null
rueshyna/gogol
gogol-spectrum/gen/Network/Google/Spectrum/Types/Product.hs
mpl-2.0
-- | The validity status: true if the device is valid for operation, false -- otherwise. It will always be present. dvIsValid :: Lens' DeviceValidity (Maybe Bool) dvIsValid = lens _dvIsValid (\ s a -> s{_dvIsValid = a})
221
dvIsValid :: Lens' DeviceValidity (Maybe Bool) dvIsValid = lens _dvIsValid (\ s a -> s{_dvIsValid = a})
105
dvIsValid = lens _dvIsValid (\ s a -> s{_dvIsValid = a})
58
true
true
1
9
39
53
26
27
null
null
phischu/fragnix
tests/packages/scotty/System.Directory.hs
bsd-3-clause
-- | Add or remove the trailing path separator in the second path so as to -- match its presence in the first path. -- -- (internal API) matchTrailingSeparator :: FilePath -> FilePath -> FilePath matchTrailingSeparator path | hasTrailingPathSeparator path = addTrailingPathSeparator | otherwise =...
346
matchTrailingSeparator :: FilePath -> FilePath -> FilePath matchTrailingSeparator path | hasTrailingPathSeparator path = addTrailingPathSeparator | otherwise = dropTrailingPathSeparator
209
matchTrailingSeparator path | hasTrailingPathSeparator path = addTrailingPathSeparator | otherwise = dropTrailingPathSeparator
150
true
true
1
8
69
43
22
21
null
null
gamelost/pcgen-rules
src/JEPFormula.hs
apache-2.0
parseNumber :: PParser Formula parseNumber = Number <$> parseInteger
68
parseNumber :: PParser Formula parseNumber = Number <$> parseInteger
68
parseNumber = Number <$> parseInteger
37
false
true
2
6
8
25
10
15
null
null
prb/perpubplat
src/Blog/Model/EntryParser.hs
bsd-3-clause
parse_tag :: Parser String parse_tag = many1 (letter <|> digit <|> (oneOf "_-.")) <?> "Expected a combination of letters, digits, -. and _"
151
parse_tag :: Parser String parse_tag = many1 (letter <|> digit <|> (oneOf "_-.")) <?> "Expected a combination of letters, digits, -. and _"
151
parse_tag = many1 (letter <|> digit <|> (oneOf "_-.")) <?> "Expected a combination of letters, digits, -. and _"
124
false
true
0
10
34
38
19
19
null
null
gwright83/Wheeler
src/Math/Symbolic/Wheeler/Symbol.hs
bsd-3-clause
showsSymbol_ (Indexed i) = showString "Indexed " . shows (identifier i)
106
showsSymbol_ (Indexed i) = showString "Indexed " . shows (identifier i)
106
showsSymbol_ (Indexed i) = showString "Indexed " . shows (identifier i)
106
false
false
0
8
45
32
14
18
null
null
lambdageek/insomnia
src/Insomnia/ToF/Expr.hs
bsd-3-clause
-- | Given a value constructor, returns the pair (inout, f) where -- 'inout' is a term of type '{dataIn : ... ; dataOut : ...}' that -- injects or projects the constructor arguments into (out of) the -- data type, and 'f' is the field name among the 'fi's that -- corresponds to this particular value constructor. valueC...
677
valueConstructor :: ToF m => ValueConstructor -> m (F.Term, F.Field) valueConstructor (VCLocal valCon) = do mv <- view (valConEnv . at valCon) (inoutX, fld) <- case mv of Just a -> return a Nothing -> throwError "internal error: ToF.valueConstructor VCLocal valCon not...
363
valueConstructor (VCLocal valCon) = do mv <- view (valConEnv . at valCon) (inoutX, fld) <- case mv of Just a -> return a Nothing -> throwError "internal error: ToF.valueConstructor VCLocal valCon not in environment" return (F.V inoutX, fld)
254
true
true
0
11
159
124
62
62
null
null
literate-unitb/literate-unitb
src/Code/Synthesis.hs
mit
disabled :: [Expr] -> EventId -> POGen () disabled ps lbl = do evts <- lift $ asks $ upward_event <$> machine <*> pure (Right lbl) entails ("disabled" </> as_label lbl) ps [znot $ zall $ evts^.new.coarse_sched]
227
disabled :: [Expr] -> EventId -> POGen () disabled ps lbl = do evts <- lift $ asks $ upward_event <$> machine <*> pure (Right lbl) entails ("disabled" </> as_label lbl) ps [znot $ zall $ evts^.new.coarse_sched]
227
disabled ps lbl = do evts <- lift $ asks $ upward_event <$> machine <*> pure (Right lbl) entails ("disabled" </> as_label lbl) ps [znot $ zall $ evts^.new.coarse_sched]
185
false
true
0
11
53
101
49
52
null
null
pocket7878/rubik-cube-hs
src/Rubik/Perm.hs
lgpl-3.0
conc [] bs = bs
15
conc [] bs = bs
15
conc [] bs = bs
15
false
false
0
6
4
13
6
7
null
null
codygman/Frames
src/Frames/ColumnUniverse.hs
bsd-3-clause
-- | We use a join semi-lattice on types for representations. The -- bottom of the lattice is effectively an error (we have nothing to -- represent), @Bool < Int@, @Int < Double@, and @forall n. n <= Text@. -- -- The high-level goal here is that we will pick the "greater" of two -- choices in 'bestRep'. A 'Definitely' ...
880
lubTypeReps :: Parsed TypeRep -> Parsed TypeRep -> Maybe Ordering lubTypeReps (Possibly _) (Definitely _) = Just LT
115
lubTypeReps (Possibly _) (Definitely _) = Just LT
49
true
true
0
7
156
61
35
26
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ElasticBeanstalkConfigurationTemplateSourceConfiguration.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticbeanstalk-configurationtemplate-sourceconfiguration.html#cfn-elasticbeanstalk-configurationtemplate-sourceconfiguration-applicationname ebctscApplicationName :: Lens' ElasticBeanstalkConfigurationTemplateSourceConfiguration (Val Te...
518
ebctscApplicationName :: Lens' ElasticBeanstalkConfigurationTemplateSourceConfiguration (Val Text) ebctscApplicationName = lens _elasticBeanstalkConfigurationTemplateSourceConfigurationApplicationName (\s a -> s { _elasticBeanstalkConfigurationTemplateSourceConfigurationApplicationName = a })
293
ebctscApplicationName = lens _elasticBeanstalkConfigurationTemplateSourceConfigurationApplicationName (\s a -> s { _elasticBeanstalkConfigurationTemplateSourceConfigurationApplicationName = a })
194
true
true
0
9
21
46
25
21
null
null
danr/hipspec
tfp1/tests/IWC.hs
gpl-3.0
sum' x (S y) f | S y `lt` x = Z | True = f (S y) `plus` sum' x y f
81
sum' x (S y) f | S y `lt` x = Z | True = f (S y) `plus` sum' x y f
81
sum' x (S y) f | S y `lt` x = Z | True = f (S y) `plus` sum' x y f
81
false
false
4
9
37
65
31
34
null
null
ezyang/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
monoidClassKey = mkPreludeClassUnique 47
43
monoidClassKey = mkPreludeClassUnique 47
43
monoidClassKey = mkPreludeClassUnique 47
43
false
false
1
5
6
12
4
8
null
null
facebookincubator/duckling
Duckling/AmountOfMoney/RO/Rules.hs
bsd-3-clause
ruleIntervalDash :: Rule ruleIntervalDash = Rule { name = "<amount-of-money> - <amount-of-money>" , pattern = [ Predicate isSimpleAmountOfMoney , regex "-" , Predicate isSimpleAmountOfMoney ] , prod = \tokens -> case tokens of (Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Jus...
656
ruleIntervalDash :: Rule ruleIntervalDash = Rule { name = "<amount-of-money> - <amount-of-money>" , pattern = [ Predicate isSimpleAmountOfMoney , regex "-" , Predicate isSimpleAmountOfMoney ] , prod = \tokens -> case tokens of (Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Jus...
656
ruleIntervalDash = Rule { name = "<amount-of-money> - <amount-of-money>" , pattern = [ Predicate isSimpleAmountOfMoney , regex "-" , Predicate isSimpleAmountOfMoney ] , prod = \tokens -> case tokens of (Token AmountOfMoney AmountOfMoneyData{TAmountOfMoney.value = Just from, ...
631
false
true
0
20
182
188
97
91
null
null
Shamar/RPNCalculator
src/Computation.hs
gpl-3.0
apply (Function f) (Value x) = f x
34
apply (Function f) (Value x) = f x
34
apply (Function f) (Value x) = f x
34
false
false
0
7
7
26
12
14
null
null
pparkkin/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpHasSideEffects ReadByteArrayOp_Float = True
49
primOpHasSideEffects ReadByteArrayOp_Float = True
49
primOpHasSideEffects ReadByteArrayOp_Float = True
49
false
false
0
5
3
9
4
5
null
null
janschulz/pandoc
src/Text/Pandoc/Readers/TWiki.hs
gpl-2.0
separator :: TWParser B.Blocks separator = tryMsg "separator" $ string "---" >> newline >> return B.horizontalRule
114
separator :: TWParser B.Blocks separator = tryMsg "separator" $ string "---" >> newline >> return B.horizontalRule
114
separator = tryMsg "separator" $ string "---" >> newline >> return B.horizontalRule
83
false
true
2
7
15
45
19
26
null
null
CulpaBS/wbBach
src/Futhark/Test.hs
bsd-3-clause
comparePrimValue tol (FloatValue (Float64Value x)) (FloatValue (Float64Value y)) = compareFractional tol x y
111
comparePrimValue tol (FloatValue (Float64Value x)) (FloatValue (Float64Value y)) = compareFractional tol x y
111
comparePrimValue tol (FloatValue (Float64Value x)) (FloatValue (Float64Value y)) = compareFractional tol x y
111
false
false
0
9
15
44
21
23
null
null
tek/proteome
packages/proteome/lib/Proteome/Project/Resolve.hs
mit
byProjectTypeName :: [ProjectSpec] -> ProjectName -> ProjectType -> Maybe ProjectSpec byProjectTypeName specs name tpe = find (hasProjectTypeName tpe name) specs
161
byProjectTypeName :: [ProjectSpec] -> ProjectName -> ProjectType -> Maybe ProjectSpec byProjectTypeName specs name tpe = find (hasProjectTypeName tpe name) specs
161
byProjectTypeName specs name tpe = find (hasProjectTypeName tpe name) specs
75
false
true
0
8
19
49
24
25
null
null
creichert/persistent
persistent/Database/Persist/Sql/Orphan/PersistQuery.hs
mit
deleteWhereCount :: (PersistEntity val, MonadIO m, PersistEntityBackend val ~ SqlBackend, BackendCompatible SqlBackend backend) => [Filter val] -> ReaderT backend m Int64 deleteWhereCount filts = withReaderT projectBackend $ do conn <- ask let t = entityDef $ dummyFromFilts fil...
698
deleteWhereCount :: (PersistEntity val, MonadIO m, PersistEntityBackend val ~ SqlBackend, BackendCompatible SqlBackend backend) => [Filter val] -> ReaderT backend m Int64 deleteWhereCount filts = withReaderT projectBackend $ do conn <- ask let t = entityDef $ dummyFromFilts fil...
698
deleteWhereCount filts = withReaderT projectBackend $ do conn <- ask let t = entityDef $ dummyFromFilts filts let wher = if null filts then "" else filterClause False conn filts sql = mconcat [ "DELETE FROM " , connEscapeName conn $ entityDB t ...
493
false
true
4
10
227
160
81
79
null
null
omefire/HaskellProjects
ioref-bubblesort.hs
apache-2.0
bubbleSort :: [Int] -> IO [Int] bubbleSort input = do let n = length input xs <- mapM newIORef input forM_ [0..n-1] $ \i -> do forM_ [0..n-2] $ \j -> do let ix = xs !! j let iy = xs !! (j + 1) x <- readIORef ix y <- readIORef iy when (x > y) $ do writeIORef ix y ...
358
bubbleSort :: [Int] -> IO [Int] bubbleSort input = do let n = length input xs <- mapM newIORef input forM_ [0..n-1] $ \i -> do forM_ [0..n-2] $ \j -> do let ix = xs !! j let iy = xs !! (j + 1) x <- readIORef ix y <- readIORef iy when (x > y) $ do writeIORef ix y ...
358
bubbleSort input = do let n = length input xs <- mapM newIORef input forM_ [0..n-1] $ \i -> do forM_ [0..n-2] $ \j -> do let ix = xs !! j let iy = xs !! (j + 1) x <- readIORef ix y <- readIORef iy when (x > y) $ do writeIORef ix y writeIORef iy x mapM readIO...
326
false
true
0
20
130
193
89
104
null
null
MichaelXavier/GooglePlus
Web/GooglePlus.hs
bsd-2-clause
simpleDepaginationStep _ _ _ NoMorePages = return Nothing
57
simpleDepaginationStep _ _ _ NoMorePages = return Nothing
57
simpleDepaginationStep _ _ _ NoMorePages = return Nothing
57
false
false
0
5
7
18
8
10
null
null
nvasilakis/pandoc
src/Text/Pandoc/Readers/HTML.hs
gpl-2.0
"li" `closes` "li" = True
25
"li" `closes` "li" = True
25
"li" `closes` "li" = True
25
false
false
0
5
4
18
8
10
null
null
alphalambda/codeworld
codeworld-compiler/src/CodeWorld/Compile/Stages.hs
apache-2.0
isGoodExpAppLhs (UnboxedSum _ _ _ _) = False
44
isGoodExpAppLhs (UnboxedSum _ _ _ _) = False
44
isGoodExpAppLhs (UnboxedSum _ _ _ _) = False
44
false
false
0
7
7
21
10
11
null
null
Tener/haskell-package-vt
package-vt.hs
bsd-3-clause
pprintVC (ChangeABC info details) = printf "ChangeABC : %s\n---\n%s\n---" info details
86
pprintVC (ChangeABC info details) = printf "ChangeABC : %s\n---\n%s\n---" info details
86
pprintVC (ChangeABC info details) = printf "ChangeABC : %s\n---\n%s\n---" info details
86
false
false
0
7
10
24
11
13
null
null
spechub/Hets
Common/Doc.hs
gpl-2.0
interleave = symbol interleavingS
33
interleave = symbol interleavingS
33
interleave = symbol interleavingS
33
false
false
0
5
3
9
4
5
null
null
ohbadiah/nickmcavoy-dotcom
src/Metaplasm/Tags.hs
apache-2.0
renderSimpleTagList :: Tags -> Compiler (String) renderSimpleTagList = renderTags makeLink (intercalate " | ") where makeLink tag url _ _ _ = renderHtml $ H.a ! A.href (toValue url) $ toHtml tag
206
renderSimpleTagList :: Tags -> Compiler (String) renderSimpleTagList = renderTags makeLink (intercalate " | ") where makeLink tag url _ _ _ = renderHtml $ H.a ! A.href (toValue url) $ toHtml tag
206
renderSimpleTagList = renderTags makeLink (intercalate " | ") where makeLink tag url _ _ _ = renderHtml $ H.a ! A.href (toValue url) $ toHtml tag
157
false
true
0
9
43
78
38
40
null
null
cornell-pl/HsAdapton
stmshf/Control/Concurrent/SHFSTM.hs
bsd-3-clause
newTVar :: a -- ^ the content of the TVar -> STM (TVar a) -- ^ the result newTVar a = NewTVar a return
123
newTVar :: a -- ^ the content of the TVar -> STM (TVar a) newTVar a = NewTVar a return
106
newTVar a = NewTVar a return
28
true
true
0
9
44
39
18
21
null
null
brendanhay/gogol
gogol-cloudprivatecatalogproducer/gen/Network/Google/Resource/CloudPrivateCatalogProducer/Catalogs/Products/List.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). cplUploadType :: Lens' CatalogsProductsList (Maybe Text) cplUploadType = lens _cplUploadType (\ s a -> s{_cplUploadType = a})
204
cplUploadType :: Lens' CatalogsProductsList (Maybe Text) cplUploadType = lens _cplUploadType (\ s a -> s{_cplUploadType = a})
133
cplUploadType = lens _cplUploadType (\ s a -> s{_cplUploadType = a})
76
true
true
0
9
34
48
25
23
null
null
haskell-tinc/hpack
src/Hpack/Config.hs
mit
traverseConfig :: Traversal Config traverseConfig t = bitraverse (traverseCommonOptions t) (traversePackageConfig t)
116
traverseConfig :: Traversal Config traverseConfig t = bitraverse (traverseCommonOptions t) (traversePackageConfig t)
116
traverseConfig t = bitraverse (traverseCommonOptions t) (traversePackageConfig t)
81
false
true
0
7
11
34
16
18
null
null
sdiehl/ghc
compiler/GHC/CmmToC.hs
bsd-3-clause
pprDataExterns :: [CmmStatic] -> SDoc pprDataExterns statics = vcat (map pprExternDecl (Map.keys lbls)) where (_, lbls) = runTE (mapM_ te_Static statics)
157
pprDataExterns :: [CmmStatic] -> SDoc pprDataExterns statics = vcat (map pprExternDecl (Map.keys lbls)) where (_, lbls) = runTE (mapM_ te_Static statics)
157
pprDataExterns statics = vcat (map pprExternDecl (Map.keys lbls)) where (_, lbls) = runTE (mapM_ te_Static statics)
119
false
true
0
10
24
65
33
32
null
null
haskell-distributed/distributed-process-platform
src/Control/Distributed/Process/Platform/ManagedProcess.hs
bsd-3-clause
-- | Starts the /message handling loop/ for a managed process, configured with -- a typed /control channel/. The caller supplied expression is evaluated with -- an opaque reference to the channel, which must be passed when calling -- @handleControlChan@. The meaning and behaviour of the init handler and -- initial argu...
1,143
chanServe :: (Serializable b) => a -> InitHandler a s -> (ControlChannel b -> Process (ProcessDefinition s)) -> Process () chanServe argv init mkDef = do pDef <- mkDef . ControlChannel =<< newChan runProcess (recvLoop pDef) argv init -- | Wraps any /process loop/ and ensures...
707
chanServe argv init mkDef = do pDef <- mkDef . ControlChannel =<< newChan runProcess (recvLoop pDef) argv init -- | Wraps any /process loop/ and ensures that it adheres to the -- managed process start/stop semantics, i.e., evaluating the -- @InitHandler@ with an initial state and delay will either -- @die@ due to ...
544
true
true
0
14
223
119
63
56
null
null
HIPERFIT/futhark
src/Futhark/Internalise/TypesValues.hs
isc
internaliseLambdaReturnType :: E.TypeBase (E.DimDecl VName) () -> [TypeBase shape u] -> InternaliseM [I.TypeBase Shape NoUniqueness] internaliseLambdaReturnType et ts = map fromDecl <$> internaliseLoopParamType et ts
224
internaliseLambdaReturnType :: E.TypeBase (E.DimDecl VName) () -> [TypeBase shape u] -> InternaliseM [I.TypeBase Shape NoUniqueness] internaliseLambdaReturnType et ts = map fromDecl <$> internaliseLoopParamType et ts
224
internaliseLambdaReturnType et ts = map fromDecl <$> internaliseLoopParamType et ts
85
false
true
5
8
32
82
35
47
null
null
Slava/6.035-decaf-compiler
Setup.hs
mit
main = defaultMain
18
main = defaultMain
18
main = defaultMain
18
false
false
0
4
2
6
3
3
null
null
gbaz/haskell-platform
hptool/src/OS/Win/WinPaths.hs
bsd-3-clause
winProductFile :: Bool -> Version -> String -> FilePath winProductFile isFull hpv arch = productDir </> winProductFileName isFull hpv arch
138
winProductFile :: Bool -> Version -> String -> FilePath winProductFile isFull hpv arch = productDir </> winProductFileName isFull hpv arch
138
winProductFile isFull hpv arch = productDir </> winProductFileName isFull hpv arch
82
false
true
2
9
19
47
21
26
null
null
alexander-at-github/eta
compiler/ETA/SimplStg/StgStats.hs
bsd-3-clause
statExpr (StgLam {}) = panic "statExpr StgLam"
46
statExpr (StgLam {}) = panic "statExpr StgLam"
46
statExpr (StgLam {}) = panic "statExpr StgLam"
46
false
false
0
6
6
20
9
11
null
null
rueshyna/gogol
gogol-monitoring/gen/Network/Google/Resource/Monitoring/Projects/Groups/Update.hs
mpl-2.0
-- | JSONP pguCallback :: Lens' ProjectsGroupsUpdate (Maybe Text) pguCallback = lens _pguCallback (\ s a -> s{_pguCallback = a})
130
pguCallback :: Lens' ProjectsGroupsUpdate (Maybe Text) pguCallback = lens _pguCallback (\ s a -> s{_pguCallback = a})
119
pguCallback = lens _pguCallback (\ s a -> s{_pguCallback = a})
64
true
true
1
9
21
52
25
27
null
null
tomahawkins/atom-hd
Language/AtomHD.hs
bsd-3-clause
-- | Update an entire array. assignArray :: E -> [E] -> Action () assignArray a vs = sequence_ [ a ! 8%i <== v | (i, v) <- zip [0 ..] vs ]
138
assignArray :: E -> [E] -> Action () assignArray a vs = sequence_ [ a ! 8%i <== v | (i, v) <- zip [0 ..] vs ]
109
assignArray a vs = sequence_ [ a ! 8%i <== v | (i, v) <- zip [0 ..] vs ]
72
true
true
0
10
33
74
39
35
null
null
ruicc/websocket-min
src/Main.hs
mit
getClientState :: ClientId -> [ClientState] -> ClientState getClientState _ [] = error "Target ClientState not found"
117
getClientState :: ClientId -> [ClientState] -> ClientState getClientState _ [] = error "Target ClientState not found"
117
getClientState _ [] = error "Target ClientState not found"
58
false
true
0
7
15
32
16
16
null
null
jameseb7/markov
Data/RandSet.hs
bsd-2-clause
height :: RandSet w v -> Int height Nil = 0
47
height :: RandSet w v -> Int height Nil = 0
43
height Nil = 0
14
false
true
0
6
14
23
11
12
null
null
jamesdabbs/keenser
src/Keenser.hs
bsd-3-clause
mkManager :: MonadIO m => Config m -> m Manager mkManager Config{..} = liftIO $ do now <- getCurrentTime host <- getHostName CPid pid <- getProcessID nonce <- randomHex 6 let key = BSC.pack $ concat [host, ".", show pid, ".", nonce] Manager (BSC.pack host) now pid kConcurrency kQueues [] key k...
415
mkManager :: MonadIO m => Config m -> m Manager mkManager Config{..} = liftIO $ do now <- getCurrentTime host <- getHostName CPid pid <- getProcessID nonce <- randomHex 6 let key = BSC.pack $ concat [host, ".", show pid, ".", nonce] Manager (BSC.pack host) now pid kConcurrency kQueues [] key k...
415
mkManager Config{..} = liftIO $ do now <- getCurrentTime host <- getHostName CPid pid <- getProcessID nonce <- randomHex 6 let key = BSC.pack $ concat [host, ".", show pid, ".", nonce] Manager (BSC.pack host) now pid kConcurrency kQueues [] key kRedis <$> newTVarIO M.empty <*> newTVarI...
367
false
true
19
6
105
138
78
60
null
null
moon-musick/xmonad-ubuntu-conf
xmonad.hs
mit
-- Here we combine our default layouts with our specific, workspace-locked -- layouts. myLayouts = onWorkspace "0:VM" chatLayout $ onWorkspace "9:Pix" gimpLayout $ defaultLayouts
184
myLayouts = onWorkspace "0:VM" chatLayout $ onWorkspace "9:Pix" gimpLayout $ defaultLayouts
97
myLayouts = onWorkspace "0:VM" chatLayout $ onWorkspace "9:Pix" gimpLayout $ defaultLayouts
97
true
false
5
5
29
32
13
19
null
null
gnn/Hets
Common/Keywords.hs
gpl-2.0
-- | Open a renaming (process) ren_proc_openS :: String ren_proc_openS = "[["
77
ren_proc_openS :: String ren_proc_openS = "[["
46
ren_proc_openS = "[["
21
true
true
0
6
11
19
8
11
null
null
ktvoelker/todo
src/Handler/CurUser.hs
gpl-3.0
handleCurUser :: Handler handleCurUser = do uId <- getf sessionUser case uId of Just uId -> do user <- ask >>= liftIO . flip query (GetUserProfile uId) case user of Just user -> return $ RespUserProfile uId user Nothing -> return $ RespError ENotFound "" _ -> return RespEmpty
316
handleCurUser :: Handler handleCurUser = do uId <- getf sessionUser case uId of Just uId -> do user <- ask >>= liftIO . flip query (GetUserProfile uId) case user of Just user -> return $ RespUserProfile uId user Nothing -> return $ RespError ENotFound "" _ -> return RespEmpty
316
handleCurUser = do uId <- getf sessionUser case uId of Just uId -> do user <- ask >>= liftIO . flip query (GetUserProfile uId) case user of Just user -> return $ RespUserProfile uId user Nothing -> return $ RespError ENotFound "" _ -> return RespEmpty
291
false
true
0
16
88
112
51
61
null
null
ganeti-github-testing/ganeti-test-1
src/Ganeti/Constants.hs
bsd-2-clause
-- * 'autoconf' constants for Python only ('lib/build/sphinx_ext.py') manPages :: Map String Int manPages = Map.fromList AutoConf.manPages
139
manPages :: Map String Int manPages = Map.fromList AutoConf.manPages
68
manPages = Map.fromList AutoConf.manPages
41
true
true
0
6
17
24
12
12
null
null
byorgey/Idris-dev
src/Idris/ElabTerm.hs
bsd-3-clause
reflectConstant c@(Ch _) = reflCall "Ch" [RConstant c]
54
reflectConstant c@(Ch _) = reflCall "Ch" [RConstant c]
54
reflectConstant c@(Ch _) = reflCall "Ch" [RConstant c]
54
false
false
0
8
7
29
14
15
null
null
HJvT/hdirect
src/Parser.hs
bsd-3-clause
happyReduce_191 = happySpecReduce_3 55# happyReduction_191
58
happyReduce_191 = happySpecReduce_3 55# happyReduction_191
58
happyReduce_191 = happySpecReduce_3 55# happyReduction_191
58
false
false
0
5
4
11
5
6
null
null
Proclivis/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_CMD_WORDLEFTEXTEND :: Int wxSTC_CMD_WORDLEFTEXTEND = 2309
63
wxSTC_CMD_WORDLEFTEXTEND :: Int wxSTC_CMD_WORDLEFTEXTEND = 2309
63
wxSTC_CMD_WORDLEFTEXTEND = 2309
31
false
true
0
4
5
11
6
5
null
null
marcmo/hsDiagnosis
other/DiagClientEvent.hs
bsd-3-clause
sendMessageWithCallback :: Int -> DiagConfig -> HSFZMessage -> Callback -> IO () sendMessageWithCallback listenTime c msg cb = bracket (diagConnect c) (disconnectWithTimeout 10) loop where disconnectWithTimeout t con = do sleep t print "disconnecting....with timeout" >>(hClose . diagHandle) c...
424
sendMessageWithCallback :: Int -> DiagConfig -> HSFZMessage -> Callback -> IO () sendMessageWithCallback listenTime c msg cb = bracket (diagConnect c) (disconnectWithTimeout 10) loop where disconnectWithTimeout t con = do sleep t print "disconnecting....with timeout" >>(hClose . diagHandle) c...
424
sendMessageWithCallback listenTime c msg cb = bracket (diagConnect c) (disconnectWithTimeout 10) loop where disconnectWithTimeout t con = do sleep t print "disconnecting....with timeout" >>(hClose . diagHandle) con loop st = catch (runReaderT (run listenTime c cb msg) st) (\(err :: IOE...
343
false
true
1
11
89
149
72
77
null
null
rvion/lamdu
Lamdu/GUI/ExpressionEdit/HoleEdit/ResultGroups.hs
gpl-3.0
makeAll :: MonadA m => EditableHoleInfo m -> ExprGuiM m ([ResultsList m], HaveHiddenResults) makeAll holeInfo = do config <- ExprGuiM.readConfig <&> Config.hole makeAllGroups holeInfo <&> ListClass.fromList <&> ListClass.mapL (makeResultsList holeInfo) <&>...
413
makeAll :: MonadA m => EditableHoleInfo m -> ExprGuiM m ([ResultsList m], HaveHiddenResults) makeAll holeInfo = do config <- ExprGuiM.readConfig <&> Config.hole makeAllGroups holeInfo <&> ListClass.fromList <&> ListClass.mapL (makeResultsList holeInfo) <&>...
413
makeAll holeInfo = do config <- ExprGuiM.readConfig <&> Config.hole makeAllGroups holeInfo <&> ListClass.fromList <&> ListClass.mapL (makeResultsList holeInfo) <&> ListClass.catMaybes >>= collectResults config & ExprGuiM.transaction
312
false
true
0
13
124
106
50
56
null
null
sapek/optparse-applicative
tests/Tests.hs
bsd-3-clause
case_alt_cont :: Assertion case_alt_cont = do let p = Alternatives.a <|> Alternatives.b i = info p idm result = run i ["-a", "-b"] case result of Success r -> assertFailure $ "unexpected result: " ++ show r _ -> return ()
245
case_alt_cont :: Assertion case_alt_cont = do let p = Alternatives.a <|> Alternatives.b i = info p idm result = run i ["-a", "-b"] case result of Success r -> assertFailure $ "unexpected result: " ++ show r _ -> return ()
245
case_alt_cont = do let p = Alternatives.a <|> Alternatives.b i = info p idm result = run i ["-a", "-b"] case result of Success r -> assertFailure $ "unexpected result: " ++ show r _ -> return ()
218
false
true
0
12
64
99
46
53
null
null
daleooo/barrelfish
hake/RuleDefs.hs
mit
flounderTHCStubPath opts ifn = (optSuffix opts) ./. (ifn ++ "_thc.c")
73
flounderTHCStubPath opts ifn = (optSuffix opts) ./. (ifn ++ "_thc.c")
73
flounderTHCStubPath opts ifn = (optSuffix opts) ./. (ifn ++ "_thc.c")
73
false
false
0
7
13
28
14
14
null
null
kojiromike/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
runIdeModeCommand h id orig fn mods (IdeMode.CaseSplit line name) = process fn (CaseSplitAt False line (sUN name))
116
runIdeModeCommand h id orig fn mods (IdeMode.CaseSplit line name) = process fn (CaseSplitAt False line (sUN name))
116
runIdeModeCommand h id orig fn mods (IdeMode.CaseSplit line name) = process fn (CaseSplitAt False line (sUN name))
116
false
false
0
9
18
50
24
26
null
null
SamirTalwar/advent-of-code
2015/AOC_09_1.hs
mit
sortedPairs (a : xs@(b : _)) = sortTuple (a, b) : sortedPairs xs
64
sortedPairs (a : xs@(b : _)) = sortTuple (a, b) : sortedPairs xs
64
sortedPairs (a : xs@(b : _)) = sortTuple (a, b) : sortedPairs xs
64
false
false
0
10
12
42
22
20
null
null
sheyll/b9-vm-image-builder
src/lib/B9/VmBuilder.hs
mit
withBackend :: IsB9 e => (forall x. Backend x => x -> Eff e a) -> Eff e (Maybe a) withBackend k = do lxcCfg <- getBackendConfig (Proxy :: Proxy LXC.LibVirtLXC) case lxcCfg of Just cfg -> Just <$> k cfg Nothing -> do dockerCfg <- getBackendConfig (Proxy :: Proxy Docker.Docker) case dockerCf...
623
withBackend :: IsB9 e => (forall x. Backend x => x -> Eff e a) -> Eff e (Maybe a) withBackend k = do lxcCfg <- getBackendConfig (Proxy :: Proxy LXC.LibVirtLXC) case lxcCfg of Just cfg -> Just <$> k cfg Nothing -> do dockerCfg <- getBackendConfig (Proxy :: Proxy Docker.Docker) case dockerCf...
623
withBackend k = do lxcCfg <- getBackendConfig (Proxy :: Proxy LXC.LibVirtLXC) case lxcCfg of Just cfg -> Just <$> k cfg Nothing -> do dockerCfg <- getBackendConfig (Proxy :: Proxy Docker.Docker) case dockerCfg of Just cfg -> Just <$> k cfg Nothing -> do ...
541
false
true
0
21
212
213
99
114
null
null
phischu/fragnix
tests/packages/scotty/Data.Text.Encoding.Error.hs
bsd-3-clause
strictEncode :: OnEncodeError strictEncode desc c = throw (EncodeError desc c)
78
strictEncode :: OnEncodeError strictEncode desc c = throw (EncodeError desc c)
78
strictEncode desc c = throw (EncodeError desc c)
48
false
true
0
7
10
27
13
14
null
null
k0001/gtk2hs
gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs
gpl-3.0
-- | Change a node in the store. -- -- * Returns @True@ if the node was found. For a purely functional version, see -- 'treeStoreChange'. -- treeStoreChangeM :: TreeStore a -> TreePath -> (a -> IO a) -> IO Bool treeStoreChangeM (TreeStore model) path act = do customStoreInvalidateIters model store@Store { depth =...
985
treeStoreChangeM :: TreeStore a -> TreePath -> (a -> IO a) -> IO Bool treeStoreChangeM (TreeStore model) path act = do customStoreInvalidateIters model store@Store { depth = d, content = cache } <- readIORef (customStoreGetPrivate model) (store'@Store { depth = d, content = cache }, found) <- do mRes <-...
842
treeStoreChangeM (TreeStore model) path act = do customStoreInvalidateIters model store@Store { depth = d, content = cache } <- readIORef (customStoreGetPrivate model) (store'@Store { depth = d, content = cache }, found) <- do mRes <- changeForest (cacheToStore cache) act path return $ case mRes of ...
772
true
true
0
17
228
280
141
139
null
null
uuhan/Idris-dev
src/Idris/TypeSearch.hs
bsd-3-clause
deleteFromDag :: Ord n => n -> [((n, TT n), (a, Set n))] -> [((n, TT n), (a, Set n))] deleteFromDag name [] = []
112
deleteFromDag :: Ord n => n -> [((n, TT n), (a, Set n))] -> [((n, TT n), (a, Set n))] deleteFromDag name [] = []
112
deleteFromDag name [] = []
26
false
true
0
11
24
89
49
40
null
null
AlexanderPankiv/ghc
compiler/hsSyn/HsTypes.hs
bsd-3-clause
mkQualifiedHsForAllTy :: LHsContext RdrName -> LHsType RdrName -> HsType RdrName -- | mkImplicitHsForAllTy is called when we encounter -- f :: type -- Wrap around a HsForallTy if one is not there already. mkImplicitHsForAllTy (L _ (HsForAllTy exp extra tvs cxt ty)) = HsForAllTy exp' extr...
552
mkQualifiedHsForAllTy :: LHsContext RdrName -> LHsType RdrName -> HsType RdrName mkImplicitHsForAllTy (L _ (HsForAllTy exp extra tvs cxt ty)) = HsForAllTy exp' extra tvs cxt ty where exp' = case exp of Qualified -> Implicit -- Qualified is used on...
424
mkImplicitHsForAllTy (L _ (HsForAllTy exp extra tvs cxt ty)) = HsForAllTy exp' extra tvs cxt ty where exp' = case exp of Qualified -> Implicit -- Qualified is used only for a nested forall, -- this is now top level _ -> exp
317
true
true
0
9
199
93
47
46
null
null
TomMD/ghc
compiler/cmm/SMRep.hs
bsd-3-clause
isStaticRep _ = False
45
isStaticRep _ = False
45
isStaticRep _ = False
45
false
false
0
5
27
9
4
5
null
null
jtojnar/haste-compiler
libraries/ghc-7.8/base/Data/Foldable.hs
bsd-3-clause
-- | The least element of a non-empty structure with respect to the -- given comparison function. minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a minimumBy cmp = foldr1 min' where min' x y = case cmp x y of GT -> y _ -> x -- | Does the element occur in the...
331
minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a minimumBy cmp = foldr1 min' where min' x y = case cmp x y of GT -> y _ -> x -- | Does the element occur in the structure?
233
minimumBy cmp = foldr1 min' where min' x y = case cmp x y of GT -> y _ -> x -- | Does the element occur in the structure?
173
true
true
0
9
113
82
41
41
null
null
pparkkin/eta
compiler/ETA/BasicTypes/Id.hs
bsd-3-clause
clearOneShotLambda :: Id -> Id clearOneShotLambda id = modifyIdInfo (`setOneShotInfo` NoOneShotInfo) id
103
clearOneShotLambda :: Id -> Id clearOneShotLambda id = modifyIdInfo (`setOneShotInfo` NoOneShotInfo) id
103
clearOneShotLambda id = modifyIdInfo (`setOneShotInfo` NoOneShotInfo) id
72
false
true
0
6
11
29
16
13
null
null
neerajrao/scalable-bloom-filter-haskell
src/MutableBloomFilter.hs
mit
-- | Returns True if the number of elements inserted in the filter -- is equal to the capacity of the filter -- Returns False otherwise isFull :: MutableBloom s a -> ST s Bool isFull filt@(MutableBloom _ capacity _ _ _ _)= getCount filt >>= \curCount -> do if (curCount == capacity) then return True else...
1,381
isFull :: MutableBloom s a -> ST s Bool isFull filt@(MutableBloom _ capacity _ _ _ _)= getCount filt >>= \curCount -> do if (curCount == capacity) then return True else return False -- | Convert a mutable bloom filter to an immutable bloom filter in ST --toImmutable' :: Hashable a => (MutableBl...
1,245
isFull filt@(MutableBloom _ capacity _ _ _ _)= getCount filt >>= \curCount -> do if (curCount == capacity) then return True else return False -- | Convert a mutable bloom filter to an immutable bloom filter in ST --toImmutable' :: Hashable a => (MutableBloom s a) -> ST s (ImmutableBloom a) --to...
1,205
true
true
0
11
458
99
57
42
null
null