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
gitfoxi/ascii-vector-avc
Data/Avc/Parser.hs
gpl-2.0
joinStatements :: [ByteString] -> [ByteString] joinStatements bss = P.map unwords (grouped bss) where grouped = split (keepDelimsR $ whenElt hasSemi) hasSemi hs = ';' `elem` hs -- Assume first statement is Format
227
joinStatements :: [ByteString] -> [ByteString] joinStatements bss = P.map unwords (grouped bss) where grouped = split (keepDelimsR $ whenElt hasSemi) hasSemi hs = ';' `elem` hs -- Assume first statement is Format
227
joinStatements bss = P.map unwords (grouped bss) where grouped = split (keepDelimsR $ whenElt hasSemi) hasSemi hs = ';' `elem` hs -- Assume first statement is Format
180
false
true
2
8
46
84
39
45
null
null
gridaphobe/liquid-fixpoint
src/Language/Fixpoint/SortCheck.hs
bsd-3-clause
checkRel f Eq (EApp g es) (EVar x) = checkRelEqVar f x g es
59
checkRel f Eq (EApp g es) (EVar x) = checkRelEqVar f x g es
59
checkRel f Eq (EApp g es) (EVar x) = checkRelEqVar f x g es
59
false
false
0
6
13
42
18
24
null
null
dgvncsz0f/hzk
src/Database/Zookeeper.hs
bsd-3-clause
set :: Zookeeper -- ^ Zookeeper handle -> String -- ^ The name of the znode expressed as a file name with slashes -- separating ancestors of the znode -> Maybe B.ByteString -- ^ The data to set on this znode -> Maybe Version -- ^ The expected version of the znode. The function will fail -- if the actual version of the znode does not match the -- expected version. If `Nothing' is given the version check -- will not take place -> IO (Either ZKError Stat) set (Zookeeper zh) path mdata version = withCString path $ \pathPtr -> allocaStat $ \statPtr -> maybeUseAsCStringLen mdata $ \(dataPtr, dataLen) -> do rc <- c_zooSet2 zh pathPtr dataPtr (fromIntegral dataLen) (maybe (-1) fromIntegral version) statPtr onZOK rc (toStat statPtr) where maybeUseAsCStringLen Nothing f = f (nullPtr, -1) maybeUseAsCStringLen (Just s) f = B.useAsCStringLen s f -- | Sets the acl associated with a node. This operation is not -- recursive on the children. See 'getAcl' for more information (synchronous)
1,080
set :: Zookeeper -- ^ Zookeeper handle -> String -- ^ The name of the znode expressed as a file name with slashes -- separating ancestors of the znode -> Maybe B.ByteString -- ^ The data to set on this znode -> Maybe Version -- ^ The expected version of the znode. The function will fail -- if the actual version of the znode does not match the -- expected version. If `Nothing' is given the version check -- will not take place -> IO (Either ZKError Stat) set (Zookeeper zh) path mdata version = withCString path $ \pathPtr -> allocaStat $ \statPtr -> maybeUseAsCStringLen mdata $ \(dataPtr, dataLen) -> do rc <- c_zooSet2 zh pathPtr dataPtr (fromIntegral dataLen) (maybe (-1) fromIntegral version) statPtr onZOK rc (toStat statPtr) where maybeUseAsCStringLen Nothing f = f (nullPtr, -1) maybeUseAsCStringLen (Just s) f = B.useAsCStringLen s f -- | Sets the acl associated with a node. This operation is not -- recursive on the children. See 'getAcl' for more information (synchronous)
1,080
set (Zookeeper zh) path mdata version = withCString path $ \pathPtr -> allocaStat $ \statPtr -> maybeUseAsCStringLen mdata $ \(dataPtr, dataLen) -> do rc <- c_zooSet2 zh pathPtr dataPtr (fromIntegral dataLen) (maybe (-1) fromIntegral version) statPtr onZOK rc (toStat statPtr) where maybeUseAsCStringLen Nothing f = f (nullPtr, -1) maybeUseAsCStringLen (Just s) f = B.useAsCStringLen s f -- | Sets the acl associated with a node. This operation is not -- recursive on the children. See 'getAcl' for more information (synchronous)
575
false
true
0
18
261
211
109
102
null
null
sumeetchhetri/FrameworkBenchmarks
frameworks/Haskell/warp/warp-shared/src/Lib.hs
bsd-3-clause
-- * route implementations getPlaintext :: Wai.Response getPlaintext = respondText Status.status200 "Hello, World!"
116
getPlaintext :: Wai.Response getPlaintext = respondText Status.status200 "Hello, World!"
88
getPlaintext = respondText Status.status200 "Hello, World!"
59
true
true
0
6
13
21
11
10
null
null
GaloisInc/halvm-ghc
compiler/basicTypes/RdrName.hs
bsd-3-clause
insertGRE :: GlobalRdrElt -> [GlobalRdrElt] -> [GlobalRdrElt] insertGRE new_g [] = [new_g]
90
insertGRE :: GlobalRdrElt -> [GlobalRdrElt] -> [GlobalRdrElt] insertGRE new_g [] = [new_g]
90
insertGRE new_g [] = [new_g]
28
false
true
0
9
11
41
20
21
null
null
bamboo/idris-cil
src/IRTS/CodegenCil.hs
bsd-3-clause
exportedTypes :: CilCodegenInfo -> CAF [TypeDef] exportedTypes cci@(ci, _) = concatMapM exports (exportDecls ci) where exports :: ExportIFace -> CAF [TypeDef] exports (Export (sn -> "FFI_CIL") exportedDataType es) = do cilExports <- mapM (cilExport cci) es let (cilFuns, cilTypes) = partition isCilFun cilExports methods = unCilFun <$> cilFuns types = unCilType <$> cilTypes pure $ publicClass exportedDataType methods : types where isCilFun (CilFun _) = True isCilFun _ = False publicClass name methods = publicSealedClass name noExtends noImplements [] methods [] exports e = error $ "Unsupported Export: " <> show e -- |Queries the Idris state for the parameter names of the first function definition with the given name.
854
exportedTypes :: CilCodegenInfo -> CAF [TypeDef] exportedTypes cci@(ci, _) = concatMapM exports (exportDecls ci) where exports :: ExportIFace -> CAF [TypeDef] exports (Export (sn -> "FFI_CIL") exportedDataType es) = do cilExports <- mapM (cilExport cci) es let (cilFuns, cilTypes) = partition isCilFun cilExports methods = unCilFun <$> cilFuns types = unCilType <$> cilTypes pure $ publicClass exportedDataType methods : types where isCilFun (CilFun _) = True isCilFun _ = False publicClass name methods = publicSealedClass name noExtends noImplements [] methods [] exports e = error $ "Unsupported Export: " <> show e -- |Queries the Idris state for the parameter names of the first function definition with the given name.
854
exportedTypes cci@(ci, _) = concatMapM exports (exportDecls ci) where exports :: ExportIFace -> CAF [TypeDef] exports (Export (sn -> "FFI_CIL") exportedDataType es) = do cilExports <- mapM (cilExport cci) es let (cilFuns, cilTypes) = partition isCilFun cilExports methods = unCilFun <$> cilFuns types = unCilType <$> cilTypes pure $ publicClass exportedDataType methods : types where isCilFun (CilFun _) = True isCilFun _ = False publicClass name methods = publicSealedClass name noExtends noImplements [] methods [] exports e = error $ "Unsupported Export: " <> show e -- |Queries the Idris state for the parameter names of the first function definition with the given name.
805
false
true
2
10
239
246
117
129
null
null
tel/hexpat-lens
src/Text/XML/Expat/Lens/Unqualified.hs
mit
amed :: (Eq a, Applicative f, Choice p) => a -> Optic' p f (NodeG f1 a text) (NodeG f1 a text) named = G.named
118
named :: (Eq a, Applicative f, Choice p) => a -> Optic' p f (NodeG f1 a text) (NodeG f1 a text) named = G.named
118
named = G.named
15
false
true
0
10
32
72
35
37
null
null
fpco/hlint
src/Hint/Monad.hs
bsd-3-clause
monadCall _ = Nothing
21
monadCall _ = Nothing
21
monadCall _ = Nothing
21
false
false
0
5
3
9
4
5
null
null
Mathnerd314/lamdu
src/Lamdu/Data/Expression/Lens.hs
gpl-3.0
-- Pure expressions: pureExpr :: Lens.Iso' (Expression def ()) (Body def (Expression def ())) pureExpr = Lens.iso (^. eBody) (`Expression` ())
142
pureExpr :: Lens.Iso' (Expression def ()) (Body def (Expression def ())) pureExpr = Lens.iso (^. eBody) (`Expression` ())
121
pureExpr = Lens.iso (^. eBody) (`Expression` ())
48
true
true
0
10
20
66
36
30
null
null
markflorisson/hpack
src/HPack/Iface/IfaceExtract.hs
bsd-3-clause
-- | TODO: IfaceClassOp changed in GHC 7.10 or 8.1 extractMethodSignature :: IfaceClassOp -> Symbol extractMethodSignature (IfaceClassOp name maybeImpl typ) = Fun (extractOccName name) (extractType typ)
206
extractMethodSignature :: IfaceClassOp -> Symbol extractMethodSignature (IfaceClassOp name maybeImpl typ) = Fun (extractOccName name) (extractType typ)
155
extractMethodSignature (IfaceClassOp name maybeImpl typ) = Fun (extractOccName name) (extractType typ)
106
true
true
0
7
29
51
24
27
null
null
davmre/matrizer
src/Matrizer/CodeGen.hs
gpl-2.0
generateNumpy (Branch2 MColProduct t1 t2) = "( " ++ (generateNumpy t1) ++ ".flatten() * " ++ (generateNumpy t2) ++ ")"
169
generateNumpy (Branch2 MColProduct t1 t2) = "( " ++ (generateNumpy t1) ++ ".flatten() * " ++ (generateNumpy t2) ++ ")"
169
generateNumpy (Branch2 MColProduct t1 t2) = "( " ++ (generateNumpy t1) ++ ".flatten() * " ++ (generateNumpy t2) ++ ")"
169
false
false
0
10
70
47
23
24
null
null
jsnajder/dsem
src/dm2dep.hs
bsd-3-clause
showDepModel :: DepModel -> String showDepModel dm = unlines [ B.toString t ++ "\t" ++ showVec v | (t,v) <- M.toAscList dm ] where showVec v = intercalate "\t" [ intercalate ":" [show l,show w2,show w] | (l,w2,w) <- S.elems v ]
242
showDepModel :: DepModel -> String showDepModel dm = unlines [ B.toString t ++ "\t" ++ showVec v | (t,v) <- M.toAscList dm ] where showVec v = intercalate "\t" [ intercalate ":" [show l,show w2,show w] | (l,w2,w) <- S.elems v ]
242
showDepModel dm = unlines [ B.toString t ++ "\t" ++ showVec v | (t,v) <- M.toAscList dm ] where showVec v = intercalate "\t" [ intercalate ":" [show l,show w2,show w] | (l,w2,w) <- S.elems v ]
207
false
true
0
10
56
122
61
61
null
null
4ZP6Capstone2015/ampersand
src/Database/Design/Ampersand/FSpec/ToFSpec/Calc.hs
gpl-3.0
commaNLPandoc' _ [] = mempty
32
commaNLPandoc' _ [] = mempty
32
commaNLPandoc' _ [] = mempty
32
false
false
0
6
8
13
6
7
null
null
phaazon/igl
src/Graphics/Rendering/IGL/VertexArray.hs
bsd-3-clause
deleteVertexArrays :: [VertexArray] -> GL i i () deleteVertexArrays vas = wrapGL $ withArrayLen (map vertexArrayID vas) $ glDeleteVertexArrays . fromIntegral
159
deleteVertexArrays :: [VertexArray] -> GL i i () deleteVertexArrays vas = wrapGL $ withArrayLen (map vertexArrayID vas) $ glDeleteVertexArrays . fromIntegral
159
deleteVertexArrays vas = wrapGL $ withArrayLen (map vertexArrayID vas) $ glDeleteVertexArrays . fromIntegral
110
false
true
0
10
22
53
26
27
null
null
mrakgr/futhark
src/Futhark/Pass/ExtractKernels.hs
bsd-3-clause
transformBinding :: Binding -> DistribM [Out.Binding] transformBinding (Let pat () (If c tb fb rt)) = do tb' <- transformBody tb fb' <- transformBody fb return [Let pat () $ If c tb' fb' rt]
197
transformBinding :: Binding -> DistribM [Out.Binding] transformBinding (Let pat () (If c tb fb rt)) = do tb' <- transformBody tb fb' <- transformBody fb return [Let pat () $ If c tb' fb' rt]
196
transformBinding (Let pat () (If c tb fb rt)) = do tb' <- transformBody tb fb' <- transformBody fb return [Let pat () $ If c tb' fb' rt]
142
false
true
0
11
41
99
46
53
null
null
facebookincubator/duckling
Duckling/Rules/HR.hs
bsd-3-clause
langRules (Seal Numeral) = Numeral.rules
40
langRules (Seal Numeral) = Numeral.rules
40
langRules (Seal Numeral) = Numeral.rules
40
false
false
0
7
4
17
8
9
null
null
mhuesch/scheme_compiler
src/L1Tox64/Compile.hs
bsd-3-clause
fileFooter :: String fileFooter = " .size go, .-go\n" ++ " .section .note.GNU-stack,\"\",@progbits\n"
120
fileFooter :: String fileFooter = " .size go, .-go\n" ++ " .section .note.GNU-stack,\"\",@progbits\n"
120
fileFooter = " .size go, .-go\n" ++ " .section .note.GNU-stack,\"\",@progbits\n"
99
false
true
0
5
31
15
8
7
null
null
vito/hummus
src/Control/Monad/CC.hs
bsd-3-clause
-- | Abortively captures the current subcontinuation, delimiting it in a reified -- function. The resulting computation, however, is undelimited. shift0 :: (MonadDelimitedCont p s m) => p b -> ((m a -> m b) -> m b) -> m a shift0 p f = withSubCont p $ \sk -> f (\a -> pushPrompt p $ pushSubCont sk a)
299
shift0 :: (MonadDelimitedCont p s m) => p b -> ((m a -> m b) -> m b) -> m a shift0 p f = withSubCont p $ \sk -> f (\a -> pushPrompt p $ pushSubCont sk a)
153
shift0 p f = withSubCont p $ \sk -> f (\a -> pushPrompt p $ pushSubCont sk a)
77
true
true
0
12
58
103
51
52
null
null
duplode/threepenny-gui
src/Graphics/UI/Threepenny/SVG/Attributes.hs
bsd-3-clause
specularConstant = fltAttr "specularConstant"
58
specularConstant = fltAttr "specularConstant"
58
specularConstant = fltAttr "specularConstant"
58
false
false
1
5
16
12
4
8
null
null
Jonplussed/url-text-histogram
src/Main.hs
mit
main :: IO () main = do [port] <- liftIO getArgs withDb $ \db -> liftIO $ run (read port) (app db) return ()
120
main :: IO () main = do [port] <- liftIO getArgs withDb $ \db -> liftIO $ run (read port) (app db) return ()
120
main = do [port] <- liftIO getArgs withDb $ \db -> liftIO $ run (read port) (app db) return ()
106
false
true
0
12
35
70
33
37
null
null
diku-dk/futhark
src/Language/Futhark/TypeChecker/Modules.hs
isc
missingType :: Pretty a => Loc -> a -> Either TypeError b missingType loc name = Left . TypeError loc mempty $ "Module does not define a type named" <+> ppr name <> "."
174
missingType :: Pretty a => Loc -> a -> Either TypeError b missingType loc name = Left . TypeError loc mempty $ "Module does not define a type named" <+> ppr name <> "."
174
missingType loc name = Left . TypeError loc mempty $ "Module does not define a type named" <+> ppr name <> "."
116
false
true
0
9
39
60
28
32
null
null
dmringo/pure-basic
src/Basic/Parser.hs
mit
statements :: Parser [Stmt] statements = tok statement `sepBy` colon
68
statements :: Parser [Stmt] statements = tok statement `sepBy` colon
68
statements = tok statement `sepBy` colon
40
false
true
0
6
9
26
14
12
null
null
DimaSamoz/thodo
src/Commands/Common.hs
mit
tomorrow :: Parser Category tomorrow = flag' (RelTime Tomorrow) ( long "tomorrow" <> short 'T' <> help "Tasks from tomorrow")
138
tomorrow :: Parser Category tomorrow = flag' (RelTime Tomorrow) ( long "tomorrow" <> short 'T' <> help "Tasks from tomorrow")
138
tomorrow = flag' (RelTime Tomorrow) ( long "tomorrow" <> short 'T' <> help "Tasks from tomorrow")
110
false
true
0
9
32
52
22
30
null
null
sjakobi/brick
src/Brick/Widgets/Internal.hs
bsd-3-clause
cropExtents :: Context -> [Extent n] -> [Extent n] cropExtents ctx es = catMaybes $ cropExtent <$> es where -- An extent is cropped in places where it is not within the -- region described by the context. -- -- If its entirety is outside the context region, it is dropped. -- -- Otherwise its size and upper left corner are adjusted so that -- they are contained within the context region. cropExtent (Extent n (Location (c, r)) (w, h)) = -- First, clamp the upper-left corner to at least (0, 0). let c' = max c 0 r' = max r 0 -- Then, determine the new lower-right corner based on -- the clamped corner. endCol = c' + w endRow = r' + h -- Then clamp the lower-right corner based on the -- context endCol' = min (ctx^.availWidthL) endCol endRow' = min (ctx^.availHeightL) endRow -- Then compute the new width and height from the -- clamped lower-right corner. w' = endCol' - c' h' = endRow' - r' e = Extent n (Location (c', r')) (w', h') in if w' < 0 || h' < 0 then Nothing else Just e
1,343
cropExtents :: Context -> [Extent n] -> [Extent n] cropExtents ctx es = catMaybes $ cropExtent <$> es where -- An extent is cropped in places where it is not within the -- region described by the context. -- -- If its entirety is outside the context region, it is dropped. -- -- Otherwise its size and upper left corner are adjusted so that -- they are contained within the context region. cropExtent (Extent n (Location (c, r)) (w, h)) = -- First, clamp the upper-left corner to at least (0, 0). let c' = max c 0 r' = max r 0 -- Then, determine the new lower-right corner based on -- the clamped corner. endCol = c' + w endRow = r' + h -- Then clamp the lower-right corner based on the -- context endCol' = min (ctx^.availWidthL) endCol endRow' = min (ctx^.availHeightL) endRow -- Then compute the new width and height from the -- clamped lower-right corner. w' = endCol' - c' h' = endRow' - r' e = Extent n (Location (c', r')) (w', h') in if w' < 0 || h' < 0 then Nothing else Just e
1,343
cropExtents ctx es = catMaybes $ cropExtent <$> es where -- An extent is cropped in places where it is not within the -- region described by the context. -- -- If its entirety is outside the context region, it is dropped. -- -- Otherwise its size and upper left corner are adjusted so that -- they are contained within the context region. cropExtent (Extent n (Location (c, r)) (w, h)) = -- First, clamp the upper-left corner to at least (0, 0). let c' = max c 0 r' = max r 0 -- Then, determine the new lower-right corner based on -- the clamped corner. endCol = c' + w endRow = r' + h -- Then clamp the lower-right corner based on the -- context endCol' = min (ctx^.availWidthL) endCol endRow' = min (ctx^.availHeightL) endRow -- Then compute the new width and height from the -- clamped lower-right corner. w' = endCol' - c' h' = endRow' - r' e = Extent n (Location (c', r')) (w', h') in if w' < 0 || h' < 0 then Nothing else Just e
1,292
false
true
0
12
551
245
136
109
null
null
ozgurakgun/Idris-dev
src/Idris/Directives.hs
bsd-3-clause
disambiguate :: Name -> Idris Name disambiguate n = do i <- getIState case lookupCtxtName n (idris_implicits i) of [(n', _)] -> return n' [] -> throwError (NoSuchVariable n) more -> throwError (CantResolveAlts (map fst more))
253
disambiguate :: Name -> Idris Name disambiguate n = do i <- getIState case lookupCtxtName n (idris_implicits i) of [(n', _)] -> return n' [] -> throwError (NoSuchVariable n) more -> throwError (CantResolveAlts (map fst more))
253
disambiguate n = do i <- getIState case lookupCtxtName n (idris_implicits i) of [(n', _)] -> return n' [] -> throwError (NoSuchVariable n) more -> throwError (CantResolveAlts (map fst more))
218
false
true
0
15
63
109
51
58
null
null
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/ShaderAtomicCounters.hs
bsd-3-clause
gl_ATOMIC_COUNTER_BUFFER_SIZE :: GLenum gl_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3
78
gl_ATOMIC_COUNTER_BUFFER_SIZE :: GLenum gl_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3
78
gl_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3
38
false
true
0
4
5
11
6
5
null
null
ezrakilty/narc
Numeric/Unary.hs
bsd-2-clause
unaryUnderflow = error "unary represents positive integers only"
64
unaryUnderflow = error "unary represents positive integers only"
64
unaryUnderflow = error "unary represents positive integers only"
64
false
false
0
5
7
9
4
5
null
null
cdxr/haskell-interface
module-diff/Render.hs
bsd-3-clause
withQC :: (QualContext -> Doc) -> RDoc withQC f = RDoc $ f <$> asks reQualContext
81
withQC :: (QualContext -> Doc) -> RDoc withQC f = RDoc $ f <$> asks reQualContext
81
withQC f = RDoc $ f <$> asks reQualContext
42
false
true
0
7
15
36
18
18
null
null
rueshyna/gogol
gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs
mpl-2.0
-- | The region code as a 2-letter ISO country code. irsGl :: Lens' I18nRegionSnippet (Maybe Text) irsGl = lens _irsGl (\ s a -> s{_irsGl = a})
143
irsGl :: Lens' I18nRegionSnippet (Maybe Text) irsGl = lens _irsGl (\ s a -> s{_irsGl = a})
90
irsGl = lens _irsGl (\ s a -> s{_irsGl = a})
44
true
true
0
9
27
46
25
21
null
null
pparkkin/eta
compiler/ETA/Main/DynFlags.hs
bsd-3-clause
wayOptc _ WayGran = ["-DGRAN"]
36
wayOptc _ WayGran = ["-DGRAN"]
36
wayOptc _ WayGran = ["-DGRAN"]
36
false
false
1
6
10
16
7
9
null
null
romanb/amazonka
amazonka-elasticache/gen/Network/AWS/ElastiCache/Types.hs
mpl-2.0
-- | The new cache engine version that the cache cluster will run. pmvEngineVersion :: Lens' PendingModifiedValues (Maybe Text) pmvEngineVersion = lens _pmvEngineVersion (\s a -> s { _pmvEngineVersion = a })
207
pmvEngineVersion :: Lens' PendingModifiedValues (Maybe Text) pmvEngineVersion = lens _pmvEngineVersion (\s a -> s { _pmvEngineVersion = a })
140
pmvEngineVersion = lens _pmvEngineVersion (\s a -> s { _pmvEngineVersion = a })
79
true
true
1
9
31
50
25
25
null
null
snoyberg/ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
uInfixT :: TypeQ -> Name -> TypeQ -> TypeQ uInfixT t1 n t2 = do t1' <- t1 t2' <- t2 return (UInfixT t1' n t2')
152
uInfixT :: TypeQ -> Name -> TypeQ -> TypeQ uInfixT t1 n t2 = do t1' <- t1 t2' <- t2 return (UInfixT t1' n t2')
152
uInfixT t1 n t2 = do t1' <- t1 t2' <- t2 return (UInfixT t1' n t2')
109
false
true
0
9
67
60
28
32
null
null
ambiata/mafia
src/Mafia/Path.hs
bsd-3-clause
takeBaseName :: Path -> File takeBaseName = T.pack . FilePath.takeBaseName . T.unpack
85
takeBaseName :: Path -> File takeBaseName = T.pack . FilePath.takeBaseName . T.unpack
85
takeBaseName = T.pack . FilePath.takeBaseName . T.unpack
56
false
true
1
7
11
37
16
21
null
null
mpickering/hlint
src/Hint/Lambda.hs
bsd-3-clause
-- replace any repeated pattern variable with _ fromLambda :: Exp_ -> ([Pat_], Exp_) fromLambda (Lambda _ ps1 (fromLambda . fromParen -> (ps2,x))) = (transformBi (f $ pvars ps2) ps1 ++ ps2, x) where f bad x@PVar{} | prettyPrint x `elem` bad = PWildCard an f bad x = x
281
fromLambda :: Exp_ -> ([Pat_], Exp_) fromLambda (Lambda _ ps1 (fromLambda . fromParen -> (ps2,x))) = (transformBi (f $ pvars ps2) ps1 ++ ps2, x) where f bad x@PVar{} | prettyPrint x `elem` bad = PWildCard an f bad x = x
233
fromLambda (Lambda _ ps1 (fromLambda . fromParen -> (ps2,x))) = (transformBi (f $ pvars ps2) ps1 ++ ps2, x) where f bad x@PVar{} | prettyPrint x `elem` bad = PWildCard an f bad x = x
196
true
true
0
10
63
136
68
68
null
null
talw/quoridor-hs
src/Quoridor/Cmdline/Network/Server.hs
bsd-3-clause
broadcast :: Message -> [TChan Message] -> STM () broadcast msg playerChans = forM_ playerChans $ flip writeTChan msg
117
broadcast :: Message -> [TChan Message] -> STM () broadcast msg playerChans = forM_ playerChans $ flip writeTChan msg
117
broadcast msg playerChans = forM_ playerChans $ flip writeTChan msg
67
false
true
0
9
18
51
23
28
null
null
batterseapower/machine-learning
Algorithms/MachineLearning/Framework.hs
gpl-2.0
sampleDataSet :: StdGen -> Int -> DataSet input target -> DataSet input target sampleDataSet gen n = unK . transformDataSetAsVectors (K . dataSetFromSampleList . sample gen n . dataSetToSampleList)
197
sampleDataSet :: StdGen -> Int -> DataSet input target -> DataSet input target sampleDataSet gen n = unK . transformDataSetAsVectors (K . dataSetFromSampleList . sample gen n . dataSetToSampleList)
197
sampleDataSet gen n = unK . transformDataSetAsVectors (K . dataSetFromSampleList . sample gen n . dataSetToSampleList)
118
false
true
1
9
28
70
32
38
null
null
ilya-yurtaev/hdotfiles
src/Dotfiles.hs
mit
mkDotfiles :: Env -> Names -> IO Dotfiles mkDotfiles env = fmap Set.fromList . mapM (mkDotfile env) . Set.toList
112
mkDotfiles :: Env -> Names -> IO Dotfiles mkDotfiles env = fmap Set.fromList . mapM (mkDotfile env) . Set.toList
112
mkDotfiles env = fmap Set.fromList . mapM (mkDotfile env) . Set.toList
70
false
true
0
9
18
54
24
30
null
null
conal/hermit
src/HERMIT/Kure.hs
bsd-2-clause
-- | Rewrite any children of an expression of the form: @Let@ (@NonRec@ 'Var' 'CoreExpr') 'CoreExpr' letNonRecAnyR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m Var -> Rewrite c m CoreExpr -> Rewrite c m CoreExpr -> Rewrite c m CoreExpr letNonRecAnyR r1 r2 r3 = letAnyR (nonRecAnyR r1 r2) r3
331
letNonRecAnyR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m Var -> Rewrite c m CoreExpr -> Rewrite c m CoreExpr -> Rewrite c m CoreExpr letNonRecAnyR r1 r2 r3 = letAnyR (nonRecAnyR r1 r2) r3
230
letNonRecAnyR r1 r2 r3 = letAnyR (nonRecAnyR r1 r2) r3
54
true
true
0
9
57
103
50
53
null
null
green-haskell/ghc
compiler/deSugar/DsUtils.hs
bsd-3-clause
mkFailurePair :: CoreExpr -- Result type of the whole case expression -> DsM (CoreBind, -- Binds the newly-created fail variable -- to \ _ -> expression CoreExpr) -- Fail variable applied to realWorld# -- See Note [Failure thunks and CPR] mkFailurePair expr = do { fail_fun_var <- newFailLocalDs (voidPrimTy `mkFunTy` ty) ; fail_fun_arg <- newSysLocalDs voidPrimTy ; let real_arg = setOneShotLambda fail_fun_arg ; return (NonRec fail_fun_var (Lam real_arg expr), App (Var fail_fun_var) (Var voidPrimId)) } where ty = exprType expr {- Note [Failure thunks and CPR] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When we make a failure point we ensure that it does not look like a thunk. Example: let fail = \rw -> error "urk" in case x of [] -> fail realWorld# (y:ys) -> case ys of [] -> fail realWorld# (z:zs) -> (y,z) Reason: we know that a failure point is always a "join point" and is entered at most once. Adding a dummy 'realWorld' token argument makes it clear that sharing is not an issue. And that in turn makes it more CPR-friendly. This matters a lot: if you don't get it right, you lose the tail call property. For example, see Trac #3403. -}
1,325
mkFailurePair :: CoreExpr -- Result type of the whole case expression -> DsM (CoreBind, -- Binds the newly-created fail variable -- to \ _ -> expression CoreExpr) mkFailurePair expr = do { fail_fun_var <- newFailLocalDs (voidPrimTy `mkFunTy` ty) ; fail_fun_arg <- newSysLocalDs voidPrimTy ; let real_arg = setOneShotLambda fail_fun_arg ; return (NonRec fail_fun_var (Lam real_arg expr), App (Var fail_fun_var) (Var voidPrimId)) } where ty = exprType expr {- Note [Failure thunks and CPR] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When we make a failure point we ensure that it does not look like a thunk. Example: let fail = \rw -> error "urk" in case x of [] -> fail realWorld# (y:ys) -> case ys of [] -> fail realWorld# (z:zs) -> (y,z) Reason: we know that a failure point is always a "join point" and is entered at most once. Adding a dummy 'realWorld' token argument makes it clear that sharing is not an issue. And that in turn makes it more CPR-friendly. This matters a lot: if you don't get it right, you lose the tail call property. For example, see Trac #3403. -}
1,249
mkFailurePair expr = do { fail_fun_var <- newFailLocalDs (voidPrimTy `mkFunTy` ty) ; fail_fun_arg <- newSysLocalDs voidPrimTy ; let real_arg = setOneShotLambda fail_fun_arg ; return (NonRec fail_fun_var (Lam real_arg expr), App (Var fail_fun_var) (Var voidPrimId)) } where ty = exprType expr {- Note [Failure thunks and CPR] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When we make a failure point we ensure that it does not look like a thunk. Example: let fail = \rw -> error "urk" in case x of [] -> fail realWorld# (y:ys) -> case ys of [] -> fail realWorld# (z:zs) -> (y,z) Reason: we know that a failure point is always a "join point" and is entered at most once. Adding a dummy 'realWorld' token argument makes it clear that sharing is not an issue. And that in turn makes it more CPR-friendly. This matters a lot: if you don't get it right, you lose the tail call property. For example, see Trac #3403. -}
1,012
true
true
1
11
382
140
70
70
null
null
onponomarev/ganeti
src/Ganeti/Query/Instance.hs
bsd-2-clause
-- | Gets the VLAN of a NIC. getNicVlan :: FilledNicParams -> Maybe String getNicVlan params | nicpMode params == NMOvs = Just $ nicpVlan params | otherwise = Nothing
185
getNicVlan :: FilledNicParams -> Maybe String getNicVlan params | nicpMode params == NMOvs = Just $ nicpVlan params | otherwise = Nothing
156
getNicVlan params | nicpMode params == NMOvs = Just $ nicpVlan params | otherwise = Nothing
110
true
true
1
9
48
50
23
27
null
null
scottgw/demonL
Language/DemonL/Script.hs
bsd-3-clause
argM _ _ _ = Nothing
20
argM _ _ _ = Nothing
20
argM _ _ _ = Nothing
20
false
false
0
5
5
13
6
7
null
null
cchens/courseography
hs/ImageResponse.hs
gpl-3.0
-- | Creates an image, and returns the base64 representation of that image. getGraphImage :: Int64 -> M.Map String String -> IO Response getGraphImage gId courseMap = do gen <- newStdGen let (rand, _) = next gen svgFilename = (show rand ++ ".svg") imageFilename = (show rand ++ ".png") buildSVG gId courseMap svgFilename True returnImageData svgFilename imageFilename -- | Creates an image, and returns the base64 representation of that image.
476
getGraphImage :: Int64 -> M.Map String String -> IO Response getGraphImage gId courseMap = do gen <- newStdGen let (rand, _) = next gen svgFilename = (show rand ++ ".svg") imageFilename = (show rand ++ ".png") buildSVG gId courseMap svgFilename True returnImageData svgFilename imageFilename -- | Creates an image, and returns the base64 representation of that image.
400
getGraphImage gId courseMap = do gen <- newStdGen let (rand, _) = next gen svgFilename = (show rand ++ ".svg") imageFilename = (show rand ++ ".png") buildSVG gId courseMap svgFilename True returnImageData svgFilename imageFilename -- | Creates an image, and returns the base64 representation of that image.
339
true
true
0
12
102
112
54
58
null
null
vikraman/ghc
compiler/types/Type.hs
bsd-3-clause
-- | Is this a numeric literal. We also look through type synonyms. isNumLitTy :: Type -> Maybe Integer isNumLitTy ty | Just ty1 <- coreView ty = isNumLitTy ty1
160
isNumLitTy :: Type -> Maybe Integer isNumLitTy ty | Just ty1 <- coreView ty = isNumLitTy ty1
92
isNumLitTy ty | Just ty1 <- coreView ty = isNumLitTy ty1
56
true
true
0
9
29
45
19
26
null
null
fffej/HS-Poker
LookupPatternMatch.hs
bsd-3-clause
getValueFromProduct 6271811 = 1662
34
getValueFromProduct 6271811 = 1662
34
getValueFromProduct 6271811 = 1662
34
false
false
0
5
3
9
4
5
null
null
laurencer/confluence-sync
vendor/http-streams/tests/TestSuite.hs
bsd-3-clause
testResponseParser1 = it "parses a simple 200 response" $ do p <- Streams.withFileAsInput "tests/example1.txt" (\i -> readResponseHeader i) assertEqual "Incorrect parse of response" 200 (getStatusCode p) return ()
242
testResponseParser1 = it "parses a simple 200 response" $ do p <- Streams.withFileAsInput "tests/example1.txt" (\i -> readResponseHeader i) assertEqual "Incorrect parse of response" 200 (getStatusCode p) return ()
242
testResponseParser1 = it "parses a simple 200 response" $ do p <- Streams.withFileAsInput "tests/example1.txt" (\i -> readResponseHeader i) assertEqual "Incorrect parse of response" 200 (getStatusCode p) return ()
242
false
false
0
12
56
62
28
34
null
null
wildsebastian/99HaskellProblems
01-10_ListProblems/MyList.hs
mit
elementAt (x:xs) position | length (x:xs) < position = error "Out of bounds!" | position < 0 = error "Negative positions not supported!" | position == 1 = x | otherwise = elementAt xs (position - 1)
206
elementAt (x:xs) position | length (x:xs) < position = error "Out of bounds!" | position < 0 = error "Negative positions not supported!" | position == 1 = x | otherwise = elementAt xs (position - 1)
206
elementAt (x:xs) position | length (x:xs) < position = error "Out of bounds!" | position < 0 = error "Negative positions not supported!" | position == 1 = x | otherwise = elementAt xs (position - 1)
206
false
false
3
11
44
89
42
47
null
null
rleshchinskiy/vector
Data/Vector/Generic/New.hs
bsd-3-clause
transform f g (New p) = New (MVector.transform f =<< p)
55
transform f g (New p) = New (MVector.transform f =<< p)
55
transform f g (New p) = New (MVector.transform f =<< p)
55
false
false
0
9
10
34
16
18
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
withdrawn = id
14
withdrawn = id
14
withdrawn = id
14
false
false
0
4
2
6
3
3
null
null
JPMoresmau/leksah-server
src/IDE/Core/CTypes.hs
gpl-2.0
parenList :: [Doc] -> Doc parenList = PP.parens . fsep . PP.punctuate PP.comma
78
parenList :: [Doc] -> Doc parenList = PP.parens . fsep . PP.punctuate PP.comma
78
parenList = PP.parens . fsep . PP.punctuate PP.comma
52
false
true
0
7
12
35
18
17
null
null
superduper/digestive-functors-aeson
src/Text/Digestive/Aeson.hs
gpl-3.0
-------------------------------------------------------------------------------- {-| Given a JSON document and a form, attempt to use the JSON document to evaluation the form. If the form fails validation, then 'Nothing' is returned. Example: > import Data.Aeson (json) > import Data.Attoparsec.Lazy (parse, maybeResult) > import Text.Digestive.Aeson (digestJSON) > ... > Just parsedJson <- maybeResult . parse json <$> fetchJsonText > digestJSON "" myForm parsedJson -} digestJSON :: Monad m => Form v m a -- ^ The form to evaluate. -> Value -- ^ The JSON document to use for validation. If you need to use -- only part of this document, you need to transform this value -- first. You may find the @aeson-lens@ package useful for this. -> m (View v, Maybe a) digestJSON f json = postForm "" f (const (return (jsonEnv json))) where jsonEnv :: Monad m => Value -> Env m jsonEnv v p | last p == "indices" = case join (Just v ^? pathToLens (init p)) of Just (Array a) -> return $ return . TextInput $ unparseIndices [0 .. (pred $ V.length a)] _ -> return [ TextInput "" ] | otherwise = return . maybe [] jsonToText $ join (Just v ^? pathToLens p) jsonToText (String s) = [TextInput s] jsonToText (Bool True) = [TextInput "on"] jsonToText (Bool False) = [TextInput "off"] jsonToText (Number n) = showPack n jsonToText Null = [] jsonToText (Object _) = [] jsonToText (Array _) = [] showPack = return . TextInput . T.pack . show -------------------------------------------------------------------------------- {-| Takes a 'View' and displays any errors in a hierachical format that matches the expected input. Example: > > jsonErrors myForm > {"person":{"name":"This field is required"}} -}
1,957
digestJSON :: Monad m => Form v m a -- ^ The form to evaluate. -> Value -- ^ The JSON document to use for validation. If you need to use -- only part of this document, you need to transform this value -- first. You may find the @aeson-lens@ package useful for this. -> m (View v, Maybe a) digestJSON f json = postForm "" f (const (return (jsonEnv json))) where jsonEnv :: Monad m => Value -> Env m jsonEnv v p | last p == "indices" = case join (Just v ^? pathToLens (init p)) of Just (Array a) -> return $ return . TextInput $ unparseIndices [0 .. (pred $ V.length a)] _ -> return [ TextInput "" ] | otherwise = return . maybe [] jsonToText $ join (Just v ^? pathToLens p) jsonToText (String s) = [TextInput s] jsonToText (Bool True) = [TextInput "on"] jsonToText (Bool False) = [TextInput "off"] jsonToText (Number n) = showPack n jsonToText Null = [] jsonToText (Object _) = [] jsonToText (Array _) = [] showPack = return . TextInput . T.pack . show -------------------------------------------------------------------------------- {-| Takes a 'View' and displays any errors in a hierachical format that matches the expected input. Example: > > jsonErrors myForm > {"person":{"name":"This field is required"}} -}
1,460
digestJSON f json = postForm "" f (const (return (jsonEnv json))) where jsonEnv :: Monad m => Value -> Env m jsonEnv v p | last p == "indices" = case join (Just v ^? pathToLens (init p)) of Just (Array a) -> return $ return . TextInput $ unparseIndices [0 .. (pred $ V.length a)] _ -> return [ TextInput "" ] | otherwise = return . maybe [] jsonToText $ join (Just v ^? pathToLens p) jsonToText (String s) = [TextInput s] jsonToText (Bool True) = [TextInput "on"] jsonToText (Bool False) = [TextInput "off"] jsonToText (Number n) = showPack n jsonToText Null = [] jsonToText (Object _) = [] jsonToText (Array _) = [] showPack = return . TextInput . T.pack . show -------------------------------------------------------------------------------- {-| Takes a 'View' and displays any errors in a hierachical format that matches the expected input. Example: > > jsonErrors myForm > {"person":{"name":"This field is required"}} -}
1,094
true
true
11
15
546
396
195
201
null
null
spechub/Hets
CASL/QuickCheck.hs
gpl-2.0
showSingleAssignment :: QModel -> (VAR, CASLTERM) -> String showSingleAssignment qm (v, t) = show v ++ "->" ++ showDoc (rmTypesT (const return) (const id) (sign qm) t) ""
172
showSingleAssignment :: QModel -> (VAR, CASLTERM) -> String showSingleAssignment qm (v, t) = show v ++ "->" ++ showDoc (rmTypesT (const return) (const id) (sign qm) t) ""
172
showSingleAssignment qm (v, t) = show v ++ "->" ++ showDoc (rmTypesT (const return) (const id) (sign qm) t) ""
112
false
true
0
10
29
82
42
40
null
null
ejconlon/analyze
test/Generation.hs
bsd-3-clause
declGen :: Data k => Gen k -> Gen t -> Gen (Vector (k, t)) declGen kg tg = sized (declGenSized kg tg)
101
declGen :: Data k => Gen k -> Gen t -> Gen (Vector (k, t)) declGen kg tg = sized (declGenSized kg tg)
101
declGen kg tg = sized (declGenSized kg tg)
42
false
true
0
12
22
68
31
37
null
null
holmisen/glbrix
src/Types.hs
gpl-3.0
translate :: V3 Int -> P3 -> P3 translate (Vector3 a b c) (P3 x y z) = P3 (x + a) (y + b) (z + c)
97
translate :: V3 Int -> P3 -> P3 translate (Vector3 a b c) (P3 x y z) = P3 (x + a) (y + b) (z + c)
97
translate (Vector3 a b c) (P3 x y z) = P3 (x + a) (y + b) (z + c)
65
false
true
0
7
27
75
38
37
null
null
OpenXT/manager
xenmgr/Vm/Config.hs
gpl-2.0
stringifyXlConfig :: XlConfig -> String stringifyXlConfig (XlConfig params) = unlines params
92
stringifyXlConfig :: XlConfig -> String stringifyXlConfig (XlConfig params) = unlines params
92
stringifyXlConfig (XlConfig params) = unlines params
52
false
true
0
7
10
27
13
14
null
null
nushio3/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
negateClassOpKey = mkPreludeMiscIdUnique 169
57
negateClassOpKey = mkPreludeMiscIdUnique 169
57
negateClassOpKey = mkPreludeMiscIdUnique 169
57
false
false
0
5
16
9
4
5
null
null
kustomzone/plush
src/Plush/Types.hs
apache-2.0
commandAssignment a = SimpleCommand [] [a] []
46
commandAssignment a = SimpleCommand [] [a] []
46
commandAssignment a = SimpleCommand [] [a] []
46
false
false
0
6
7
23
11
12
null
null
carymrobbins/haskell-conf
tools/generate-readme.hs
bsd-3-clause
parseBody = lines >>> parseDescription >>> parseNewlines >>> parseCode >>> unlines
102
parseBody = lines >>> parseDescription >>> parseNewlines >>> parseCode >>> unlines
102
parseBody = lines >>> parseDescription >>> parseNewlines >>> parseCode >>> unlines
102
false
false
9
5
30
30
11
19
null
null
kaoskorobase/mescaline
resources/hugs/packages/base/Data/Map.hs
gpl-3.0
-- | /O(n)/. Map keys\/values and collect the 'Just' results. mapMaybeWithKey :: Ord k => (k -> a -> Maybe b) -> Map k a -> Map k b mapMaybeWithKey f Tip = Tip
159
mapMaybeWithKey :: Ord k => (k -> a -> Maybe b) -> Map k a -> Map k b mapMaybeWithKey f Tip = Tip
97
mapMaybeWithKey f Tip = Tip
27
true
true
0
10
33
56
27
29
null
null
mrshannon/trees
src/Input/Keyboard/GLUT.hs
gpl-2.0
changeAsciiKeyState 'p' ns k = k { pKey = ns }
46
changeAsciiKeyState 'p' ns k = k { pKey = ns }
46
changeAsciiKeyState 'p' ns k = k { pKey = ns }
46
false
false
0
6
10
21
11
10
null
null
sdiehl/ghc
compiler/types/Coercion.hs
bsd-3-clause
------------------------------------------------------- -- and some coercion kind stuff coVarLType, coVarRType :: HasDebugCallStack => CoVar -> Type coVarLType cv | (_, _, ty1, _, _) <- coVarKindsTypesRole cv = ty1
215
coVarLType, coVarRType :: HasDebugCallStack => CoVar -> Type coVarLType cv | (_, _, ty1, _, _) <- coVarKindsTypesRole cv = ty1
126
coVarLType cv | (_, _, ty1, _, _) <- coVarKindsTypesRole cv = ty1
65
true
true
2
9
28
62
30
32
null
null
23Skidoo/snap
src/Snap/Snaplet/Auth/Handlers.hs
bsd-3-clause
withBackend :: (forall r. (IAuthBackend r) => r -> Handler b (AuthManager v) a) -- ^ The function to run with the handler. -> Handler b (AuthManager v) a withBackend f = join $ do (AuthManager backend_ _ _ _ _ _ _ _ _ _) <- get return $ f backend_ ------------------------------------------------------------------------------ -- | This function generates a random password reset token and stores it in -- the database for the user. Call this function when a user forgets their -- password. Then use the token to autogenerate a link that the user can -- visit to reset their password. This function also sets a timestamp so the -- reset token can be expired.
679
withBackend :: (forall r. (IAuthBackend r) => r -> Handler b (AuthManager v) a) -- ^ The function to run with the handler. -> Handler b (AuthManager v) a withBackend f = join $ do (AuthManager backend_ _ _ _ _ _ _ _ _ _) <- get return $ f backend_ ------------------------------------------------------------------------------ -- | This function generates a random password reset token and stores it in -- the database for the user. Call this function when a user forgets their -- password. Then use the token to autogenerate a link that the user can -- visit to reset their password. This function also sets a timestamp so the -- reset token can be expired.
679
withBackend f = join $ do (AuthManager backend_ _ _ _ _ _ _ _ _ _) <- get return $ f backend_ ------------------------------------------------------------------------------ -- | This function generates a random password reset token and stores it in -- the database for the user. Call this function when a user forgets their -- password. Then use the token to autogenerate a link that the user can -- visit to reset their password. This function also sets a timestamp so the -- reset token can be expired.
513
false
true
0
13
135
118
61
57
null
null
markus-git/PBKDF2
src/Soft2.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- ** HMAC-SHA1 -------------------------------------------------------------------------------- hmac :: SArr SWord8 -> SArr SWord8 -> Software (SArr SWord8) hmac msg key = undefined
264
hmac :: SArr SWord8 -> SArr SWord8 -> Software (SArr SWord8) hmac msg key = undefined
85
hmac msg key = undefined
24
true
true
0
9
21
42
21
21
null
null
avh4/elm-format
elm-format-lib/src/Parse/Comments.hs
bsd-3-clause
preCommented :: IParser a -> IParser (C1 l a) preCommented a = C <$> whitespace <*> a
89
preCommented :: IParser a -> IParser (C1 l a) preCommented a = C <$> whitespace <*> a
89
preCommented a = C <$> whitespace <*> a
43
false
true
0
8
20
40
19
21
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
unRec1_RDR = varQual_RDR gHC_GENERICS (fsLit "unRec1")
55
unRec1_RDR = varQual_RDR gHC_GENERICS (fsLit "unRec1")
55
unRec1_RDR = varQual_RDR gHC_GENERICS (fsLit "unRec1")
55
false
false
1
7
6
21
8
13
null
null
sinjar666/fbthrift
thrift/compiler/test/fixtures/namespace/gen-hs/My/Namespacing/Test/Hsmodule_Types.hs
apache-2.0
encode_HsFoo :: (Thrift.Protocol p, Thrift.Transport t) => p t -> HsFoo -> BS.ByteString encode_HsFoo oprot record = Thrift.serializeVal oprot $ from_HsFoo record
162
encode_HsFoo :: (Thrift.Protocol p, Thrift.Transport t) => p t -> HsFoo -> BS.ByteString encode_HsFoo oprot record = Thrift.serializeVal oprot $ from_HsFoo record
162
encode_HsFoo oprot record = Thrift.serializeVal oprot $ from_HsFoo record
73
false
true
0
8
21
60
29
31
null
null
thoughtpolice/cabal
Cabal/Distribution/PackageDescription.hs
bsd-3-clause
testType :: TestSuite -> TestType testType test = case testInterface test of TestSuiteExeV10 ver _ -> TestTypeExe ver TestSuiteLibV09 ver _ -> TestTypeLib ver TestSuiteUnsupported testtype -> testtype -- --------------------------------------------------------------------------- -- The Benchmark type -- | A \"benchmark\" stanza in a cabal file. --
373
testType :: TestSuite -> TestType testType test = case testInterface test of TestSuiteExeV10 ver _ -> TestTypeExe ver TestSuiteLibV09 ver _ -> TestTypeLib ver TestSuiteUnsupported testtype -> testtype -- --------------------------------------------------------------------------- -- The Benchmark type -- | A \"benchmark\" stanza in a cabal file. --
373
testType test = case testInterface test of TestSuiteExeV10 ver _ -> TestTypeExe ver TestSuiteLibV09 ver _ -> TestTypeLib ver TestSuiteUnsupported testtype -> testtype -- --------------------------------------------------------------------------- -- The Benchmark type -- | A \"benchmark\" stanza in a cabal file. --
339
false
true
0
8
67
66
32
34
null
null
Hi-Angel/yi
yi-core/src/Yi/Buffer/Misc.hs
gpl-2.0
queryAndModifyRawbuf :: (forall syntax. BufferImpl syntax -> (BufferImpl syntax,x)) -> FBuffer -> (FBuffer, x) queryAndModifyRawbuf f (FBuffer f1 f5 f3) = let (f5', x) = f f5 in (FBuffer f1 f5' f3, x)
229
queryAndModifyRawbuf :: (forall syntax. BufferImpl syntax -> (BufferImpl syntax,x)) -> FBuffer -> (FBuffer, x) queryAndModifyRawbuf f (FBuffer f1 f5 f3) = let (f5', x) = f f5 in (FBuffer f1 f5' f3, x)
229
queryAndModifyRawbuf f (FBuffer f1 f5 f3) = let (f5', x) = f f5 in (FBuffer f1 f5' f3, x)
97
false
true
0
10
61
98
51
47
null
null
ob-cs-hm-edu/compiler-md2html
src/HTMLGen.hs
bsd-3-clause
generateHTML :: AST -> String generateHTML ast = htmlHead ++ generateHTML' ast ++ htmlFooter
92
generateHTML :: AST -> String generateHTML ast = htmlHead ++ generateHTML' ast ++ htmlFooter
92
generateHTML ast = htmlHead ++ generateHTML' ast ++ htmlFooter
62
false
true
2
7
13
36
15
21
null
null
hguenther/smtlib2
Language/SMTLib2/Internals/Expression.hs
gpl-3.0
allEqFromList :: [a tp] -> (forall n. Natural n -> List a (AllEq tp n) -> r) -> r allEqFromList [] f = f Zero Nil
113
allEqFromList :: [a tp] -> (forall n. Natural n -> List a (AllEq tp n) -> r) -> r allEqFromList [] f = f Zero Nil
113
allEqFromList [] f = f Zero Nil
31
false
true
0
14
25
74
35
39
null
null
ezyang/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
integerToInt64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToInt64") integerToInt64IdKey
96
integerToInt64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToInt64") integerToInt64IdKey
96
integerToInt64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToInt64") integerToInt64IdKey
96
false
false
1
7
12
22
9
13
null
null
brendanhay/gogol
gogol-dns/gen/Network/Google/Resource/DNS/Policies/Patch.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). ppUploadType :: Lens' PoliciesPatch (Maybe Text) ppUploadType = lens _ppUploadType (\ s a -> s{_ppUploadType = a})
187
ppUploadType :: Lens' PoliciesPatch (Maybe Text) ppUploadType = lens _ppUploadType (\ s a -> s{_ppUploadType = a})
116
ppUploadType = lens _ppUploadType (\ s a -> s{_ppUploadType = a})
67
true
true
1
9
28
52
25
27
null
null
wangwangwar/cis194
src/ch7/Ch7.hs
bsd-3-clause
treeSum' :: Tree Integer -> Integer treeSum' = treeFold 0 (\l x r -> l + r + x)
79
treeSum' :: Tree Integer -> Integer treeSum' = treeFold 0 (\l x r -> l + r + x)
79
treeSum' = treeFold 0 (\l x r -> l + r + x)
43
false
true
0
9
18
51
23
28
null
null
mgsloan/airship
src/Airship/Internal/Decision.hs
mit
g08 r@Resource{..} = do trace "g08" req <- lift request let reqHeaders = requestHeaders req case lookup hIfMatch reqHeaders of (Just _h) -> g09 r Nothing -> h10 r
218
g08 r@Resource{..} = do trace "g08" req <- lift request let reqHeaders = requestHeaders req case lookup hIfMatch reqHeaders of (Just _h) -> g09 r Nothing -> h10 r
218
g08 r@Resource{..} = do trace "g08" req <- lift request let reqHeaders = requestHeaders req case lookup hIfMatch reqHeaders of (Just _h) -> g09 r Nothing -> h10 r
218
false
false
1
12
84
86
36
50
null
null
bgwines/avalon-meta-comparison
Metas.hs
bsd-3-clause
getMissionSize 6 3 = 3
22
getMissionSize 6 3 = 3
22
getMissionSize 6 3 = 3
22
false
false
0
5
4
11
5
6
null
null
monostable/haskell-kicad-data
tests/Parse.hs
mit
parseAndDisplay :: [String] -> IO () parseAndDisplay [] = return ()
67
parseAndDisplay :: [String] -> IO () parseAndDisplay [] = return ()
67
parseAndDisplay [] = return ()
30
false
true
0
7
10
33
16
17
null
null
brendanhay/gogol
gogol-iam/gen/Network/Google/IAM/Types/Product.hs
mpl-2.0
-- | Creates a value of 'UndeleteWorkLoadIdentityPoolProviderRequest' with the minimum fields required to make a request. -- undeleteWorkLoadIdentityPoolProviderRequest :: UndeleteWorkLoadIdentityPoolProviderRequest undeleteWorkLoadIdentityPoolProviderRequest = UndeleteWorkLoadIdentityPoolProviderRequest'
312
undeleteWorkLoadIdentityPoolProviderRequest :: UndeleteWorkLoadIdentityPoolProviderRequest undeleteWorkLoadIdentityPoolProviderRequest = UndeleteWorkLoadIdentityPoolProviderRequest'
187
undeleteWorkLoadIdentityPoolProviderRequest = UndeleteWorkLoadIdentityPoolProviderRequest'
92
true
true
1
5
28
17
8
9
null
null
GaloisInc/pads-haskell
Examples/First.hs
bsd-3-clause
test_Record = mkTestCase "Record" expect_Record result_Record
63
test_Record = mkTestCase "Record" expect_Record result_Record
63
test_Record = mkTestCase "Record" expect_Record result_Record
63
false
false
0
5
7
13
6
7
null
null
jfoutz/language-bash
src/Language/Bash/Word.hs
bsd-3-clause
prettyParameter :: Bool -> Parameter -> Doc -> Doc prettyParameter bang param suffix = "${" <> (if bang then "!" else empty) <> pretty param <> suffix <> "}"
161
prettyParameter :: Bool -> Parameter -> Doc -> Doc prettyParameter bang param suffix = "${" <> (if bang then "!" else empty) <> pretty param <> suffix <> "}"
161
prettyParameter bang param suffix = "${" <> (if bang then "!" else empty) <> pretty param <> suffix <> "}"
110
false
true
0
10
32
60
31
29
null
null
sdiehl/ghc
libraries/ghc-boot/GHC/Serialized.hs
bsd-3-clause
serializeWithData :: Data a => a -> [Word8] serializeWithData what = serializeWithData' what []
95
serializeWithData :: Data a => a -> [Word8] serializeWithData what = serializeWithData' what []
95
serializeWithData what = serializeWithData' what []
51
false
true
0
9
13
40
18
22
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
{- - The part from which the vessel is controlled. -} setPartsControlling :: KRPCHS.SpaceCenter.Parts -> KRPCHS.SpaceCenter.Part -> RPCContext () setPartsControlling thisArg valueArg = do let r = makeRequest "SpaceCenter" "Parts_set_Controlling" [makeArgument 0 thisArg, makeArgument 1 valueArg] res <- sendRequest r processResponse res {- - The current amount of propellant. -}
396
setPartsControlling :: KRPCHS.SpaceCenter.Parts -> KRPCHS.SpaceCenter.Part -> RPCContext () setPartsControlling thisArg valueArg = do let r = makeRequest "SpaceCenter" "Parts_set_Controlling" [makeArgument 0 thisArg, makeArgument 1 valueArg] res <- sendRequest r processResponse res {- - The current amount of propellant. -}
340
setPartsControlling thisArg valueArg = do let r = makeRequest "SpaceCenter" "Parts_set_Controlling" [makeArgument 0 thisArg, makeArgument 1 valueArg] res <- sendRequest r processResponse res {- - The current amount of propellant. -}
248
true
true
0
13
67
90
42
48
null
null
DaMSL/K3
src/Language/K3/Interpreter/Builtins/DateTime.hs
apache-2.0
genDateTimeBuiltin "getUTCTime" _ = Just $ vfun $ \_ -> do currentTime <- liftIO $ getCurrentTime dayTime <- return $ utctDayTime currentTime timeOfDay <- return $ timeToTimeOfDay dayTime return $ VRecord $ Map.fromList $ [("h", (VInt $ todHour timeOfDay, MemImmut)), ("m", (VInt $ todMin timeOfDay, MemImmut)), ("s", (VInt $ truncate $ todSec timeOfDay, MemImmut))] -- getUTCTimeWithFormat :: string -> string
447
genDateTimeBuiltin "getUTCTime" _ = Just $ vfun $ \_ -> do currentTime <- liftIO $ getCurrentTime dayTime <- return $ utctDayTime currentTime timeOfDay <- return $ timeToTimeOfDay dayTime return $ VRecord $ Map.fromList $ [("h", (VInt $ todHour timeOfDay, MemImmut)), ("m", (VInt $ todMin timeOfDay, MemImmut)), ("s", (VInt $ truncate $ todSec timeOfDay, MemImmut))] -- getUTCTimeWithFormat :: string -> string
447
genDateTimeBuiltin "getUTCTime" _ = Just $ vfun $ \_ -> do currentTime <- liftIO $ getCurrentTime dayTime <- return $ utctDayTime currentTime timeOfDay <- return $ timeToTimeOfDay dayTime return $ VRecord $ Map.fromList $ [("h", (VInt $ todHour timeOfDay, MemImmut)), ("m", (VInt $ todMin timeOfDay, MemImmut)), ("s", (VInt $ truncate $ todSec timeOfDay, MemImmut))] -- getUTCTimeWithFormat :: string -> string
447
false
false
0
14
96
151
79
72
null
null
google/cabal2bazel
bzl/tests/ffi/LinkInputsTest.hs
apache-2.0
main :: IO () main = return ()
30
main :: IO () main = return ()
30
main = return ()
16
false
true
1
6
7
24
10
14
null
null
termite2/tsl
Frontend/ExprFlatten.hs
bsd-3-clause
-- Flatten static enum or const name by prepending template name to it flattenName :: (WithName a) => Template -> a -> Ident flattenName t x = Ident (pos $ name x) $ (sname t) ++ "::" ++ (sname x)
196
flattenName :: (WithName a) => Template -> a -> Ident flattenName t x = Ident (pos $ name x) $ (sname t) ++ "::" ++ (sname x)
125
flattenName t x = Ident (pos $ name x) $ (sname t) ++ "::" ++ (sname x)
71
true
true
0
11
39
71
36
35
null
null
brendanhay/gogol
gogol-vision/gen/Network/Google/Vision/Types/Product.hs
mpl-2.0
-- | UTF-8 text detected on the pages. gText :: Lens' GoogleCloudVisionV1p3beta1TextAnnotation (Maybe Text) gText = lens _gText (\ s a -> s{_gText = a})
152
gText :: Lens' GoogleCloudVisionV1p3beta1TextAnnotation (Maybe Text) gText = lens _gText (\ s a -> s{_gText = a})
113
gText = lens _gText (\ s a -> s{_gText = a})
44
true
true
1
9
24
52
25
27
null
null
spanners/dissertation
dissertation/code/elm-lang.org/server/Editor.hs
mit
empty :: Html empty = ideBuilder Elm "50%,50%" "1" "Try Elm" "Empty.elm" "/Try.elm"
83
empty :: Html empty = ideBuilder Elm "50%,50%" "1" "Try Elm" "Empty.elm" "/Try.elm"
83
empty = ideBuilder Elm "50%,50%" "1" "Try Elm" "Empty.elm" "/Try.elm"
69
false
true
0
5
12
24
12
12
null
null
sol/pandoc
src/Text/Pandoc/Writers/LaTeX.hs
gpl-2.0
blockToLaTeX (Header level lst) = sectionHeader "" level lst
60
blockToLaTeX (Header level lst) = sectionHeader "" level lst
60
blockToLaTeX (Header level lst) = sectionHeader "" level lst
60
false
false
0
6
8
25
11
14
null
null
anton-k/language-css
src/Language/Css/Build/Tags.hs
bsd-3-clause
-- | @col@ tag col :: Sel' col = ident "col"
44
col :: Sel' col = ident "col"
29
col = ident "col"
17
true
true
0
6
10
22
9
13
null
null
sdiehl/ghc
compiler/main/FileCleanup.hs
bsd-3-clause
-- Find a temporary name that doesn't already exist. newTempName :: DynFlags -> TempFileLifetime -> Suffix -> IO FilePath newTempName dflags lifetime extn = do d <- getTempDir dflags findTempName (d </> "ghc_") -- See Note [Deterministic base name] where findTempName :: FilePath -> IO FilePath findTempName prefix = do n <- newTempSuffix dflags let filename = prefix ++ show n <.> extn b <- doesFileExist filename if b then findTempName prefix else do -- clean it up later addFilesToClean dflags lifetime [filename] return filename
654
newTempName :: DynFlags -> TempFileLifetime -> Suffix -> IO FilePath newTempName dflags lifetime extn = do d <- getTempDir dflags findTempName (d </> "ghc_") -- See Note [Deterministic base name] where findTempName :: FilePath -> IO FilePath findTempName prefix = do n <- newTempSuffix dflags let filename = prefix ++ show n <.> extn b <- doesFileExist filename if b then findTempName prefix else do -- clean it up later addFilesToClean dflags lifetime [filename] return filename
601
newTempName dflags lifetime extn = do d <- getTempDir dflags findTempName (d </> "ghc_") -- See Note [Deterministic base name] where findTempName :: FilePath -> IO FilePath findTempName prefix = do n <- newTempSuffix dflags let filename = prefix ++ show n <.> extn b <- doesFileExist filename if b then findTempName prefix else do -- clean it up later addFilesToClean dflags lifetime [filename] return filename
532
true
true
2
12
206
155
72
83
null
null
Alasdair/Mella
Lang/Term.hs
bsd-3-clause
inf (Lam _ _) = False
21
inf (Lam _ _) = False
21
inf (Lam _ _) = False
21
false
false
0
6
5
18
8
10
null
null
snoyberg/ghc
compiler/hsSyn/HsDecls.hs
bsd-3-clause
hsGroupInstDecls :: HsGroup id -> [LInstDecl id] hsGroupInstDecls = (=<<) group_instds . hs_tyclds
98
hsGroupInstDecls :: HsGroup id -> [LInstDecl id] hsGroupInstDecls = (=<<) group_instds . hs_tyclds
98
hsGroupInstDecls = (=<<) group_instds . hs_tyclds
49
false
true
0
7
12
33
17
16
null
null
noteed/covered
bin/covered.hs
bsd-3-clause
index_exp = "expressions"
26
index_exp = "expressions"
26
index_exp = "expressions"
26
false
false
0
4
3
6
3
3
null
null
sopvop/cabal
cabal-install/Distribution/Client/Freeze.hs
bsd-3-clause
planPackages :: Verbosity -> Compiler -> Platform -> Maybe SandboxPackageInfo -> FreezeFlags -> InstalledPackageIndex -> SourcePackageDb -> PkgConfigDb -> [PackageSpecifier UnresolvedSourcePackage] -> IO [SolverPlanPackage] planPackages verbosity comp platform mSandboxPkgInfo freezeFlags installedPkgIndex sourcePkgDb pkgConfigDb pkgSpecifiers = do solver <- chooseSolver verbosity (fromFlag (freezeSolver freezeFlags)) (compilerInfo comp) notice verbosity "Resolving dependencies..." installPlan <- foldProgress logMsg die return $ resolveDependencies platform (compilerInfo comp) pkgConfigDb solver resolverParams return $ pruneInstallPlan installPlan pkgSpecifiers where resolverParams = setMaxBackjumps (if maxBackjumps < 0 then Nothing else Just maxBackjumps) . setIndependentGoals independentGoals . setReorderGoals reorderGoals . setCountConflicts countConflicts . setShadowPkgs shadowPkgs . setStrongFlags strongFlags . addConstraints [ let pkg = pkgSpecifierTarget pkgSpecifier pc = PackageConstraintStanzas pkg stanzas in LabeledPackageConstraint pc ConstraintSourceFreeze | pkgSpecifier <- pkgSpecifiers ] . maybe id applySandboxInstallPolicy mSandboxPkgInfo $ standardInstallPolicy installedPkgIndex sourcePkgDb pkgSpecifiers logMsg message rest = debug verbosity message >> rest stanzas = [ TestStanzas | testsEnabled ] ++ [ BenchStanzas | benchmarksEnabled ] testsEnabled = fromFlagOrDefault False $ freezeTests freezeFlags benchmarksEnabled = fromFlagOrDefault False $ freezeBenchmarks freezeFlags reorderGoals = fromFlag (freezeReorderGoals freezeFlags) countConflicts = fromFlag (freezeCountConflicts freezeFlags) independentGoals = fromFlag (freezeIndependentGoals freezeFlags) shadowPkgs = fromFlag (freezeShadowPkgs freezeFlags) strongFlags = fromFlag (freezeStrongFlags freezeFlags) maxBackjumps = fromFlag (freezeMaxBackjumps freezeFlags) -- | Remove all unneeded packages from an install plan. -- -- A package is unneeded if it is either -- -- 1) the package that we are freezing, or -- -- 2) not a dependency (directly or transitively) of the package we are -- freezing. This is useful for removing previously installed packages -- which are no longer required from the install plan. -- -- Invariant: @pkgSpecifiers@ must refer to packages which are not -- 'PreExisting' in the 'SolverInstallPlan'.
2,833
planPackages :: Verbosity -> Compiler -> Platform -> Maybe SandboxPackageInfo -> FreezeFlags -> InstalledPackageIndex -> SourcePackageDb -> PkgConfigDb -> [PackageSpecifier UnresolvedSourcePackage] -> IO [SolverPlanPackage] planPackages verbosity comp platform mSandboxPkgInfo freezeFlags installedPkgIndex sourcePkgDb pkgConfigDb pkgSpecifiers = do solver <- chooseSolver verbosity (fromFlag (freezeSolver freezeFlags)) (compilerInfo comp) notice verbosity "Resolving dependencies..." installPlan <- foldProgress logMsg die return $ resolveDependencies platform (compilerInfo comp) pkgConfigDb solver resolverParams return $ pruneInstallPlan installPlan pkgSpecifiers where resolverParams = setMaxBackjumps (if maxBackjumps < 0 then Nothing else Just maxBackjumps) . setIndependentGoals independentGoals . setReorderGoals reorderGoals . setCountConflicts countConflicts . setShadowPkgs shadowPkgs . setStrongFlags strongFlags . addConstraints [ let pkg = pkgSpecifierTarget pkgSpecifier pc = PackageConstraintStanzas pkg stanzas in LabeledPackageConstraint pc ConstraintSourceFreeze | pkgSpecifier <- pkgSpecifiers ] . maybe id applySandboxInstallPolicy mSandboxPkgInfo $ standardInstallPolicy installedPkgIndex sourcePkgDb pkgSpecifiers logMsg message rest = debug verbosity message >> rest stanzas = [ TestStanzas | testsEnabled ] ++ [ BenchStanzas | benchmarksEnabled ] testsEnabled = fromFlagOrDefault False $ freezeTests freezeFlags benchmarksEnabled = fromFlagOrDefault False $ freezeBenchmarks freezeFlags reorderGoals = fromFlag (freezeReorderGoals freezeFlags) countConflicts = fromFlag (freezeCountConflicts freezeFlags) independentGoals = fromFlag (freezeIndependentGoals freezeFlags) shadowPkgs = fromFlag (freezeShadowPkgs freezeFlags) strongFlags = fromFlag (freezeStrongFlags freezeFlags) maxBackjumps = fromFlag (freezeMaxBackjumps freezeFlags) -- | Remove all unneeded packages from an install plan. -- -- A package is unneeded if it is either -- -- 1) the package that we are freezing, or -- -- 2) not a dependency (directly or transitively) of the package we are -- freezing. This is useful for removing previously installed packages -- which are no longer required from the install plan. -- -- Invariant: @pkgSpecifiers@ must refer to packages which are not -- 'PreExisting' in the 'SolverInstallPlan'.
2,833
planPackages verbosity comp platform mSandboxPkgInfo freezeFlags installedPkgIndex sourcePkgDb pkgConfigDb pkgSpecifiers = do solver <- chooseSolver verbosity (fromFlag (freezeSolver freezeFlags)) (compilerInfo comp) notice verbosity "Resolving dependencies..." installPlan <- foldProgress logMsg die return $ resolveDependencies platform (compilerInfo comp) pkgConfigDb solver resolverParams return $ pruneInstallPlan installPlan pkgSpecifiers where resolverParams = setMaxBackjumps (if maxBackjumps < 0 then Nothing else Just maxBackjumps) . setIndependentGoals independentGoals . setReorderGoals reorderGoals . setCountConflicts countConflicts . setShadowPkgs shadowPkgs . setStrongFlags strongFlags . addConstraints [ let pkg = pkgSpecifierTarget pkgSpecifier pc = PackageConstraintStanzas pkg stanzas in LabeledPackageConstraint pc ConstraintSourceFreeze | pkgSpecifier <- pkgSpecifiers ] . maybe id applySandboxInstallPolicy mSandboxPkgInfo $ standardInstallPolicy installedPkgIndex sourcePkgDb pkgSpecifiers logMsg message rest = debug verbosity message >> rest stanzas = [ TestStanzas | testsEnabled ] ++ [ BenchStanzas | benchmarksEnabled ] testsEnabled = fromFlagOrDefault False $ freezeTests freezeFlags benchmarksEnabled = fromFlagOrDefault False $ freezeBenchmarks freezeFlags reorderGoals = fromFlag (freezeReorderGoals freezeFlags) countConflicts = fromFlag (freezeCountConflicts freezeFlags) independentGoals = fromFlag (freezeIndependentGoals freezeFlags) shadowPkgs = fromFlag (freezeShadowPkgs freezeFlags) strongFlags = fromFlag (freezeStrongFlags freezeFlags) maxBackjumps = fromFlag (freezeMaxBackjumps freezeFlags) -- | Remove all unneeded packages from an install plan. -- -- A package is unneeded if it is either -- -- 1) the package that we are freezing, or -- -- 2) not a dependency (directly or transitively) of the package we are -- freezing. This is useful for removing previously installed packages -- which are no longer required from the install plan. -- -- Invariant: @pkgSpecifiers@ must refer to packages which are not -- 'PreExisting' in the 'SolverInstallPlan'.
2,492
false
true
0
16
783
469
231
238
null
null
ajnsit/glambda
src/Language/Glambda/Parse.hs
bsd-3-clause
var :: Parser UExp var = do n <- tok' unName m_index <- asks (elemIndex n) case m_index of Nothing -> return (UGlobal n) Just i -> return (UVar i)
161
var :: Parser UExp var = do n <- tok' unName m_index <- asks (elemIndex n) case m_index of Nothing -> return (UGlobal n) Just i -> return (UVar i)
161
var = do n <- tok' unName m_index <- asks (elemIndex n) case m_index of Nothing -> return (UGlobal n) Just i -> return (UVar i)
142
false
true
1
13
44
84
36
48
null
null
dtekcth/DtekPortalen
src/Foundation.hs
bsd-2-clause
setErrorMessage t = setMessage [shamlet|$newline never <div .error>#{t} |]
86
setErrorMessage t = setMessage [shamlet|$newline never <div .error>#{t} |]
86
setErrorMessage t = setMessage [shamlet|$newline never <div .error>#{t} |]
86
false
false
0
5
20
16
9
7
null
null
hguenther/nbis
MemoryModel/Typed.hs
agpl-3.0
typedStore offset len eoff (tp:tps) idx expr (arr:arrs) | eoff >= len = fmap (\x -> (x,False)) (arr:arrs) | offset >= tlen = (arr,False):typedStore (offset - tlen) len eoff tps idx expr arrs | offset == 0 && tlen == len && eoff == 0 = (store arr idx expr,True):(fmap (\x -> (x,False)) arrs) | offset == 0 && tlen <= len-eoff = (store arr idx (bvextract' eoff tlen expr),True):(typedStore 0 len (eoff+tlen) tps idx expr arrs) | offset == 0 = (store arr idx (bvconcat expr (bvextract' eoff (tlen-len-eoff) (select arr idx))),True):(fmap (\x -> (x,False)) arrs) | otherwise = (store arr idx (bvconcat (bvextract' offset (tlen-offset) (select arr idx)) (bvconcat expr (bvextract' 0 (offset+len-eoff) (select arr idx)))),True):(fmap (\x -> (x,False)) arrs) where tlen = bitWidth' tp
1,188
typedStore offset len eoff (tp:tps) idx expr (arr:arrs) | eoff >= len = fmap (\x -> (x,False)) (arr:arrs) | offset >= tlen = (arr,False):typedStore (offset - tlen) len eoff tps idx expr arrs | offset == 0 && tlen == len && eoff == 0 = (store arr idx expr,True):(fmap (\x -> (x,False)) arrs) | offset == 0 && tlen <= len-eoff = (store arr idx (bvextract' eoff tlen expr),True):(typedStore 0 len (eoff+tlen) tps idx expr arrs) | offset == 0 = (store arr idx (bvconcat expr (bvextract' eoff (tlen-len-eoff) (select arr idx))),True):(fmap (\x -> (x,False)) arrs) | otherwise = (store arr idx (bvconcat (bvextract' offset (tlen-offset) (select arr idx)) (bvconcat expr (bvextract' 0 (offset+len-eoff) (select arr idx)))),True):(fmap (\x -> (x,False)) arrs) where tlen = bitWidth' tp
1,188
typedStore offset len eoff (tp:tps) idx expr (arr:arrs) | eoff >= len = fmap (\x -> (x,False)) (arr:arrs) | offset >= tlen = (arr,False):typedStore (offset - tlen) len eoff tps idx expr arrs | offset == 0 && tlen == len && eoff == 0 = (store arr idx expr,True):(fmap (\x -> (x,False)) arrs) | offset == 0 && tlen <= len-eoff = (store arr idx (bvextract' eoff tlen expr),True):(typedStore 0 len (eoff+tlen) tps idx expr arrs) | offset == 0 = (store arr idx (bvconcat expr (bvextract' eoff (tlen-len-eoff) (select arr idx))),True):(fmap (\x -> (x,False)) arrs) | otherwise = (store arr idx (bvconcat (bvextract' offset (tlen-offset) (select arr idx)) (bvconcat expr (bvextract' 0 (offset+len-eoff) (select arr idx)))),True):(fmap (\x -> (x,False)) arrs) where tlen = bitWidth' tp
1,188
false
false
0
17
537
478
249
229
null
null
mat8913/haskell-rust-experiments
haskell/hsbits/Setup.hs
apache-2.0
recurseDirs :: FilePath -> IO [FilePath] recurseDirs fp = listDirectory' fp >>= maybe (return [fp]) (fmap concat . mapM (recurseDirs . (fp</>)))
148
recurseDirs :: FilePath -> IO [FilePath] recurseDirs fp = listDirectory' fp >>= maybe (return [fp]) (fmap concat . mapM (recurseDirs . (fp</>)))
148
recurseDirs fp = listDirectory' fp >>= maybe (return [fp]) (fmap concat . mapM (recurseDirs . (fp</>)))
107
false
true
0
12
25
69
35
34
null
null
infotroph/pandoc
src/Text/Pandoc/Pretty.hs
gpl-2.0
-- | Inserts a blank line unless one exists already. -- (@blankline <> blankline@ has the same effect as @blankline@. blankline :: Doc blankline = Doc $ singleton (BlankLines 1)
177
blankline :: Doc blankline = Doc $ singleton (BlankLines 1)
59
blankline = Doc $ singleton (BlankLines 1)
42
true
true
0
8
29
26
14
12
null
null
simonmichael/hledger
hledger-lib/Hledger/Data/Types.hs
gpl-3.0
maCompare :: MixedAmount -> MixedAmount -> Ordering maCompare (Mixed a) (Mixed b) = go (M.toList a) (M.toList b) where go xss@((kx,x):xs) yss@((ky,y):ys) = case compare kx ky of EQ -> compareQuantities (Just x) (Just y) <> go xs ys LT -> compareQuantities (Just x) Nothing <> go xs yss GT -> compareQuantities Nothing (Just y) <> go xss ys go ((_,x):xs) [] = compareQuantities (Just x) Nothing <> go xs [] go [] ((_,y):ys) = compareQuantities Nothing (Just y) <> go [] ys go [] [] = EQ compareQuantities = comparing (maybe 0 aquantity) <> comparing (maybe 0 totalprice) totalprice x = case aprice x of Just (TotalPrice p) -> aquantity p _ -> 0 -- | Stores the CommoditySymbol of the Amount, along with the CommoditySymbol of -- the price, and its unit price if being used.
928
maCompare :: MixedAmount -> MixedAmount -> Ordering maCompare (Mixed a) (Mixed b) = go (M.toList a) (M.toList b) where go xss@((kx,x):xs) yss@((ky,y):ys) = case compare kx ky of EQ -> compareQuantities (Just x) (Just y) <> go xs ys LT -> compareQuantities (Just x) Nothing <> go xs yss GT -> compareQuantities Nothing (Just y) <> go xss ys go ((_,x):xs) [] = compareQuantities (Just x) Nothing <> go xs [] go [] ((_,y):ys) = compareQuantities Nothing (Just y) <> go [] ys go [] [] = EQ compareQuantities = comparing (maybe 0 aquantity) <> comparing (maybe 0 totalprice) totalprice x = case aprice x of Just (TotalPrice p) -> aquantity p _ -> 0 -- | Stores the CommoditySymbol of the Amount, along with the CommoditySymbol of -- the price, and its unit price if being used.
928
maCompare (Mixed a) (Mixed b) = go (M.toList a) (M.toList b) where go xss@((kx,x):xs) yss@((ky,y):ys) = case compare kx ky of EQ -> compareQuantities (Just x) (Just y) <> go xs ys LT -> compareQuantities (Just x) Nothing <> go xs yss GT -> compareQuantities Nothing (Just y) <> go xss ys go ((_,x):xs) [] = compareQuantities (Just x) Nothing <> go xs [] go [] ((_,y):ys) = compareQuantities Nothing (Just y) <> go [] ys go [] [] = EQ compareQuantities = comparing (maybe 0 aquantity) <> comparing (maybe 0 totalprice) totalprice x = case aprice x of Just (TotalPrice p) -> aquantity p _ -> 0 -- | Stores the CommoditySymbol of the Amount, along with the CommoditySymbol of -- the price, and its unit price if being used.
876
false
true
0
11
293
375
187
188
null
null
xaverdh/hfish-parser
HFish/UnParser/UnParser.hs
mit
unparseOrSt :: Stmt T.Text t -> T.Text unparseOrSt st = "or" <> " " <> unparse st
83
unparseOrSt :: Stmt T.Text t -> T.Text unparseOrSt st = "or" <> " " <> unparse st
83
unparseOrSt st = "or" <> " " <> unparse st
44
false
true
0
7
18
38
18
20
null
null
fmapfmapfmap/amazonka
amazonka-emr/gen/Network/AWS/EMR/Types/Product.hs
mpl-2.0
-- | The current state of the instance. isState :: Lens' InstanceStatus (Maybe InstanceState) isState = lens _isState (\ s a -> s{_isState = a})
144
isState :: Lens' InstanceStatus (Maybe InstanceState) isState = lens _isState (\ s a -> s{_isState = a})
104
isState = lens _isState (\ s a -> s{_isState = a})
50
true
true
2
9
24
55
25
30
null
null