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
Warbo/nix-eval
src/Language/Eval/Internal.hs
gpl-3.0
-- | Append packages to an expression's context withPkgs :: [Pkg] -> Expr -> Expr withPkgs ps x = x { ePkgs = ePkgs x ++ ps }
125
withPkgs :: [Pkg] -> Expr -> Expr withPkgs ps x = x { ePkgs = ePkgs x ++ ps }
77
withPkgs ps x = x { ePkgs = ePkgs x ++ ps }
43
true
true
0
8
27
43
23
20
null
null
skill-lang/skill
deps/haskell/Serialize.hs
bsd-3-clause
----------------------------------- ---------- VISUALIZATION ---------- ----------------------------------- print'tDs :: [TD_F] -> IO () print'tDs = mapM_ go where go (TDF id nameID count fDs subtypes lbpo rec) = putStrLn (" ### Type " ++ show id ++ " : s(" ++ show nameID ++ ") LBPO " ++ show lbpo ++ " Count " ++ show count ++ " ###") >> eL 1 >> mapM_ print'fD fDs >> eL 1 >> putStr "Number of Subtypes: " >> print (length subtypes) >> print rec >> print'tDs subtypes
498
print'tDs :: [TD_F] -> IO () print'tDs = mapM_ go where go (TDF id nameID count fDs subtypes lbpo rec) = putStrLn (" ### Type " ++ show id ++ " : s(" ++ show nameID ++ ") LBPO " ++ show lbpo ++ " Count " ++ show count ++ " ###") >> eL 1 >> mapM_ print'fD fDs >> eL 1 >> putStr "Number of Subtypes: " >> print (length subtypes) >> print rec >> print'tDs subtypes
389
print'tDs = mapM_ go where go (TDF id nameID count fDs subtypes lbpo rec) = putStrLn (" ### Type " ++ show id ++ " : s(" ++ show nameID ++ ") LBPO " ++ show lbpo ++ " Count " ++ show count ++ " ###") >> eL 1 >> mapM_ print'fD fDs >> eL 1 >> putStr "Number of Subtypes: " >> print (length subtypes) >> print rec >> print'tDs subtypes
360
true
true
0
22
112
165
78
87
null
null
olsner/ghc
compiler/cmm/CmmUtils.hs
bsd-3-clause
ofBlockList :: BlockId -> [CmmBlock] -> CmmGraph ofBlockList entry blocks = CmmGraph { g_entry = entry , g_graph = GMany NothingO body NothingO } where body = foldr addBlock emptyBody blocks
228
ofBlockList :: BlockId -> [CmmBlock] -> CmmGraph ofBlockList entry blocks = CmmGraph { g_entry = entry , g_graph = GMany NothingO body NothingO } where body = foldr addBlock emptyBody blocks
228
ofBlockList entry blocks = CmmGraph { g_entry = entry , g_graph = GMany NothingO body NothingO } where body = foldr addBlock emptyBody blocks
179
false
true
0
7
68
63
33
30
null
null
phischu/fragnix
builtins/base/GHC.Event.Manager.hs
bsd-3-clause
callbackTableVar :: EventManager -> Fd -> MVar (IntTable [FdData]) callbackTableVar mgr fd = emFds mgr ! hashFd fd
114
callbackTableVar :: EventManager -> Fd -> MVar (IntTable [FdData]) callbackTableVar mgr fd = emFds mgr ! hashFd fd
114
callbackTableVar mgr fd = emFds mgr ! hashFd fd
47
false
true
0
10
17
46
22
24
null
null
copton/ocram
ocram/src/Ocram/Names.hs
gpl-2.0
-- |The naming scheme for unique variable names varUnique :: String -> Int -> String varUnique = printf "%sunique_%s_%d" ecPrefix
129
varUnique :: String -> Int -> String varUnique = printf "%sunique_%s_%d" ecPrefix
81
varUnique = printf "%sunique_%s_%d" ecPrefix
44
true
true
0
8
19
32
14
18
null
null
Lythimus/lptv
sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Pretty.hs
gpl-2.0
renderList (BreakingSpace : NewLine : xs) = renderList (NewLine:xs)
67
renderList (BreakingSpace : NewLine : xs) = renderList (NewLine:xs)
67
renderList (BreakingSpace : NewLine : xs) = renderList (NewLine:xs)
67
false
false
0
8
8
30
15
15
null
null
ford-prefect/haskell-gi
lib/Data/GI/CodeGen/Overrides.hs
lgpl-2.1
-- Comments parseOneLine (T.stripPrefix "#" -> Just _) = return ()
66
parseOneLine (T.stripPrefix "#" -> Just _) = return ()
54
parseOneLine (T.stripPrefix "#" -> Just _) = return ()
54
true
false
0
9
10
30
14
16
null
null
brendanhay/gogol
gogol-spanner/gen/Network/Google/Resource/Spanner/Projects/Instances/Databases/DropDatabase.hs
mpl-2.0
-- | Creates a value of 'ProjectsInstancesDatabasesDropDatabase' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'pidddXgafv' -- -- * 'pidddUploadProtocol' -- -- * 'pidddDatabase' -- -- * 'pidddAccessToken' -- -- * 'pidddUploadType' -- -- * 'pidddCallback' projectsInstancesDatabasesDropDatabase :: Text -- ^ 'pidddDatabase' -> ProjectsInstancesDatabasesDropDatabase projectsInstancesDatabasesDropDatabase pPidddDatabase_ = ProjectsInstancesDatabasesDropDatabase' { _pidddXgafv = Nothing , _pidddUploadProtocol = Nothing , _pidddDatabase = pPidddDatabase_ , _pidddAccessToken = Nothing , _pidddUploadType = Nothing , _pidddCallback = Nothing }
766
projectsInstancesDatabasesDropDatabase :: Text -- ^ 'pidddDatabase' -> ProjectsInstancesDatabasesDropDatabase projectsInstancesDatabasesDropDatabase pPidddDatabase_ = ProjectsInstancesDatabasesDropDatabase' { _pidddXgafv = Nothing , _pidddUploadProtocol = Nothing , _pidddDatabase = pPidddDatabase_ , _pidddAccessToken = Nothing , _pidddUploadType = Nothing , _pidddCallback = Nothing }
424
projectsInstancesDatabasesDropDatabase pPidddDatabase_ = ProjectsInstancesDatabasesDropDatabase' { _pidddXgafv = Nothing , _pidddUploadProtocol = Nothing , _pidddDatabase = pPidddDatabase_ , _pidddAccessToken = Nothing , _pidddUploadType = Nothing , _pidddCallback = Nothing }
306
true
true
0
7
128
81
52
29
null
null
AaronFriel/hyhac
sandbox/src/Chaos/Doomsday.hs
bsd-3-clause
withDoomsdaySTM :: (Exception e) => [e] -> STM a -> STM a withDoomsdaySTM e f = do unsafeIOToSTM $ withDoomsday e (return ()) f
185
withDoomsdaySTM :: (Exception e) => [e] -> STM a -> STM a withDoomsdaySTM e f = do unsafeIOToSTM $ withDoomsday e (return ()) f
184
withDoomsdaySTM e f = do unsafeIOToSTM $ withDoomsday e (return ()) f
75
false
true
0
11
81
65
31
34
null
null
peddie/latc
Numeric/LATC/NestedList.hs
gpl-3.0
-- | How many elements are in the vector? length :: Vector b -> Int length (Vector v) = P.length v
98
length :: Vector b -> Int length (Vector v) = P.length v
56
length (Vector v) = P.length v
30
true
true
0
9
20
38
17
21
null
null
sdiehl/ghc
compiler/typecheck/TcOrigin.hs
bsd-3-clause
pprUserTypeCtxt (TyVarBndrKindCtxt n) = text "the kind annotation on the type variable" <+> quotes (ppr n)
106
pprUserTypeCtxt (TyVarBndrKindCtxt n) = text "the kind annotation on the type variable" <+> quotes (ppr n)
106
pprUserTypeCtxt (TyVarBndrKindCtxt n) = text "the kind annotation on the type variable" <+> quotes (ppr n)
106
false
false
0
8
15
31
14
17
null
null
shlevy/ghc
testsuite/tests/typecheck/should_compile/TcTypeNatSimple.hs
bsd-3-clause
e15 :: Proxy (x <=? x) -> Proxy True e15 = id
45
e15 :: Proxy (x <=? x) -> Proxy True e15 = id
45
e15 = id
8
false
true
0
9
11
34
15
19
null
null
peter-fogg/pardoc
src/Text/Pandoc/Templates.hs
gpl-2.0
-- | Get default template for the specified writer. getDefaultTemplate :: (Maybe FilePath) -- ^ User data directory to search first -> String -- ^ Name of writer -> IO (Either E.IOException String) getDefaultTemplate user writer = do let format = takeWhile (`notElem` "+-") writer -- strip off extensions case format of "native" -> return $ Right "" "json" -> return $ Right "" "docx" -> return $ Right "" "odt" -> getDefaultTemplate user "opendocument" "markdown_strict" -> getDefaultTemplate user "markdown" "multimarkdown" -> getDefaultTemplate user "markdown" "markdown_github" -> getDefaultTemplate user "markdown" "markdown_mmd" -> getDefaultTemplate user "markdown" "markdown_phpextra" -> getDefaultTemplate user "markdown" _ -> let fname = "templates" </> "default" <.> format in E.try $ readDataFileUTF8 user fname
993
getDefaultTemplate :: (Maybe FilePath) -- ^ User data directory to search first -> String -- ^ Name of writer -> IO (Either E.IOException String) getDefaultTemplate user writer = do let format = takeWhile (`notElem` "+-") writer -- strip off extensions case format of "native" -> return $ Right "" "json" -> return $ Right "" "docx" -> return $ Right "" "odt" -> getDefaultTemplate user "opendocument" "markdown_strict" -> getDefaultTemplate user "markdown" "multimarkdown" -> getDefaultTemplate user "markdown" "markdown_github" -> getDefaultTemplate user "markdown" "markdown_mmd" -> getDefaultTemplate user "markdown" "markdown_phpextra" -> getDefaultTemplate user "markdown" _ -> let fname = "templates" </> "default" <.> format in E.try $ readDataFileUTF8 user fname
941
getDefaultTemplate user writer = do let format = takeWhile (`notElem` "+-") writer -- strip off extensions case format of "native" -> return $ Right "" "json" -> return $ Right "" "docx" -> return $ Right "" "odt" -> getDefaultTemplate user "opendocument" "markdown_strict" -> getDefaultTemplate user "markdown" "multimarkdown" -> getDefaultTemplate user "markdown" "markdown_github" -> getDefaultTemplate user "markdown" "markdown_mmd" -> getDefaultTemplate user "markdown" "markdown_phpextra" -> getDefaultTemplate user "markdown" _ -> let fname = "templates" </> "default" <.> format in E.try $ readDataFileUTF8 user fname
747
true
true
0
15
285
215
104
111
null
null
pawel-n/lambda
Lambda/Driver.hs
apache-2.0
parseInput :: MonadDriver m => (ByteString, FilePath) -> ContT () m [Located (Decl LExpr)] parseInput (text, filePath) = ContT $ \cont -> case parse text of Left err -> printErrorStr err Right decls -> do target' <- view target if target' == DumpAST then printOutput . render . format $ (map unLoc decls) else cont decls -- | Transforms untyped AST into typed AST.
445
parseInput :: MonadDriver m => (ByteString, FilePath) -> ContT () m [Located (Decl LExpr)] parseInput (text, filePath) = ContT $ \cont -> case parse text of Left err -> printErrorStr err Right decls -> do target' <- view target if target' == DumpAST then printOutput . render . format $ (map unLoc decls) else cont decls -- | Transforms untyped AST into typed AST.
445
parseInput (text, filePath) = ContT $ \cont -> case parse text of Left err -> printErrorStr err Right decls -> do target' <- view target if target' == DumpAST then printOutput . render . format $ (map unLoc decls) else cont decls -- | Transforms untyped AST into typed AST.
354
false
true
0
16
144
149
72
77
null
null
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss/Graphics/Gloss/Data/ViewState.hs
mit
-- | Apply an event to a `ViewState`. updateViewStateWithEvent :: Event -> ViewState -> ViewState updateViewStateWithEvent ev viewState = fromMaybe viewState $ updateViewStateWithEventMaybe ev viewState
210
updateViewStateWithEvent :: Event -> ViewState -> ViewState updateViewStateWithEvent ev viewState = fromMaybe viewState $ updateViewStateWithEventMaybe ev viewState
172
updateViewStateWithEvent ev viewState = fromMaybe viewState $ updateViewStateWithEventMaybe ev viewState
112
true
true
0
6
32
37
18
19
null
null
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/GetConsoleOutput.hs
mpl-2.0
-- | The time the output was last updated. gcorsTimestamp :: Lens' GetConsoleOutputResponse (Maybe UTCTime) gcorsTimestamp = lens _gcorsTimestamp (\ s a -> s{_gcorsTimestamp = a}) . mapping _Time
195
gcorsTimestamp :: Lens' GetConsoleOutputResponse (Maybe UTCTime) gcorsTimestamp = lens _gcorsTimestamp (\ s a -> s{_gcorsTimestamp = a}) . mapping _Time
152
gcorsTimestamp = lens _gcorsTimestamp (\ s a -> s{_gcorsTimestamp = a}) . mapping _Time
87
true
true
0
10
28
53
28
25
null
null
RayRacine/nucleic
Nucleic/Style.hs
gpl-3.0
centerItems :: Style centerItems = alignItems "center"
54
centerItems :: Style centerItems = alignItems "center"
54
centerItems = alignItems "center"
33
false
true
0
6
6
21
8
13
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Upgrade.hs
mit
repeats TerranVehicleWeapons = 3
32
repeats TerranVehicleWeapons = 3
32
repeats TerranVehicleWeapons = 3
32
false
false
0
5
3
9
4
5
null
null
ezyang/ghc
testsuite/tests/simplCore/should_run/T11731.hs
bsd-3-clause
main :: IO () main = go 42
26
main :: IO () main = go 42
26
main = go 42
12
false
true
0
6
7
19
9
10
null
null
tjunier/mlgsc
src/mlgsc_train.hs
mit
parseVerbosityLevel :: Parser Int parseVerbosityLevel = option auto (long "verbosity" <> short 'v' <> metavar "VERBOSITY LEVEL" <> value 1 <> help "0: quiet, 1: normal, 2: verbose")
281
parseVerbosityLevel :: Parser Int parseVerbosityLevel = option auto (long "verbosity" <> short 'v' <> metavar "VERBOSITY LEVEL" <> value 1 <> help "0: quiet, 1: normal, 2: verbose")
281
parseVerbosityLevel = option auto (long "verbosity" <> short 'v' <> metavar "VERBOSITY LEVEL" <> value 1 <> help "0: quiet, 1: normal, 2: verbose")
247
false
true
0
11
127
53
24
29
null
null
zsedem/haskell-playground
imperative-vs-declerative/declerative/Main.hs
mit
main :: IO () main = print . sum . map readInt . lines =<< readFile "numbers.txt"
81
main :: IO () main = print . sum . map readInt . lines =<< readFile "numbers.txt"
81
main = print . sum . map readInt . lines =<< readFile "numbers.txt"
67
false
true
1
8
16
41
18
23
null
null
EarthCitizen/baskell
test/SymbolStoreSpecLib.hs
bsd-3-clause
genSymbol :: Gen Symbol genSymbol = do let leadChrs = ['A'..'Z'] ++ ['a'..'z'] ++ ['_'] let bodyChrs = leadChrs ++ ['0'..'9'] prefix <- oneof [ return "" , resize 30 $ listOf $ return $ '_' ] lead <- elements leadChrs body <- resize 60 $ listOf $ elements bodyChrs return $ prefix ++ [lead] ++ body
366
genSymbol :: Gen Symbol genSymbol = do let leadChrs = ['A'..'Z'] ++ ['a'..'z'] ++ ['_'] let bodyChrs = leadChrs ++ ['0'..'9'] prefix <- oneof [ return "" , resize 30 $ listOf $ return $ '_' ] lead <- elements leadChrs body <- resize 60 $ listOf $ elements bodyChrs return $ prefix ++ [lead] ++ body
366
genSymbol = do let leadChrs = ['A'..'Z'] ++ ['a'..'z'] ++ ['_'] let bodyChrs = leadChrs ++ ['0'..'9'] prefix <- oneof [ return "" , resize 30 $ listOf $ return $ '_' ] lead <- elements leadChrs body <- resize 60 $ listOf $ elements bodyChrs return $ prefix ++ [lead] ++ body
342
false
true
0
13
124
151
71
80
null
null
spire/spire
src/Spire/Canonical/Types.hs
bsd-3-clause
rElimDesc :: Value -> Bind Nom Value -> Bind Nom Value -> Bind Nom3 Value -> Bind Nom3 Value -> Nom -> Value rElimDesc _I _P pend prec parg _D = VNeut _D (Pipe Id (EElimDesc _I _P pend prec parg))
196
rElimDesc :: Value -> Bind Nom Value -> Bind Nom Value -> Bind Nom3 Value -> Bind Nom3 Value -> Nom -> Value rElimDesc _I _P pend prec parg _D = VNeut _D (Pipe Id (EElimDesc _I _P pend prec parg))
196
rElimDesc _I _P pend prec parg _D = VNeut _D (Pipe Id (EElimDesc _I _P pend prec parg))
87
false
true
0
10
40
95
45
50
null
null
brendanhay/gogol
gogol-pubsub/gen/Network/Google/Resource/PubSub/Projects/Schemas/TestIAMPermissions.hs
mpl-2.0
-- | OAuth access token. pstipsAccessToken :: Lens' ProjectsSchemasTestIAMPermissions (Maybe Text) pstipsAccessToken = lens _pstipsAccessToken (\ s a -> s{_pstipsAccessToken = a})
187
pstipsAccessToken :: Lens' ProjectsSchemasTestIAMPermissions (Maybe Text) pstipsAccessToken = lens _pstipsAccessToken (\ s a -> s{_pstipsAccessToken = a})
162
pstipsAccessToken = lens _pstipsAccessToken (\ s a -> s{_pstipsAccessToken = a})
88
true
true
0
9
29
48
25
23
null
null
dicomgrid/dicom-haskell-library
src/Data/DICOM/Dictionary.hs
gpl-3.0
printerstatusinfo :: String -> Element printerstatusinfo = cs $ tag (TagGroup 0x2110) (TagElement 0x0020)
105
printerstatusinfo :: String -> Element printerstatusinfo = cs $ tag (TagGroup 0x2110) (TagElement 0x0020)
105
printerstatusinfo = cs $ tag (TagGroup 0x2110) (TagElement 0x0020)
66
false
true
2
7
13
43
19
24
null
null
masaedw/Yiki
Settings.hs
bsd-2-clause
loadConfig :: AppEnvironment -> IO AppConfig loadConfig env = do allSettings <- (join $ YAML.decodeFile ("config/settings.yml" :: String)) >>= fromMapping settings <- lookupMapping (show env) allSettings hostS <- lookupScalar "host" settings port <- fmap read $ lookupScalar "port" settings connectionPoolSizeS <- lookupScalar "connectionPoolSize" settings return $ AppConfig { appEnv = env , appPort = port , appRoot = pack $ hostS ++ addPort port , connectionPoolSize = read connectionPoolSizeS } where addPort :: Int -> String #ifdef PRODUCTION addPort _ = "" #else addPort p = ":" ++ (show p) #endif -- Static setting below. Changing these requires a recompile -- | The location of static files on your system. This is a file system -- path. The default value works properly with your scaffolded site.
881
loadConfig :: AppEnvironment -> IO AppConfig loadConfig env = do allSettings <- (join $ YAML.decodeFile ("config/settings.yml" :: String)) >>= fromMapping settings <- lookupMapping (show env) allSettings hostS <- lookupScalar "host" settings port <- fmap read $ lookupScalar "port" settings connectionPoolSizeS <- lookupScalar "connectionPoolSize" settings return $ AppConfig { appEnv = env , appPort = port , appRoot = pack $ hostS ++ addPort port , connectionPoolSize = read connectionPoolSizeS } where addPort :: Int -> String #ifdef PRODUCTION addPort _ = "" #else addPort p = ":" ++ (show p) #endif -- Static setting below. Changing these requires a recompile -- | The location of static files on your system. This is a file system -- path. The default value works properly with your scaffolded site.
881
loadConfig env = do allSettings <- (join $ YAML.decodeFile ("config/settings.yml" :: String)) >>= fromMapping settings <- lookupMapping (show env) allSettings hostS <- lookupScalar "host" settings port <- fmap read $ lookupScalar "port" settings connectionPoolSizeS <- lookupScalar "connectionPoolSize" settings return $ AppConfig { appEnv = env , appPort = port , appRoot = pack $ hostS ++ addPort port , connectionPoolSize = read connectionPoolSizeS } where addPort :: Int -> String #ifdef PRODUCTION addPort _ = "" #else addPort p = ":" ++ (show p) #endif -- Static setting below. Changing these requires a recompile -- | The location of static files on your system. This is a file system -- path. The default value works properly with your scaffolded site.
836
false
true
0
12
201
194
95
99
null
null
8l/barrelfish
hake/RuleDefs.hs
mit
withSuffices :: TreeDB -> String -> [String] -> [String] withSuffices srcDB hakepath extensions = map (\f -> "/" </> f) $ fromMaybe [] $ tdbByDirExts (takeDirectory hakepath) extensions srcDB
203
withSuffices :: TreeDB -> String -> [String] -> [String] withSuffices srcDB hakepath extensions = map (\f -> "/" </> f) $ fromMaybe [] $ tdbByDirExts (takeDirectory hakepath) extensions srcDB
203
withSuffices srcDB hakepath extensions = map (\f -> "/" </> f) $ fromMaybe [] $ tdbByDirExts (takeDirectory hakepath) extensions srcDB
146
false
true
4
10
40
84
40
44
null
null
isomorphism/webgl
src/Graphics/Rendering/WebGL/Constants.hs
mit
gl_INVALID_ENUM :: GLenum gl_INVALID_ENUM = 0x0500
50
gl_INVALID_ENUM :: GLenum gl_INVALID_ENUM = 0x0500
50
gl_INVALID_ENUM = 0x0500
24
false
true
0
4
5
11
6
5
null
null
amccausl/Swish
Swish/HaskellRDF/N3ParserTest.hs
lgpl-2.1
tx1505 = arc c2 res_rdf_first b3
32
tx1505 = arc c2 res_rdf_first b3
32
tx1505 = arc c2 res_rdf_first b3
32
false
false
0
5
5
13
6
7
null
null
fpco/fay
src/Fay/Compiler/Pattern.hs
bsd-3-clause
compilePLit :: JsExp -> S.Literal -> [JsStmt] -> Compile [JsStmt] compilePLit exp literal body = do c <- ask lit <- readerCompileLit c literal return [JsIf (equalExps exp lit) body []] where -- Equality test for two expressions, with some optimizations. equalExps :: JsExp -> JsExp -> JsExp equalExps a b | isConstant a && isConstant b = JsEq a b | isConstant a = JsEq a (force b) | isConstant b = JsEq (force a) b | otherwise = JsApp (JsName (JsBuiltIn "equal")) [a,b] -- | Compile as binding in pattern match
595
compilePLit :: JsExp -> S.Literal -> [JsStmt] -> Compile [JsStmt] compilePLit exp literal body = do c <- ask lit <- readerCompileLit c literal return [JsIf (equalExps exp lit) body []] where -- Equality test for two expressions, with some optimizations. equalExps :: JsExp -> JsExp -> JsExp equalExps a b | isConstant a && isConstant b = JsEq a b | isConstant a = JsEq a (force b) | isConstant b = JsEq (force a) b | otherwise = JsApp (JsName (JsBuiltIn "equal")) [a,b] -- | Compile as binding in pattern match
595
compilePLit exp literal body = do c <- ask lit <- readerCompileLit c literal return [JsIf (equalExps exp lit) body []] where -- Equality test for two expressions, with some optimizations. equalExps :: JsExp -> JsExp -> JsExp equalExps a b | isConstant a && isConstant b = JsEq a b | isConstant a = JsEq a (force b) | isConstant b = JsEq (force a) b | otherwise = JsApp (JsName (JsBuiltIn "equal")) [a,b] -- | Compile as binding in pattern match
529
false
true
3
11
177
207
100
107
null
null
mattias-lundell/timber-llvm
src/Termred.hs
bsd-3-clause
finite env (EVar x) = x `elem` args env || maybe False (finite env) (lookup x (eqns env))
101
finite env (EVar x) = x `elem` args env || maybe False (finite env) (lookup x (eqns env))
101
finite env (EVar x) = x `elem` args env || maybe False (finite env) (lookup x (eqns env))
101
false
false
0
10
29
57
28
29
null
null
YoEight/machines
src/Data/Machine/Type.hs
bsd-3-clause
-- | Generates a model that runs a machine until it stops, then start it up again. -- -- @'repeatedly' m = 'construct' ('Control.Monad.forever' m)@ repeatedly :: Monad m => PlanT k o m a -> MachineT m k o repeatedly m = r where r = MachineT $ runPlanT m (const (runMachineT r)) (\o k -> return (Yield o (MachineT k))) (\f k g -> return (Await (MachineT . f) k (MachineT g))) (return Stop) -- | Evaluate a machine until it stops, and then yield answers according to the supplied model.
503
repeatedly :: Monad m => PlanT k o m a -> MachineT m k o repeatedly m = r where r = MachineT $ runPlanT m (const (runMachineT r)) (\o k -> return (Yield o (MachineT k))) (\f k g -> return (Await (MachineT . f) k (MachineT g))) (return Stop) -- | Evaluate a machine until it stops, and then yield answers according to the supplied model.
355
repeatedly m = r where r = MachineT $ runPlanT m (const (runMachineT r)) (\o k -> return (Yield o (MachineT k))) (\f k g -> return (Await (MachineT . f) k (MachineT g))) (return Stop) -- | Evaluate a machine until it stops, and then yield answers according to the supplied model.
298
true
true
3
11
111
164
78
86
null
null
soenkehahn/edith
Edith/Buffer.hs
agpl-3.0
firstA :: Accessor (a, b) a firstA = accessor fst (\ a (_, b) -> (a, b))
72
firstA :: Accessor (a, b) a firstA = accessor fst (\ a (_, b) -> (a, b))
72
firstA = accessor fst (\ a (_, b) -> (a, b))
44
false
true
0
8
16
55
29
26
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Julia.hs
gpl-2.0
parseRules ("Julia","String") = (((pDetectSpaces >>= withAttribute StringTok)) <|> ((pDetectIdentifier >>= withAttribute StringTok)) <|> ((pLineContinue >>= withAttribute StringTok)) <|> ((pHlCStringChar >>= withAttribute NormalTok)) <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext)) <|> (currentContext >>= \x -> guard (x == ("Julia","String")) >> pDefault >>= withAttribute StringTok))
444
parseRules ("Julia","String") = (((pDetectSpaces >>= withAttribute StringTok)) <|> ((pDetectIdentifier >>= withAttribute StringTok)) <|> ((pLineContinue >>= withAttribute StringTok)) <|> ((pHlCStringChar >>= withAttribute NormalTok)) <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext)) <|> (currentContext >>= \x -> guard (x == ("Julia","String")) >> pDefault >>= withAttribute StringTok))
444
parseRules ("Julia","String") = (((pDetectSpaces >>= withAttribute StringTok)) <|> ((pDetectIdentifier >>= withAttribute StringTok)) <|> ((pLineContinue >>= withAttribute StringTok)) <|> ((pHlCStringChar >>= withAttribute NormalTok)) <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext)) <|> (currentContext >>= \x -> guard (x == ("Julia","String")) >> pDefault >>= withAttribute StringTok))
444
false
false
0
15
76
154
82
72
null
null
silky/ImplicitCAD
Graphics/Implicit.hs
gpl-2.0
writeTHREEJS :: ℝ -> FilePath -> SymbolicObj3 -> IO () writeTHREEJS = Export.writeTHREEJS
89
writeTHREEJS :: ℝ -> FilePath -> SymbolicObj3 -> IO () writeTHREEJS = Export.writeTHREEJS
89
writeTHREEJS = Export.writeTHREEJS
34
false
true
0
9
12
30
15
15
null
null
mightymoose/liquidhaskell
tests/todo/maybe0.hs
bsd-3-clause
{-@ measure isJustS :: forall a. MaybeS a -> Bool isJustS (JustS x) = true isJustS (NothingS) = false @-} {-@ measure fromJustS :: forall a. MaybeS a -> a fromJustS (JustS x) = x @-} gloop = poop True
221
gloop = poop True
17
gloop = poop True
17
true
false
1
5
60
14
6
8
null
null
bitemyapp/wreq
tests/UnitTests.hs
bsd-3-clause
basicDelete Verb{..} site = do r <- delete (site "/delete") assertEqual "DELETE succeeds" status200 (r ^. responseStatus)
125
basicDelete Verb{..} site = do r <- delete (site "/delete") assertEqual "DELETE succeeds" status200 (r ^. responseStatus)
125
basicDelete Verb{..} site = do r <- delete (site "/delete") assertEqual "DELETE succeeds" status200 (r ^. responseStatus)
125
false
false
0
10
20
50
23
27
null
null
genos/online_problems
advent_of_code_2021/day10/Main.hs
mit
cToPair :: Char -> (OpenClose, Item) cToPair '(' = (Open, Paren)
64
cToPair :: Char -> (OpenClose, Item) cToPair '(' = (Open, Paren)
64
cToPair '(' = (Open, Paren)
27
false
true
0
6
10
30
17
13
null
null
tombusby/haskell-des
keyschedule/KeyGeneration.hs
mit
-- Key Generation Control Structure generateKey :: Rounds -> IO ByteString generateKey rounds = do ns <- randomRIOs (0 :: Word8, 255 :: Word8) return . pack . concat $ [take keyLengthInBytes ns | n <- [1..rounds]]
216
generateKey :: Rounds -> IO ByteString generateKey rounds = do ns <- randomRIOs (0 :: Word8, 255 :: Word8) return . pack . concat $ [take keyLengthInBytes ns | n <- [1..rounds]]
179
generateKey rounds = do ns <- randomRIOs (0 :: Word8, 255 :: Word8) return . pack . concat $ [take keyLengthInBytes ns | n <- [1..rounds]]
140
true
true
0
11
39
80
41
39
null
null
jkoppel/compstrat
Data/Comp/Multi/Strategic.hs
bsd-3-clause
idR :: (Applicative m) => RewriteM m f l idR = pure
51
idR :: (Applicative m) => RewriteM m f l idR = pure
51
idR = pure
10
false
true
0
7
11
33
15
18
null
null
brendanhay/gogol
gogol-android-enterprise/gen/Network/Google/AndroidEnterprise/Types/Product.hs
mpl-2.0
-- | The manifest describing a web app. walrWebApp :: Lens' WebAppsListResponse [WebApp] walrWebApp = lens _walrWebApp (\ s a -> s{_walrWebApp = a}) . _Default . _Coerce
183
walrWebApp :: Lens' WebAppsListResponse [WebApp] walrWebApp = lens _walrWebApp (\ s a -> s{_walrWebApp = a}) . _Default . _Coerce
143
walrWebApp = lens _walrWebApp (\ s a -> s{_walrWebApp = a}) . _Default . _Coerce
94
true
true
1
10
41
55
28
27
null
null
robdockins/canonical-lf
toyml/Scope.hs
bsd-3-clause
scopeAnalysis :: (LiftClosed γ , ?hyps :: Hyps LF γ ) => Map String (LF γ TERM) -> AST -> M (LF γ TERM) scopeAnalysis symbolTable t = case t of Ident nm -> case Map.lookup nm symbolTable of Just v -> "ml_var" @@ return v Nothing -> fail $ concat ["identifier '", nm, "' not in scope"] Fn nm m -> "ml_lam" @@ (λ nm v $ \x -> do x' <- var x let symbolTable' = Map.insert nm x' $ fmap weak symbolTable scopeAnalysis symbolTable' m) Letval nm m body -> "ml_letval" @@ (scopeAnalysis symbolTable m) @@ (λ nm v $ \x -> do x' <- var x let symbolTable' = Map.insert nm x' $ fmap weak symbolTable scopeAnalysis symbolTable' body) Tt -> "ml_tt" App a b -> "ml_app" @@ scopeAnalysis symbolTable a @@ scopeAnalysis symbolTable b Case e (lnm, lbranch) (rnm, rbranch) -> "ml_case" @@ scopeAnalysis symbolTable e @@ (λ lnm v $ \x -> do x' <- var x let symbolTable' = Map.insert lnm x' $ fmap weak symbolTable scopeAnalysis symbolTable' lbranch) @@ (λ rnm v $ \x -> do x' <- var x let symbolTable' = Map.insert rnm x' $ fmap weak symbolTable scopeAnalysis symbolTable' rbranch) Pair a b -> "ml_pair" @@ scopeAnalysis symbolTable a @@ scopeAnalysis symbolTable b Inl a -> "ml_inl" @@ scopeAnalysis symbolTable a Inr a -> "ml_inr" @@ scopeAnalysis symbolTable a Fst a -> "ml_fst" @@ scopeAnalysis symbolTable a Snd a -> "ml_snd" @@ scopeAnalysis symbolTable a
1,766
scopeAnalysis :: (LiftClosed γ , ?hyps :: Hyps LF γ ) => Map String (LF γ TERM) -> AST -> M (LF γ TERM) scopeAnalysis symbolTable t = case t of Ident nm -> case Map.lookup nm symbolTable of Just v -> "ml_var" @@ return v Nothing -> fail $ concat ["identifier '", nm, "' not in scope"] Fn nm m -> "ml_lam" @@ (λ nm v $ \x -> do x' <- var x let symbolTable' = Map.insert nm x' $ fmap weak symbolTable scopeAnalysis symbolTable' m) Letval nm m body -> "ml_letval" @@ (scopeAnalysis symbolTable m) @@ (λ nm v $ \x -> do x' <- var x let symbolTable' = Map.insert nm x' $ fmap weak symbolTable scopeAnalysis symbolTable' body) Tt -> "ml_tt" App a b -> "ml_app" @@ scopeAnalysis symbolTable a @@ scopeAnalysis symbolTable b Case e (lnm, lbranch) (rnm, rbranch) -> "ml_case" @@ scopeAnalysis symbolTable e @@ (λ lnm v $ \x -> do x' <- var x let symbolTable' = Map.insert lnm x' $ fmap weak symbolTable scopeAnalysis symbolTable' lbranch) @@ (λ rnm v $ \x -> do x' <- var x let symbolTable' = Map.insert rnm x' $ fmap weak symbolTable scopeAnalysis symbolTable' rbranch) Pair a b -> "ml_pair" @@ scopeAnalysis symbolTable a @@ scopeAnalysis symbolTable b Inl a -> "ml_inl" @@ scopeAnalysis symbolTable a Inr a -> "ml_inr" @@ scopeAnalysis symbolTable a Fst a -> "ml_fst" @@ scopeAnalysis symbolTable a Snd a -> "ml_snd" @@ scopeAnalysis symbolTable a
1,766
scopeAnalysis symbolTable t = case t of Ident nm -> case Map.lookup nm symbolTable of Just v -> "ml_var" @@ return v Nothing -> fail $ concat ["identifier '", nm, "' not in scope"] Fn nm m -> "ml_lam" @@ (λ nm v $ \x -> do x' <- var x let symbolTable' = Map.insert nm x' $ fmap weak symbolTable scopeAnalysis symbolTable' m) Letval nm m body -> "ml_letval" @@ (scopeAnalysis symbolTable m) @@ (λ nm v $ \x -> do x' <- var x let symbolTable' = Map.insert nm x' $ fmap weak symbolTable scopeAnalysis symbolTable' body) Tt -> "ml_tt" App a b -> "ml_app" @@ scopeAnalysis symbolTable a @@ scopeAnalysis symbolTable b Case e (lnm, lbranch) (rnm, rbranch) -> "ml_case" @@ scopeAnalysis symbolTable e @@ (λ lnm v $ \x -> do x' <- var x let symbolTable' = Map.insert lnm x' $ fmap weak symbolTable scopeAnalysis symbolTable' lbranch) @@ (λ rnm v $ \x -> do x' <- var x let symbolTable' = Map.insert rnm x' $ fmap weak symbolTable scopeAnalysis symbolTable' rbranch) Pair a b -> "ml_pair" @@ scopeAnalysis symbolTable a @@ scopeAnalysis symbolTable b Inl a -> "ml_inl" @@ scopeAnalysis symbolTable a Inr a -> "ml_inr" @@ scopeAnalysis symbolTable a Fst a -> "ml_fst" @@ scopeAnalysis symbolTable a Snd a -> "ml_snd" @@ scopeAnalysis symbolTable a
1,644
false
true
0
20
670
596
277
319
null
null
spechub/Hets
RDF/Parse.hs
gpl-2.0
parsePrefix :: CharParser st Prefix parsePrefix = do pkeyword "@prefix" p <- skips (option "" prefix << char ':') i <- skips uriP skips $ char '.' return $ PrefixR p i
187
parsePrefix :: CharParser st Prefix parsePrefix = do pkeyword "@prefix" p <- skips (option "" prefix << char ':') i <- skips uriP skips $ char '.' return $ PrefixR p i
187
parsePrefix = do pkeyword "@prefix" p <- skips (option "" prefix << char ':') i <- skips uriP skips $ char '.' return $ PrefixR p i
151
false
true
0
11
51
79
34
45
null
null
rahulmutt/ghcvm
compiler/Eta/Rename/RnTypes.hs
bsd-3-clause
bindSigTyVarsFV :: [Name] -> RnM (a, FreeVars) -> RnM (a, FreeVars) -- Used just before renaming the defn of a function -- with a separate type signature, to bring its tyvars into scope -- With no -XScopedTypeVariables, this is a no-op bindSigTyVarsFV tvs thing_inside = do { scoped_tyvars <- xoptM LangExt.ScopedTypeVariables ; if not scoped_tyvars then thing_inside else bindLocalNamesFV tvs thing_inside }
493
bindSigTyVarsFV :: [Name] -> RnM (a, FreeVars) -> RnM (a, FreeVars) bindSigTyVarsFV tvs thing_inside = do { scoped_tyvars <- xoptM LangExt.ScopedTypeVariables ; if not scoped_tyvars then thing_inside else bindLocalNamesFV tvs thing_inside }
325
bindSigTyVarsFV tvs thing_inside = do { scoped_tyvars <- xoptM LangExt.ScopedTypeVariables ; if not scoped_tyvars then thing_inside else bindLocalNamesFV tvs thing_inside }
225
true
true
0
9
146
82
44
38
null
null
shlevy/ghc
compiler/coreSyn/CoreUtils.hs
bsd-3-clause
-- push a tick into the arguments of a HNF (call or constructor app) tickHNFArgs :: Tickish Id -> CoreExpr -> CoreExpr tickHNFArgs t e = push t e where push t (App f (Type u)) = App (push t f) (Type u) push t (App f arg) = App (push t f) (mkTick t arg) push _t e = e -- | Strip ticks satisfying a predicate from top of an expression
340
tickHNFArgs :: Tickish Id -> CoreExpr -> CoreExpr tickHNFArgs t e = push t e where push t (App f (Type u)) = App (push t f) (Type u) push t (App f arg) = App (push t f) (mkTick t arg) push _t e = e -- | Strip ticks satisfying a predicate from top of an expression
271
tickHNFArgs t e = push t e where push t (App f (Type u)) = App (push t f) (Type u) push t (App f arg) = App (push t f) (mkTick t arg) push _t e = e -- | Strip ticks satisfying a predicate from top of an expression
221
true
true
0
9
80
129
63
66
null
null
alphalambda/codeworld
codeworld-prediction/src/CodeWorld/Prediction.hs
apache-2.0
handleNextEvents :: StepFun s -> AnimationRate -> EventQueue s -> TState s -> TState s handleNextEvents step rate eq ts = foldl' (flip (handleNextEvent step rate)) ts $ map (\((t, _p), h) -> (t, h)) $ M.toList eq
227
handleNextEvents :: StepFun s -> AnimationRate -> EventQueue s -> TState s -> TState s handleNextEvents step rate eq ts = foldl' (flip (handleNextEvent step rate)) ts $ map (\((t, _p), h) -> (t, h)) $ M.toList eq
227
handleNextEvents step rate eq ts = foldl' (flip (handleNextEvent step rate)) ts $ map (\((t, _p), h) -> (t, h)) $ M.toList eq
133
false
true
0
11
52
109
55
54
null
null
cdornan/keystore
src/Data/KeyStore/PasswordManager.hs
bsd-3-clause
psComment :: PW p => PMConfig p -> PasswordStoreComment -> IO () psComment pmc cmt = wrap pmc $ \ps -> return $ Just $ L.set ps_comment cmt ps
142
psComment :: PW p => PMConfig p -> PasswordStoreComment -> IO () psComment pmc cmt = wrap pmc $ \ps -> return $ Just $ L.set ps_comment cmt ps
142
psComment pmc cmt = wrap pmc $ \ps -> return $ Just $ L.set ps_comment cmt ps
77
false
true
0
9
28
68
32
36
null
null
akegalj/snowdrift
Foundation.hs
agpl-3.0
getAlert :: Handler (Maybe Html) getAlert = do mmsg <- liftM (fmap preEscapedToMarkup) $ lookupSession alertKey deleteSession alertKey return mmsg -- | Write a list of SnowdriftEvent to the event channel.
217
getAlert :: Handler (Maybe Html) getAlert = do mmsg <- liftM (fmap preEscapedToMarkup) $ lookupSession alertKey deleteSession alertKey return mmsg -- | Write a list of SnowdriftEvent to the event channel.
217
getAlert = do mmsg <- liftM (fmap preEscapedToMarkup) $ lookupSession alertKey deleteSession alertKey return mmsg -- | Write a list of SnowdriftEvent to the event channel.
184
false
true
0
11
43
56
25
31
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x1FAA' = "\x03A9\x0313\x0300\x0345"
51
decomposeChar '\x1FAA' = "\x03A9\x0313\x0300\x0345"
51
decomposeChar '\x1FAA' = "\x03A9\x0313\x0300\x0345"
51
false
false
0
4
3
10
4
6
null
null
tjakway/ghcjvm
compiler/codeGen/CgUtils.hs
bsd-3-clause
baseRegOffset dflags EagerBlackholeInfo = oFFSET_stgEagerBlackholeInfo dflags
78
baseRegOffset dflags EagerBlackholeInfo = oFFSET_stgEagerBlackholeInfo dflags
78
baseRegOffset dflags EagerBlackholeInfo = oFFSET_stgEagerBlackholeInfo dflags
78
false
false
0
5
6
15
6
9
null
null
supki/envparse
src/Env/Internal/Free.hs
bsd-2-clause
liftAlt :: f a -> Alt f a liftAlt = Lift
40
liftAlt :: f a -> Alt f a liftAlt = Lift
40
liftAlt = Lift
14
false
true
0
7
10
29
12
17
null
null
mkm/sokoban
src/Queue.hs
gpl-3.0
remove (Queue (x:xs) ys) = Just (x, Queue xs ys)
48
remove (Queue (x:xs) ys) = Just (x, Queue xs ys)
48
remove (Queue (x:xs) ys) = Just (x, Queue xs ys)
48
false
false
0
9
9
38
19
19
null
null
Azabuhs/Roogle
src/Roogle.hs
mit
compactMaybe (x:xs) = case x of Just v -> [v] ++ compactMaybe xs Nothing -> compactMaybe xs
139
compactMaybe (x:xs) = case x of Just v -> [v] ++ compactMaybe xs Nothing -> compactMaybe xs
139
compactMaybe (x:xs) = case x of Just v -> [v] ++ compactMaybe xs Nothing -> compactMaybe xs
139
false
false
0
9
64
49
23
26
null
null
dec9ue/jhc_copygc
src/Options.hs
gpl-2.0
idu "-" _ = []
14
idu "-" _ = []
14
idu "-" _ = []
14
false
false
1
6
4
16
6
10
null
null
pparkkin/eta
compiler/ETA/Main/HscTypes.hs
bsd-3-clause
-- | Constructs an empty ModIface emptyModIface :: Module -> ModIface emptyModIface mod = ModIface { mi_module = mod, mi_sig_of = Nothing, mi_iface_hash = fingerprint0, mi_mod_hash = fingerprint0, mi_flag_hash = fingerprint0, mi_orphan = False, mi_finsts = False, mi_boot = False, mi_deps = noDependencies, mi_usages = [], mi_exports = [], mi_exp_hash = fingerprint0, mi_used_th = False, mi_fixities = [], mi_warns = NoWarnings, mi_anns = [], mi_insts = [], mi_fam_insts = [], mi_rules = [], mi_decls = [], mi_globals = Nothing, mi_orphan_hash = fingerprint0, mi_vect_info = noIfaceVectInfo, mi_warn_fn = emptyIfaceWarnCache, mi_fix_fn = emptyIfaceFixCache, mi_hash_fn = emptyIfaceHashCache, mi_hpc = False, mi_trust = noIfaceTrustInfo, mi_trust_pkg = False }
1,308
emptyModIface :: Module -> ModIface emptyModIface mod = ModIface { mi_module = mod, mi_sig_of = Nothing, mi_iface_hash = fingerprint0, mi_mod_hash = fingerprint0, mi_flag_hash = fingerprint0, mi_orphan = False, mi_finsts = False, mi_boot = False, mi_deps = noDependencies, mi_usages = [], mi_exports = [], mi_exp_hash = fingerprint0, mi_used_th = False, mi_fixities = [], mi_warns = NoWarnings, mi_anns = [], mi_insts = [], mi_fam_insts = [], mi_rules = [], mi_decls = [], mi_globals = Nothing, mi_orphan_hash = fingerprint0, mi_vect_info = noIfaceVectInfo, mi_warn_fn = emptyIfaceWarnCache, mi_fix_fn = emptyIfaceFixCache, mi_hash_fn = emptyIfaceHashCache, mi_hpc = False, mi_trust = noIfaceTrustInfo, mi_trust_pkg = False }
1,274
emptyModIface mod = ModIface { mi_module = mod, mi_sig_of = Nothing, mi_iface_hash = fingerprint0, mi_mod_hash = fingerprint0, mi_flag_hash = fingerprint0, mi_orphan = False, mi_finsts = False, mi_boot = False, mi_deps = noDependencies, mi_usages = [], mi_exports = [], mi_exp_hash = fingerprint0, mi_used_th = False, mi_fixities = [], mi_warns = NoWarnings, mi_anns = [], mi_insts = [], mi_fam_insts = [], mi_rules = [], mi_decls = [], mi_globals = Nothing, mi_orphan_hash = fingerprint0, mi_vect_info = noIfaceVectInfo, mi_warn_fn = emptyIfaceWarnCache, mi_fix_fn = emptyIfaceFixCache, mi_hash_fn = emptyIfaceHashCache, mi_hpc = False, mi_trust = noIfaceTrustInfo, mi_trust_pkg = False }
1,238
true
true
0
8
652
220
137
83
null
null
litherum/http-conduit-browser
Network/HTTP/Conduit/Browser2.hs
bsd-2-clause
getOverrideHeaders :: BrowserAction HT.RequestHeaders getOverrideHeaders = get >>= \ a -> return $ Map.toList $ overrideHeaders a
129
getOverrideHeaders :: BrowserAction HT.RequestHeaders getOverrideHeaders = get >>= \ a -> return $ Map.toList $ overrideHeaders a
129
getOverrideHeaders = get >>= \ a -> return $ Map.toList $ overrideHeaders a
75
false
true
0
9
16
38
19
19
null
null
peterokagey/haskellOEIS
src/Staircase/A282444.hs
apache-2.0
a282444_list :: [Int] a282444_list = map fst $ filter valid $ zip [1..] $ map a282443 [1..] where valid (n, a_n) = n == a282443 n
131
a282444_list :: [Int] a282444_list = map fst $ filter valid $ zip [1..] $ map a282443 [1..] where valid (n, a_n) = n == a282443 n
131
a282444_list = map fst $ filter valid $ zip [1..] $ map a282443 [1..] where valid (n, a_n) = n == a282443 n
109
false
true
3
8
27
78
36
42
null
null
brendanhay/gogol
gogol-discovery/gen/Network/Google/Discovery/Types/Product.hs
mpl-2.0
-- | The schema for the response. rmResponse :: Lens' RestMethod (Maybe RestMethodResponse) rmResponse = lens _rmResponse (\ s a -> s{_rmResponse = a})
153
rmResponse :: Lens' RestMethod (Maybe RestMethodResponse) rmResponse = lens _rmResponse (\ s a -> s{_rmResponse = a})
119
rmResponse = lens _rmResponse (\ s a -> s{_rmResponse = a})
61
true
true
1
9
25
52
25
27
null
null
AlexeyRaga/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpHasSideEffects WriteArrayArrayOp_ArrayArray = True
56
primOpHasSideEffects WriteArrayArrayOp_ArrayArray = True
56
primOpHasSideEffects WriteArrayArrayOp_ArrayArray = True
56
false
false
0
4
3
10
4
6
null
null
sdiehl/ghc
testsuite/tests/partial-sigs/should_compile/T12033.hs
bsd-3-clause
tripleStoreToRuleSet :: v -> v tripleStoreToRuleSet getAtom = makeTuple getAtom where makeRule v = makeExpression v makeTuple v = makeExpression v makeExpression :: _ makeExpression v = makeTuple getAtom
217
tripleStoreToRuleSet :: v -> v tripleStoreToRuleSet getAtom = makeTuple getAtom where makeRule v = makeExpression v makeTuple v = makeExpression v makeExpression :: _ makeExpression v = makeTuple getAtom
217
tripleStoreToRuleSet getAtom = makeTuple getAtom where makeRule v = makeExpression v makeTuple v = makeExpression v makeExpression :: _ makeExpression v = makeTuple getAtom
186
false
true
1
5
42
63
29
34
null
null
czakian/Roxy
src/Roxy/HTTPProxy.hs
gpl-3.0
readHeaders :: Sink ByteString IO Headers readHeaders = do line <- takeLine let empty = BS.empty case line of "" -> return MP.empty header -> do headers <- readHeaders return $ insertHeader header headers where errorString = "Encountered malformed header when attempting to parse the string: " -- Strip beginning colon and any whitespace on either end of the string. sanitizeHeader val = fst $ BS.spanEnd (==' ') $ BS.dropWhile (==' ') $ BS.dropWhile (==':') val -- Insert the parsed header into the headers map. Duplicate values are overwritten. insertHeader header headers = case BS.breakSubstring ":" header of (key, val) | BS.null val -> error $ errorString ++ (show header) | otherwise -> MP.insert key (sanitizeHeader val) headers
855
readHeaders :: Sink ByteString IO Headers readHeaders = do line <- takeLine let empty = BS.empty case line of "" -> return MP.empty header -> do headers <- readHeaders return $ insertHeader header headers where errorString = "Encountered malformed header when attempting to parse the string: " -- Strip beginning colon and any whitespace on either end of the string. sanitizeHeader val = fst $ BS.spanEnd (==' ') $ BS.dropWhile (==' ') $ BS.dropWhile (==':') val -- Insert the parsed header into the headers map. Duplicate values are overwritten. insertHeader header headers = case BS.breakSubstring ":" header of (key, val) | BS.null val -> error $ errorString ++ (show header) | otherwise -> MP.insert key (sanitizeHeader val) headers
855
readHeaders = do line <- takeLine let empty = BS.empty case line of "" -> return MP.empty header -> do headers <- readHeaders return $ insertHeader header headers where errorString = "Encountered malformed header when attempting to parse the string: " -- Strip beginning colon and any whitespace on either end of the string. sanitizeHeader val = fst $ BS.spanEnd (==' ') $ BS.dropWhile (==' ') $ BS.dropWhile (==':') val -- Insert the parsed header into the headers map. Duplicate values are overwritten. insertHeader header headers = case BS.breakSubstring ":" header of (key, val) | BS.null val -> error $ errorString ++ (show header) | otherwise -> MP.insert key (sanitizeHeader val) headers
813
false
true
2
14
236
221
107
114
null
null
d0kt0r0/estuary
client/src/Estuary/Resources.hs
gpl-3.0
appendResource (aMap,iMap,vMap) Image url bankName = (aMap,LocMap.append bankName url iMap,vMap)
96
appendResource (aMap,iMap,vMap) Image url bankName = (aMap,LocMap.append bankName url iMap,vMap)
96
appendResource (aMap,iMap,vMap) Image url bankName = (aMap,LocMap.append bankName url iMap,vMap)
96
false
false
1
8
9
45
23
22
null
null
betoesquivel/haskell
1139626_1195815_Tarea6.hs
mit
bolos 3 = bolos 1 ++ [[2, 3]]
29
bolos 3 = bolos 1 ++ [[2, 3]]
29
bolos 3 = bolos 1 ++ [[2, 3]]
29
false
false
0
7
7
25
13
12
null
null
jutaro/rdf4h
src/Data/RDF/Graph/MapSP.hs
bsd-3-clause
mkRdf' :: Triples -> Maybe BaseUrl -> PrefixMappings -> MapSP mkRdf' triples baseURL pms = MapSP (tsMap, baseURL, pms) where tsMap = sortAndGroup triples sortAndGroup xs = Map.fromListWith (++) [((s,p), [o]) | Triple s p o <- xs]
245
mkRdf' :: Triples -> Maybe BaseUrl -> PrefixMappings -> MapSP mkRdf' triples baseURL pms = MapSP (tsMap, baseURL, pms) where tsMap = sortAndGroup triples sortAndGroup xs = Map.fromListWith (++) [((s,p), [o]) | Triple s p o <- xs]
245
mkRdf' triples baseURL pms = MapSP (tsMap, baseURL, pms) where tsMap = sortAndGroup triples sortAndGroup xs = Map.fromListWith (++) [((s,p), [o]) | Triple s p o <- xs]
183
false
true
1
9
53
105
56
49
null
null
cullina/Extractor
src/LempelZiv.hs
bsd-3-clause
{---------------------------------------------------------} encodeLempelZiv = serialize . completeParse parse
110
encodeLempelZiv = serialize . completeParse parse
49
encodeLempelZiv = serialize . completeParse parse
49
true
false
1
6
7
17
7
10
null
null
hiratara/doukaku-past-questions-advent-2013
src/Doukaku/TwoTone.hs
bsd-3-clause
solve :: String -> String solve input = (n' ++) . (':' :) . fill . pack . turnRight l n . unpack $ tile' where (n', _:tile') = break (== ':') input n = read n' l = length tile' fill x = replicate (l - length x) '0' ++ x
237
solve :: String -> String solve input = (n' ++) . (':' :) . fill . pack . turnRight l n . unpack $ tile' where (n', _:tile') = break (== ':') input n = read n' l = length tile' fill x = replicate (l - length x) '0' ++ x
237
solve input = (n' ++) . (':' :) . fill . pack . turnRight l n . unpack $ tile' where (n', _:tile') = break (== ':') input n = read n' l = length tile' fill x = replicate (l - length x) '0' ++ x
211
false
true
3
11
69
124
65
59
null
null
dhrosa/haskell-avr-simulator
AVR/AVRState.hs
gpl-3.0
-- | Pushes a value onto the stack, this also decrements the stack pointer stackPush :: Word8 -> AVRState -> AVRState stackPush val = decSP . (writeDMem' val =<< getSP) where writeDMem' = flip writeDMem -- | Pops a value off the stack, this also increments the stack pointer
277
stackPush :: Word8 -> AVRState -> AVRState stackPush val = decSP . (writeDMem' val =<< getSP) where writeDMem' = flip writeDMem -- | Pops a value off the stack, this also increments the stack pointer
202
stackPush val = decSP . (writeDMem' val =<< getSP) where writeDMem' = flip writeDMem -- | Pops a value off the stack, this also increments the stack pointer
159
true
true
0
8
51
49
25
24
null
null
alphalambda/codeworld
codeworld-api/src/CodeWorld/App.hs
apache-2.0
subrule getter setter (EventRule event_b) = EventRule event_a where event_a k ev a = setter (event_b k ev (getter a)) a
125
subrule getter setter (EventRule event_b) = EventRule event_a where event_a k ev a = setter (event_b k ev (getter a)) a
125
subrule getter setter (EventRule event_b) = EventRule event_a where event_a k ev a = setter (event_b k ev (getter a)) a
125
false
false
1
9
26
66
27
39
null
null
robeverest/accelerate
Data/Array/Accelerate/Trafo/Algebra.hs
bsd-3-clause
evalAbs (FloatingNumType ty) | FloatingDict <- floatingDict ty = eval1 abs
74
evalAbs (FloatingNumType ty) | FloatingDict <- floatingDict ty = eval1 abs
74
evalAbs (FloatingNumType ty) | FloatingDict <- floatingDict ty = eval1 abs
74
false
false
0
9
10
31
13
18
null
null
crockeo/jalapeno
src/lib/FRP/Jalapeno/IO.hs
mit
runNetwork :: Show a => Behavior Double IO () a -> Int -> IO () runNetwork b rate = do succ <- initialize case succ of False -> putStrLn "Failed to initialize GLFW." True -> do openWindow (Size 640 480) [DisplayRGBBits 8 8 8, DisplayAlphaBits 8, DisplayDepthBits 24] Window closedRef <- newIORef False windowTitle $= "Testing Jalapeno" windowCloseCallback $= closeCallback closedRef sp <- loadShaderProgram "test" >>= (\e -> case e of Left err -> putStrLn err >> return 0 Right (ShaderProgram v) -> return v) driveNetwork closedRef b rate glDeleteProgram sp closeWindow terminate
770
runNetwork :: Show a => Behavior Double IO () a -> Int -> IO () runNetwork b rate = do succ <- initialize case succ of False -> putStrLn "Failed to initialize GLFW." True -> do openWindow (Size 640 480) [DisplayRGBBits 8 8 8, DisplayAlphaBits 8, DisplayDepthBits 24] Window closedRef <- newIORef False windowTitle $= "Testing Jalapeno" windowCloseCallback $= closeCallback closedRef sp <- loadShaderProgram "test" >>= (\e -> case e of Left err -> putStrLn err >> return 0 Right (ShaderProgram v) -> return v) driveNetwork closedRef b rate glDeleteProgram sp closeWindow terminate
770
runNetwork b rate = do succ <- initialize case succ of False -> putStrLn "Failed to initialize GLFW." True -> do openWindow (Size 640 480) [DisplayRGBBits 8 8 8, DisplayAlphaBits 8, DisplayDepthBits 24] Window closedRef <- newIORef False windowTitle $= "Testing Jalapeno" windowCloseCallback $= closeCallback closedRef sp <- loadShaderProgram "test" >>= (\e -> case e of Left err -> putStrLn err >> return 0 Right (ShaderProgram v) -> return v) driveNetwork closedRef b rate glDeleteProgram sp closeWindow terminate
706
false
true
0
21
283
228
102
126
null
null
GRACeFUL-project/haskelzinc
src/Interfaces/MZBuiltIns.hs
bsd-3-clause
mz_most_constrained = Annotation "most_constrained"
51
mz_most_constrained = Annotation "most_constrained"
51
mz_most_constrained = Annotation "most_constrained"
51
false
false
0
5
3
9
4
5
null
null
tyoko-dev/coreutils-haskell
src/wc.hs
agpl-3.0
main :: IO () main = do cs <- getContents print $ length $ lines cs
77
main :: IO () main = do cs <- getContents print $ length $ lines cs
77
main = do cs <- getContents print $ length $ lines cs
63
false
true
0
8
25
37
17
20
null
null
portnov/integration-server
THIS/Templates/Text.hs
lgpl-3.0
pKey :: P.Parser Item pKey = do name <- identifier c <- oneOf "]?" case c of ']' -> return (Variable name "") '?' -> do def <- defaultValue char ']' return (Variable name def) _ -> fail $ "Unexpected: " ++ [c]
262
pKey :: P.Parser Item pKey = do name <- identifier c <- oneOf "]?" case c of ']' -> return (Variable name "") '?' -> do def <- defaultValue char ']' return (Variable name def) _ -> fail $ "Unexpected: " ++ [c]
262
pKey = do name <- identifier c <- oneOf "]?" case c of ']' -> return (Variable name "") '?' -> do def <- defaultValue char ']' return (Variable name def) _ -> fail $ "Unexpected: " ++ [c]
240
false
true
1
15
95
112
49
63
null
null
DanielWaterworth/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
pMetavars :: [(Name, (Maybe Name, Int, Bool))] -> Idris () pMetavars ns = do i <- getIState putIState $ i { idris_metavars = Data.List.reverse ns ++ idris_metavars i } ----- For Cheapskate
261
pMetavars :: [(Name, (Maybe Name, Int, Bool))] -> Idris () pMetavars ns = do i <- getIState putIState $ i { idris_metavars = Data.List.reverse ns ++ idris_metavars i } ----- For Cheapskate
261
pMetavars ns = do i <- getIState putIState $ i { idris_metavars = Data.List.reverse ns ++ idris_metavars i } ----- For Cheapskate
202
false
true
0
13
104
85
43
42
null
null
jwiegley/ghc-release
libraries/bytestring/Data/ByteString/Unsafe.hs
gpl-3.0
------------------------------------------------------------------------ -- Packing CStrings into ByteStrings -- | /O(n)/ Build a @ByteString@ from a @CString@. This value will have /no/ -- finalizer associated to it, and will not be garbage collected by -- Haskell. The ByteString length is calculated using /strlen(3)/, -- and thus the complexity is a /O(n)/. -- -- This function is /unsafe/. If the @CString@ is later modified, this -- change will be reflected in the resulting @ByteString@, breaking -- referential transparency. -- unsafePackCString :: CString -> IO ByteString unsafePackCString cstr = do fp <- newForeignPtr_ (castPtr cstr) l <- c_strlen cstr return $! PS fp 0 (fromIntegral l) -- | /O(1)/ Build a @ByteString@ from a @CStringLen@. This value will -- have /no/ finalizer associated with it, and will not be garbage -- collected by Haskell. This operation has /O(1)/ complexity as we -- already know the final size, so no /strlen(3)/ is required. -- -- This funtion is /unsafe/. If the original @CStringLen@ is later -- modified, this change will be reflected in the resulting @ByteString@, -- breaking referential transparency. --
1,166
unsafePackCString :: CString -> IO ByteString unsafePackCString cstr = do fp <- newForeignPtr_ (castPtr cstr) l <- c_strlen cstr return $! PS fp 0 (fromIntegral l) -- | /O(1)/ Build a @ByteString@ from a @CStringLen@. This value will -- have /no/ finalizer associated with it, and will not be garbage -- collected by Haskell. This operation has /O(1)/ complexity as we -- already know the final size, so no /strlen(3)/ is required. -- -- This funtion is /unsafe/. If the original @CStringLen@ is later -- modified, this change will be reflected in the resulting @ByteString@, -- breaking referential transparency. --
629
unsafePackCString cstr = do fp <- newForeignPtr_ (castPtr cstr) l <- c_strlen cstr return $! PS fp 0 (fromIntegral l) -- | /O(1)/ Build a @ByteString@ from a @CStringLen@. This value will -- have /no/ finalizer associated with it, and will not be garbage -- collected by Haskell. This operation has /O(1)/ complexity as we -- already know the final size, so no /strlen(3)/ is required. -- -- This funtion is /unsafe/. If the original @CStringLen@ is later -- modified, this change will be reflected in the resulting @ByteString@, -- breaking referential transparency. --
583
true
true
0
10
189
87
50
37
null
null
dmjio/miso
src/Miso/Html/Property.hs
bsd-3-clause
-- | <https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/pattern> pattern_ :: MisoString -> Attribute action pattern_ = textProp "pattern"
166
pattern_ :: MisoString -> Attribute action pattern_ = textProp "pattern"
83
pattern_ = textProp "pattern"
39
true
true
0
6
23
22
11
11
null
null
vituscze/logic
src/Logic/Term.hs
bsd-3-clause
showSTerm (Function f ts) = concatD [ str f , str "(" , concatD . intersperse (str ",") . map showSTerm $ ts , str ")" ] where str = showString -- Difference list concatenation. concatD = foldr (.) id -- | Pretty prints a 'Term'. -- -- > showTerm (Function "f" [Function "g" [Var "x"], Var "y"]) -- > == "f(g(x),y)"
355
showSTerm (Function f ts) = concatD [ str f , str "(" , concatD . intersperse (str ",") . map showSTerm $ ts , str ")" ] where str = showString -- Difference list concatenation. concatD = foldr (.) id -- | Pretty prints a 'Term'. -- -- > showTerm (Function "f" [Function "g" [Var "x"], Var "y"]) -- > == "f(g(x),y)"
355
showSTerm (Function f ts) = concatD [ str f , str "(" , concatD . intersperse (str ",") . map showSTerm $ ts , str ")" ] where str = showString -- Difference list concatenation. concatD = foldr (.) id -- | Pretty prints a 'Term'. -- -- > showTerm (Function "f" [Function "g" [Var "x"], Var "y"]) -- > == "f(g(x),y)"
355
false
false
0
11
101
90
47
43
null
null
JamesSullivan1/Mpp
src/MppSemanticAnalyzer.hs
mit
typeErr :: M_expr -> String typeErr e = "Type error in expression " ++ show e ++ ": " ++ t where t = case e of (M_size (n,s) _) -> "Invalid type for symbol " ++ show n (M_id (n,es) _) -> "Invalid type for symbol " ++ show n
247
typeErr :: M_expr -> String typeErr e = "Type error in expression " ++ show e ++ ": " ++ t where t = case e of (M_size (n,s) _) -> "Invalid type for symbol " ++ show n (M_id (n,es) _) -> "Invalid type for symbol " ++ show n
247
typeErr e = "Type error in expression " ++ show e ++ ": " ++ t where t = case e of (M_size (n,s) _) -> "Invalid type for symbol " ++ show n (M_id (n,es) _) -> "Invalid type for symbol " ++ show n
219
false
true
0
10
74
97
50
47
null
null
nevrenato/HetsAlloy
Isabelle/Isa2DG.hs
gpl-2.0
_insNodeDG :: Sign -> [Named Sentence] -> String -> DGraph -> (DGraph, Node) _insNodeDG sig sens n dg = let gt = G_theory Isabelle Nothing (makeExtSign Isabelle sig) startSigId (toThSens sens) startThId labelK = newInfoNodeLab (makeName (simpleIdToIRI (mkSimpleId n))) (newNodeInfo DGEmpty) gt k = getNewNodeDG dg insN = [InsertNode (k, labelK)] newDG = changesDGH dg insN labCh = [SetNodeLab labelK (k, labelK { globalTheory = computeLabelTheory Map.empty newDG (k, labelK) })] newDG1 = changesDGH newDG labCh in (newDG1, k)
613
_insNodeDG :: Sign -> [Named Sentence] -> String -> DGraph -> (DGraph, Node) _insNodeDG sig sens n dg = let gt = G_theory Isabelle Nothing (makeExtSign Isabelle sig) startSigId (toThSens sens) startThId labelK = newInfoNodeLab (makeName (simpleIdToIRI (mkSimpleId n))) (newNodeInfo DGEmpty) gt k = getNewNodeDG dg insN = [InsertNode (k, labelK)] newDG = changesDGH dg insN labCh = [SetNodeLab labelK (k, labelK { globalTheory = computeLabelTheory Map.empty newDG (k, labelK) })] newDG1 = changesDGH newDG labCh in (newDG1, k)
613
_insNodeDG sig sens n dg = let gt = G_theory Isabelle Nothing (makeExtSign Isabelle sig) startSigId (toThSens sens) startThId labelK = newInfoNodeLab (makeName (simpleIdToIRI (mkSimpleId n))) (newNodeInfo DGEmpty) gt k = getNewNodeDG dg insN = [InsertNode (k, labelK)] newDG = changesDGH dg insN labCh = [SetNodeLab labelK (k, labelK { globalTheory = computeLabelTheory Map.empty newDG (k, labelK) })] newDG1 = changesDGH newDG labCh in (newDG1, k)
522
false
true
0
15
166
215
113
102
null
null
fumieval/control-bool
Control/Bool.hs
bsd-3-clause
-- | 'guard'' b a returns a if b is True, otherwise becomes 'mzero'. guard' :: MonadPlus m => Bool -> a -> m a guard' b a = bool mzero (return a) b
147
guard' :: MonadPlus m => Bool -> a -> m a guard' b a = bool mzero (return a) b
78
guard' b a = bool mzero (return a) b
36
true
true
0
9
33
54
24
30
null
null
geophf/1HaskellADay
exercises/HAD/Y2020/M10/D30/Solution.hs
mit
-- for Name dear :: FilePath dear = "Y2020/M10/D30/"
53
dear :: FilePath dear = "Y2020/M10/D30/"
40
dear = "Y2020/M10/D30/"
23
true
true
0
6
9
19
8
11
null
null
DrSLDR/logoff
src/Logoff.hs
mit
ifocusL s = s
13
ifocusL s = s
13
ifocusL s = s
13
false
false
1
5
3
13
4
9
null
null
nurpax/aeson
Data/Aeson/Types/Instances.hs
bsd-3-clause
vectorToJSON :: (VG.Vector v a, ToJSON a) => v a -> Value vectorToJSON = Array . V.map toJSON . V.convert
105
vectorToJSON :: (VG.Vector v a, ToJSON a) => v a -> Value vectorToJSON = Array . V.map toJSON . V.convert
105
vectorToJSON = Array . V.map toJSON . V.convert
47
false
true
0
8
19
52
26
26
null
null
narurien/ganeti-ceph
src/Ganeti/HTools/Types.hs
gpl-2.0
-- | Default max disk usage ratio. defReservedDiskRatio :: Double defReservedDiskRatio = 0
90
defReservedDiskRatio :: Double defReservedDiskRatio = 0
55
defReservedDiskRatio = 0
24
true
true
0
4
12
12
7
5
null
null
GaloisInc/sk-dev-platform
libs/SCD/src/SCD/M4/Dependencies.hs
bsd-3-clause
callGraphStmt (RefPolicyWarn _) = Set.empty
51
callGraphStmt (RefPolicyWarn _) = Set.empty
51
callGraphStmt (RefPolicyWarn _) = Set.empty
51
false
false
0
7
12
17
8
9
null
null
Sealos/funcional
tarea2/example.hs
mit
eval5 t@(Div l r) = do vl <- eval5 l vr <- eval5 r s <- get if vr == 0 then throwError DivisionPorCero else do let v = vl `div` vr put $ s { divs = divs s + 1 } tell $ logExp t v checkForThirteen v
282
eval5 t@(Div l r) = do vl <- eval5 l vr <- eval5 r s <- get if vr == 0 then throwError DivisionPorCero else do let v = vl `div` vr put $ s { divs = divs s + 1 } tell $ logExp t v checkForThirteen v
282
eval5 t@(Div l r) = do vl <- eval5 l vr <- eval5 r s <- get if vr == 0 then throwError DivisionPorCero else do let v = vl `div` vr put $ s { divs = divs s + 1 } tell $ logExp t v checkForThirteen v
282
false
false
1
16
134
126
56
70
null
null
tkemps/bcbs-crawler
src/BcbsCrawler-old.hs
bsd-3-clause
getTitleFromRow tags = let tag = (tags!!2)!!4 in if isTagText tag then deleteAll ["\t","\r","\n"] $ fromTagText tag else ""
198
getTitleFromRow tags = let tag = (tags!!2)!!4 in if isTagText tag then deleteAll ["\t","\r","\n"] $ fromTagText tag else ""
198
getTitleFromRow tags = let tag = (tags!!2)!!4 in if isTagText tag then deleteAll ["\t","\r","\n"] $ fromTagText tag else ""
198
false
false
0
11
93
61
31
30
null
null
zeyuanxy/haskell-playground
write-yourself-a-scheme/chap8/main.hs
mit
eqv [(DottedList xs x), (DottedList ys y)] = eqv [List $ xs ++ [x], List $ ys ++ [y]]
85
eqv [(DottedList xs x), (DottedList ys y)] = eqv [List $ xs ++ [x], List $ ys ++ [y]]
85
eqv [(DottedList xs x), (DottedList ys y)] = eqv [List $ xs ++ [x], List $ ys ++ [y]]
85
false
false
0
8
18
63
33
30
null
null
randen/haddock
haddock-api/src/Haddock/GhcUtils.hs
bsd-2-clause
setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d }
79
setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d }
79
setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d }
79
false
false
0
8
21
35
18
17
null
null
phischu/fragnix
tests/packages/scotty/Data.ByteString.Builder.ASCII.hs
bsd-3-clause
word64Dec :: Word64 -> Builder word64Dec = P.primBounded P.word64Dec
68
word64Dec :: Word64 -> Builder word64Dec = P.primBounded P.word64Dec
68
word64Dec = P.primBounded P.word64Dec
37
false
true
0
6
8
22
11
11
null
null
dmvianna/haskellbook
src/Ch08Ex.hs
unlicense
incTimes times n = 1 + (incTimes (times - 1) n)
47
incTimes times n = 1 + (incTimes (times - 1) n)
47
incTimes times n = 1 + (incTimes (times - 1) n)
47
false
false
0
9
10
30
15
15
null
null
rayl/keylog
gui/Main.hs
gpl-3.0
-- attach stdin to the label connectStdinTo :: Label -> IO HandlerId connectStdinTo label = do m <- newMVar $ Ticker stdin label [] inputAdd (fromEnum stdInput) [IOIn] priorityDefault (readAll m) -- drain events from stdin, then update label
250
connectStdinTo :: Label -> IO HandlerId connectStdinTo label = do m <- newMVar $ Ticker stdin label [] inputAdd (fromEnum stdInput) [IOIn] priorityDefault (readAll m) -- drain events from stdin, then update label
221
connectStdinTo label = do m <- newMVar $ Ticker stdin label [] inputAdd (fromEnum stdInput) [IOIn] priorityDefault (readAll m) -- drain events from stdin, then update label
181
true
true
0
10
47
70
34
36
null
null
phischu/fragnix
tests/packages/scotty/Text.PrettyPrint.Annotated.HughesPJ.hs
bsd-3-clause
mkNest 0 p = p
30
mkNest 0 p = p
30
mkNest 0 p = p
30
false
false
0
4
20
12
5
7
null
null
siddhanathan/ghc
testsuite/tests/parser/should_fail/T1344a.hs
bsd-3-clause
a = "Hel\x6c000000000000000 World"
34
a = "Hel\x6c000000000000000 World"
34
a = "Hel\x6c000000000000000 World"
34
false
false
1
5
3
10
3
7
null
null
lancelet/bored-robot
src/CI/Docker.hs
apache-2.0
procTagImage :: (Member Proc r, Member (Exception DockerEx) r) => Image -> Tag -> Eff r Image procTagImage img@(Image name _tag) tag' = do (status, _stdout, stderr) <- docker "tag" [imageRepr img, name <> ":" <> tagRepr tag'] when (isFailure status) $ -- TODO Parse the error and throw correct exception when (isFailure status) $ throwException (parseError stderr) return (Image name tag')
440
procTagImage :: (Member Proc r, Member (Exception DockerEx) r) => Image -> Tag -> Eff r Image procTagImage img@(Image name _tag) tag' = do (status, _stdout, stderr) <- docker "tag" [imageRepr img, name <> ":" <> tagRepr tag'] when (isFailure status) $ -- TODO Parse the error and throw correct exception when (isFailure status) $ throwException (parseError stderr) return (Image name tag')
440
procTagImage img@(Image name _tag) tag' = do (status, _stdout, stderr) <- docker "tag" [imageRepr img, name <> ":" <> tagRepr tag'] when (isFailure status) $ -- TODO Parse the error and throw correct exception when (isFailure status) $ throwException (parseError stderr) return (Image name tag')
323
false
true
0
11
112
159
78
81
null
null
cdupont/eprocess
src/Control/Concurrent/Process.hs
bsd-3-clause
spawn :: MonadIO m => Process r k -- ^ The process to be run -> m (Handle r) -- ^ The handle for that process spawn p = liftIO $ do pChan <- newChan pThread <- forkIO $ do t <- myThreadId _ <- runReaderT (internalReader p) $ PH pChan t return () return $ PH pChan pThread -- | /runHere/ executes process code in the current environment. Usage: -- @ -- result <- runHere process -- @
592
spawn :: MonadIO m => Process r k -- ^ The process to be run -> m (Handle r) spawn p = liftIO $ do pChan <- newChan pThread <- forkIO $ do t <- myThreadId _ <- runReaderT (internalReader p) $ PH pChan t return () return $ PH pChan pThread -- | /runHere/ executes process code in the current environment. Usage: -- @ -- result <- runHere process -- @
543
spawn p = liftIO $ do pChan <- newChan pThread <- forkIO $ do t <- myThreadId _ <- runReaderT (internalReader p) $ PH pChan t return () return $ PH pChan pThread -- | /runHere/ executes process code in the current environment. Usage: -- @ -- result <- runHere process -- @
452
true
true
0
16
288
119
56
63
null
null
danielgrigg/haskell-cis194
week4/week4.hs
bsd-2-clause
fun2 n | even n = n + fun2 (n `div` 2) | otherwise = fun2 (3 * n + 1)
76
fun2 n | even n = n + fun2 (n `div` 2) | otherwise = fun2 (3 * n + 1)
76
fun2 n | even n = n + fun2 (n `div` 2) | otherwise = fun2 (3 * n + 1)
76
false
false
0
9
27
57
27
30
null
null
lancelotsix/hs-tls
core/Network/TLS/State.hs
bsd-3-clause
setVersion :: Version -> TLSSt () setVersion ver = modify (\st -> st { stVersion = Just ver })
94
setVersion :: Version -> TLSSt () setVersion ver = modify (\st -> st { stVersion = Just ver })
94
setVersion ver = modify (\st -> st { stVersion = Just ver })
60
false
true
0
10
18
45
23
22
null
null
diku-dk/futhark
src/Futhark/CodeGen/Backends/SimpleRep.hs
isc
primTypeToCType (FloatType Float32) = [C.cty|float|]
52
primTypeToCType (FloatType Float32) = [C.cty|float|]
52
primTypeToCType (FloatType Float32) = [C.cty|float|]
52
false
false
0
7
4
21
12
9
null
null
mydaum/cabal
cabal-testsuite/Test/Cabal/Prelude.hs
bsd-3-clause
requireHasSourceCopy :: TestM () requireHasSourceCopy = do env <- getTestEnv unless (testHaveSourceCopy env) $ do error "This operation requires a source copy; use withSourceCopy and 'git add' all test files" -- NB: Keep this synchronized with partitionTests
275
requireHasSourceCopy :: TestM () requireHasSourceCopy = do env <- getTestEnv unless (testHaveSourceCopy env) $ do error "This operation requires a source copy; use withSourceCopy and 'git add' all test files" -- NB: Keep this synchronized with partitionTests
275
requireHasSourceCopy = do env <- getTestEnv unless (testHaveSourceCopy env) $ do error "This operation requires a source copy; use withSourceCopy and 'git add' all test files" -- NB: Keep this synchronized with partitionTests
242
false
true
0
10
53
46
21
25
null
null