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
limansky/Hascal
src/Hascal.hs
bsd-3-clause
importICS fn = do putStrLn $ "Importing file:" ++ fn h <- openFile fn ReadMode cont <- hGetContents h case icalToEvents cont of Nothing -> putStrLn "Failed to parse ICS file" (Just es) -> mapM (putStrLn . show) es >> return () hClose h
272
importICS fn = do putStrLn $ "Importing file:" ++ fn h <- openFile fn ReadMode cont <- hGetContents h case icalToEvents cont of Nothing -> putStrLn "Failed to parse ICS file" (Just es) -> mapM (putStrLn . show) es >> return () hClose h
272
importICS fn = do putStrLn $ "Importing file:" ++ fn h <- openFile fn ReadMode cont <- hGetContents h case icalToEvents cont of Nothing -> putStrLn "Failed to parse ICS file" (Just es) -> mapM (putStrLn . show) es >> return () hClose h
272
false
false
0
13
80
100
44
56
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/enumFromThenTo_6.hs
mit
takeWhile0 p x xs MyTrue = Nil
30
takeWhile0 p x xs MyTrue = Nil
30
takeWhile0 p x xs MyTrue = Nil
30
false
false
0
5
6
15
7
8
null
null
koterpillar/tianbar
src/System/Tianbar/Callbacks.hs
mit
newCallbackT :: (MonadState Callbacks m, ToJSON r) => m (Callback r, CallbackIndex) newCallbackT = do host <- use cbHost newIndex <- use cbNextIndex cbNextIndex += 1 return (host newIndex . toJSON, CallbackIndex newIndex)
237
newCallbackT :: (MonadState Callbacks m, ToJSON r) => m (Callback r, CallbackIndex) newCallbackT = do host <- use cbHost newIndex <- use cbNextIndex cbNextIndex += 1 return (host newIndex . toJSON, CallbackIndex newIndex)
237
newCallbackT = do host <- use cbHost newIndex <- use cbNextIndex cbNextIndex += 1 return (host newIndex . toJSON, CallbackIndex newIndex)
153
false
true
0
10
48
89
42
47
null
null
mathhun/stack
src/Path/IO.hs
bsd-3-clause
-- | Make a directory tree, creating parents if needed. createTree :: MonadIO m => Path b Dir -> m () createTree = liftIO . D.createDirectoryIfMissing True . toFilePath
168
createTree :: MonadIO m => Path b Dir -> m () createTree = liftIO . D.createDirectoryIfMissing True . toFilePath
112
createTree = liftIO . D.createDirectoryIfMissing True . toFilePath
66
true
true
0
8
28
46
22
24
null
null
haskell/haddock
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
bsd-2-clause
ppPatSigType :: Unicode -> Qualification -> LHsSigType DocNameI -> Html ppPatSigType unicode qual typ = let emptyCtxts = patSigContext typ in ppLSigType unicode qual emptyCtxts typ
182
ppPatSigType :: Unicode -> Qualification -> LHsSigType DocNameI -> Html ppPatSigType unicode qual typ = let emptyCtxts = patSigContext typ in ppLSigType unicode qual emptyCtxts typ
182
ppPatSigType unicode qual typ = let emptyCtxts = patSigContext typ in ppLSigType unicode qual emptyCtxts typ
110
false
true
0
9
27
61
27
34
null
null
nevrenato/Hets_Fork
OWL2/ProfilesAndSublogics.hs
gpl-2.0
sMorph :: OWLMorphism -> ProfSub sMorph m = bottomS {sublogic = slMor m}
72
sMorph :: OWLMorphism -> ProfSub sMorph m = bottomS {sublogic = slMor m}
72
sMorph m = bottomS {sublogic = slMor m}
39
false
true
0
8
12
38
17
21
null
null
keera-studios/hsQt
Qtc/Enums/Core/QDir.hs
bsd-2-clause
eAllDirs :: Filter eAllDirs = ieFilter $ 1024
47
eAllDirs :: Filter eAllDirs = ieFilter $ 1024
47
eAllDirs = ieFilter $ 1024
28
false
true
0
6
9
18
8
10
null
null
kawamuray/ganeti
src/Ganeti/HTools/Program/Hbal.hs
gpl-2.0
execCancelWrapper anno master nl il cref alljss = do cancel <- readIORef cref if cancel > 0 then do putStrLn $ "Exiting early due to user request, " ++ show (length alljss) ++ " jobset(s) remaining." return $ Ok () else execJobSet anno master nl il cref alljss -- | Execute an ent...
331
execCancelWrapper anno master nl il cref alljss = do cancel <- readIORef cref if cancel > 0 then do putStrLn $ "Exiting early due to user request, " ++ show (length alljss) ++ " jobset(s) remaining." return $ Ok () else execJobSet anno master nl il cref alljss -- | Execute an ent...
331
execCancelWrapper anno master nl il cref alljss = do cancel <- readIORef cref if cancel > 0 then do putStrLn $ "Exiting early due to user request, " ++ show (length alljss) ++ " jobset(s) remaining." return $ Ok () else execJobSet anno master nl il cref alljss -- | Execute an ent...
331
false
false
0
14
93
94
44
50
null
null
mpickering/HaRe
test/UtilsSpec.hs
bsd-3-clause
spec :: Spec spec = do describe "locToExp on ParsedSource" $ do it "finds the largest leftmost expression contained in a given region #1" $ do (t, _toks,_) <- ct $ parsedFileGhc "./TypeUtils/B.hs" let parsed = GHC.pm_parsed_source $ GHC.tm_parsed_module t let (Just expr) = locToExp (7,7) (7,43...
22,815
spec :: Spec spec = do describe "locToExp on ParsedSource" $ do it "finds the largest leftmost expression contained in a given region #1" $ do (t, _toks,_) <- ct $ parsedFileGhc "./TypeUtils/B.hs" let parsed = GHC.pm_parsed_source $ GHC.tm_parsed_module t let (Just expr) = locToExp (7,7) (7,43...
22,815
spec = do describe "locToExp on ParsedSource" $ do it "finds the largest leftmost expression contained in a given region #1" $ do (t, _toks,_) <- ct $ parsedFileGhc "./TypeUtils/B.hs" let parsed = GHC.pm_parsed_source $ GHC.tm_parsed_module t let (Just expr) = locToExp (7,7) (7,43) parsed :: M...
22,802
false
true
96
25
5,738
2,910
1,524
1,386
null
null
wkoiking/fieldequip
src/Core/Interval.hs
bsd-3-clause
joinIntervals :: (Eq a, Monoid a) => [Interval a] -> [Interval a] joinIntervals = sanitize . foldr joinInterval [] . sortBy (comparing fst)
139
joinIntervals :: (Eq a, Monoid a) => [Interval a] -> [Interval a] joinIntervals = sanitize . foldr joinInterval [] . sortBy (comparing fst)
139
joinIntervals = sanitize . foldr joinInterval [] . sortBy (comparing fst)
73
false
true
0
10
22
72
34
38
null
null
wskplho/stack
src/Stack/Options.hs
bsd-3-clause
initOptsParser :: Parser InitOpts initOptsParser = InitOpts <$> method <*> overwrite <*> fmap not ignoreSubDirs where ignoreSubDirs = flag False True (long "ignore-subdirs" <> help "Do not search for .cabal files in sub directories") ...
1,254
initOptsParser :: Parser InitOpts initOptsParser = InitOpts <$> method <*> overwrite <*> fmap not ignoreSubDirs where ignoreSubDirs = flag False True (long "ignore-subdirs" <> help "Do not search for .cabal files in sub directories") ...
1,254
initOptsParser = InitOpts <$> method <*> overwrite <*> fmap not ignoreSubDirs where ignoreSubDirs = flag False True (long "ignore-subdirs" <> help "Do not search for .cabal files in sub directories") overwrite = flag False ...
1,220
false
true
0
10
460
217
105
112
null
null
machine-intelligence/Botworld
ct2hs.hs
bsd-3-clause
name :: Parser Name name = (:) <$> satisfy isAlpha_ <*> many (satisfy isAlphaNum_) where isAlpha_ = (||) <$> isAlpha <*> (== '_') isAlphaNum_ = (||) <$> isAlphaNum <*> (== '_')
180
name :: Parser Name name = (:) <$> satisfy isAlpha_ <*> many (satisfy isAlphaNum_) where isAlpha_ = (||) <$> isAlpha <*> (== '_') isAlphaNum_ = (||) <$> isAlphaNum <*> (== '_')
180
name = (:) <$> satisfy isAlpha_ <*> many (satisfy isAlphaNum_) where isAlpha_ = (||) <$> isAlpha <*> (== '_') isAlphaNum_ = (||) <$> isAlphaNum <*> (== '_')
160
false
true
0
8
34
76
43
33
null
null
eklavya/Idris-dev
src/Idris/Docs.hs
bsd-3-clause
showDoc ist d | nullDocstring d = empty | otherwise = text " -- " <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) d
173
showDoc ist d | nullDocstring d = empty | otherwise = text " -- " <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) d
173
showDoc ist d | nullDocstring d = empty | otherwise = text " -- " <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) d
173
false
false
0
12
45
77
34
43
null
null
kig/tomtegebra
Tomtegebra/VBO.hs
gpl-3.0
-- | Creates a 'BufferObject' for the given list of 'Storable' elements. -- -- E.g. @my_vbo \<- createVBO [1,2,3,4::GLfloat]@ createVBO :: Storable a => [a] -> IO BufferObject createVBO elems = do [vbo] <- genObjectNames 1 bindBuffer ArrayBuffer $= Just vbo arr <- newListArray (0, length elems - 1) elems ...
646
createVBO :: Storable a => [a] -> IO BufferObject createVBO elems = do [vbo] <- genObjectNames 1 bindBuffer ArrayBuffer $= Just vbo arr <- newListArray (0, length elems - 1) elems -- Data.Array.MArray withStorableArray arr (\ptr -> -- Data.Array.Storable bufferData ArrayBuffer $...
518
createVBO elems = do [vbo] <- genObjectNames 1 bindBuffer ArrayBuffer $= Just vbo arr <- newListArray (0, length elems - 1) elems -- Data.Array.MArray withStorableArray arr (\ptr -> -- Data.Array.Storable bufferData ArrayBuffer $= (ptrsize elems, ptr, StaticDraw)) bindBuffer...
468
true
true
0
12
156
188
91
97
null
null
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles
Algebraic_DataTypes/PhoneExercise.hs
gpl-3.0
mapAlphabetToButton :: Alphabet -> (Digit, [Alphabet]) mapAlphabetToButton a = case find (\(_, as) -> elem (toLower a) as) keypad of Just k -> k _ -> undefined
179
mapAlphabetToButton :: Alphabet -> (Digit, [Alphabet]) mapAlphabetToButton a = case find (\(_, as) -> elem (toLower a) as) keypad of Just k -> k _ -> undefined
179
mapAlphabetToButton a = case find (\(_, as) -> elem (toLower a) as) keypad of Just k -> k _ -> undefined
124
false
true
0
11
46
76
40
36
null
null
ocharles/opaleye-tf
src/Opaleye/TF/Text.hs
bsd-3-clause
chr :: Expr s 'PGInteger -> Expr s 'PGText chr (Expr a) = Expr (Op.FunExpr "chr" [a])
85
chr :: Expr s 'PGInteger -> Expr s 'PGText chr (Expr a) = Expr (Op.FunExpr "chr" [a])
85
chr (Expr a) = Expr (Op.FunExpr "chr" [a])
42
false
true
0
8
16
58
27
31
null
null
christiaanb/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
metaTyVarInfo :: TcTyVar -> MetaInfo metaTyVarInfo tv = ASSERT( isTcTyVar tv ) case tcTyVarDetails tv of MetaTv { mtv_info = info } -> info _ -> pprPanic "metaTyVarInfo" (ppr tv)
196
metaTyVarInfo :: TcTyVar -> MetaInfo metaTyVarInfo tv = ASSERT( isTcTyVar tv ) case tcTyVarDetails tv of MetaTv { mtv_info = info } -> info _ -> pprPanic "metaTyVarInfo" (ppr tv)
196
metaTyVarInfo tv = ASSERT( isTcTyVar tv ) case tcTyVarDetails tv of MetaTv { mtv_info = info } -> info _ -> pprPanic "metaTyVarInfo" (ppr tv)
159
false
true
0
11
47
68
33
35
null
null
kyren/hsgb
lib/Gameboy/Instructions.hs
unlicense
encodeInstruction DEC_SP = [0x3b]
33
encodeInstruction DEC_SP = [0x3b]
33
encodeInstruction DEC_SP = [0x3b]
33
false
false
1
5
3
15
6
9
null
null
comius/haskell-mpfr
src/Numeric/Rounded/Interval.hs
lgpl-3.0
{- -- | Deflate an interval by shrinking it from both ends. -- -- >>> deflate 3.0 (-4.0 ... 10.0) -- -1.0 ... 7.0 -- -- >>> deflate 2.0 (-1.0 ... 1.0) -- Empty -- -- >>> deflate 1.0 empty -- Empty deflate :: => a -> Interval a -> Interval a deflate _ Empty = Empty deflate x (I a b) | a' <= b' = I a' b' ...
786
(<!) :: Precision p => Interval p -> Interval p -> Bool I _ bx <! I ay _ = coerce bx < ay
90
I _ bx <! I ay _ = coerce bx < ay
33
true
true
2
10
223
73
38
35
null
null
chwthewke/horbits
testsuite/Horbits/KerbalDateTimeTest.hs
bsd-3-clause
prop_ModifyingIntegralComponentVariesDurationBySameAmount :: Property prop_ModifyingIntegralComponentVariesDurationBySameAmount = forAll ((,,) <$> genKerbalTime <*> elements integralComponentWeights <*> arbitrary) $ uncurry3 checkModifyingIntegralComponentVariesDurationAccordingToWeight where uncurry3 f (...
338
prop_ModifyingIntegralComponentVariesDurationBySameAmount :: Property prop_ModifyingIntegralComponentVariesDurationBySameAmount = forAll ((,,) <$> genKerbalTime <*> elements integralComponentWeights <*> arbitrary) $ uncurry3 checkModifyingIntegralComponentVariesDurationAccordingToWeight where uncurry3 f (...
338
prop_ModifyingIntegralComponentVariesDurationBySameAmount = forAll ((,,) <$> genKerbalTime <*> elements integralComponentWeights <*> arbitrary) $ uncurry3 checkModifyingIntegralComponentVariesDurationAccordingToWeight where uncurry3 f (a, b, c) = f a b c
268
false
true
0
11
41
71
37
34
null
null
mbrock/HBEAM
src/Language/Erlang/BEAM/Emulator.hs
gpl-3.0
getStack :: Int -> Emulation EValue getStack i = do p <- asks emuProcess liftIO $ do stack <- readIORef (procStack p) sp <- readIORef (procSP p) readArray stack (sp - i)
239
getStack :: Int -> Emulation EValue getStack i = do p <- asks emuProcess liftIO $ do stack <- readIORef (procStack p) sp <- readIORef (procSP p) readArray stack (sp - i)
239
getStack i = do p <- asks emuProcess liftIO $ do stack <- readIORef (procStack p) sp <- readIORef (procSP p) readArray stack (sp - i)
203
false
true
0
13
101
85
38
47
null
null
brendanhay/gogol
gogol-servicemanagement/gen/Network/Google/ServiceManagement/Types/Product.hs
mpl-2.0
-- | Percentage of completion of this operation, ranging from 0 to 100. omProgressPercentage :: Lens' OperationMetadata (Maybe Int32) omProgressPercentage = lens _omProgressPercentage (\ s a -> s{_omProgressPercentage = a}) . mapping _Coerce
255
omProgressPercentage :: Lens' OperationMetadata (Maybe Int32) omProgressPercentage = lens _omProgressPercentage (\ s a -> s{_omProgressPercentage = a}) . mapping _Coerce
183
omProgressPercentage = lens _omProgressPercentage (\ s a -> s{_omProgressPercentage = a}) . mapping _Coerce
121
true
true
0
10
46
55
28
27
null
null
m-lopez/jack
src/Repl/Repl.hs
mit
-- | Prints a definition. showDef :: (ExprName, QType, Expr) -> String showDef (ExprName s, t, e) = "defined " ++ show s ++ ": " ++ show t ++ " := " ++ show e
160
showDef :: (ExprName, QType, Expr) -> String showDef (ExprName s, t, e) = "defined " ++ show s ++ ": " ++ show t ++ " := " ++ show e
134
showDef (ExprName s, t, e) = "defined " ++ show s ++ ": " ++ show t ++ " := " ++ show e
89
true
true
0
10
37
73
37
36
null
null
kishoredbn/barrelfish
tools/flounder/MsgFragments.hs
mit
bitsizeof_builtin _ ErrVal = 32
31
bitsizeof_builtin _ ErrVal = 32
31
bitsizeof_builtin _ ErrVal = 32
31
false
false
0
5
4
11
5
6
null
null
pacak/cuddly-bassoon
hashable-1.2.6.0/Data/Hashable/SipHash.hs
bsd-3-clause
finalize :: Int -> (Word64 -> r) -> Sip -> r finalize d k st@Sip{..} | d == 4 = sipRound (sipRound (sipRound (sipRound k'))) st' | otherwise = runRounds d k' st' where k' Sip{..} = k $! v0 `xor` v1 `xor` v2 `xor` v3 st' = st{ v2 = v2 `xor` 0xff }
275
finalize :: Int -> (Word64 -> r) -> Sip -> r finalize d k st@Sip{..} | d == 4 = sipRound (sipRound (sipRound (sipRound k'))) st' | otherwise = runRounds d k' st' where k' Sip{..} = k $! v0 `xor` v1 `xor` v2 `xor` v3 st' = st{ v2 = v2 `xor` 0xff }
275
finalize d k st@Sip{..} | d == 4 = sipRound (sipRound (sipRound (sipRound k'))) st' | otherwise = runRounds d k' st' where k' Sip{..} = k $! v0 `xor` v1 `xor` v2 `xor` v3 st' = st{ v2 = v2 `xor` 0xff }
230
false
true
2
12
83
152
80
72
null
null
ssanj/YorgeyCourse
src/Chapter2/LogAnalysis.hs
mit
isNumeric :: String -> Bool isNumeric [] = False
48
isNumeric :: String -> Bool isNumeric [] = False
48
isNumeric [] = False
20
false
true
0
6
8
20
10
10
null
null
ddssff/process-listlike-old
System/Process/ListLike/Chunks.hs
mit
-- | Based on the 'ExitCode', either return a Result Chunk or throw an -- IO error similar to what 'System.Process.readProcess' would have -- thrown. throwProcessResult :: String -> String -> ExitCode -> IO (Chunk a) throwProcessResult _ _ ExitSuccess = return $ Result ExitSuccess
281
throwProcessResult :: String -> String -> ExitCode -> IO (Chunk a) throwProcessResult _ _ ExitSuccess = return $ Result ExitSuccess
131
throwProcessResult _ _ ExitSuccess = return $ Result ExitSuccess
64
true
true
0
10
44
49
25
24
null
null
shmookey/bc-tools
src/Munt/App.hs
bsd-3-clause
stdout :: Sink B8.ByteString IO () stdout = CL.mapM_ B8.putStr
62
stdout :: Sink B8.ByteString IO () stdout = CL.mapM_ B8.putStr
62
stdout = CL.mapM_ B8.putStr
27
false
true
1
6
9
35
14
21
null
null
urbanslug/ghc
compiler/types/TyCon.hs
bsd-3-clause
-- | Extract an 'AlgTyConRhs' with information about data constructors from an -- algebraic or tuple 'TyCon'. Panics for any other sort of 'TyCon' algTyConRhs :: TyCon -> AlgTyConRhs algTyConRhs (AlgTyCon {algTcRhs = rhs}) = rhs
228
algTyConRhs :: TyCon -> AlgTyConRhs algTyConRhs (AlgTyCon {algTcRhs = rhs}) = rhs
81
algTyConRhs (AlgTyCon {algTcRhs = rhs}) = rhs
45
true
true
3
7
35
39
19
20
null
null
sopvop/snap-server
test/Snap/Internal/Http/Server/Session/Tests.hs
bsd-3-clause
testWeirdMissingSlash :: Test testWeirdMissingSlash = testCase "session/weirdMissingSlash" $ do do let req = "GET foo/bar?z HTTP/1.0\r\n\r\n" out <- getSessionOutput [req] snap assertBool "missing slash" $ expected1 `S.isSuffixOf` out do let req = "GET /foo/bar?z HTTP/1.0\r\n\r\n" out <- getSess...
1,020
testWeirdMissingSlash :: Test testWeirdMissingSlash = testCase "session/weirdMissingSlash" $ do do let req = "GET foo/bar?z HTTP/1.0\r\n\r\n" out <- getSessionOutput [req] snap assertBool "missing slash" $ expected1 `S.isSuffixOf` out do let req = "GET /foo/bar?z HTTP/1.0\r\n\r\n" out <- getSess...
1,020
testWeirdMissingSlash = testCase "session/weirdMissingSlash" $ do do let req = "GET foo/bar?z HTTP/1.0\r\n\r\n" out <- getSessionOutput [req] snap assertBool "missing slash" $ expected1 `S.isSuffixOf` out do let req = "GET /foo/bar?z HTTP/1.0\r\n\r\n" out <- getSessionOutput [req] snap asser...
990
false
true
0
16
381
226
109
117
null
null
shlevy/ghc
compiler/basicTypes/VarEnv.hs
bsd-3-clause
emptyDVarEnv :: DVarEnv a emptyDVarEnv = emptyUDFM
50
emptyDVarEnv :: DVarEnv a emptyDVarEnv = emptyUDFM
50
emptyDVarEnv = emptyUDFM
24
false
true
0
5
6
14
7
7
null
null
ocramz/monad-bayes
models/HMM.hs
mit
scores :: [Vector Double] scores = map (\y -> fromList $ map (fromLogDomain . (\x -> pdf (emission x) y)) states) values
120
scores :: [Vector Double] scores = map (\y -> fromList $ map (fromLogDomain . (\x -> pdf (emission x) y)) states) values
120
scores = map (\y -> fromList $ map (fromLogDomain . (\x -> pdf (emission x) y)) states) values
94
false
true
0
16
21
72
35
37
null
null
hvr/jhc
src/Info/Binary.hs
mit
cb n x = (n, Binable x, typeOf x)
33
cb n x = (n, Binable x, typeOf x)
33
cb n x = (n, Binable x, typeOf x)
33
false
false
0
6
8
27
13
14
null
null
Kludgy/hdevtools
src/CommandLoop.hs
mit
logAction :: IORef State -> ClientSend -> GHC.DynFlags -> GHC.Severity -> GHC.SrcSpan -> Outputable.PprStyle -> ErrUtils.MsgDoc -> IO () logAction state clientSend dflags severity srcspan style msg = let out = Outputable.renderWithStyle dflags fullMsg style _ = severity in logActionSend state clientSend...
768
logAction :: IORef State -> ClientSend -> GHC.DynFlags -> GHC.Severity -> GHC.SrcSpan -> Outputable.PprStyle -> ErrUtils.MsgDoc -> IO () logAction state clientSend dflags severity srcspan style msg = let out = Outputable.renderWithStyle dflags fullMsg style _ = severity in logActionSend state clientSend...
768
logAction state clientSend dflags severity srcspan style msg = let out = Outputable.renderWithStyle dflags fullMsg style _ = severity in logActionSend state clientSend severity out where fullMsg = ErrUtils.mkLocMessage severity srcspan msg #else logAction :: IORef State -> ClientSend -> GHC.Severity...
631
false
true
0
14
138
128
61
67
null
null
JJ/linguist
samples/Haskell/maze-solving.hs
mit
solve' maze pos@(x, y) prevPos = let newPositions = [(x, y - 2), (x + 4, y), (x, y + 2), (x - 4, y)] notPrev pos' = pos' /= prevPos newPositions' = filter notPrev newPositions wallPositions = map (average pos) newPositions' zipped = zip newPositions' wallPositions legalMoves = filter (no...
375
solve' maze pos@(x, y) prevPos = let newPositions = [(x, y - 2), (x + 4, y), (x, y + 2), (x - 4, y)] notPrev pos' = pos' /= prevPos newPositions' = filter notPrev newPositions wallPositions = map (average pos) newPositions' zipped = zip newPositions' wallPositions legalMoves = filter (no...
375
solve' maze pos@(x, y) prevPos = let newPositions = [(x, y - 2), (x + 4, y), (x, y + 2), (x - 4, y)] notPrev pos' = pos' /= prevPos newPositions' = filter notPrev newPositions wallPositions = map (average pos) newPositions' zipped = zip newPositions' wallPositions legalMoves = filter (no...
375
false
false
0
11
91
156
84
72
null
null
ezyang/ghc
compiler/utils/Bag.hs
bsd-3-clause
anyBag :: (a -> Bool) -> Bag a -> Bool anyBag _ EmptyBag = False
71
anyBag :: (a -> Bool) -> Bag a -> Bool anyBag _ EmptyBag = False
71
anyBag _ EmptyBag = False
32
false
true
0
7
21
34
17
17
null
null
bitemyapp/hdph-rs
src/Control/Parallel/HdpH/Strategies.hs
bsd-3-clause
-- | @parClosureListClusterBy cluster uncluster@ is a generic parallel -- clustering strategy combinator for lists of Closures, evaluating -- clusters generated by @cluster@ in parallel. -- Clusters are distributed by lazy work stealing. -- The function @uncluster@ must be a /left inverse/ of @cluster@, -- that is @unc...
1,031
parClosureListClusterBy :: ([Closure a] -> [[Closure a]]) -> ([[Closure a]] -> [Closure a]) -> Closure (Strategy (Closure a)) -> Strategy [Closure a] parClosureListClusterBy cluster uncluster clo_strat = evalClusterBy cluster' uncluster' strat' ...
671
parClosureListClusterBy cluster uncluster clo_strat = evalClusterBy cluster' uncluster' strat' where cluster' = map toClosure . cluster uncluster' = uncluster . map unClosure -- strat' :: Strategy [Closure [Closure a]] strat' = parClosureList clo_strat'' -- clo_strat'' :: Closu...
449
true
true
4
12
260
172
92
80
null
null
y-kamiya/parallel-concurrent-haskell
src/Server/Kvs3/KvsMaster.hs
gpl-2.0
createDB :: [NodeId] -> Process Database createDB peers = spawnLocal $ do pids <- forM peers $ \nid -> do say $ "spawn on: " ++ show nid spawn nid $ $(mkStaticClosure 'worker) _ <- mapM_ monitor pids let handle = forever $ do receiveWait [ match handleNotification , match $ ...
500
createDB :: [NodeId] -> Process Database createDB peers = spawnLocal $ do pids <- forM peers $ \nid -> do say $ "spawn on: " ++ show nid spawn nid $ $(mkStaticClosure 'worker) _ <- mapM_ monitor pids let handle = forever $ do receiveWait [ match handleNotification , match $ ...
500
createDB peers = spawnLocal $ do pids <- forM peers $ \nid -> do say $ "spawn on: " ++ show nid spawn nid $ $(mkStaticClosure 'worker) _ <- mapM_ monitor pids let handle = forever $ do receiveWait [ match handleNotification , match $ handleRequest pids , matchAny $...
459
false
true
0
28
164
171
80
91
null
null
Hara-Laboratory/subleq-mips
TestRFix2.hs
gpl-3.0
prop_Lbi = testLSbi 3 lvui "lbuiTest"
38
prop_Lbi = testLSbi 3 lvui "lbuiTest"
38
prop_Lbi = testLSbi 3 lvui "lbuiTest"
38
false
false
0
5
6
13
6
7
null
null
shlevy/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
58
gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
58
gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
58
false
false
0
7
4
15
7
8
null
null
MichielDerhaeg/stack
src/Stack/Package.hs
bsd-3-clause
resolveFiles :: (MonadIO m, MonadLogger m, MonadThrow m, MonadReader Ctx m) => [Path Abs Dir] -- ^ Directories to look in. -> [DotCabalDescriptor] -- ^ Base names. -> [Text] -- ^ Extensions. -> m [(DotCabalDescriptor, Maybe DotCabalPath)] resolveFiles dirs names exts = forM names (\name -> liftM...
361
resolveFiles :: (MonadIO m, MonadLogger m, MonadThrow m, MonadReader Ctx m) => [Path Abs Dir] -- ^ Directories to look in. -> [DotCabalDescriptor] -- ^ Base names. -> [Text] -- ^ Extensions. -> m [(DotCabalDescriptor, Maybe DotCabalPath)] resolveFiles dirs names exts = forM names (\name -> liftM...
361
resolveFiles dirs names exts = forM names (\name -> liftM (name, ) (findCandidate dirs exts name))
102
false
true
0
12
76
123
66
57
null
null
dysinger/amazonka
amazonka-rds/gen/Network/AWS/RDS/Types.hs
mpl-2.0
-- | 'PendingModifiedValues' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'pmvAllocatedStorage' @::@ 'Maybe' 'Int' -- -- * 'pmvBackupRetentionPeriod' @::@ 'Maybe' 'Int' -- -- * 'pmvDBInstanceClass' @::@ 'Maybe' 'Text' -- -- * 'pmvDBInstanceIdentifier' @::@ 'Maybe' 'Text' -- -- * 'p...
1,090
pendingModifiedValues :: PendingModifiedValues pendingModifiedValues = PendingModifiedValues { _pmvDBInstanceClass = Nothing , _pmvAllocatedStorage = Nothing , _pmvMasterUserPassword = Nothing , _pmvPort = Nothing , _pmvBackupRetentionPeriod = Nothing , _pmvMultiAZ...
518
pendingModifiedValues = PendingModifiedValues { _pmvDBInstanceClass = Nothing , _pmvAllocatedStorage = Nothing , _pmvMasterUserPassword = Nothing , _pmvPort = Nothing , _pmvBackupRetentionPeriod = Nothing , _pmvMultiAZ = Nothing , _pmvEngineVersio...
471
true
true
0
7
255
101
72
29
null
null
jbracker/presentation-gen
src/PresentationGen/Types.hs
gpl-2.0
getAuthors :: SlideM [(String, [Int])] getAuthors = do meta <- getSlideMetaData return $ map (\(auth,a) -> (auth, map (read . trim) $ separateBy a ',')) $ combineAuthorAssocs $ filter (fieldFilter ["Author", "Associated"]) meta where combineAuthorAssocs :: MetaData -> MetaData combineAut...
606
getAuthors :: SlideM [(String, [Int])] getAuthors = do meta <- getSlideMetaData return $ map (\(auth,a) -> (auth, map (read . trim) $ separateBy a ',')) $ combineAuthorAssocs $ filter (fieldFilter ["Author", "Associated"]) meta where combineAuthorAssocs :: MetaData -> MetaData combineAut...
606
getAuthors = do meta <- getSlideMetaData return $ map (\(auth,a) -> (auth, map (read . trim) $ separateBy a ',')) $ combineAuthorAssocs $ filter (fieldFilter ["Author", "Associated"]) meta where combineAuthorAssocs :: MetaData -> MetaData combineAuthorAssocs (("Author", auth) : ("Associa...
567
false
true
7
17
130
246
123
123
null
null
soumith/fbthrift
thrift/lib/hs/Thrift/Protocol/Binary.hs
apache-2.0
parseBinaryMap :: ThriftType -> ThriftType -> Int32 -> P.Parser [(ThriftVal, ThriftVal)] parseBinaryMap kt vt n | n <= 0 = return [] | otherwise = do k <- parseBinaryValue kt v <- parseBinaryValue vt ((k,v) :) <$> parseBinaryMap kt vt (n-1)
269
parseBinaryMap :: ThriftType -> ThriftType -> Int32 -> P.Parser [(ThriftVal, ThriftVal)] parseBinaryMap kt vt n | n <= 0 = return [] | otherwise = do k <- parseBinaryValue kt v <- parseBinaryValue vt ((k,v) :) <$> parseBinaryMap kt vt (n-1)
269
parseBinaryMap kt vt n | n <= 0 = return [] | otherwise = do k <- parseBinaryValue kt v <- parseBinaryValue vt ((k,v) :) <$> parseBinaryMap kt vt (n-1)
180
false
true
0
11
69
119
58
61
null
null
polachok/hs-nginx
src/Nginx/Utils.hs
mit
numAndSizeDirective :: Text -> Parser (Integer, Size) numAndSizeDirective name = (,) <$> (string name *> skipSpace *> decimal) <*> (skipSpace *> size <* skipSpace <* char ';')
175
numAndSizeDirective :: Text -> Parser (Integer, Size) numAndSizeDirective name = (,) <$> (string name *> skipSpace *> decimal) <*> (skipSpace *> size <* skipSpace <* char ';')
175
numAndSizeDirective name = (,) <$> (string name *> skipSpace *> decimal) <*> (skipSpace *> size <* skipSpace <* char ';')
121
false
true
0
10
26
70
36
34
null
null
SimSaladin/hajong
hajong-server/src/Mahjong/Hand/Yaku/Builder.hs
mit
findMatch mp (x:xs) | matchProp mp x = Just (x, xs) | otherwise = findMatch mp xs & _Just._2 %~ (x:)
113
findMatch mp (x:xs) | matchProp mp x = Just (x, xs) | otherwise = findMatch mp xs & _Just._2 %~ (x:)
113
findMatch mp (x:xs) | matchProp mp x = Just (x, xs) | otherwise = findMatch mp xs & _Just._2 %~ (x:)
113
false
false
0
8
33
66
32
34
null
null
sixears/fluffy
src/Fluffy/Data/List.hs
mit
-- | generate a list of differences between xs & ys diff :: Eq a => [a] -> [a] -> [Diff a] diff xs ys = collapse Nothing $ DAD.getDiff xs ys where -- take a list of DAD.Diffs, convert to Diffs, spotting patterns of -- n -x- First followed by n -x- Second; collapsing those into n -x- Change collapse ::...
1,791
diff :: Eq a => [a] -> [a] -> [Diff a] diff xs ys = collapse Nothing $ DAD.getDiff xs ys where -- take a list of DAD.Diffs, convert to Diffs, spotting patterns of -- n -x- First followed by n -x- Second; collapsing those into n -x- Change collapse :: Eq a => Maybe (Either [a] [a]) -> [DAD.Diff a] -> [D...
1,738
diff xs ys = collapse Nothing $ DAD.getDiff xs ys where -- take a list of DAD.Diffs, convert to Diffs, spotting patterns of -- n -x- First followed by n -x- Second; collapsing those into n -x- Change collapse :: Eq a => Maybe (Either [a] [a]) -> [DAD.Diff a] -> [Diff a] collapse_ (Just (Left firs...
1,699
true
true
19
16
483
664
337
327
null
null
danr/hipspec
testsuite/prod/zeno_version/PropT42.hs
gpl-3.0
drop (S x) (_:xs) = drop x xs
29
drop (S x) (_:xs) = drop x xs
29
drop (S x) (_:xs) = drop x xs
29
false
false
1
7
7
31
14
17
null
null
haasn/colour
Data/Colour/Names.hs
mit
goldenrod :: (Ord a, Floating a) => Colour a goldenrod = sRGB24 218 165 32
74
goldenrod :: (Ord a, Floating a) => Colour a goldenrod = sRGB24 218 165 32
74
goldenrod = sRGB24 218 165 32
29
false
true
0
7
14
44
19
25
null
null
kazu-yamamoto/dns
internal/Network/DNS/StateBinary.hs
bsd-3-clause
-- plain punctuation -- | Some numeric byte constants. zero, semi, atsign, bslash :: Word8 zero = fromIntegral $ fromEnum '0'
126
zero, semi, atsign, bslash :: Word8 zero = fromIntegral $ fromEnum '0'
70
zero = fromIntegral $ fromEnum '0'
34
true
true
2
6
21
30
17
13
null
null
seereason/HJScript
src/HJScript/DOM/ElementNode.hs
bsd-3-clause
parentNode :: IsElementNode n => Exp n -> Exp Node parentNode = deref "parentNode"
82
parentNode :: IsElementNode n => Exp n -> Exp Node parentNode = deref "parentNode"
82
parentNode = deref "parentNode"
31
false
true
0
7
13
31
14
17
null
null
Softsapiens/yampy-cube
src/Graphics.hs
bsd-3-clause
translate :: (Num a, Eq a) => (a, a) -> [(a, a)] -> [(a, a)] translate v = map (v .+)
85
translate :: (Num a, Eq a) => (a, a) -> [(a, a)] -> [(a, a)] translate v = map (v .+)
85
translate v = map (v .+)
24
false
true
0
9
20
68
39
29
null
null
neglectedvalue/xmobar-freebsd
Plugins/Monitors/Common.hs
bsd-3-clause
skipTillString :: String -> Parser String skipTillString s = manyTill skipRestOfLine $ string s
100
skipTillString :: String -> Parser String skipTillString s = manyTill skipRestOfLine $ string s
100
skipTillString s = manyTill skipRestOfLine $ string s
58
false
true
0
6
18
31
14
17
null
null
bitemyapp/hpp
src/Hpp/Expr.hs
bsd-3-clause
readNarrowChar :: String -> Maybe Char readNarrowChar ['\'',c,'\''] = Just c
76
readNarrowChar :: String -> Maybe Char readNarrowChar ['\'',c,'\''] = Just c
76
readNarrowChar ['\'',c,'\''] = Just c
37
false
true
0
6
10
27
13
14
null
null
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/Projects/Locations/Buckets/Views/Create.hs
mpl-2.0
-- | Multipart request metadata. plbvcPayload :: Lens' ProjectsLocationsBucketsViewsCreate LogView plbvcPayload = lens _plbvcPayload (\ s a -> s{_plbvcPayload = a})
166
plbvcPayload :: Lens' ProjectsLocationsBucketsViewsCreate LogView plbvcPayload = lens _plbvcPayload (\ s a -> s{_plbvcPayload = a})
133
plbvcPayload = lens _plbvcPayload (\ s a -> s{_plbvcPayload = a})
67
true
true
0
9
22
42
22
20
null
null
tobytripp/SpiraJira
src/Main.hs
lgpl-3.0
transitionsUrl :: String -> TicketId -> String transitionsUrl baseUrl key = (issueUrl baseUrl key) ++ "/transitions"
116
transitionsUrl :: String -> TicketId -> String transitionsUrl baseUrl key = (issueUrl baseUrl key) ++ "/transitions"
116
transitionsUrl baseUrl key = (issueUrl baseUrl key) ++ "/transitions"
69
false
true
0
7
15
36
18
18
null
null
kowey/GenI
geni-gui/src/NLP/GenI/Simple/SimpleGui.hs
gpl-2.0
simpleGui1p = simpleGui False
29
simpleGui1p = simpleGui False
29
simpleGui1p = simpleGui False
29
false
false
0
5
3
9
4
5
null
null
ambiata/mafia
src/Mafia/Cabal/Sandbox.hs
bsd-3-clause
initSandbox :: EitherT CabalError IO SandboxDir initSandbox = do sandboxDir <- getInferredSandboxDir cfgSandboxDir <- liftIO (runEitherT getSandboxDir) let cfgOk = dropLeft cfgSandboxDir == Just sandboxDir dirOk <- doesDirectoryExist sandboxDir unless (cfgOk && dirOk) $ do PassErr <- call CabalProcessEr...
411
initSandbox :: EitherT CabalError IO SandboxDir initSandbox = do sandboxDir <- getInferredSandboxDir cfgSandboxDir <- liftIO (runEitherT getSandboxDir) let cfgOk = dropLeft cfgSandboxDir == Just sandboxDir dirOk <- doesDirectoryExist sandboxDir unless (cfgOk && dirOk) $ do PassErr <- call CabalProcessEr...
411
initSandbox = do sandboxDir <- getInferredSandboxDir cfgSandboxDir <- liftIO (runEitherT getSandboxDir) let cfgOk = dropLeft cfgSandboxDir == Just sandboxDir dirOk <- doesDirectoryExist sandboxDir unless (cfgOk && dirOk) $ do PassErr <- call CabalProcessError "cabal" ["sandbox", "--sandbox", sandboxDir,...
363
false
true
0
12
70
127
58
69
null
null
gergoerdi/tinymicro-mos6502-kansas-lava
lava/TinyMicro/Machine.hs
gpl-2.0
synthesize :: BS.ByteString -> IO [(String, String)] synthesize prog = do boardKLEG <- reifyFabric $ do theClk cpuClock wing_init let vpipe = Board.board prog (we, w) = unpackEnabled vpipe (wAddr, wData) = unpack w outStdLogic "VIDEO_WE" we outStdLogic...
1,041
synthesize :: BS.ByteString -> IO [(String, String)] synthesize prog = do boardKLEG <- reifyFabric $ do theClk cpuClock wing_init let vpipe = Board.board prog (we, w) = unpackEnabled vpipe (wAddr, wData) = unpack w outStdLogic "VIDEO_WE" we outStdLogic...
1,041
synthesize prog = do boardKLEG <- reifyFabric $ do theClk cpuClock wing_init let vpipe = Board.board prog (we, w) = unpackEnabled vpipe (wAddr, wData) = unpack w outStdLogic "VIDEO_WE" we outStdLogicVector "VIDEO_W_ADDR" wAddr outStdLogicVector...
988
false
true
0
16
267
305
143
162
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_PATH_MAX_PROJECTION_STACK_DEPTH_NV :: GLenum gl_PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38
94
gl_PATH_MAX_PROJECTION_STACK_DEPTH_NV :: GLenum gl_PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38
94
gl_PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38
46
false
true
0
4
5
11
6
5
null
null
elaye/svg-parser
src/Elements.hs
bsd-3-clause
-- | Any element. anyTag :: Parsec String () ElementName anyTag = do name <- Parsec.many1 $ Parsec.noneOf " =\n\r" return $ ElementName name
144
anyTag :: Parsec String () ElementName anyTag = do name <- Parsec.many1 $ Parsec.noneOf " =\n\r" return $ ElementName name
126
anyTag = do name <- Parsec.many1 $ Parsec.noneOf " =\n\r" return $ ElementName name
87
true
true
0
10
27
49
23
26
null
null
ulyssesp/oscillare
src/Visuals.hs
gpl-3.0
buddhist = Palette $ Hex . BS.pack . fmap toUpper <$> ["0000FF", "FFFF00", "FF0000", "FFFFFF", "FF9800"]
104
buddhist = Palette $ Hex . BS.pack . fmap toUpper <$> ["0000FF", "FFFF00", "FF0000", "FFFFFF", "FF9800"]
104
buddhist = Palette $ Hex . BS.pack . fmap toUpper <$> ["0000FF", "FFFF00", "FF0000", "FFFFFF", "FF9800"]
104
false
false
0
8
15
42
23
19
null
null
luqui/collada
Graphics/Formats/Collada.hs
bsd-3-clause
-- | Takes a prefix and returns a texture loader that prepends the prefix to the path -- and loads from disk. pathTextureLoader :: String -> String -> IO GL.TextureObject pathTextureLoader prefix path = do let loc = prefix ++ "/" ++ path e <- Image.loadImage loc case e of Left err -> fail $ "Couldn'...
406
pathTextureLoader :: String -> String -> IO GL.TextureObject pathTextureLoader prefix path = do let loc = prefix ++ "/" ++ path e <- Image.loadImage loc case e of Left err -> fail $ "Couldn't load " ++ loc ++ ": " ++ err Right bmp -> Bitmap.makeSimpleBitmapTexture bmp
296
pathTextureLoader prefix path = do let loc = prefix ++ "/" ++ path e <- Image.loadImage loc case e of Left err -> fail $ "Couldn't load " ++ loc ++ ": " ++ err Right bmp -> Bitmap.makeSimpleBitmapTexture bmp
235
true
true
0
14
97
111
51
60
null
null
forsyde/forsyde-shallow
src/ForSyDe/Shallow/Utility/Memory.hs
bsd-3-clause
writeMem :: Memory a -> (Int, a) -> Memory a writeMem (Mem size vs) (i, x) | i < size && i >= 0 = Mem size (replaceV vs i (abstExt x)) | otherwise = Mem size vs
178
writeMem :: Memory a -> (Int, a) -> Memory a writeMem (Mem size vs) (i, x) | i < size && i >= 0 = Mem size (replaceV vs i (abstExt x)) | otherwise = Mem size vs
178
writeMem (Mem size vs) (i, x) | i < size && i >= 0 = Mem size (replaceV vs i (abstExt x)) | otherwise = Mem size vs
133
false
true
1
10
55
101
50
51
null
null
DavidAlphaFox/ghc
libraries/containers/Data/IntMap/Base.hs
bsd-3-clause
foldlFB :: (a -> Key -> b -> a) -> a -> IntMap b -> a foldlFB = foldlWithKey
76
foldlFB :: (a -> Key -> b -> a) -> a -> IntMap b -> a foldlFB = foldlWithKey
76
foldlFB = foldlWithKey
22
false
true
0
9
18
41
21
20
null
null
termite2/simple-abstractor
SimpleAbstractor/Parser.hs
bsd-3-clause
tp t@T.TokenParser{..} = (Right <$> typ t) <|> (Left <$> identifier)
75
tp t@T.TokenParser{..} = (Right <$> typ t) <|> (Left <$> identifier)
75
tp t@T.TokenParser{..} = (Right <$> typ t) <|> (Left <$> identifier)
75
false
false
1
8
17
50
22
28
null
null
siddhanathan/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
ctEvId ctev = pprPanic "ctEvId:" (ppr ctev)
43
ctEvId ctev = pprPanic "ctEvId:" (ppr ctev)
43
ctEvId ctev = pprPanic "ctEvId:" (ppr ctev)
43
false
false
0
7
6
20
9
11
null
null
bacchanalia/KitchenSink
KitchenSink/Qualified.hs
gpl-3.0
-- |'VM.read' vm_read = VM.read
31
vm_read = VM.read
17
vm_read = VM.read
17
true
false
0
5
4
9
5
4
null
null
simonmichael/hledger
hledger-lib/Hledger/Data/Posting.hs
gpl-3.0
-- | Apply a specified valuation to this posting's amount, using the -- provided price oracle, commodity styles, and reference dates. -- See amountApplyValuation. postingApplyValuation :: PriceOracle -> M.Map CommoditySymbol AmountStyle -> Day -> Day -> ValuationType -> Posting -> Posting postingApplyValuation priceora...
464
postingApplyValuation :: PriceOracle -> M.Map CommoditySymbol AmountStyle -> Day -> Day -> ValuationType -> Posting -> Posting postingApplyValuation priceoracle styles periodlast today v p = postingTransformAmount (mixedAmountApplyValuation priceoracle styles periodlast today (postingDate p) v) p
301
postingApplyValuation priceoracle styles periodlast today v p = postingTransformAmount (mixedAmountApplyValuation priceoracle styles periodlast today (postingDate p) v) p
174
true
true
0
10
62
85
43
42
null
null
rvion/lamdu
bottlelib/Graphics/UI/Bottle/View.hs
gpl-3.0
width :: Lens' View R width = size . _1
39
width :: Lens' View R width = size . _1
39
width = size . _1
17
false
true
0
5
9
20
10
10
null
null
jtdaugherty/mathblog
src/MB/Server.hs
bsd-3-clause
fileToResponse :: FilePath -> IO (Response BS.ByteString) fileToResponse f = do bytes <- BS.readFile f return $ (respond Found :: Response BS.ByteString) { rspHeaders = [ Header HdrContentLength $ show $ BS.length bytes , Header HdrCacheControl "no-cache" ...
376
fileToResponse :: FilePath -> IO (Response BS.ByteString) fileToResponse f = do bytes <- BS.readFile f return $ (respond Found :: Response BS.ByteString) { rspHeaders = [ Header HdrContentLength $ show $ BS.length bytes , Header HdrCacheControl "no-cache" ...
376
fileToResponse f = do bytes <- BS.readFile f return $ (respond Found :: Response BS.ByteString) { rspHeaders = [ Header HdrContentLength $ show $ BS.length bytes , Header HdrCacheControl "no-cache" ] , rspBody = bytes }
318
false
true
0
13
141
103
51
52
null
null
input-output-hk/pos-haskell-prototype
chain/src/Pos/Chain/Txp/Toil/Monad.hs
mit
-- | Put a transaction with corresponding 'TxUndo' into MemPool. -- Transaction must not be in MemPool (but it's checked anyway). putTxWithUndo :: TxId -> TxAux -> TxUndo -> LocalToilM () putTxWithUndo id tx undo = unlessM (hasTx id) $ do ltsMemPool . mpLocalTxs . at id .= Just tx ltsMemPool . mpSiz...
427
putTxWithUndo :: TxId -> TxAux -> TxUndo -> LocalToilM () putTxWithUndo id tx undo = unlessM (hasTx id) $ do ltsMemPool . mpLocalTxs . at id .= Just tx ltsMemPool . mpSize += 1 ltsUndos . at id .= Just undo -- | Return the number of transactions contained in the pool.
297
putTxWithUndo id tx undo = unlessM (hasTx id) $ do ltsMemPool . mpLocalTxs . at id .= Just tx ltsMemPool . mpSize += 1 ltsUndos . at id .= Just undo -- | Return the number of transactions contained in the pool.
239
true
true
0
10
101
100
47
53
null
null
dan-t/layers
src/Ressources.hs
bsd-3-clause
getDataFileName :: FilePath -> IO FilePath getDataFileName path = #ifdef CABAL PL.getDataFileName path
105
getDataFileName :: FilePath -> IO FilePath getDataFileName path = #ifdef CABAL PL.getDataFileName path
105
getDataFileName path = #ifdef CABAL PL.getDataFileName path
62
false
true
0
7
15
32
14
18
null
null
stothardj/Sequence-Generator
Main.hs
bsd-3-clause
promptPolynomial :: IO [Double] promptPolynomial = do putStr "Polynomial sequence { c*(x0+i*d)^n } for i = 0,1,2, ..., L-1.\nEnter the degree n: " n <- fmap read getLine :: IO Double putStr "Enter the constant multiplier c: " c <- fmap read getLine :: IO Double putSt...
638
promptPolynomial :: IO [Double] promptPolynomial = do putStr "Polynomial sequence { c*(x0+i*d)^n } for i = 0,1,2, ..., L-1.\nEnter the degree n: " n <- fmap read getLine :: IO Double putStr "Enter the constant multiplier c: " c <- fmap read getLine :: IO Double putSt...
638
promptPolynomial = do putStr "Polynomial sequence { c*(x0+i*d)^n } for i = 0,1,2, ..., L-1.\nEnter the degree n: " n <- fmap read getLine :: IO Double putStr "Enter the constant multiplier c: " c <- fmap read getLine :: IO Double putStr "Enter the initial value of th...
606
false
true
0
13
211
176
79
97
null
null
seL4/capDL-tool
CapDL/State.hs
bsd-2-clause
slotCap :: CapRef -> Model Word -> Cap slotCap cref = fromJust . maybeSlotCap cref
82
slotCap :: CapRef -> Model Word -> Cap slotCap cref = fromJust . maybeSlotCap cref
82
slotCap cref = fromJust . maybeSlotCap cref
43
false
true
1
8
14
39
16
23
null
null
spacekitteh/smcghc
compiler/cmm/PprC.hs
bsd-3-clause
pprExpr1 e@(CmmReg _reg) = pprExpr e
37
pprExpr1 e@(CmmReg _reg) = pprExpr e
37
pprExpr1 e@(CmmReg _reg) = pprExpr e
37
false
false
0
8
6
21
10
11
null
null
bitemyapp/persistent
persistent/Database/Persist/Class/PersistUnique.hs
mit
-- TODO: expose this to users recordName :: (PersistEntity record) => record -> Text recordName = unHaskellName . entityHaskell . entityDef . Just
154
recordName :: (PersistEntity record) => record -> Text recordName = unHaskellName . entityHaskell . entityDef . Just
124
recordName = unHaskellName . entityHaskell . entityDef . Just
61
true
true
0
7
30
41
21
20
null
null
spechub/Hets
Propositional/Parse_AS_Basic.hs
gpl-2.0
-- | Parser for equivalence @<=>@ equivKey :: AParser st Token equivKey = asKey equivS
86
equivKey :: AParser st Token equivKey = asKey equivS
52
equivKey = asKey equivS
23
true
true
0
5
14
20
10
10
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F16.hs
bsd-3-clause
-- glMapVertexAttrib2dAPPLE ---------------------------------------------------- glMapVertexAttrib2dAPPLE :: MonadIO m => GLuint -- ^ @index@. -> GLuint -- ^ @size@. -> GLdouble -- ^ @u1@ of type @CoordD@. -> GLdouble -- ^ @u2@ of type @CoordD@. -> GLint -- ^ @ustride@. -> GLint -- ^ @uorder@ of type @Ch...
762
glMapVertexAttrib2dAPPLE :: MonadIO m => GLuint -- ^ @index@. -> GLuint -- ^ @size@. -> GLdouble -- ^ @u1@ of type @CoordD@. -> GLdouble -- ^ @u2@ of type @CoordD@. -> GLint -- ^ @ustride@. -> GLint -- ^ @uorder@ of type @CheckedInt32@. -> GLdouble -- ^ @v1@ of type @CoordD@. -> GLdouble -- ^ @v2@ of ...
680
glMapVertexAttrib2dAPPLE v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 = liftIO $ dyn540 ptr_glMapVertexAttrib2dAPPLE v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11
141
true
true
0
19
145
138
72
66
null
null
DNNX/hyphenation
src/Text/Hyphenation/Language.hs
bsd-3-clause
greek_Poly = unsafePerformIO (loadHyphenator (languageAffix Greek_Poly))
72
greek_Poly = unsafePerformIO (loadHyphenator (languageAffix Greek_Poly))
72
greek_Poly = unsafePerformIO (loadHyphenator (languageAffix Greek_Poly))
72
false
false
0
9
5
21
10
11
null
null
omefire/lens
src/Data/Text/Lazy/Lens.hs
bsd-3-clause
-- | This is an alias for 'unpacked' that makes it clearer how to use it with @('#')@. -- -- @ -- '_Text' = 'from' 'packed' -- @ -- -- >>> _Text # "hello" -- :: Text -- "hello" _Text :: Iso' Text String _Text = from packed
222
_Text :: Iso' Text String _Text = from packed
45
_Text = from packed
19
true
true
0
5
47
27
17
10
null
null
gtk2hs/soegtk
Graphics/SOE/Gtk.hs
lgpl-2.1
emptyGraphic :: Graphic emptyGraphic = Graphic (\_ -> return ())
64
emptyGraphic :: Graphic emptyGraphic = Graphic (\_ -> return ())
64
emptyGraphic = Graphic (\_ -> return ())
40
false
true
0
9
9
27
14
13
null
null
fffej/HS-Poker
LookupNaive.hs
bsd-3-clause
lookupFlushes :: Int -> Int lookupFlushes n = flushes V.! n
59
lookupFlushes :: Int -> Int lookupFlushes n = flushes V.! n
59
lookupFlushes n = flushes V.! n
31
false
true
0
5
10
24
12
12
null
null
Kiandr/CrackingCodingInterview
Haskell/src/chapter-3/Data/Queue.hs
mit
isEmpty (Queue _ _ ) = False
29
isEmpty (Queue _ _ ) = False
29
isEmpty (Queue _ _ ) = False
29
false
false
0
6
7
18
8
10
null
null
mydaum/cabal
cabal-install/Distribution/Client/ProjectPlanning.hs
bsd-3-clause
programsMonitorFiles :: ProgramDb -> [MonitorFilePath] programsMonitorFiles progdb = [ monitor | prog <- configuredPrograms progdb , monitor <- monitorFileSearchPath (programMonitorFiles prog) (programPath prog) ]
271
programsMonitorFiles :: ProgramDb -> [MonitorFilePath] programsMonitorFiles progdb = [ monitor | prog <- configuredPrograms progdb , monitor <- monitorFileSearchPath (programMonitorFiles prog) (programPath prog) ]
271
programsMonitorFiles progdb = [ monitor | prog <- configuredPrograms progdb , monitor <- monitorFileSearchPath (programMonitorFiles prog) (programPath prog) ]
216
false
true
0
10
81
60
30
30
null
null
sdiehl/ghc
testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs
bsd-3-clause
plugin :: Plugin plugin = defaultPlugin { parsedResultAction = parsedPlugin , typeCheckResultAction = typecheckPlugin , spliceRunAction = metaPlugin' , interfaceLoadAction = interfaceLoadPlugin' }
288
plugin :: Plugin plugin = defaultPlugin { parsedResultAction = parsedPlugin , typeCheckResultAction = typecheckPlugin , spliceRunAction = metaPlugin' , interfaceLoadAction = interfaceLoadPlugin' }
288
plugin = defaultPlugin { parsedResultAction = parsedPlugin , typeCheckResultAction = typecheckPlugin , spliceRunAction = metaPlugin' , interfaceLoadAction = interfaceLoadPlugin' }
271
false
true
0
6
114
37
23
14
null
null
henrytill/deviser
src/Deviser/Evaluator.hs
bsd-3-clause
cdr x = throwError (NumArgs 1 x)
58
cdr x = throwError (NumArgs 1 x)
58
cdr x = throwError (NumArgs 1 x)
58
false
false
0
7
32
20
9
11
null
null
glutamate/inliterate
InOut.hs
bsd-3-clause
maySrc (SpliceDecl sloc (InfixApp (Var (UnQual (Ident vnm))) (QVarOp (UnQual (Symbol "<*"))) src)) = Just (sloc, vnm, src)
123
maySrc (SpliceDecl sloc (InfixApp (Var (UnQual (Ident vnm))) (QVarOp (UnQual (Symbol "<*"))) src)) = Just (sloc, vnm, src)
123
maySrc (SpliceDecl sloc (InfixApp (Var (UnQual (Ident vnm))) (QVarOp (UnQual (Symbol "<*"))) src)) = Just (sloc, vnm, src)
123
false
false
0
15
18
75
38
37
null
null
uduki/hsQt
Qtc/Enums/Gui/QAbstractItemView.hs
bsd-2-clause
eAnyKeyPressed :: EditTrigger eAnyKeyPressed = ieEditTrigger $ 16
67
eAnyKeyPressed :: EditTrigger eAnyKeyPressed = ieEditTrigger $ 16
67
eAnyKeyPressed = ieEditTrigger $ 16
37
false
true
0
6
9
18
8
10
null
null
qzchenwl/r-proxy
src/Utils.hs
bsd-3-clause
update :: (Eq k) => (k, v) -> [(k, v)] -> [(k, v)] update (k, v) l = (k, v) : filter (\(k', _) -> k' /= k) l
108
update :: (Eq k) => (k, v) -> [(k, v)] -> [(k, v)] update (k, v) l = (k, v) : filter (\(k', _) -> k' /= k) l
108
update (k, v) l = (k, v) : filter (\(k', _) -> k' /= k) l
57
false
true
2
11
28
102
57
45
null
null
osa1/vindinium
src/Main.hs
mit
arenaCmd :: Parser Cmd arenaCmd = Arena <$> settings
52
arenaCmd :: Parser Cmd arenaCmd = Arena <$> settings
52
arenaCmd = Arena <$> settings
29
false
true
1
6
8
22
9
13
null
null
bergey/diagrams-opengl
src/Graphics/Rendering/Util.hs
bsd-3-clause
p2ToV3 :: P2 -> L.V3 GLfloat p2ToV3 (unp2 -> (x, y)) = L.V3 (r2f x) (r2f y) 0
77
p2ToV3 :: P2 -> L.V3 GLfloat p2ToV3 (unp2 -> (x, y)) = L.V3 (r2f x) (r2f y) 0
77
p2ToV3 (unp2 -> (x, y)) = L.V3 (r2f x) (r2f y) 0
48
false
true
0
10
17
61
30
31
null
null
DimaSamoz/mezzo
src/Mezzo/Compose/Templates.hs
mit
durLitFormatter :: Formatter durLitFormatter = ('_' :) . map toLower . take 2 . nameBase
88
durLitFormatter :: Formatter durLitFormatter = ('_' :) . map toLower . take 2 . nameBase
88
durLitFormatter = ('_' :) . map toLower . take 2 . nameBase
59
false
true
1
7
14
41
18
23
null
null
myuon/DOTO
src/Api/TodoItem.hs
mit
selectTodoItems :: IO [TodoItem] selectTodoItems = do todos <- runDB connInfo $ selectList [] [] return $ (\(Entity _ u) -> u) <$> todos
140
selectTodoItems :: IO [TodoItem] selectTodoItems = do todos <- runDB connInfo $ selectList [] [] return $ (\(Entity _ u) -> u) <$> todos
140
selectTodoItems = do todos <- runDB connInfo $ selectList [] [] return $ (\(Entity _ u) -> u) <$> todos
107
false
true
0
12
27
67
33
34
null
null
robdockins/edison
edison-core/src/Data/Edison/Seq/MyersStack.hs
mit
foldl _ e E = e
15
foldl _ e E = e
15
foldl _ e E = e
15
false
false
0
5
5
13
6
7
null
null
shouya/gximemo
GxiMemo/Parser.hs
mit
parseI (PositiveLookahead p) = do oldST <- get m' <- parseI p put oldST case m' of Just _ -> return $ Just $ MAtom "" Nothing -> return Nothing
162
parseI (PositiveLookahead p) = do oldST <- get m' <- parseI p put oldST case m' of Just _ -> return $ Just $ MAtom "" Nothing -> return Nothing
162
parseI (PositiveLookahead p) = do oldST <- get m' <- parseI p put oldST case m' of Just _ -> return $ Just $ MAtom "" Nothing -> return Nothing
162
false
false
0
11
48
74
32
42
null
null
danr/hipspec
src/HipSpec/GHC/Utils.hs
gpl-3.0
-- | Is this Id a data or newtype constructor? -- -- Note: cannot run isDataConWorkId on things that aren't isId, -- then we get a panic from idDetails. -- -- (mainly from type variables) isDataConId :: Id -> Bool isDataConId v = isId v && (isConLikeId v || isNewtypeConId v)
293
isDataConId :: Id -> Bool isDataConId v = isId v && (isConLikeId v || isNewtypeConId v)
87
isDataConId v = isId v && (isConLikeId v || isNewtypeConId v)
61
true
true
0
9
68
50
25
25
null
null
dillonhuff/GitVisualizer
test/AllTests.hs
gpl-2.0
main = do allAnalysisTests allParserTests
45
main = do allAnalysisTests allParserTests
45
main = do allAnalysisTests allParserTests
45
false
false
1
7
8
16
5
11
null
null
byteally/webapi
webapi-swagger/src/SwaggerJSONGen.hs
bsd-3-clause
petFindByTagsPath :: (FilePath, PathItem) petFindByTagsPath = ("/pet/findByTags", mempty & get ?~ (mempty & SwaggerLens.tags .~ (Set.singleton "pet") & responses .~ (mempty & responses .~ (HMSIns.fromList [(200, Inline $ mempty & description .~ "successful operation" ...
1,537
petFindByTagsPath :: (FilePath, PathItem) petFindByTagsPath = ("/pet/findByTags", mempty & get ?~ (mempty & SwaggerLens.tags .~ (Set.singleton "pet") & responses .~ (mempty & responses .~ (HMSIns.fromList [(200, Inline $ mempty & description .~ "successful operation" ...
1,537
petFindByTagsPath = ("/pet/findByTags", mempty & get ?~ (mempty & SwaggerLens.tags .~ (Set.singleton "pet") & responses .~ (mempty & responses .~ (HMSIns.fromList [(200, Inline $ mempty & description .~ "successful operation" ...
1,495
false
true
0
36
661
329
174
155
null
null
AnthonyMl/pathfinding
src/main.hs
mit
intExplicitGraph g costFn algo = do putStrLn ("length: " ++ show (List.length path)) putStrLn ("cost: " ++ show (List.foldr (\ (a, b) cost -> cost + costFn a b) 0 (List.zip (ExplicitGraph.start g : rpath) rpath))) putStrLn (show (ExplicitGraph.start g : rpath)) putStrLn "" where (_, path) = algo g rpa...
344
printExplicitGraph g costFn algo = do putStrLn ("length: " ++ show (List.length path)) putStrLn ("cost: " ++ show (List.foldr (\ (a, b) cost -> cost + costFn a b) 0 (List.zip (ExplicitGraph.start g : rpath) rpath))) putStrLn (show (ExplicitGraph.start g : rpath)) putStrLn "" where (_, path) = algo g r...
344
printExplicitGraph g costFn algo = do putStrLn ("length: " ++ show (List.length path)) putStrLn ("cost: " ++ show (List.foldr (\ (a, b) cost -> cost + costFn a b) 0 (List.zip (ExplicitGraph.start g : rpath) rpath))) putStrLn (show (ExplicitGraph.start g : rpath)) putStrLn "" where (_, path) = algo g r...
344
false
false
1
18
73
173
82
91
null
null