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
urbanslug/ghc
testsuite/tests/indexed-types/should_compile/NonLinearLHS.hs
bsd-3-clause
goo :: F Int Int -> F Bool Bool goo (MkF xs) = MkF $ map odd xs
63
goo :: F Int Int -> F Bool Bool goo (MkF xs) = MkF $ map odd xs
63
goo (MkF xs) = MkF $ map odd xs
31
false
true
0
7
17
43
20
23
null
null
HuwCampbell/machines
src/Data/Machine/Tee.hs
bsd-3-clause
-- | Zip together two inputs, then apply the given function, -- halting as soon as either input is exhausted. -- This implementation reads from the left, then the right zipWith :: (a -> b -> c) -> Tee a b c zipWith f = repeatedly $ do a <- awaits L b <- awaits R yield (f a b)
287
zipWith :: (a -> b -> c) -> Tee a b c zipWith f = repeatedly $ do a <- awaits L b <- awaits R yield (f a b)
114
zipWith f = repeatedly $ do a <- awaits L b <- awaits R yield (f a b)
76
true
true
0
10
70
77
37
40
null
null
blambo/accelerate-examples
tests/simple/SliceExamples.hs
bsd-3-clause
run5 :: IO (() -> UA.UArray (Int,Int,Int) Int, () -> Acc (Array DIM3 Int)) run5 = return (\() -> UA.array ((0,0,0),(1,1,1)) [ ((0,0,0), 1) , ((0,0,1), 1) , ((0,1,0), 2) , ((0,1,1), 2) , ((1,0,0), 3) , ((1,0,1), 3) , ((1,1,0), 4) , ((1,1,1), 4) ] ,\() -> repExample' arr)
627
run5 :: IO (() -> UA.UArray (Int,Int,Int) Int, () -> Acc (Array DIM3 Int)) run5 = return (\() -> UA.array ((0,0,0),(1,1,1)) [ ((0,0,0), 1) , ((0,0,1), 1) , ((0,1,0), 2) , ((0,1,1), 2) , ((1,0,0), 3) , ((1,0,1), 3) , ((1,1,0), 4) , ((1,1,1), 4) ] ,\() -> repExample' arr)
627
run5 = return (\() -> UA.array ((0,0,0),(1,1,1)) [ ((0,0,0), 1) , ((0,0,1), 1) , ((0,1,0), 2) , ((0,1,1), 2) , ((1,0,0), 3) , ((1,0,1), 3) , ((1,1,0), 4) , ((1,1,1), 4) ] ,\() -> repExample' arr)
552
false
true
2
11
406
263
160
103
null
null
Drezil/hgraph
src/Util.hs
agpl-3.0
-- | Move first argument to first place (for style uniformity) flip1 :: (a -> b) -> (a -> b) flip1 = id
103
flip1 :: (a -> b) -> (a -> b) flip1 = id
40
flip1 = id
10
true
true
0
7
22
30
17
13
null
null
afiskon/JuicyPixels-canvas
src/Codec/Picture/Canvas.hs
bsd-2-clause
maxWH :: Int maxWH = 1 `shiftL` 14 - 1
38
maxWH :: Int maxWH = 1 `shiftL` 14 - 1
38
maxWH = 1 `shiftL` 14 - 1
25
false
true
0
6
9
21
12
9
null
null
vincenthz/socksmaster
Src/Config.hs
bsd-3-clause
configOneProvider p = mempty { configProviders = [p] }
54
configOneProvider p = mempty { configProviders = [p] }
54
configOneProvider p = mempty { configProviders = [p] }
54
false
false
0
7
8
20
11
9
null
null
adambaker/bioinformatics
src/Week2.hs
unlicense
bases = ['A', 'C', 'G', 'T']
28
bases = ['A', 'C', 'G', 'T']
28
bases = ['A', 'C', 'G', 'T']
28
false
false
0
5
5
18
11
7
null
null
capital-match/raptr
src/Network/Raptr/Raptr.hs
bsd-3-clause
stop :: Raptr -> IO () stop (raptrThread -> Nothing) = return ()
69
stop :: Raptr -> IO () stop (raptrThread -> Nothing) = return ()
69
stop (raptrThread -> Nothing) = return ()
46
false
true
0
7
17
35
17
18
null
null
rrnewton/accelerate
Data/Array/Accelerate/Trafo/Vectorise.hs
bsd-3-clause
fstE :: forall acc env aenv a b. (Elt a, Elt b) => PreOpenExp acc env aenv (a,b) -> PreOpenExp acc env aenv a fstE = Prj (SuccTupIdx ZeroTupIdx)
154
fstE :: forall acc env aenv a b. (Elt a, Elt b) => PreOpenExp acc env aenv (a,b) -> PreOpenExp acc env aenv a fstE = Prj (SuccTupIdx ZeroTupIdx)
154
fstE = Prj (SuccTupIdx ZeroTupIdx)
34
false
true
0
9
38
72
39
33
null
null
snoyberg/ghc
compiler/hsSyn/HsDecls.hs
bsd-3-clause
pprTyClDeclFlavour (DataDecl { tcdDataDefn = HsDataDefn { dd_ND = nd } }) = ppr nd
84
pprTyClDeclFlavour (DataDecl { tcdDataDefn = HsDataDefn { dd_ND = nd } }) = ppr nd
84
pprTyClDeclFlavour (DataDecl { tcdDataDefn = HsDataDefn { dd_ND = nd } }) = ppr nd
84
false
false
0
12
16
33
17
16
null
null
Solonarv/units
Data/Unit/Constants.hs
mit
-- von Klitzing constant -- Atomic and nuclear constants a0, re, me, _GF, alpha, _Eh, mp, _Rinf, sin2_weakmix, efimov :: Floating a => Quantity a a0 = alpha / (4 * pi * _Rinf)
190
a0, re, me, _GF, alpha, _Eh, mp, _Rinf, sin2_weakmix, efimov :: Floating a => Quantity a a0 = alpha / (4 * pi * _Rinf)
128
a0 = alpha / (4 * pi * _Rinf)
39
true
true
9
9
48
76
38
38
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\xFA08' = "\x884C"
33
decomposeChar '\xFA08' = "\x884C"
33
decomposeChar '\xFA08' = "\x884C"
33
false
false
0
4
3
10
4
6
null
null
facebook/fbthrift
thrift/compiler/test/fixtures/namespace/gen-hs/My/Namespacing/Test/HsTestService.hs
apache-2.0
-- | Write a 'Init_args' with the given 'Thrift.Protocol' write_Init_args :: (Thrift.Protocol p, Thrift.Transport t) => p t -> Init_args -> IO () write_Init_args oprot record = Thrift.writeVal oprot $ from_Init_args record
222
write_Init_args :: (Thrift.Protocol p, Thrift.Transport t) => p t -> Init_args -> IO () write_Init_args oprot record = Thrift.writeVal oprot $ from_Init_args record
164
write_Init_args oprot record = Thrift.writeVal oprot $ from_Init_args record
76
true
true
0
10
31
68
32
36
null
null
keithodulaigh/Hets
CMDL/Utils.hs
gpl-2.0
{- | mapAndSplit maps a function to a list. If the function can not be applied to an element it is stored in a different list for producing error message later on -} mapAndSplit :: (a -> Maybe b) -> [a] -> ([a], [b]) mapAndSplit fn ls = let ps = zip ls $ map fn ls (oks, errs) = partition (isJust . snd) ps in (map fst errs, mapMaybe snd oks)
358
mapAndSplit :: (a -> Maybe b) -> [a] -> ([a], [b]) mapAndSplit fn ls = let ps = zip ls $ map fn ls (oks, errs) = partition (isJust . snd) ps in (map fst errs, mapMaybe snd oks)
186
mapAndSplit fn ls = let ps = zip ls $ map fn ls (oks, errs) = partition (isJust . snd) ps in (map fst errs, mapMaybe snd oks)
135
true
true
0
11
87
113
59
54
null
null
mohamedhayibor/haskelling-hard
realWorldHaskell/testingQSwithQuickCheck.hs
mit
qsort :: Ord a => [a] -> [a] qsort [] = []
42
qsort :: Ord a => [a] -> [a] qsort [] = []
42
qsort [] = []
13
false
true
0
7
11
35
18
17
null
null
fmapfmapfmap/amazonka
gen/src/Gen/AST/Data.hs
mpl-2.0
pagerFields :: HasMetadata a Identity => a -> Operation Identity Ref (Pager Id) -> Either Error (Maybe (Pager Field)) pagerFields m o = traverse go (o ^. opPager) where inp = o ^. opInput . _Identity . refAnn out = o ^. opOutput . _Identity . refAnn go :: Pager Id -> Either Error (Pager Field) go = \case Next x t -> Next <$> notation m out x <*> token t -- One x t -> One <$> notation m out x <*> token t Many x ts -> Many <$> notation m out x <*> traverse token ts token :: Token Id -> Either Error (Token Field) token (Token x y) = Token <$> notation m inp x <*> notation m out y
691
pagerFields :: HasMetadata a Identity => a -> Operation Identity Ref (Pager Id) -> Either Error (Maybe (Pager Field)) pagerFields m o = traverse go (o ^. opPager) where inp = o ^. opInput . _Identity . refAnn out = o ^. opOutput . _Identity . refAnn go :: Pager Id -> Either Error (Pager Field) go = \case Next x t -> Next <$> notation m out x <*> token t -- One x t -> One <$> notation m out x <*> token t Many x ts -> Many <$> notation m out x <*> traverse token ts token :: Token Id -> Either Error (Token Field) token (Token x y) = Token <$> notation m inp x <*> notation m out y
691
pagerFields m o = traverse go (o ^. opPager) where inp = o ^. opInput . _Identity . refAnn out = o ^. opOutput . _Identity . refAnn go :: Pager Id -> Either Error (Pager Field) go = \case Next x t -> Next <$> notation m out x <*> token t -- One x t -> One <$> notation m out x <*> token t Many x ts -> Many <$> notation m out x <*> traverse token ts token :: Token Id -> Either Error (Token Field) token (Token x y) = Token <$> notation m inp x <*> notation m out y
537
false
true
0
12
232
264
127
137
null
null
isido/functional-morphology-for-koine-greek
lib/Options.hs
gpl-3.0
{- |Does the filename end with the suffix .lex? -} is_lexicon :: FilePath -> Bool is_lexicon = isSuffixOf ".lexicon"
116
is_lexicon :: FilePath -> Bool is_lexicon = isSuffixOf ".lexicon"
65
is_lexicon = isSuffixOf ".lexicon"
34
true
true
0
5
18
19
10
9
null
null
palf/free-driver
packages/drive-browser/lib/Drive/Browser/Commands.hs
bsd-3-clause
sendKeys :: (W.Cl.WebDriver m) => Ref -> Text -> m () sendKeys r t = withElement r (W.Com.sendKeys t)
101
sendKeys :: (W.Cl.WebDriver m) => Ref -> Text -> m () sendKeys r t = withElement r (W.Com.sendKeys t)
101
sendKeys r t = withElement r (W.Com.sendKeys t)
47
false
true
0
9
18
55
28
27
null
null
ocramz/petsc-hs
src/Numerical/PETSc/Internal/Types.hs
gpl-3.0
boolToPetscBoolC :: Bool -> PetscBool boolToPetscBoolC = petscBoolToC . p where p False = PetscFalse p True = PetscTrue -- | elementary type synonyms
156
boolToPetscBoolC :: Bool -> PetscBool boolToPetscBoolC = petscBoolToC . p where p False = PetscFalse p True = PetscTrue -- | elementary type synonyms
156
boolToPetscBoolC = petscBoolToC . p where p False = PetscFalse p True = PetscTrue -- | elementary type synonyms
118
false
true
0
5
30
37
20
17
null
null
diku-dk/futhark
src/Language/Futhark/Traversals.hs
isc
bareExp (Ascript e tdecl loc) = Ascript (bareExp e) (bareTypeDecl tdecl) loc
78
bareExp (Ascript e tdecl loc) = Ascript (bareExp e) (bareTypeDecl tdecl) loc
78
bareExp (Ascript e tdecl loc) = Ascript (bareExp e) (bareTypeDecl tdecl) loc
78
false
false
0
7
13
40
18
22
null
null
M42/mikrokosmos
source/Stlc/Gentzen.hs
gpl-3.0
proofBlock :: ProofTree String String -> Block proofBlock (Inference x) = textBlock x
90
proofBlock :: ProofTree String String -> Block proofBlock (Inference x) = textBlock x
90
proofBlock (Inference x) = textBlock x
43
false
true
0
6
17
36
16
20
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x1F08' = "\x0391\x0313"
39
decomposeChar '\x1F08' = "\x0391\x0313"
39
decomposeChar '\x1F08' = "\x0391\x0313"
39
false
false
0
5
3
9
4
5
null
null
notae/haskell-exercise
yesod/my-project/Application.hs
bsd-3-clause
-- | This function allocates resources (such as a database connection pool), -- performs initialization and returns a foundation datatype value. This is also -- the place to put your migrate statements to have automatic database -- migrations handled by Yesod. makeFoundation :: AppSettings -> IO App makeFoundation appSettings = do -- Some basic initializations: HTTP connection manager, logger, and static -- subsite. appHttpManager <- newManager appLogger <- newStdoutLoggerSet defaultBufSize >>= makeYesodLogger appStatic <- (if appMutableStatic appSettings then staticDevel else static) (appStaticDir appSettings) -- We need a log function to create a connection pool. We need a connection -- pool to create our foundation. And we need our foundation to get a -- logging function. To get out of this loop, we initially create a -- temporary foundation without a real connection pool, get a log function -- from there, and then create the real foundation. let mkFoundation appConnPool = App {..} -- The App {..} syntax is an example of record wild cards. For more -- information, see: -- https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html tempFoundation = mkFoundation $ error "connPool forced in tempFoundation" logFunc = messageLoggerSource tempFoundation appLogger -- Create the database connection pool pool <- flip runLoggingT logFunc $ createSqlitePool (sqlDatabase $ appDatabaseConf appSettings) (sqlPoolSize $ appDatabaseConf appSettings) -- Perform database migration using our application's logging settings. runLoggingT (runSqlPool (runMigration migrateAll) pool) logFunc -- Return the foundation return $ mkFoundation pool -- | Convert our foundation to a WAI Application by calling @toWaiAppPlain@ and -- applying some additional middlewares.
1,921
makeFoundation :: AppSettings -> IO App makeFoundation appSettings = do -- Some basic initializations: HTTP connection manager, logger, and static -- subsite. appHttpManager <- newManager appLogger <- newStdoutLoggerSet defaultBufSize >>= makeYesodLogger appStatic <- (if appMutableStatic appSettings then staticDevel else static) (appStaticDir appSettings) -- We need a log function to create a connection pool. We need a connection -- pool to create our foundation. And we need our foundation to get a -- logging function. To get out of this loop, we initially create a -- temporary foundation without a real connection pool, get a log function -- from there, and then create the real foundation. let mkFoundation appConnPool = App {..} -- The App {..} syntax is an example of record wild cards. For more -- information, see: -- https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html tempFoundation = mkFoundation $ error "connPool forced in tempFoundation" logFunc = messageLoggerSource tempFoundation appLogger -- Create the database connection pool pool <- flip runLoggingT logFunc $ createSqlitePool (sqlDatabase $ appDatabaseConf appSettings) (sqlPoolSize $ appDatabaseConf appSettings) -- Perform database migration using our application's logging settings. runLoggingT (runSqlPool (runMigration migrateAll) pool) logFunc -- Return the foundation return $ mkFoundation pool -- | Convert our foundation to a WAI Application by calling @toWaiAppPlain@ and -- applying some additional middlewares.
1,660
makeFoundation appSettings = do -- Some basic initializations: HTTP connection manager, logger, and static -- subsite. appHttpManager <- newManager appLogger <- newStdoutLoggerSet defaultBufSize >>= makeYesodLogger appStatic <- (if appMutableStatic appSettings then staticDevel else static) (appStaticDir appSettings) -- We need a log function to create a connection pool. We need a connection -- pool to create our foundation. And we need our foundation to get a -- logging function. To get out of this loop, we initially create a -- temporary foundation without a real connection pool, get a log function -- from there, and then create the real foundation. let mkFoundation appConnPool = App {..} -- The App {..} syntax is an example of record wild cards. For more -- information, see: -- https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html tempFoundation = mkFoundation $ error "connPool forced in tempFoundation" logFunc = messageLoggerSource tempFoundation appLogger -- Create the database connection pool pool <- flip runLoggingT logFunc $ createSqlitePool (sqlDatabase $ appDatabaseConf appSettings) (sqlPoolSize $ appDatabaseConf appSettings) -- Perform database migration using our application's logging settings. runLoggingT (runSqlPool (runMigration migrateAll) pool) logFunc -- Return the foundation return $ mkFoundation pool -- | Convert our foundation to a WAI Application by calling @toWaiAppPlain@ and -- applying some additional middlewares.
1,620
true
true
0
12
391
203
105
98
null
null
ezyang/ghc
compiler/typecheck/TcAnnotations.hs
bsd-3-clause
tcAnnotations :: [LAnnDecl GhcRn] -> TcM [Annotation] tcAnnotations anns = do dflags <- getDynFlags case gopt Opt_ExternalInterpreter dflags of True -> tcAnnotations' anns False -> warnAnns anns
207
tcAnnotations :: [LAnnDecl GhcRn] -> TcM [Annotation] tcAnnotations anns = do dflags <- getDynFlags case gopt Opt_ExternalInterpreter dflags of True -> tcAnnotations' anns False -> warnAnns anns
207
tcAnnotations anns = do dflags <- getDynFlags case gopt Opt_ExternalInterpreter dflags of True -> tcAnnotations' anns False -> warnAnns anns
153
false
true
0
10
39
67
31
36
null
null
nfjinjing/objective-c-ffi
src/Foreign/ObjectiveC.hs
bsd-3-clause
sendMessageBySelector :: Object -> Selector -> [Arg] -> (forall a.Ptr a -> IO b) -> IO b sendMessageBySelector (Object classObj) (Selector methodSel) args marshallAct = do retPtr <- msgSend classObj methodSel args marshallAct retPtr -- | Run the actions with an autorelease pool. Note that newly initialized objects within the action -- should be sent the "autorelease" message in order for them to use the autorelease pool.
508
sendMessageBySelector :: Object -> Selector -> [Arg] -> (forall a.Ptr a -> IO b) -> IO b sendMessageBySelector (Object classObj) (Selector methodSel) args marshallAct = do retPtr <- msgSend classObj methodSel args marshallAct retPtr -- | Run the actions with an autorelease pool. Note that newly initialized objects within the action -- should be sent the "autorelease" message in order for them to use the autorelease pool.
508
sendMessageBySelector (Object classObj) (Selector methodSel) args marshallAct = do retPtr <- msgSend classObj methodSel args marshallAct retPtr -- | Run the actions with an autorelease pool. Note that newly initialized objects within the action -- should be sent the "autorelease" message in order for them to use the autorelease pool.
419
false
true
0
13
150
99
47
52
null
null
harendra-kumar/stack
src/Options/Applicative/Builder/Extra.hs
bsd-3-clause
-- | Enable/disable flags for any type, without a default (to allow chaining with '<|>') enableDisableFlagsNoDefault :: (Eq a) => a -- ^ Enabled value -> a -- ^ Disabled value -> String -- ^ Name -> String -- ^ Help suffix -> Mod FlagFields a -> Parser a enableDisableFlagsNoDefault enabledValue disabledValue name helpSuffix mods = last <$> some ((flag' enabledValue (hidden <> internal <> long name <> help helpSuffix <> mods) <|> flag' disabledValue (hidden <> internal <> long ("no-" ++ name) <> help helpSuffix <> mods)) <|> flag' disabledValue (long (concat ["[no-]", name]) <> help (concat ["Enable/disable ", helpSuffix]) <> mods))
1,069
enableDisableFlagsNoDefault :: (Eq a) => a -- ^ Enabled value -> a -- ^ Disabled value -> String -- ^ Name -> String -- ^ Help suffix -> Mod FlagFields a -> Parser a enableDisableFlagsNoDefault enabledValue disabledValue name helpSuffix mods = last <$> some ((flag' enabledValue (hidden <> internal <> long name <> help helpSuffix <> mods) <|> flag' disabledValue (hidden <> internal <> long ("no-" ++ name) <> help helpSuffix <> mods)) <|> flag' disabledValue (long (concat ["[no-]", name]) <> help (concat ["Enable/disable ", helpSuffix]) <> mods))
980
enableDisableFlagsNoDefault enabledValue disabledValue name helpSuffix mods = last <$> some ((flag' enabledValue (hidden <> internal <> long name <> help helpSuffix <> mods) <|> flag' disabledValue (hidden <> internal <> long ("no-" ++ name) <> help helpSuffix <> mods)) <|> flag' disabledValue (long (concat ["[no-]", name]) <> help (concat ["Enable/disable ", helpSuffix]) <> mods))
592
true
true
0
16
532
198
101
97
null
null
hanepjiv/make10_hs
src/Game/Make10/Operator.hs
mit
function DIV = (/)
30
function DIV = (/)
30
function DIV = (/)
30
false
false
0
5
15
11
6
5
null
null
amccausl/Swish
Swish/HaskellRDF/MapXsdInteger.hs
lgpl-2.1
------------------------------------------------------------ -- Implementation of DatatypeMap for xsd:integer ------------------------------------------------------------ -- |mapXsdInteger contains functions that perform lexical-to-value -- and value-to-canonical-lexical mappings for xsd:integer values -- mapXsdInteger :: DatatypeMap Integer mapXsdInteger = DatatypeMap { -- mapL2V :: String -> Maybe Integer mapL2V = \s -> case [ x | matchRe reInteger s , (x,t) <- reads $ skipPlus s , ("","") <- lex t ] of [] -> Nothing is -> Just $ head is -- mapV2L :: Integer -> Maybe String , mapV2L = Just . show }
797
mapXsdInteger :: DatatypeMap Integer mapXsdInteger = DatatypeMap { -- mapL2V :: String -> Maybe Integer mapL2V = \s -> case [ x | matchRe reInteger s , (x,t) <- reads $ skipPlus s , ("","") <- lex t ] of [] -> Nothing is -> Just $ head is -- mapV2L :: Integer -> Maybe String , mapV2L = Just . show }
479
mapXsdInteger = DatatypeMap { -- mapL2V :: String -> Maybe Integer mapL2V = \s -> case [ x | matchRe reInteger s , (x,t) <- reads $ skipPlus s , ("","") <- lex t ] of [] -> Nothing is -> Just $ head is -- mapV2L :: Integer -> Maybe String , mapV2L = Just . show }
442
true
true
0
13
275
120
67
53
null
null
Fermat/FCR
src/Fcr/Rewrite.hs
gpl-3.0
match (Const s) (Const t) | s == t = return []
46
match (Const s) (Const t) | s == t = return []
46
match (Const s) (Const t) | s == t = return []
46
false
false
0
8
11
40
17
23
null
null
kebertx/Monadgrab
src/Game1.2.hs
mit
main :: IO () main = SDL.withInit [SDL.InitEverything] $ do vs <- SDL.setVideoMode scrW scrH 32 [] SDL.setCaption "Moneygrab" "Monadgrab" clearSurface (0x40, 0x80, 0xC0) vs >> SDL.flip vs agentLoop 0 []
239
main :: IO () main = SDL.withInit [SDL.InitEverything] $ do vs <- SDL.setVideoMode scrW scrH 32 [] SDL.setCaption "Moneygrab" "Monadgrab" clearSurface (0x40, 0x80, 0xC0) vs >> SDL.flip vs agentLoop 0 []
239
main = SDL.withInit [SDL.InitEverything] $ do vs <- SDL.setVideoMode scrW scrH 32 [] SDL.setCaption "Moneygrab" "Monadgrab" clearSurface (0x40, 0x80, 0xC0) vs >> SDL.flip vs agentLoop 0 []
225
false
true
0
11
67
102
46
56
null
null
vrom911/hs-init
summoner-cli/test/Test/TomlSpec.hs
mit
tomlSpec :: Spec tomlSpec = describe "TOML Testing" $ do tomlConfigSpec tomlProp
88
tomlSpec :: Spec tomlSpec = describe "TOML Testing" $ do tomlConfigSpec tomlProp
88
tomlSpec = describe "TOML Testing" $ do tomlConfigSpec tomlProp
71
false
true
0
8
19
31
12
19
null
null
glutamate/blaze-bootstrap
Text/Blaze/Html/AngularJS.hs
mit
ngClick :: AttributeValue -> Attribute ngClick = attribute "ng-click" " ng-click=\""
84
ngClick :: AttributeValue -> Attribute ngClick = attribute "ng-click" " ng-click=\""
84
ngClick = attribute "ng-click" " ng-click=\""
45
false
true
0
7
10
27
11
16
null
null
adinapoli/api-tools
src/Data/API/Changes.hs
bsd-3-clause
validateAfter chks _ = chks >= CheckAll
56
validateAfter chks _ = chks >= CheckAll
56
validateAfter chks _ = chks >= CheckAll
56
false
false
0
5
23
17
7
10
null
null
wei2912/blog_src
app/Main.hs
mit
main :: IO () main = hakyll $ do (match . fromList) ["favicon.ico", "favicon-16x16.png", "favicon-32x32.png"] $ do route idRoute compile copyFileCompiler match "css/**.sass" $ do route $ setExtension ".min.css" compile $ getResourceString >>= withItemBody (unixFilter "sass" ["--stdin", "--indented", "--style=compressed"]) match "posts/**.md" $ do route $ setExtension ".html" compile $ pandocMathCompiler >>= loadAndApplyTemplate "templates/post.html" postCtx >>= saveSnapshot "content" >>= loadAndApplyTemplate "templates/default.html" postCtx >>= relativizeUrls match "index.md" $ do route $ setExtension ".html" compile $ do posts <- recentFirst =<< loadAllSnapshots "posts/**.md" "content" let indexCtx = listField "posts" postCtx (return posts) <> defaultContext pandocMathCompiler >>= loadAndApplyTemplate "templates/default.html" indexCtx >>= relativizeUrls match "templates/**" $ compile templateCompiler match (fromRegex "^posts/" .&&. complement (fromRegex "\\.md$")) $ do route idRoute compile copyFileCompiler create ["sitemap.xml"] $ do route idRoute compile $ do posts <- recentFirst =<< loadAllSnapshots "posts/**.md" "content" let sitemapCtx = listField "posts" postCtx (return posts) <> defaultContext makeItem "" >>= loadAndApplyTemplate "templates/sitemap.xml" sitemapCtx
1,750
main :: IO () main = hakyll $ do (match . fromList) ["favicon.ico", "favicon-16x16.png", "favicon-32x32.png"] $ do route idRoute compile copyFileCompiler match "css/**.sass" $ do route $ setExtension ".min.css" compile $ getResourceString >>= withItemBody (unixFilter "sass" ["--stdin", "--indented", "--style=compressed"]) match "posts/**.md" $ do route $ setExtension ".html" compile $ pandocMathCompiler >>= loadAndApplyTemplate "templates/post.html" postCtx >>= saveSnapshot "content" >>= loadAndApplyTemplate "templates/default.html" postCtx >>= relativizeUrls match "index.md" $ do route $ setExtension ".html" compile $ do posts <- recentFirst =<< loadAllSnapshots "posts/**.md" "content" let indexCtx = listField "posts" postCtx (return posts) <> defaultContext pandocMathCompiler >>= loadAndApplyTemplate "templates/default.html" indexCtx >>= relativizeUrls match "templates/**" $ compile templateCompiler match (fromRegex "^posts/" .&&. complement (fromRegex "\\.md$")) $ do route idRoute compile copyFileCompiler create ["sitemap.xml"] $ do route idRoute compile $ do posts <- recentFirst =<< loadAllSnapshots "posts/**.md" "content" let sitemapCtx = listField "posts" postCtx (return posts) <> defaultContext makeItem "" >>= loadAndApplyTemplate "templates/sitemap.xml" sitemapCtx
1,750
main = hakyll $ do (match . fromList) ["favicon.ico", "favicon-16x16.png", "favicon-32x32.png"] $ do route idRoute compile copyFileCompiler match "css/**.sass" $ do route $ setExtension ".min.css" compile $ getResourceString >>= withItemBody (unixFilter "sass" ["--stdin", "--indented", "--style=compressed"]) match "posts/**.md" $ do route $ setExtension ".html" compile $ pandocMathCompiler >>= loadAndApplyTemplate "templates/post.html" postCtx >>= saveSnapshot "content" >>= loadAndApplyTemplate "templates/default.html" postCtx >>= relativizeUrls match "index.md" $ do route $ setExtension ".html" compile $ do posts <- recentFirst =<< loadAllSnapshots "posts/**.md" "content" let indexCtx = listField "posts" postCtx (return posts) <> defaultContext pandocMathCompiler >>= loadAndApplyTemplate "templates/default.html" indexCtx >>= relativizeUrls match "templates/**" $ compile templateCompiler match (fromRegex "^posts/" .&&. complement (fromRegex "\\.md$")) $ do route idRoute compile copyFileCompiler create ["sitemap.xml"] $ do route idRoute compile $ do posts <- recentFirst =<< loadAllSnapshots "posts/**.md" "content" let sitemapCtx = listField "posts" postCtx (return posts) <> defaultContext makeItem "" >>= loadAndApplyTemplate "templates/sitemap.xml" sitemapCtx
1,736
false
true
2
20
605
394
172
222
null
null
arnizamani/occam
Haskell.hs
mit
-- | Returns multiple bindings for the same variable, if any exist sameVarBinding :: [(HsName,HsExp)] -> [(HsName,HsExp)] sameVarBinding [] = []
144
sameVarBinding :: [(HsName,HsExp)] -> [(HsName,HsExp)] sameVarBinding [] = []
77
sameVarBinding [] = []
22
true
true
0
9
20
47
25
22
null
null
davdar/quals
src/Lang/Lam/Parser.hs
bsd-3-clause
parseLam :: String -> Doc :+: Exp parseLam = parseExp openExp
61
parseLam :: String -> Doc :+: Exp parseLam = parseExp openExp
61
parseLam = parseExp openExp
27
false
true
0
8
10
29
12
17
null
null
rsasse/tamarin-prover
lib/utils/src/Control/Monad/Bind.hs
gpl-3.0
-- | Run a computation with bindings. runBindT :: BindT k v m a -> Bindings k v -> m (a, Bindings k v) runBindT = runStateT
123
runBindT :: BindT k v m a -> Bindings k v -> m (a, Bindings k v) runBindT = runStateT
85
runBindT = runStateT
20
true
true
0
9
26
48
24
24
null
null
randen/cabal
cabal-install/Distribution/Client/Dependency/Modular/Version.hs
bsd-3-clause
-- | Simplify a version range. simplifyVR :: VR -> VR simplifyVR = CV.simplifyVersionRange
90
simplifyVR :: VR -> VR simplifyVR = CV.simplifyVersionRange
59
simplifyVR = CV.simplifyVersionRange
36
true
true
0
7
13
25
11
14
null
null
barrucadu/search-party
Control/Concurrent/Find/Internal.hs
mit
explorer :: MonadConc m => Bool -> Bool -> Int -> TVar (STM m) [(m (WorkItem m a), Int)] -> (a -> b) -> TVar (STM m) [(Int, Int)] -> TVar (STM m) Int -> TMVar (STM m) b -> m () -- If there is only one explorer, skip all the synchronisation stuff. explorer looping _ 1 workitems wf _ liveworkers var = do work <- atomically (readTVar workitems) loop work atomically $ writeTVar liveworkers 0 where loop ((item,_):rest) = item >>= result >>= maybe (loop rest) (\a -> do atomically . putTMVar var $ wf a when looping $ loop rest) loop [] = return ()
660
explorer :: MonadConc m => Bool -> Bool -> Int -> TVar (STM m) [(m (WorkItem m a), Int)] -> (a -> b) -> TVar (STM m) [(Int, Int)] -> TVar (STM m) Int -> TMVar (STM m) b -> m () explorer looping _ 1 workitems wf _ liveworkers var = do work <- atomically (readTVar workitems) loop work atomically $ writeTVar liveworkers 0 where loop ((item,_):rest) = item >>= result >>= maybe (loop rest) (\a -> do atomically . putTMVar var $ wf a when looping $ loop rest) loop [] = return ()
590
explorer looping _ 1 workitems wf _ liveworkers var = do work <- atomically (readTVar workitems) loop work atomically $ writeTVar liveworkers 0 where loop ((item,_):rest) = item >>= result >>= maybe (loop rest) (\a -> do atomically . putTMVar var $ wf a when looping $ loop rest) loop [] = return ()
329
true
true
1
17
221
291
138
153
null
null
GarrisonJ/Nock
src/Optimizer.hs
unlicense
additionFunc :: Noun -> Noun additionFunc n = case n of (Cell (Atom n1) (Atom n2)) -> Atom (n1+n2) _ -> let x=x in x -- Infinite Loop
177
additionFunc :: Noun -> Noun additionFunc n = case n of (Cell (Atom n1) (Atom n2)) -> Atom (n1+n2) _ -> let x=x in x -- Infinite Loop
177
additionFunc n = case n of (Cell (Atom n1) (Atom n2)) -> Atom (n1+n2) _ -> let x=x in x -- Infinite Loop
148
false
true
0
11
71
82
39
43
null
null
karamellpelle/grid
source/Game/LevelPuzzle/Output/Plain.hs
gpl-3.0
outputPlay :: LevelPuzzleWorld -> RunWorld -> MEnv' (LevelPuzzleWorld, RunWorld) outputPlay = \lvl run -> do gamedata <- resourceGameData io $ do putStrLn "LevelPuzzle.iterationPlay" outputSoundPlay gamedata lvl run outputScreenPlay gamedata lvl run return (lvl, run)
300
outputPlay :: LevelPuzzleWorld -> RunWorld -> MEnv' (LevelPuzzleWorld, RunWorld) outputPlay = \lvl run -> do gamedata <- resourceGameData io $ do putStrLn "LevelPuzzle.iterationPlay" outputSoundPlay gamedata lvl run outputScreenPlay gamedata lvl run return (lvl, run)
300
outputPlay = \lvl run -> do gamedata <- resourceGameData io $ do putStrLn "LevelPuzzle.iterationPlay" outputSoundPlay gamedata lvl run outputScreenPlay gamedata lvl run return (lvl, run)
219
false
true
0
12
66
87
41
46
null
null
nickspinale/wmonad
src/WMonad/Stack.hs
mit
removeL (Stack (l:ls) x rs) = Just (x, Stack ls l rs)
53
removeL (Stack (l:ls) x rs) = Just (x, Stack ls l rs)
53
removeL (Stack (l:ls) x rs) = Just (x, Stack ls l rs)
53
false
false
0
9
11
42
21
21
null
null
svenssonjoel/MonadObsidian
Obsidian/MonadObsidian/MM.hs
bsd-3-clause
memMax :: Int memMax = maxBound
35
memMax :: Int memMax = maxBound
34
memMax = maxBound
20
false
true
0
4
9
11
6
5
null
null
laszlopandy/elm-package
src/Elm/Package/Constraint.hs
bsd-3-clause
takeOp :: String -> Maybe (Op, String) takeOp str = case str of '<' : '=' : rest -> Just (LessOrEqual, rest) '<' : rest -> Just (Less, rest) _ -> Nothing
167
takeOp :: String -> Maybe (Op, String) takeOp str = case str of '<' : '=' : rest -> Just (LessOrEqual, rest) '<' : rest -> Just (Less, rest) _ -> Nothing
167
takeOp str = case str of '<' : '=' : rest -> Just (LessOrEqual, rest) '<' : rest -> Just (Less, rest) _ -> Nothing
128
false
true
0
9
45
84
42
42
null
null
mbekavac/gpkex
getAnnotated.hs
bsd-3-clause
makeTuples :: S.Set String -> String -> [[String]] makeTuples stopW = filter (removeStop stopW) . concat . map (filter (\ss -> ss /= [] && length ss <= 4) . map (stem . words) . splitText "!\"'()+.,;:?" "") . splitText "|" ""
227
makeTuples :: S.Set String -> String -> [[String]] makeTuples stopW = filter (removeStop stopW) . concat . map (filter (\ss -> ss /= [] && length ss <= 4) . map (stem . words) . splitText "!\"'()+.,;:?" "") . splitText "|" ""
227
makeTuples stopW = filter (removeStop stopW) . concat . map (filter (\ss -> ss /= [] && length ss <= 4) . map (stem . words) . splitText "!\"'()+.,;:?" "") . splitText "|" ""
176
false
true
1
16
43
124
58
66
null
null
tabemann/botwars
src/Robots/Genetic/HunterKiller/Mutate.hs
bsd-3-clause
mutateCond :: Int -> Int -> RobotExpr -> RobotExpr -> RobotExpr -> State.State RobotMutate RobotExpr mutateCond contextDepth totalDepth condExpr trueExpr falseExpr = do removeCondChance <- robotParamsMutationRemoveCondChance <$> robotMutateParams <$> State.get removeCondAsTrueChance <- robotParamsMutationRemoveCondAsTrueChance <$> robotMutateParams <$> State.get flipCondChance <- robotParamsMutationFlipCondChance <$> robotMutateParams <$> State.get let removeCondChance' = getProbability removeCondChance totalDepth removeCondAsTrueChance' = getProbability removeCondAsTrueChance totalDepth flipCondChance' = getProbability flipCondChance totalDepth probability <- random if probability <= removeCondChance' then do probability <- random if probability <= removeCondAsTrueChance' then return trueExpr else return falseExpr else if probability <= removeCondChance' + flipCondChance' then return $ RobotCond condExpr falseExpr trueExpr else return $ RobotCond condExpr trueExpr falseExpr -- | Adjust load expressions.
1,172
mutateCond :: Int -> Int -> RobotExpr -> RobotExpr -> RobotExpr -> State.State RobotMutate RobotExpr mutateCond contextDepth totalDepth condExpr trueExpr falseExpr = do removeCondChance <- robotParamsMutationRemoveCondChance <$> robotMutateParams <$> State.get removeCondAsTrueChance <- robotParamsMutationRemoveCondAsTrueChance <$> robotMutateParams <$> State.get flipCondChance <- robotParamsMutationFlipCondChance <$> robotMutateParams <$> State.get let removeCondChance' = getProbability removeCondChance totalDepth removeCondAsTrueChance' = getProbability removeCondAsTrueChance totalDepth flipCondChance' = getProbability flipCondChance totalDepth probability <- random if probability <= removeCondChance' then do probability <- random if probability <= removeCondAsTrueChance' then return trueExpr else return falseExpr else if probability <= removeCondChance' + flipCondChance' then return $ RobotCond condExpr falseExpr trueExpr else return $ RobotCond condExpr trueExpr falseExpr -- | Adjust load expressions.
1,172
mutateCond contextDepth totalDepth condExpr trueExpr falseExpr = do removeCondChance <- robotParamsMutationRemoveCondChance <$> robotMutateParams <$> State.get removeCondAsTrueChance <- robotParamsMutationRemoveCondAsTrueChance <$> robotMutateParams <$> State.get flipCondChance <- robotParamsMutationFlipCondChance <$> robotMutateParams <$> State.get let removeCondChance' = getProbability removeCondChance totalDepth removeCondAsTrueChance' = getProbability removeCondAsTrueChance totalDepth flipCondChance' = getProbability flipCondChance totalDepth probability <- random if probability <= removeCondChance' then do probability <- random if probability <= removeCondAsTrueChance' then return trueExpr else return falseExpr else if probability <= removeCondChance' + flipCondChance' then return $ RobotCond condExpr falseExpr trueExpr else return $ RobotCond condExpr trueExpr falseExpr -- | Adjust load expressions.
1,057
false
true
0
11
260
223
108
115
null
null
ThomasBDev/Iron-Rat
src/Game.hs
gpl-2.0
vierkant = polygon (rectanglePath 100 100)
42
vierkant = polygon (rectanglePath 100 100)
42
vierkant = polygon (rectanglePath 100 100)
42
false
false
1
7
5
20
8
12
null
null
rvion/ride
twitch-cast/src/Types.hs
bsd-3-clause
demoStream :: Maybe TwitchStream demoStream = js_decode d2
58
demoStream :: Maybe TwitchStream demoStream = js_decode d2
58
demoStream = js_decode d2
25
false
true
0
5
7
17
8
9
null
null
juampi/runaway
runaway.hs
mit
solveOne :: IO () solveOne = do solve' "" return () -- Solves levels one after another
100
solveOne :: IO () solveOne = do solve' "" return () -- Solves levels one after another
99
solveOne = do solve' "" return () -- Solves levels one after another
81
false
true
0
8
30
31
14
17
null
null
kim/amazonka
amazonka-cloudsearch/gen/Network/AWS/CloudSearch/Types.hs
mpl-2.0
-- | Whether highlights can be returned for the field. taoHighlightEnabled :: Lens' TextArrayOptions (Maybe Bool) taoHighlightEnabled = lens _taoHighlightEnabled (\s a -> s { _taoHighlightEnabled = a })
206
taoHighlightEnabled :: Lens' TextArrayOptions (Maybe Bool) taoHighlightEnabled = lens _taoHighlightEnabled (\s a -> s { _taoHighlightEnabled = a })
151
taoHighlightEnabled = lens _taoHighlightEnabled (\s a -> s { _taoHighlightEnabled = a })
92
true
true
0
9
32
46
25
21
null
null
jthornber/XMonadContrib
XMonad/Hooks/DebugEvents.hs
bsd-3-clause
dumpEnum' :: [String] -> Atom -> Decoder Bool dumpEnum' ss fmt = guardType fmt $ getInt 32 $ \r -> case () of () | r < 0 -> "undefined value " ++ show r | r >= genericLength ss -> "undefined value " ++ show r | otherwise -> genericIndex ss r -- we do not, unlike @xev@, try to ascii-art pixmaps.
466
dumpEnum' :: [String] -> Atom -> Decoder Bool dumpEnum' ss fmt = guardType fmt $ getInt 32 $ \r -> case () of () | r < 0 -> "undefined value " ++ show r | r >= genericLength ss -> "undefined value " ++ show r | otherwise -> genericIndex ss r -- we do not, unlike @xev@, try to ascii-art pixmaps.
466
dumpEnum' ss fmt = guardType fmt $ getInt 32 $ \r -> case () of () | r < 0 -> "undefined value " ++ show r | r >= genericLength ss -> "undefined value " ++ show r | otherwise -> genericIndex ss r -- we do not, unlike @xev@, try to ascii-art pixmaps.
413
false
true
0
14
233
122
56
66
null
null
np/hlatex
Language/LaTeX/Builder/Internal.hs
bsd-3-clause
egroup = texDecl "egroup"
30
egroup = texDecl "egroup"
30
egroup = texDecl "egroup"
30
false
false
0
5
8
9
4
5
null
null
mettekou/ghc
compiler/simplStg/UnariseStg.hs
bsd-3-clause
unariseConArgBinder :: UnariseEnv -> Id -> UniqSM (UnariseEnv, [Id]) unariseConArgBinder rho x = case repType (idType x) of UnaryRep _ -> return (rho, [x]) MultiRep slots -> do xs <- mkIds (mkFastString "us") (map slotTyToType slots) return (extendRho rho x (MultiVal (map StgVarArg xs)), xs)
318
unariseConArgBinder :: UnariseEnv -> Id -> UniqSM (UnariseEnv, [Id]) unariseConArgBinder rho x = case repType (idType x) of UnaryRep _ -> return (rho, [x]) MultiRep slots -> do xs <- mkIds (mkFastString "us") (map slotTyToType slots) return (extendRho rho x (MultiVal (map StgVarArg xs)), xs)
318
unariseConArgBinder rho x = case repType (idType x) of UnaryRep _ -> return (rho, [x]) MultiRep slots -> do xs <- mkIds (mkFastString "us") (map slotTyToType slots) return (extendRho rho x (MultiVal (map StgVarArg xs)), xs)
249
false
true
2
14
70
137
68
69
null
null
pbrisbin/devsite
Application.hs
bsd-2-clause
makeFoundation :: AppConfig DefaultEnv () -> IO App makeFoundation conf = do manager <- newManager def s <- staticSite dbconf <- withYamlEnvironment "config/postgresql.yml" (appEnv conf) Database.Persist.loadConfig >>= Database.Persist.applyEnv p <- Database.Persist.createPoolConfig (dbconf :: Settings.PersistConf) logger <- mkLogger True stdout let foundation = App conf s p manager dbconf logger -- Perform database migration using our application's logging settings. runLoggingT (Database.Persist.runPool dbconf (runMigration migrateAll) p) (messageLoggerSource foundation logger) -- TODO: combine this with above runLoggingT (Database.Persist.runPool dbconf (runMigration migrateComments) p) (messageLoggerSource foundation logger) return foundation -- for yesod devel
882
makeFoundation :: AppConfig DefaultEnv () -> IO App makeFoundation conf = do manager <- newManager def s <- staticSite dbconf <- withYamlEnvironment "config/postgresql.yml" (appEnv conf) Database.Persist.loadConfig >>= Database.Persist.applyEnv p <- Database.Persist.createPoolConfig (dbconf :: Settings.PersistConf) logger <- mkLogger True stdout let foundation = App conf s p manager dbconf logger -- Perform database migration using our application's logging settings. runLoggingT (Database.Persist.runPool dbconf (runMigration migrateAll) p) (messageLoggerSource foundation logger) -- TODO: combine this with above runLoggingT (Database.Persist.runPool dbconf (runMigration migrateComments) p) (messageLoggerSource foundation logger) return foundation -- for yesod devel
882
makeFoundation conf = do manager <- newManager def s <- staticSite dbconf <- withYamlEnvironment "config/postgresql.yml" (appEnv conf) Database.Persist.loadConfig >>= Database.Persist.applyEnv p <- Database.Persist.createPoolConfig (dbconf :: Settings.PersistConf) logger <- mkLogger True stdout let foundation = App conf s p manager dbconf logger -- Perform database migration using our application's logging settings. runLoggingT (Database.Persist.runPool dbconf (runMigration migrateAll) p) (messageLoggerSource foundation logger) -- TODO: combine this with above runLoggingT (Database.Persist.runPool dbconf (runMigration migrateComments) p) (messageLoggerSource foundation logger) return foundation -- for yesod devel
830
false
true
0
11
195
209
100
109
null
null
GaloisInc/halvm-ghc
compiler/simplCore/CSE.hs
bsd-3-clause
lookupCSEnv :: CSEnv -> OutExpr -> Maybe Id lookupCSEnv (CS { cs_map = csmap }) expr = case lookupCoreMap csmap expr of Just (_,e) -> Just e Nothing -> Nothing
176
lookupCSEnv :: CSEnv -> OutExpr -> Maybe Id lookupCSEnv (CS { cs_map = csmap }) expr = case lookupCoreMap csmap expr of Just (_,e) -> Just e Nothing -> Nothing
176
lookupCSEnv (CS { cs_map = csmap }) expr = case lookupCoreMap csmap expr of Just (_,e) -> Just e Nothing -> Nothing
132
false
true
3
9
46
76
36
40
null
null
christiaanb/ghc
compiler/types/TyCon.hs
bsd-3-clause
tyConRoles :: TyCon -> [Role] -- See also Note [TyCon Role signatures] tyConRoles tc = case tc of { FunTyCon {} -> const_role Representational ; AlgTyCon { tcRoles = roles } -> roles ; SynonymTyCon { tcRoles = roles } -> roles ; FamilyTyCon {} -> const_role Nominal ; PrimTyCon { tcRoles = roles } -> roles ; PromotedDataCon { tcRoles = roles } -> roles ; PromotedTyCon {} -> const_role Nominal } where const_role r = replicate (tyConArity tc) r -- | Extract the bound type variables and type expansion of a type synonym -- 'TyCon'. Panics if the 'TyCon' is not a synonym
692
tyConRoles :: TyCon -> [Role] tyConRoles tc = case tc of { FunTyCon {} -> const_role Representational ; AlgTyCon { tcRoles = roles } -> roles ; SynonymTyCon { tcRoles = roles } -> roles ; FamilyTyCon {} -> const_role Nominal ; PrimTyCon { tcRoles = roles } -> roles ; PromotedDataCon { tcRoles = roles } -> roles ; PromotedTyCon {} -> const_role Nominal } where const_role r = replicate (tyConArity tc) r -- | Extract the bound type variables and type expansion of a type synonym -- 'TyCon'. Panics if the 'TyCon' is not a synonym
651
tyConRoles tc = case tc of { FunTyCon {} -> const_role Representational ; AlgTyCon { tcRoles = roles } -> roles ; SynonymTyCon { tcRoles = roles } -> roles ; FamilyTyCon {} -> const_role Nominal ; PrimTyCon { tcRoles = roles } -> roles ; PromotedDataCon { tcRoles = roles } -> roles ; PromotedTyCon {} -> const_role Nominal } where const_role r = replicate (tyConArity tc) r -- | Extract the bound type variables and type expansion of a type synonym -- 'TyCon'. Panics if the 'TyCon' is not a synonym
621
true
true
1
10
225
165
85
80
null
null
Eugleo/Code-Wars
src/haskell-kata/AlgebraicIsomorphism.hs
bsd-3-clause
curryISO :: ISO (a -> b -> c) ((a, b) -> c) curryISO = (uncurry, curry)
71
curryISO :: ISO (a -> b -> c) ((a, b) -> c) curryISO = (uncurry, curry)
71
curryISO = (uncurry, curry)
27
false
true
0
8
15
46
26
20
null
null
HJvT/hdirect
src/Parser.hs
bsd-3-clause
action_31 (155#) = happyShift action_49
39
action_31 (155#) = happyShift action_49
39
action_31 (155#) = happyShift action_49
39
false
false
0
6
4
15
7
8
null
null
beni55/haste-compiler
libraries/ghc-7.10/base/Data/Data.hs
bsd-3-clause
consConstr :: Constr consConstr = mkConstr listDataType "(:)" [] Infix
72
consConstr :: Constr consConstr = mkConstr listDataType "(:)" [] Infix
72
consConstr = mkConstr listDataType "(:)" [] Infix
51
false
true
0
6
11
22
11
11
null
null
takano-akio/time
test/TestMonthDay.hs
bsd-3-clause
showCompare a1 b a2 = "DIFF: " ++ (show a1) ++ " -> " ++ b ++ " -> " ++ (show a2)
81
showCompare a1 b a2 = "DIFF: " ++ (show a1) ++ " -> " ++ b ++ " -> " ++ (show a2)
81
showCompare a1 b a2 = "DIFF: " ++ (show a1) ++ " -> " ++ b ++ " -> " ++ (show a2)
81
false
false
1
11
22
51
22
29
null
null
gcampax/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
mkSimpleWC :: [CtEvidence] -> WantedConstraints mkSimpleWC cts = WC { wc_simple = listToBag (map mkNonCanonical cts) , wc_impl = emptyBag , wc_insol = emptyBag }
177
mkSimpleWC :: [CtEvidence] -> WantedConstraints mkSimpleWC cts = WC { wc_simple = listToBag (map mkNonCanonical cts) , wc_impl = emptyBag , wc_insol = emptyBag }
177
mkSimpleWC cts = WC { wc_simple = listToBag (map mkNonCanonical cts) , wc_impl = emptyBag , wc_insol = emptyBag }
129
false
true
0
9
40
52
29
23
null
null
rimmington/eclogues
eclogues-impl/app/api/Eclogues/Persist.hs
bsd-3-clause
deleteFilesAttachedTo :: Job.Name -> Action () deleteFilesAttachedTo name = Action $ P.deleteWhere [FileEntityName ==. name]
124
deleteFilesAttachedTo :: Job.Name -> Action () deleteFilesAttachedTo name = Action $ P.deleteWhere [FileEntityName ==. name]
124
deleteFilesAttachedTo name = Action $ P.deleteWhere [FileEntityName ==. name]
77
false
true
0
8
14
41
20
21
null
null
ndmitchell/extra
src/Data/List/NonEmpty/Extra.hs
bsd-3-clause
-- | The largest element of a non-empty list. maximum1 :: Ord a => NonEmpty a -> a maximum1 = List.maximum
106
maximum1 :: Ord a => NonEmpty a -> a maximum1 = List.maximum
60
maximum1 = List.maximum
23
true
true
0
7
20
28
14
14
null
null
olorin/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs
mpl-2.0
-- | One or more inbound rules associated with the security group. sgIPPermissions :: Lens' SecurityGroup [IPPermission] sgIPPermissions = lens _sgIPPermissions (\ s a -> s{_sgIPPermissions = a}) . _Default . _Coerce
216
sgIPPermissions :: Lens' SecurityGroup [IPPermission] sgIPPermissions = lens _sgIPPermissions (\ s a -> s{_sgIPPermissions = a}) . _Default . _Coerce
149
sgIPPermissions = lens _sgIPPermissions (\ s a -> s{_sgIPPermissions = a}) . _Default . _Coerce
95
true
true
0
11
31
51
28
23
null
null
jaspervdj/lorem-markdownum
lib/LoremMarkdownum/Gen/Code.hs
bsd-3-clause
printLhs (FieldLhs o i) = printIdentifier o >> printText "." >> printIdentifier i
88
printLhs (FieldLhs o i) = printIdentifier o >> printText "." >> printIdentifier i
88
printLhs (FieldLhs o i) = printIdentifier o >> printText "." >> printIdentifier i
88
false
false
0
7
19
34
15
19
null
null
HIPERFIT/futhark
src/Futhark/CLI/Pkg.hs
isc
getPkgManifest :: PkgM PkgManifest getPkgManifest = do file_exists <- liftIO $ doesFileExist futharkPkg dir_exists <- liftIO $ doesDirectoryExist futharkPkg case (file_exists, dir_exists) of (True, _) -> liftIO $ parsePkgManifestFromFile futharkPkg (_, True) -> fail $ futharkPkg <> " exists, but it is a directory! What in Odin's beard..." _ -> liftIO $ do T.putStrLn $ T.pack futharkPkg <> " not found - pretending it's empty." return $ newPkgManifest Nothing
517
getPkgManifest :: PkgM PkgManifest getPkgManifest = do file_exists <- liftIO $ doesFileExist futharkPkg dir_exists <- liftIO $ doesDirectoryExist futharkPkg case (file_exists, dir_exists) of (True, _) -> liftIO $ parsePkgManifestFromFile futharkPkg (_, True) -> fail $ futharkPkg <> " exists, but it is a directory! What in Odin's beard..." _ -> liftIO $ do T.putStrLn $ T.pack futharkPkg <> " not found - pretending it's empty." return $ newPkgManifest Nothing
517
getPkgManifest = do file_exists <- liftIO $ doesFileExist futharkPkg dir_exists <- liftIO $ doesDirectoryExist futharkPkg case (file_exists, dir_exists) of (True, _) -> liftIO $ parsePkgManifestFromFile futharkPkg (_, True) -> fail $ futharkPkg <> " exists, but it is a directory! What in Odin's beard..." _ -> liftIO $ do T.putStrLn $ T.pack futharkPkg <> " not found - pretending it's empty." return $ newPkgManifest Nothing
482
false
true
0
16
124
132
64
68
null
null
GaloisInc/haskell-tor
src/Tor/Link/CipherSuites.hs
bsd-3-clause
bulkRC4 :: Bulk bulkRC4 = Bulk { bulkName = "RC4-128" , bulkKeySize = 16 , bulkIVSize = 0 , bulkExplicitIV = 0 , bulkAuthTagLen = 0 , bulkBlockSize = 0 , bulkF = BulkStreamF rc4 } where rc4 _ bulkKey = BulkStream (combineRC4 (initialize bulkKey)) combineRC4 ctx input = let (ctx', output) = combine ctx input in (output, BulkStream (combineRC4 ctx')) -- -----------------------------------------------------------------------------
488
bulkRC4 :: Bulk bulkRC4 = Bulk { bulkName = "RC4-128" , bulkKeySize = 16 , bulkIVSize = 0 , bulkExplicitIV = 0 , bulkAuthTagLen = 0 , bulkBlockSize = 0 , bulkF = BulkStreamF rc4 } where rc4 _ bulkKey = BulkStream (combineRC4 (initialize bulkKey)) combineRC4 ctx input = let (ctx', output) = combine ctx input in (output, BulkStream (combineRC4 ctx')) -- -----------------------------------------------------------------------------
488
bulkRC4 = Bulk { bulkName = "RC4-128" , bulkKeySize = 16 , bulkIVSize = 0 , bulkExplicitIV = 0 , bulkAuthTagLen = 0 , bulkBlockSize = 0 , bulkF = BulkStreamF rc4 } where rc4 _ bulkKey = BulkStream (combineRC4 (initialize bulkKey)) combineRC4 ctx input = let (ctx', output) = combine ctx input in (output, BulkStream (combineRC4 ctx')) -- -----------------------------------------------------------------------------
472
false
true
0
10
119
135
74
61
null
null
plow-technologies/template-service
master/src/Data/Master/Template.hs
bsd-3-clause
parseAnd _ = mzero
18
parseAnd _ = mzero
18
parseAnd _ = mzero
18
false
false
0
5
3
9
4
5
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/type-level/2017-08-justin-le-fixed-length-vector-types/src/L1.hs
unlicense
withVecS' :: V.Vector a -> (forall n. S.Sing n -> Vec n a -> r) -> r withVecS' v f = S.withSomeSing (fromIntegral (V.length v)) $ \s -> f s (UnsafeMkVec v)
207
withVecS' :: V.Vector a -> (forall n. S.Sing n -> Vec n a -> r) -> r withVecS' v f = S.withSomeSing (fromIntegral (V.length v)) $ \s -> f s (UnsafeMkVec v)
207
withVecS' v f = S.withSomeSing (fromIntegral (V.length v)) $ \s -> f s (UnsafeMkVec v)
138
false
true
0
12
83
99
47
52
null
null
thalerjonathan/phd
public/towards/SugarScape/experimental/concurrent/src/SugarScape/Core/Scenario.hs
gpl-3.0
mkSugarScapeScenario :: SugarScapeScenario mkSugarScapeScenario = SugarScapeScenario { sgScenarioName = "Default" , sgAgentCount = 0 , spSugarRegrow = Immediate , sgAgentDistribution = Scatter , spSugarEndowmentRange = (0, 0) , spSugarMetabolismRange = (0, 0) , spVisionRange = (0, 0) , spReplaceAgents = False , spAgeSpan = Forever , spPolutionFormation = NoPolution , spPolutionDiffusion = Nothing , spSexRuleActive = False , spGenderRatio = 0 , spFertStartRangeFemale = (0, 0) , spFertStartRangeMale = (0, 0) , spFertEndRangeFemale = (0, 0) , spFertEndRangeMale = (0, 0) , spInheritance = False , spCulturalProcess = Nothing , spCombat = Nothing , spSpiceEnabled = False , spSpiceRegrow = Immediate , spSpiceEndowmentRange = (0, 0) , spSpiceMetabolismRange = (0, 0) , spTradingEnabled = False , spLoansEnabled = Nothing , spDiseasesEnabled = Nothing }
1,067
mkSugarScapeScenario :: SugarScapeScenario mkSugarScapeScenario = SugarScapeScenario { sgScenarioName = "Default" , sgAgentCount = 0 , spSugarRegrow = Immediate , sgAgentDistribution = Scatter , spSugarEndowmentRange = (0, 0) , spSugarMetabolismRange = (0, 0) , spVisionRange = (0, 0) , spReplaceAgents = False , spAgeSpan = Forever , spPolutionFormation = NoPolution , spPolutionDiffusion = Nothing , spSexRuleActive = False , spGenderRatio = 0 , spFertStartRangeFemale = (0, 0) , spFertStartRangeMale = (0, 0) , spFertEndRangeFemale = (0, 0) , spFertEndRangeMale = (0, 0) , spInheritance = False , spCulturalProcess = Nothing , spCombat = Nothing , spSpiceEnabled = False , spSpiceRegrow = Immediate , spSpiceEndowmentRange = (0, 0) , spSpiceMetabolismRange = (0, 0) , spTradingEnabled = False , spLoansEnabled = Nothing , spDiseasesEnabled = Nothing }
1,067
mkSugarScapeScenario = SugarScapeScenario { sgScenarioName = "Default" , sgAgentCount = 0 , spSugarRegrow = Immediate , sgAgentDistribution = Scatter , spSugarEndowmentRange = (0, 0) , spSugarMetabolismRange = (0, 0) , spVisionRange = (0, 0) , spReplaceAgents = False , spAgeSpan = Forever , spPolutionFormation = NoPolution , spPolutionDiffusion = Nothing , spSexRuleActive = False , spGenderRatio = 0 , spFertStartRangeFemale = (0, 0) , spFertStartRangeMale = (0, 0) , spFertEndRangeFemale = (0, 0) , spFertEndRangeMale = (0, 0) , spInheritance = False , spCulturalProcess = Nothing , spCombat = Nothing , spSpiceEnabled = False , spSpiceRegrow = Immediate , spSpiceEndowmentRange = (0, 0) , spSpiceMetabolismRange = (0, 0) , spTradingEnabled = False , spLoansEnabled = Nothing , spDiseasesEnabled = Nothing }
1,024
false
true
0
7
336
229
151
78
null
null
bennofs/cabal2nix
src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs
bsd-3-clause
configureCabalFlags :: PackageIdentifier -> FlagAssignment configureCabalFlags (PackageIdentifier (PackageName name) version) | name == "accelerate-examples"= [disable "opencl"] | name == "arithmoi" = [disable "llvm"] | name == "darcs" = [enable "library", enable "force-char8-encoding"] | name == "diagrams-builder" = [enable "cairo", enable "svg", enable "ps", enable "rasterific"] | name == "folds" = [disable "test-hlint"] | name == "git-annex" = [ enable "assistant" , enable "cryptonite" , enable "dbus" , enable "desktopnotify" , enable "dns" , enable "feed" , enable "inotify" , enable "pairing" , enable "production" , enable "quvi" , enable "s3" , enable "tahoe" , enable "tdfa" , enable "testsuite" , enable "torrentparser" , enable "webapp" , enable "webapp-secure" , enable "webdav" , enable "xmpp" ] | name == "haskeline" = [enable "terminfo"] | name == "haste-compiler" = [enable "portable"] | name == "highlighting-kate" = [enable "pcre-light"] | name == "hlibsass" && version >= Version [0,1,5] [] = [enable "externalLibsass"] | name == "hmatrix" = [enable "openblas"] | name == "hslua" = [enable "system-lua"] | name == "idris" = [enable "gmp", enable "ffi", enable "curses"] | name == "io-streams" = [enable "NoInteractiveTests"] | name == "liquid-fixpoint" = [enable "build-external"] | name == "pandoc" = [enable "https", disable "trypandoc"] | name == "reactive-banana-wx" = [disable "buildExamples"] | name == "snap-server" = [enable "openssl"] | name == "xmobar" = [enable "all_extensions"] | name == "xmonad-extras" = [disable "with_hlist", enable "with_split", enable "with_parsec"] | name == "yaml" = [enable "system-libyaml"] | name == "yi" = [enable "pango", enable "vty"] | otherwise = []
2,613
configureCabalFlags :: PackageIdentifier -> FlagAssignment configureCabalFlags (PackageIdentifier (PackageName name) version) | name == "accelerate-examples"= [disable "opencl"] | name == "arithmoi" = [disable "llvm"] | name == "darcs" = [enable "library", enable "force-char8-encoding"] | name == "diagrams-builder" = [enable "cairo", enable "svg", enable "ps", enable "rasterific"] | name == "folds" = [disable "test-hlint"] | name == "git-annex" = [ enable "assistant" , enable "cryptonite" , enable "dbus" , enable "desktopnotify" , enable "dns" , enable "feed" , enable "inotify" , enable "pairing" , enable "production" , enable "quvi" , enable "s3" , enable "tahoe" , enable "tdfa" , enable "testsuite" , enable "torrentparser" , enable "webapp" , enable "webapp-secure" , enable "webdav" , enable "xmpp" ] | name == "haskeline" = [enable "terminfo"] | name == "haste-compiler" = [enable "portable"] | name == "highlighting-kate" = [enable "pcre-light"] | name == "hlibsass" && version >= Version [0,1,5] [] = [enable "externalLibsass"] | name == "hmatrix" = [enable "openblas"] | name == "hslua" = [enable "system-lua"] | name == "idris" = [enable "gmp", enable "ffi", enable "curses"] | name == "io-streams" = [enable "NoInteractiveTests"] | name == "liquid-fixpoint" = [enable "build-external"] | name == "pandoc" = [enable "https", disable "trypandoc"] | name == "reactive-banana-wx" = [disable "buildExamples"] | name == "snap-server" = [enable "openssl"] | name == "xmobar" = [enable "all_extensions"] | name == "xmonad-extras" = [disable "with_hlist", enable "with_split", enable "with_parsec"] | name == "yaml" = [enable "system-libyaml"] | name == "yi" = [enable "pango", enable "vty"] | otherwise = []
2,613
configureCabalFlags (PackageIdentifier (PackageName name) version) | name == "accelerate-examples"= [disable "opencl"] | name == "arithmoi" = [disable "llvm"] | name == "darcs" = [enable "library", enable "force-char8-encoding"] | name == "diagrams-builder" = [enable "cairo", enable "svg", enable "ps", enable "rasterific"] | name == "folds" = [disable "test-hlint"] | name == "git-annex" = [ enable "assistant" , enable "cryptonite" , enable "dbus" , enable "desktopnotify" , enable "dns" , enable "feed" , enable "inotify" , enable "pairing" , enable "production" , enable "quvi" , enable "s3" , enable "tahoe" , enable "tdfa" , enable "testsuite" , enable "torrentparser" , enable "webapp" , enable "webapp-secure" , enable "webdav" , enable "xmpp" ] | name == "haskeline" = [enable "terminfo"] | name == "haste-compiler" = [enable "portable"] | name == "highlighting-kate" = [enable "pcre-light"] | name == "hlibsass" && version >= Version [0,1,5] [] = [enable "externalLibsass"] | name == "hmatrix" = [enable "openblas"] | name == "hslua" = [enable "system-lua"] | name == "idris" = [enable "gmp", enable "ffi", enable "curses"] | name == "io-streams" = [enable "NoInteractiveTests"] | name == "liquid-fixpoint" = [enable "build-external"] | name == "pandoc" = [enable "https", disable "trypandoc"] | name == "reactive-banana-wx" = [disable "buildExamples"] | name == "snap-server" = [enable "openssl"] | name == "xmobar" = [enable "all_extensions"] | name == "xmonad-extras" = [disable "with_hlist", enable "with_split", enable "with_parsec"] | name == "yaml" = [enable "system-libyaml"] | name == "yi" = [enable "pango", enable "vty"] | otherwise = []
2,554
false
true
21
10
1,143
651
315
336
null
null
spechub/Hets
GMP/GMP-CoLoSS/GMP/Logics/Generic.hs
gpl-2.0
neg :: (SigFeature a b c) => Formula (a (b c)) -> Formula (a (b c)) neg = Neg
77
neg :: (SigFeature a b c) => Formula (a (b c)) -> Formula (a (b c)) neg = Neg
77
neg = Neg
9
false
true
0
12
18
64
30
34
null
null
rueshyna/gogol
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
mpl-2.0
-- | The ID of the account for which the status is reported. asAccountId :: Lens' AccountStatus (Maybe Text) asAccountId = lens _asAccountId (\ s a -> s{_asAccountId = a})
173
asAccountId :: Lens' AccountStatus (Maybe Text) asAccountId = lens _asAccountId (\ s a -> s{_asAccountId = a})
112
asAccountId = lens _asAccountId (\ s a -> s{_asAccountId = a})
64
true
true
0
9
31
48
25
23
null
null
hvr/lens
src/Control/Lens/Lens.hs
bsd-3-clause
(<<<>=) :: (MonadState s m, Monoid r) => LensLike' ((,) r) s r -> r -> m r l <<<>= b = l %%= \a -> (a, a `mappend` b)
117
(<<<>=) :: (MonadState s m, Monoid r) => LensLike' ((,) r) s r -> r -> m r l <<<>= b = l %%= \a -> (a, a `mappend` b)
117
l <<<>= b = l %%= \a -> (a, a `mappend` b)
42
false
true
1
11
29
91
48
43
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/Image.hs
lgpl-2.1
-- | Get the color of a pixel pixelBufferGetPixel :: PixelBuffer -> Point -> IO Color pixelBufferGetPixel (PixelBuffer _owned size buffer) poynt = {- do let idx = 3*(y*w + x) r <- peekByteOff buffer idx g <- peekByteOff buffer (idx+1) b <- peekByteOff buffer (idx+2) return (colorRGB r g b) -} do colr <- wxcGetPixelRGB buffer (sizeW size) poynt return (colorFromInt colr) -- | Create an image from a pixel buffer. Note: the image will -- delete the pixelbuffer.
527
pixelBufferGetPixel :: PixelBuffer -> Point -> IO Color pixelBufferGetPixel (PixelBuffer _owned size buffer) poynt = {- do let idx = 3*(y*w + x) r <- peekByteOff buffer idx g <- peekByteOff buffer (idx+1) b <- peekByteOff buffer (idx+2) return (colorRGB r g b) -} do colr <- wxcGetPixelRGB buffer (sizeW size) poynt return (colorFromInt colr) -- | Create an image from a pixel buffer. Note: the image will -- delete the pixelbuffer.
497
pixelBufferGetPixel (PixelBuffer _owned size buffer) poynt = {- do let idx = 3*(y*w + x) r <- peekByteOff buffer idx g <- peekByteOff buffer (idx+1) b <- peekByteOff buffer (idx+2) return (colorRGB r g b) -} do colr <- wxcGetPixelRGB buffer (sizeW size) poynt return (colorFromInt colr) -- | Create an image from a pixel buffer. Note: the image will -- delete the pixelbuffer.
441
true
true
0
11
144
78
37
41
null
null
DavidAlphaFox/ghc
libraries/Cabal/Cabal/Distribution/ParseUtils.hs
bsd-3-clause
commaListField :: String -> (a -> Doc) -> ReadP [a] a -> (b -> [a]) -> ([a] -> b -> b) -> FieldDescr b commaListField = commaListFieldWithSep fsep
163
commaListField :: String -> (a -> Doc) -> ReadP [a] a -> (b -> [a]) -> ([a] -> b -> b) -> FieldDescr b commaListField = commaListFieldWithSep fsep
163
commaListField = commaListFieldWithSep fsep
43
false
true
0
12
44
76
40
36
null
null
shouya/thinking-dumps
wys48h/code/Primitive.hs
mit
cons [x, DottedList xs s] = return $ DottedList (x:xs) s
56
cons [x, DottedList xs s] = return $ DottedList (x:xs) s
56
cons [x, DottedList xs s] = return $ DottedList (x:xs) s
56
false
false
0
8
10
37
18
19
null
null
brendanhay/gogol
gogol-apps-calendar/gen/Network/Google/AppsCalendar/Types/Product.hs
mpl-2.0
-- | Token used to access the next page of this result. Omitted if no further -- results are available, in which case nextSyncToken is provided. sNextPageToken :: Lens' Settings (Maybe Text) sNextPageToken = lens _sNextPageToken (\ s a -> s{_sNextPageToken = a})
270
sNextPageToken :: Lens' Settings (Maybe Text) sNextPageToken = lens _sNextPageToken (\ s a -> s{_sNextPageToken = a})
125
sNextPageToken = lens _sNextPageToken (\ s a -> s{_sNextPageToken = a})
79
true
true
1
9
50
52
26
26
null
null
bitc/omegagb
src/Cpu.hs
gpl-2.0
mcti 0x32 _ = (LDD True, 8, 0)
62
mcti 0x32 _ = (LDD True, 8, 0)
62
mcti 0x32 _ = (LDD True, 8, 0)
62
false
false
0
6
39
25
12
13
null
null
keithodulaigh/Hets
THF/StaticAnalysisTHF.hs
gpl-2.0
thfTopLevelTypeToKind :: THFTopLevelType -> Maybe Kind thfTopLevelTypeToKind tlt = case tlt of T0TLT_THF_Binary_Type bt -> thfBinaryTypeToKind bt T0TLT_Defined_Type _ -> Just Kind _ -> Nothing
204
thfTopLevelTypeToKind :: THFTopLevelType -> Maybe Kind thfTopLevelTypeToKind tlt = case tlt of T0TLT_THF_Binary_Type bt -> thfBinaryTypeToKind bt T0TLT_Defined_Type _ -> Just Kind _ -> Nothing
204
thfTopLevelTypeToKind tlt = case tlt of T0TLT_THF_Binary_Type bt -> thfBinaryTypeToKind bt T0TLT_Defined_Type _ -> Just Kind _ -> Nothing
149
false
true
0
8
36
55
25
30
null
null
pradyuman/haskell
tree.hs
mit
delete (Node _ left right) = Node maxValue (treeDelete maxValue left) right where maxValue = treeMax left
107
delete (Node _ left right) = Node maxValue (treeDelete maxValue left) right where maxValue = treeMax left
107
delete (Node _ left right) = Node maxValue (treeDelete maxValue left) right where maxValue = treeMax left
107
false
false
1
7
18
50
21
29
null
null
CindyLinz/Haskell.js
trans/src/Desugar/Where.hs
mit
deWhereSplice (ParenSplice l exp) = ParenSplice (id l) (deWhereExp exp)
71
deWhereSplice (ParenSplice l exp) = ParenSplice (id l) (deWhereExp exp)
71
deWhereSplice (ParenSplice l exp) = ParenSplice (id l) (deWhereExp exp)
71
false
false
0
7
9
34
16
18
null
null
JacquesCarette/literate-scientific-software
code/drasil-lang/Language/Drasil/Symbol.hs
bsd-2-clause
unicodeConv (Concat ss) = Concat $ map unicodeConv ss
53
unicodeConv (Concat ss) = Concat $ map unicodeConv ss
53
unicodeConv (Concat ss) = Concat $ map unicodeConv ss
53
false
false
0
7
8
24
11
13
null
null
DanielSchuessler/hstri
Triangulation/PreTriangulation.hs
gpl-3.0
tINormalArcs :: PreTriangulation tr => tr -> [INormalArc] tINormalArcs = concatMap normalArcList . pt_tetrahedra
112
tINormalArcs :: PreTriangulation tr => tr -> [INormalArc] tINormalArcs = concatMap normalArcList . pt_tetrahedra
112
tINormalArcs = concatMap normalArcList . pt_tetrahedra
54
false
true
0
9
13
38
17
21
null
null
michaelficarra/purescript
src/Language/PureScript/TypeChecker/Types.hs
mit
inferLetBinding _ _ _ _ = internalError "Invalid argument to inferLetBinding"
77
inferLetBinding _ _ _ _ = internalError "Invalid argument to inferLetBinding"
77
inferLetBinding _ _ _ _ = internalError "Invalid argument to inferLetBinding"
77
false
false
0
5
10
18
8
10
null
null
jdpage/xmonad-config
lib/XMonad/Util/MPD.hs
mit
seekcur :: (Functor m, MonadMPD m) => Seconds -> m () seekcur t = do cs <- currentSong case cs of Just sg -> case sgIndex sg of Just idx -> seek idx t Nothing -> return () Nothing -> return ()
242
seekcur :: (Functor m, MonadMPD m) => Seconds -> m () seekcur t = do cs <- currentSong case cs of Just sg -> case sgIndex sg of Just idx -> seek idx t Nothing -> return () Nothing -> return ()
242
seekcur t = do cs <- currentSong case cs of Just sg -> case sgIndex sg of Just idx -> seek idx t Nothing -> return () Nothing -> return ()
188
false
true
0
14
91
104
48
56
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Compiler.hs
bsd-3-clause
compileExpr (ModI e1 e2) = compileTwoSubExpr "mod32" e1 e2
58
compileExpr (ModI e1 e2) = compileTwoSubExpr "mod32" e1 e2
58
compileExpr (ModI e1 e2) = compileTwoSubExpr "mod32" e1 e2
58
false
false
0
7
8
24
11
13
null
null
bjpop/berp
libs/src/Berp/Compile/PrimName.hs
bsd-3-clause
break :: Exp break = prim "break"
33
break :: Exp break = prim "break"
33
break = prim "break"
20
false
true
0
6
6
21
8
13
null
null
hvr/multi-ghc-travis
src/HaskellCI/Bash/Template.hs
bsd-3-clause
defaultZ :: Z defaultZ = Z { zJobs = [] , zRegendata = "[]" , zBlocks = [] , zTestsCond = "1" , zBenchCond = "1" , zApt = [] , zNotNull = not . null , zUnwords = unwords }
225
defaultZ :: Z defaultZ = Z { zJobs = [] , zRegendata = "[]" , zBlocks = [] , zTestsCond = "1" , zBenchCond = "1" , zApt = [] , zNotNull = not . null , zUnwords = unwords }
225
defaultZ = Z { zJobs = [] , zRegendata = "[]" , zBlocks = [] , zTestsCond = "1" , zBenchCond = "1" , zApt = [] , zNotNull = not . null , zUnwords = unwords }
211
false
true
0
8
94
81
46
35
null
null
henvic/plc
src/IntroducaoAProgramacaoFuncionalEHaskell.hs
cc0-1.0
-- conjuntos: união, interseção, diferença member e [] = False
63
member e [] = False
19
member e [] = False
19
true
false
0
6
10
14
7
7
null
null
hanshoglund/reenact
src/Control/Reactive/Util.hs
bsd-3-clause
- | -- Divide a list into parts of maximum length n. -- divideList :: Int -> [a] -> [[a]] divideList n xs | length xs <= n = [xs] | otherwise = [take n xs] ++ (divideList n $ drop n xs)
194
divideList :: Int -> [a] -> [[a]] divideList n xs | length xs <= n = [xs] | otherwise = [take n xs] ++ (divideList n $ drop n xs)
137
divideList n xs | length xs <= n = [xs] | otherwise = [take n xs] ++ (divideList n $ drop n xs)
103
true
true
3
11
51
88
46
42
null
null
rahulmutt/ghcvm
compiler/Eta/Prelude/PrelNames.hs
bsd-3-clause
decodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "decodeDoubleInteger") decodeDoubleIntegerIdKey
105
decodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "decodeDoubleInteger") decodeDoubleIntegerIdKey
105
decodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "decodeDoubleInteger") decodeDoubleIntegerIdKey
105
false
false
0
7
6
19
9
10
null
null
emptylambda/BLT
src/Boogie/Util.hs
gpl-3.0
functionExpr name pos = attachPos pos . Var $ functionConst name
64
functionExpr name pos = attachPos pos . Var $ functionConst name
64
functionExpr name pos = attachPos pos . Var $ functionConst name
64
false
false
0
7
10
25
11
14
null
null
denisshevchenko/breadu.info
src/lib/BreadU/Pages/Content/Errors/Messages.hs
mit
buIncorrectNumberErrorMessage En = "Please enter BU value as an integer (or decimal) number."
93
buIncorrectNumberErrorMessage En = "Please enter BU value as an integer (or decimal) number."
93
buIncorrectNumberErrorMessage En = "Please enter BU value as an integer (or decimal) number."
93
false
false
0
5
12
9
4
5
null
null
graninas/The-Amoeba-World
src/Amoeba/Middleware/Math/Geometry.hs
gpl-3.0
relativeCorners = [ leftUpP, leftDownP, rightUpP, rightDownP ]
62
relativeCorners = [ leftUpP, leftDownP, rightUpP, rightDownP ]
62
relativeCorners = [ leftUpP, leftDownP, rightUpP, rightDownP ]
62
false
false
1
5
7
21
11
10
null
null
GaloisInc/halvm-ghc
compiler/typecheck/TcSplice.hs
bsd-3-clause
-- tcUntypedBracket :: HsBracket Name -> [PendingRnSplice] -> ExpRhoType -> TcM (HsExpr TcId) tcUntypedBracket brack ps res_ty = do { traceTc "tc_bracket untyped" (ppr brack $$ ppr ps) ; ps' <- mapM tcPendingSplice ps ; meta_ty <- tcBrackTy brack ; traceTc "tc_bracket done untyped" (ppr meta_ty) ; tcWrapResultO (Shouldn'tHappenOrigin "untyped bracket") (HsTcBracketOut brack ps') meta_ty res_ty }
451
tcUntypedBracket brack ps res_ty = do { traceTc "tc_bracket untyped" (ppr brack $$ ppr ps) ; ps' <- mapM tcPendingSplice ps ; meta_ty <- tcBrackTy brack ; traceTc "tc_bracket done untyped" (ppr meta_ty) ; tcWrapResultO (Shouldn'tHappenOrigin "untyped bracket") (HsTcBracketOut brack ps') meta_ty res_ty }
357
tcUntypedBracket brack ps res_ty = do { traceTc "tc_bracket untyped" (ppr brack $$ ppr ps) ; ps' <- mapM tcPendingSplice ps ; meta_ty <- tcBrackTy brack ; traceTc "tc_bracket done untyped" (ppr meta_ty) ; tcWrapResultO (Shouldn'tHappenOrigin "untyped bracket") (HsTcBracketOut brack ps') meta_ty res_ty }
357
true
false
0
10
109
104
49
55
null
null
k32/visualsgsn
src/Text/LogMerger/Logs/LinuxRB.hs
unlicense
entry ∷ Tags → Parser SGSNBasicEntry entry tags = do (d, t) ← entryHead <?> "RB_entry_head" txt ← matchManyTill anyChar (() <$ entryHead <|> endOfInput) let t'' = case M.lookup t tags of Nothing → "???" Just "undefined_tag" → "tag #" ++ show t Just x → fmap (toEnum . fromIntegral) $ B.unpack x return BasicLogEntry { _basic_date = posixSecondsToUTCTime (fromIntegral d) , _basic_origin = [OData t''] , _basic_text = txt }
496
entry ∷ Tags → Parser SGSNBasicEntry entry tags = do (d, t) ← entryHead <?> "RB_entry_head" txt ← matchManyTill anyChar (() <$ entryHead <|> endOfInput) let t'' = case M.lookup t tags of Nothing → "???" Just "undefined_tag" → "tag #" ++ show t Just x → fmap (toEnum . fromIntegral) $ B.unpack x return BasicLogEntry { _basic_date = posixSecondsToUTCTime (fromIntegral d) , _basic_origin = [OData t''] , _basic_text = txt }
496
entry tags = do (d, t) ← entryHead <?> "RB_entry_head" txt ← matchManyTill anyChar (() <$ entryHead <|> endOfInput) let t'' = case M.lookup t tags of Nothing → "???" Just "undefined_tag" → "tag #" ++ show t Just x → fmap (toEnum . fromIntegral) $ B.unpack x return BasicLogEntry { _basic_date = posixSecondsToUTCTime (fromIntegral d) , _basic_origin = [OData t''] , _basic_text = txt }
453
false
true
0
16
145
174
85
89
null
null
mtolly/rhythm
src/Data/Rhythm/Parser.hs
gpl-3.0
warn :: String -> Parser a () warn str = Parser $ const ([Message str []], Right ())
84
warn :: String -> Parser a () warn str = Parser $ const ([Message str []], Right ())
84
warn str = Parser $ const ([Message str []], Right ())
54
false
true
0
10
17
53
26
27
null
null
TomMD/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
failMClassOpKey = mkPreludeMiscIdUnique 170
57
failMClassOpKey = mkPreludeMiscIdUnique 170
57
failMClassOpKey = mkPreludeMiscIdUnique 170
57
false
false
0
5
17
9
4
5
null
null
GaloisInc/saw-script
saw-core/src/Verifier/SAW/SharedTerm.hs
bsd-3-clause
-- | Multiplication of @IntMod@ values -- -- > intModMul : (n : Nat) -> IntMod n -> IntMod n -> IntMod n; scIntModMul :: SharedContext -> Term -> Term -> Term -> IO Term scIntModMul sc n x y = scGlobalApply sc "Prelude.intModMul" [n,x,y]
237
scIntModMul :: SharedContext -> Term -> Term -> Term -> IO Term scIntModMul sc n x y = scGlobalApply sc "Prelude.intModMul" [n,x,y]
131
scIntModMul sc n x y = scGlobalApply sc "Prelude.intModMul" [n,x,y]
67
true
true
0
9
44
58
31
27
null
null