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
jwiegley/ghc-release
libraries/Cabal/cabal-install/Distribution/Client/Sandbox.hs
gpl-3.0
sandboxInit :: Verbosity -> SandboxFlags -> GlobalFlags -> IO () sandboxInit verbosity sandboxFlags globalFlags = do -- Warn if there's a 'cabal-dev' sandbox. isCabalDevSandbox <- liftM2 (&&) (doesDirectoryExist "cabal-dev") (doesFileExist $ "cabal-dev" </> "cabal.config") when isCabalDevSandbox $ warn verbosity $ "You are apparently using a legacy (cabal-dev) sandbox. " ++ "Legacy sandboxes may interact badly with native Cabal sandboxes. " ++ "You may want to delete the 'cabal-dev' directory to prevent issues." -- Create the sandbox directory. let sandboxDir' = fromFlagOrDefault defaultSandboxLocation (sandboxLocation sandboxFlags) createDirectoryIfMissingVerbose verbosity True sandboxDir' sandboxDir <- tryCanonicalizePath sandboxDir' setFileHidden sandboxDir -- Determine which compiler to use (using the value from ~/.cabal/config). userConfig <- loadConfig verbosity (globalConfigFile globalFlags) NoFlag (comp, platform, conf) <- configCompilerAuxEx (savedConfigureFlags userConfig) -- Create the package environment file. pkgEnvFile <- getSandboxConfigFilePath globalFlags createPackageEnvironmentFile verbosity sandboxDir pkgEnvFile NoComments comp platform (_sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags let config = pkgEnvSavedConfig pkgEnv configFlags = savedConfigureFlags config -- Create the index file if it doesn't exist. indexFile <- tryGetIndexFilePath config indexFileExists <- doesFileExist indexFile if indexFileExists then notice verbosity $ "Using an existing sandbox located at " ++ sandboxDir else notice verbosity $ "Creating a new sandbox at " ++ sandboxDir Index.createEmpty verbosity indexFile -- Create the package DB for the default compiler. initPackageDBIfNeeded verbosity configFlags comp conf maybeAddCompilerTimestampRecord verbosity sandboxDir indexFile (compilerId comp) platform -- | Entry point for the 'cabal sandbox-delete' command.
2,045
sandboxInit :: Verbosity -> SandboxFlags -> GlobalFlags -> IO () sandboxInit verbosity sandboxFlags globalFlags = do -- Warn if there's a 'cabal-dev' sandbox. isCabalDevSandbox <- liftM2 (&&) (doesDirectoryExist "cabal-dev") (doesFileExist $ "cabal-dev" </> "cabal.config") when isCabalDevSandbox $ warn verbosity $ "You are apparently using a legacy (cabal-dev) sandbox. " ++ "Legacy sandboxes may interact badly with native Cabal sandboxes. " ++ "You may want to delete the 'cabal-dev' directory to prevent issues." -- Create the sandbox directory. let sandboxDir' = fromFlagOrDefault defaultSandboxLocation (sandboxLocation sandboxFlags) createDirectoryIfMissingVerbose verbosity True sandboxDir' sandboxDir <- tryCanonicalizePath sandboxDir' setFileHidden sandboxDir -- Determine which compiler to use (using the value from ~/.cabal/config). userConfig <- loadConfig verbosity (globalConfigFile globalFlags) NoFlag (comp, platform, conf) <- configCompilerAuxEx (savedConfigureFlags userConfig) -- Create the package environment file. pkgEnvFile <- getSandboxConfigFilePath globalFlags createPackageEnvironmentFile verbosity sandboxDir pkgEnvFile NoComments comp platform (_sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags let config = pkgEnvSavedConfig pkgEnv configFlags = savedConfigureFlags config -- Create the index file if it doesn't exist. indexFile <- tryGetIndexFilePath config indexFileExists <- doesFileExist indexFile if indexFileExists then notice verbosity $ "Using an existing sandbox located at " ++ sandboxDir else notice verbosity $ "Creating a new sandbox at " ++ sandboxDir Index.createEmpty verbosity indexFile -- Create the package DB for the default compiler. initPackageDBIfNeeded verbosity configFlags comp conf maybeAddCompilerTimestampRecord verbosity sandboxDir indexFile (compilerId comp) platform -- | Entry point for the 'cabal sandbox-delete' command.
2,045
sandboxInit verbosity sandboxFlags globalFlags = do -- Warn if there's a 'cabal-dev' sandbox. isCabalDevSandbox <- liftM2 (&&) (doesDirectoryExist "cabal-dev") (doesFileExist $ "cabal-dev" </> "cabal.config") when isCabalDevSandbox $ warn verbosity $ "You are apparently using a legacy (cabal-dev) sandbox. " ++ "Legacy sandboxes may interact badly with native Cabal sandboxes. " ++ "You may want to delete the 'cabal-dev' directory to prevent issues." -- Create the sandbox directory. let sandboxDir' = fromFlagOrDefault defaultSandboxLocation (sandboxLocation sandboxFlags) createDirectoryIfMissingVerbose verbosity True sandboxDir' sandboxDir <- tryCanonicalizePath sandboxDir' setFileHidden sandboxDir -- Determine which compiler to use (using the value from ~/.cabal/config). userConfig <- loadConfig verbosity (globalConfigFile globalFlags) NoFlag (comp, platform, conf) <- configCompilerAuxEx (savedConfigureFlags userConfig) -- Create the package environment file. pkgEnvFile <- getSandboxConfigFilePath globalFlags createPackageEnvironmentFile verbosity sandboxDir pkgEnvFile NoComments comp platform (_sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags let config = pkgEnvSavedConfig pkgEnv configFlags = savedConfigureFlags config -- Create the index file if it doesn't exist. indexFile <- tryGetIndexFilePath config indexFileExists <- doesFileExist indexFile if indexFileExists then notice verbosity $ "Using an existing sandbox located at " ++ sandboxDir else notice verbosity $ "Creating a new sandbox at " ++ sandboxDir Index.createEmpty verbosity indexFile -- Create the package DB for the default compiler. initPackageDBIfNeeded verbosity configFlags comp conf maybeAddCompilerTimestampRecord verbosity sandboxDir indexFile (compilerId comp) platform -- | Entry point for the 'cabal sandbox-delete' command.
1,979
false
true
0
13
368
355
165
190
null
null
mmhat/h-gpgme
test/CryptoTest.hs
mit
withTestTmpFiles :: (MonadIO m, MonadMask m) => ( FilePath -> Handle -- Plaintext -> FilePath -> Handle -- Ciphertext -> FilePath -> Handle -- Decrypted text -> m a) -> m a withTestTmpFiles f = withSystemTempFile "plain" $ \pp ph -> withSystemTempFile "cipher" $ \cp ch -> withSystemTempFile "decrypt" $ \dp dh -> f pp ph cp ch dp dh
444
withTestTmpFiles :: (MonadIO m, MonadMask m) => ( FilePath -> Handle -- Plaintext -> FilePath -> Handle -- Ciphertext -> FilePath -> Handle -- Decrypted text -> m a) -> m a withTestTmpFiles f = withSystemTempFile "plain" $ \pp ph -> withSystemTempFile "cipher" $ \cp ch -> withSystemTempFile "decrypt" $ \dp dh -> f pp ph cp ch dp dh
444
withTestTmpFiles f = withSystemTempFile "plain" $ \pp ph -> withSystemTempFile "cipher" $ \cp ch -> withSystemTempFile "decrypt" $ \dp dh -> f pp ph cp ch dp dh
180
false
true
0
14
170
124
63
61
null
null
SnowOnion/GrahamHaskellPractice
ch06/play.hs
mit
-- 我怎样觉悟到要加这个括号: 第一坨报错的最后一句是 -- In an equation for ‘isort’: isort (x : xs) = insert x isort xs -- 又会 "The type variable ‘a0’ is ambiguous" -- testIsort1=isort []==[] testIsort2=isort [6,1,2,4,3]==[1,2,3,4,6]
209
testIsort2=isort [6,1,2,4,3]==[1,2,3,4,6]
41
testIsort2=isort [6,1,2,4,3]==[1,2,3,4,6]
41
true
false
0
7
32
47
30
17
null
null
msakai/icfpc2013
src/GenProgram/Template.hs
bsd-2-clause
allHoles :: [Hole] allHoles = ["hole" ++ show i | i <- [(1::Int)..]]
68
allHoles :: [Hole] allHoles = ["hole" ++ show i | i <- [(1::Int)..]]
68
allHoles = ["hole" ++ show i | i <- [(1::Int)..]]
49
false
true
0
9
12
41
23
18
null
null
pawel-n/syntax-example
Main.hs
mit
-- | Parses a list of atoms and folds them with the _App prism. apps :: SyntaxText syn => syn () AST apps = bifoldl1 _App /$/ S.sepBy1 atom S.spaces1
149
apps :: SyntaxText syn => syn () AST apps = bifoldl1 _App /$/ S.sepBy1 atom S.spaces1
85
apps = bifoldl1 _App /$/ S.sepBy1 atom S.spaces1
48
true
true
0
8
29
47
21
26
null
null
taiki45/ex-simple-html-parser
test/Main.hs
mit
main :: IO () main = do args <- getArgs if length args == 0 then do result <- getContents >>= return . parseSimpleHtml "STDIN" putStrLn . (either show show) $ result else do result <- (readFile $ args !! 0) >>= return . (parseSimpleHtml $ args !! 0) putStrLn . (either show show) $ result
400
main :: IO () main = do args <- getArgs if length args == 0 then do result <- getContents >>= return . parseSimpleHtml "STDIN" putStrLn . (either show show) $ result else do result <- (readFile $ args !! 0) >>= return . (parseSimpleHtml $ args !! 0) putStrLn . (either show show) $ result
400
main = do args <- getArgs if length args == 0 then do result <- getContents >>= return . parseSimpleHtml "STDIN" putStrLn . (either show show) $ result else do result <- (readFile $ args !! 0) >>= return . (parseSimpleHtml $ args !! 0) putStrLn . (either show show) $ result
386
false
true
0
15
167
140
66
74
null
null
lukasmartinelli/hadolint
app/Main.hs
gpl-3.0
toNofailSeverity "info" = Just Rule.DLInfoC
43
toNofailSeverity "info" = Just Rule.DLInfoC
43
toNofailSeverity "info" = Just Rule.DLInfoC
43
false
false
1
6
4
17
6
11
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F17.hs
bsd-3-clause
ptr_glMultiDrawElementsIndirect :: FunPtr (GLenum -> GLenum -> Ptr a -> GLsizei -> GLsizei -> IO ()) ptr_glMultiDrawElementsIndirect = unsafePerformIO $ getCommand "glMultiDrawElementsIndirect"
193
ptr_glMultiDrawElementsIndirect :: FunPtr (GLenum -> GLenum -> Ptr a -> GLsizei -> GLsizei -> IO ()) ptr_glMultiDrawElementsIndirect = unsafePerformIO $ getCommand "glMultiDrawElementsIndirect"
193
ptr_glMultiDrawElementsIndirect = unsafePerformIO $ getCommand "glMultiDrawElementsIndirect"
92
false
true
0
13
21
52
25
27
null
null
cem3394/haskell
tensorflow-ops/tests/GradientTest.hs
apache-2.0
testCreateGraphNameScopes :: Test testCreateGraphNameScopes = testCase "testCreateGraphNameScopes" $ do [dx] <- TF.runSession $ do let shape = TF.constant (TF.Shape [1]) [1] x :: TF.Tensor TF.Value Float <- TF.withNameScope "foo" (TF.truncatedNormal shape) TF.gradients x [x] >>= TF.run -- If this test fails, it will likely be caused by an exception within -- `TF.gradients`. This assert is extra. 1 @=? TF.unScalar dx -- Test that createGraph can handle graphs with diamond shapes.
537
testCreateGraphNameScopes :: Test testCreateGraphNameScopes = testCase "testCreateGraphNameScopes" $ do [dx] <- TF.runSession $ do let shape = TF.constant (TF.Shape [1]) [1] x :: TF.Tensor TF.Value Float <- TF.withNameScope "foo" (TF.truncatedNormal shape) TF.gradients x [x] >>= TF.run -- If this test fails, it will likely be caused by an exception within -- `TF.gradients`. This assert is extra. 1 @=? TF.unScalar dx -- Test that createGraph can handle graphs with diamond shapes.
537
testCreateGraphNameScopes = testCase "testCreateGraphNameScopes" $ do [dx] <- TF.runSession $ do let shape = TF.constant (TF.Shape [1]) [1] x :: TF.Tensor TF.Value Float <- TF.withNameScope "foo" (TF.truncatedNormal shape) TF.gradients x [x] >>= TF.run -- If this test fails, it will likely be caused by an exception within -- `TF.gradients`. This assert is extra. 1 @=? TF.unScalar dx -- Test that createGraph can handle graphs with diamond shapes.
503
false
true
0
19
123
140
66
74
null
null
tdox/aircraft-service
src/Client.hs
mit
getAllAircraftsIO :: Manager -> BaseUrl -> IO (Either ServantError [Entity Aircraft]) getAllAircraftsIO mgr bu = runExceptT $ getAllAircrafts mgr bu
203
getAllAircraftsIO :: Manager -> BaseUrl -> IO (Either ServantError [Entity Aircraft]) getAllAircraftsIO mgr bu = runExceptT $ getAllAircrafts mgr bu
184
getAllAircraftsIO mgr bu = runExceptT $ getAllAircrafts mgr bu
62
false
true
0
11
74
50
24
26
null
null
dysinger/amazonka
amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/Types.hs
mpl-2.0
-- | The value, if any, that you want Elastic Transcoder to prepend to the names -- of all files that this job creates, including output files, thumbnails, and -- playlists. We recommend that you add a / or some other delimiter to the end -- of the 'OutputKeyPrefix'. jOutputKeyPrefix :: Lens' Job' Text jOutputKeyPrefix = lens _jOutputKeyPrefix (\s a -> s { _jOutputKeyPrefix = a })
383
jOutputKeyPrefix :: Lens' Job' Text jOutputKeyPrefix = lens _jOutputKeyPrefix (\s a -> s { _jOutputKeyPrefix = a })
115
jOutputKeyPrefix = lens _jOutputKeyPrefix (\s a -> s { _jOutputKeyPrefix = a })
79
true
true
0
9
66
43
25
18
null
null
tdfirth/lambda
src/Lambda/Primitives.hs
mit
readProc :: [LispVal] -> IOThrowsError LispVal readProc [] = writeProc [Port stdout]
93
readProc :: [LispVal] -> IOThrowsError LispVal readProc [] = writeProc [Port stdout]
93
readProc [] = writeProc [Port stdout]
46
false
true
0
7
20
35
17
18
null
null
ryanoneill/yorgey-haskell
Week02/LogAnalysis.hs
mit
getMessage (Unknown m) = m
26
getMessage (Unknown m) = m
26
getMessage (Unknown m) = m
26
false
false
0
7
4
15
7
8
null
null
caioariede/tpll
src/Tpll/Context.hs
mit
cIOUTCTime :: IO UTCTime -> ContextValue cIOUTCTime = CIOUTCTime False
70
cIOUTCTime :: IO UTCTime -> ContextValue cIOUTCTime = CIOUTCTime False
70
cIOUTCTime = CIOUTCTime False
29
false
true
0
7
9
27
11
16
null
null
KommuSoft/dep-software
Dep.Ui.Utils.hs
gpl-3.0
handleKeyWidget :: (WidgetKeyHandling a,KeyContextHandler a a) => Widget a -> Key -> [Modifier] -> IO Bool handleKeyWidget x y z = do ff <- handleKeyWidgetFallfront x y z if ff then return True else do s <- getState x r <- readIORef x f (focused r) (handleKeyCtx y z s s) where f True (Just l) = updateWidgetState x (const l) >> return True f _ _ = handleKeyWidgetFallback x y z
478
handleKeyWidget :: (WidgetKeyHandling a,KeyContextHandler a a) => Widget a -> Key -> [Modifier] -> IO Bool handleKeyWidget x y z = do ff <- handleKeyWidgetFallfront x y z if ff then return True else do s <- getState x r <- readIORef x f (focused r) (handleKeyCtx y z s s) where f True (Just l) = updateWidgetState x (const l) >> return True f _ _ = handleKeyWidgetFallback x y z
478
handleKeyWidget x y z = do ff <- handleKeyWidgetFallfront x y z if ff then return True else do s <- getState x r <- readIORef x f (focused r) (handleKeyCtx y z s s) where f True (Just l) = updateWidgetState x (const l) >> return True f _ _ = handleKeyWidgetFallback x y z
371
false
true
0
12
171
183
86
97
null
null
lukexi/ghc
compiler/nativeGen/X86/Instr.hs
bsd-3-clause
x86_mkStackAllocInstr :: Platform -> Int -> Instr x86_mkStackAllocInstr platform amount = case platformArch platform of ArchX86 -> SUB II32 (OpImm (ImmInt amount)) (OpReg esp) ArchX86_64 -> SUB II64 (OpImm (ImmInt amount)) (OpReg rsp) _ -> panic "x86_mkStackAllocInstr"
316
x86_mkStackAllocInstr :: Platform -> Int -> Instr x86_mkStackAllocInstr platform amount = case platformArch platform of ArchX86 -> SUB II32 (OpImm (ImmInt amount)) (OpReg esp) ArchX86_64 -> SUB II64 (OpImm (ImmInt amount)) (OpReg rsp) _ -> panic "x86_mkStackAllocInstr"
316
x86_mkStackAllocInstr platform amount = case platformArch platform of ArchX86 -> SUB II32 (OpImm (ImmInt amount)) (OpReg esp) ArchX86_64 -> SUB II64 (OpImm (ImmInt amount)) (OpReg rsp) _ -> panic "x86_mkStackAllocInstr"
242
false
true
0
12
83
107
50
57
null
null
peti/funcmp
FMP/Core.hs
gpl-3.0
drawPath _ _ n mp = (n, mp)
40
drawPath _ _ n mp = (n, mp)
40
drawPath _ _ n mp = (n, mp)
40
false
false
1
6
20
18
9
9
null
null
azapps/nlp.hs
src/NLP/Index/InvertedIndex.hs
gpl-3.0
printInvertedIndex :: (Ord a, Show a, Ord b, Show b) => InvertedIndex a b -> String printInvertedIndex invin = unlines $ toString $ Map.toList $ Map.map printRow invin where toString :: (Show a, Show b) => [(a,b)] -> [String] toString ((token,str):xs) = (show token ++ ": " ++ show str) : toString xs toString [] = [] printRow :: (Show a, Show b) => Map.Map a b -> String printRow mmap = unwords $ toStr $ Map.toList mmap where toStr ((fname,count):xs) = (show fname ++ (' ' : show count)) : toStr xs toStr [] = []
603
printInvertedIndex :: (Ord a, Show a, Ord b, Show b) => InvertedIndex a b -> String printInvertedIndex invin = unlines $ toString $ Map.toList $ Map.map printRow invin where toString :: (Show a, Show b) => [(a,b)] -> [String] toString ((token,str):xs) = (show token ++ ": " ++ show str) : toString xs toString [] = [] printRow :: (Show a, Show b) => Map.Map a b -> String printRow mmap = unwords $ toStr $ Map.toList mmap where toStr ((fname,count):xs) = (show fname ++ (' ' : show count)) : toStr xs toStr [] = []
603
printInvertedIndex invin = unlines $ toString $ Map.toList $ Map.map printRow invin where toString :: (Show a, Show b) => [(a,b)] -> [String] toString ((token,str):xs) = (show token ++ ": " ++ show str) : toString xs toString [] = [] printRow :: (Show a, Show b) => Map.Map a b -> String printRow mmap = unwords $ toStr $ Map.toList mmap where toStr ((fname,count):xs) = (show fname ++ (' ' : show count)) : toStr xs toStr [] = []
519
false
true
12
11
185
310
147
163
null
null
olorin/amazonka
amazonka-redshift/gen/Network/AWS/Redshift/Types/Product.hs
mpl-2.0
-- | The node type offered by the reserved node offering. rnoNodeType :: Lens' ReservedNodeOffering (Maybe Text) rnoNodeType = lens _rnoNodeType (\ s a -> s{_rnoNodeType = a})
175
rnoNodeType :: Lens' ReservedNodeOffering (Maybe Text) rnoNodeType = lens _rnoNodeType (\ s a -> s{_rnoNodeType = a})
117
rnoNodeType = lens _rnoNodeType (\ s a -> s{_rnoNodeType = a})
62
true
true
0
9
27
46
25
21
null
null
fredokun/piccolo
src/Backend/SeqASTUtils.hs
gpl-3.0
-- | Variable decrementation decr :: VarName -> Instr decr = Decrement
70
decr :: VarName -> Instr decr = Decrement
41
decr = Decrement
16
true
true
0
7
11
23
10
13
null
null
ezyang/ghc
compiler/cmm/PprC.hs
bsd-3-clause
pprStringInCStyle :: [Word8] -> SDoc pprStringInCStyle s = doubleQuotes (text (concatMap charToC s))
100
pprStringInCStyle :: [Word8] -> SDoc pprStringInCStyle s = doubleQuotes (text (concatMap charToC s))
100
pprStringInCStyle s = doubleQuotes (text (concatMap charToC s))
63
false
true
0
9
12
38
19
19
null
null
hesiod/OpenGL
src/Graphics/Rendering/OpenGL/GL/BufferObjects.hs
bsd-3-clause
getIndexed :: Num a => IPName1I -> BufferIndex -> GettableStateVar a getIndexed e i = makeGettableStateVar $ getInteger641i fromIntegral e i
140
getIndexed :: Num a => IPName1I -> BufferIndex -> GettableStateVar a getIndexed e i = makeGettableStateVar $ getInteger641i fromIntegral e i
140
getIndexed e i = makeGettableStateVar $ getInteger641i fromIntegral e i
71
false
true
0
8
20
45
21
24
null
null
bitemyapp/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
cryptoActionCreate :: String cryptoActionCreate = "create"
58
cryptoActionCreate :: String cryptoActionCreate = "create"
58
cryptoActionCreate = "create"
29
false
true
0
6
5
18
7
11
null
null
abuiles/turbinado-blog
tmp/dependencies/hs-plugins-1.3.1/src/System/Eval/Haskell.hs
bsd-3-clause
mkHsValues :: (Show a) => Map.Map String a -> String mkHsValues values = concat $ elems $ Map.mapWithKey convertToHs values where convertToHs :: (Show a) => String -> a -> String convertToHs name value = name ++ " = " ++ show value ++ "\n" ------------------------------------------------------------------------ -- -- | Return a compiled value's type, by using Dynamic to get a -- representation of the inferred type. --
443
mkHsValues :: (Show a) => Map.Map String a -> String mkHsValues values = concat $ elems $ Map.mapWithKey convertToHs values where convertToHs :: (Show a) => String -> a -> String convertToHs name value = name ++ " = " ++ show value ++ "\n" ------------------------------------------------------------------------ -- -- | Return a compiled value's type, by using Dynamic to get a -- representation of the inferred type. --
443
mkHsValues values = concat $ elems $ Map.mapWithKey convertToHs values where convertToHs :: (Show a) => String -> a -> String convertToHs name value = name ++ " = " ++ show value ++ "\n" ------------------------------------------------------------------------ -- -- | Return a compiled value's type, by using Dynamic to get a -- representation of the inferred type. --
390
false
true
2
9
88
115
56
59
null
null
tjakway/ghcjvm
compiler/basicTypes/DataCon.hs
bsd-3-clause
-- | The *full* constraints on the constructor type. dataConTheta :: DataCon -> ThetaType dataConTheta (MkData { dcEqSpec = eq_spec, dcOtherTheta = theta }) = eqSpecPreds eq_spec ++ theta
189
dataConTheta :: DataCon -> ThetaType dataConTheta (MkData { dcEqSpec = eq_spec, dcOtherTheta = theta }) = eqSpecPreds eq_spec ++ theta
136
dataConTheta (MkData { dcEqSpec = eq_spec, dcOtherTheta = theta }) = eqSpecPreds eq_spec ++ theta
99
true
true
0
9
30
44
24
20
null
null
forgit/Rosalind
Fasta.hs
gpl-2.0
splitStr [x] = [x]
21
splitStr [x] = [x]
21
splitStr [x] = [x]
21
false
false
0
5
6
16
8
8
null
null
dorchard/camfort
src/Camfort/Specification/Units/Monad.hs
apache-2.0
-- helper functions -- | Generate a number guaranteed to be unique in the current analysis. freshId :: UnitSolver Int freshId = do s <- get let i = usNextUnique s put $ s { usNextUnique = i + 1 } pure i
211
freshId :: UnitSolver Int freshId = do s <- get let i = usNextUnique s put $ s { usNextUnique = i + 1 } pure i
118
freshId = do s <- get let i = usNextUnique s put $ s { usNextUnique = i + 1 } pure i
92
true
true
0
11
51
66
30
36
null
null
DavidAlphaFox/ghc
compiler/ghci/ByteCodeItbls.hs
bsd-3-clause
itblCode :: DynFlags -> ItblPtr -> Ptr () itblCode dflags (ItblPtr ptr) | ghciTablesNextToCode = castPtr ptr `plusPtr` conInfoTableSizeB dflags | otherwise = castPtr ptr
182
itblCode :: DynFlags -> ItblPtr -> Ptr () itblCode dflags (ItblPtr ptr) | ghciTablesNextToCode = castPtr ptr `plusPtr` conInfoTableSizeB dflags | otherwise = castPtr ptr
182
itblCode dflags (ItblPtr ptr) | ghciTablesNextToCode = castPtr ptr `plusPtr` conInfoTableSizeB dflags | otherwise = castPtr ptr
140
false
true
1
8
37
63
30
33
null
null
CarmineM74/haskell_craft3e
Chapter17.hs
mit
pm (x,y) = x+1
14
pm (x,y) = x+1
14
pm (x,y) = x+1
14
false
false
0
6
3
19
10
9
null
null
sru-systems/protobuf-simple
src/Data/ProtoBuf/WireFormat.hs
mit
-- | Decode a ByteString into either the data-type or an error message. -- -- Decode CustomType: -- -- > decCustomType :: ByteString -> Either String CustomType -- > decCustomType = decode decode :: (Default a, Required a, WireMessage a) => ByteString -> Either String a decode bytes = case runGetOrFail getGroup bytes of Left (_, _, err) -> Left err Right (_, _, obj) -> Right obj -- | Encode a data-type into a ByteString. -- -- Encode CustomType: -- -- > encCustomType :: CustomType -> ByteString -- > encCustomType = encode
538
decode :: (Default a, Required a, WireMessage a) => ByteString -> Either String a decode bytes = case runGetOrFail getGroup bytes of Left (_, _, err) -> Left err Right (_, _, obj) -> Right obj -- | Encode a data-type into a ByteString. -- -- Encode CustomType: -- -- > encCustomType :: CustomType -> ByteString -- > encCustomType = encode
349
decode bytes = case runGetOrFail getGroup bytes of Left (_, _, err) -> Left err Right (_, _, obj) -> Right obj -- | Encode a data-type into a ByteString. -- -- Encode CustomType: -- -- > encCustomType :: CustomType -> ByteString -- > encCustomType = encode
267
true
true
0
9
103
107
60
47
null
null
wowofbob/scratch
src/Text/HTML/Parser/Tag.hs
gpl-3.0
contentChar :: Parser Char contentChar = withToken (\ t -> case t of ContentChar c -> Just c _ -> Nothing) <?> "contentChar"
154
contentChar :: Parser Char contentChar = withToken (\ t -> case t of ContentChar c -> Just c _ -> Nothing) <?> "contentChar"
154
contentChar = withToken (\ t -> case t of ContentChar c -> Just c _ -> Nothing) <?> "contentChar"
127
false
true
0
11
52
51
25
26
null
null
TomHammersley/HaskellRenderer
app/src/CornellBox.hs
gpl-2.0
whiteMaterial = Material (Colour 0.5 0.5 0.5 1) (Colour 0.5 0.5 0.5 1) colBlack colBlack 0 0 0 iorAir NullShader
112
whiteMaterial = Material (Colour 0.5 0.5 0.5 1) (Colour 0.5 0.5 0.5 1) colBlack colBlack 0 0 0 iorAir NullShader
112
whiteMaterial = Material (Colour 0.5 0.5 0.5 1) (Colour 0.5 0.5 0.5 1) colBlack colBlack 0 0 0 iorAir NullShader
112
false
false
1
7
19
52
24
28
null
null
neothemachine/monadiccp
src/Control/Monatron/Operations.hs
bsd-3-clause
modelContT :: Monad m => AlgModel (ContOp (m r)) (ContT r m) modelContT (Abort mr) = contT $ \_ -> mr
114
modelContT :: Monad m => AlgModel (ContOp (m r)) (ContT r m) modelContT (Abort mr) = contT $ \_ -> mr
114
modelContT (Abort mr) = contT $ \_ -> mr
41
false
true
0
10
33
61
30
31
null
null
spechub/Hets
TPTP/Sublogic.hs
gpl-2.0
projectSublogicMorphism :: Sublogic -> Morphism -> Morphism projectSublogicMorphism _ morphism = morphism
105
projectSublogicMorphism :: Sublogic -> Morphism -> Morphism projectSublogicMorphism _ morphism = morphism
105
projectSublogicMorphism _ morphism = morphism
45
false
true
0
6
11
24
12
12
null
null
mihaimaruseac/petulant-octo-avenger
src-draw/WarActivity.hs
mit
getOpcty :: Double -> Double getOpcty p | p < 0.2 = 0 | p < 0.4 = 0.5 | p < 0.6 = 0.7 | p < 0.8 = 0.8 | p < 0.9 = 0.9 | otherwise = 1
145
getOpcty :: Double -> Double getOpcty p | p < 0.2 = 0 | p < 0.4 = 0.5 | p < 0.6 = 0.7 | p < 0.8 = 0.8 | p < 0.9 = 0.9 | otherwise = 1
145
getOpcty p | p < 0.2 = 0 | p < 0.4 = 0.5 | p < 0.6 = 0.7 | p < 0.8 = 0.8 | p < 0.9 = 0.9 | otherwise = 1
116
false
true
5
8
52
88
41
47
null
null
bitemyapp/ganeti
src/Ganeti/Utils.hs
bsd-2-clause
monadicThe s (x:xs) | all (x ==) xs = return x | otherwise = fail s
71
monadicThe s (x:xs) | all (x ==) xs = return x | otherwise = fail s
71
monadicThe s (x:xs) | all (x ==) xs = return x | otherwise = fail s
71
false
false
1
9
19
46
22
24
null
null
ibotty/pipes-text
src/Pipes/Text.hs
bsd-3-clause
dropWhile :: Monad m => (Char -> Bool) -> Pipe Text Text m r dropWhile f = do text <- await let remainder = T.dropWhile f text if T.null remainder then dropWhile f else do yield remainder cat
236
dropWhile :: Monad m => (Char -> Bool) -> Pipe Text Text m r dropWhile f = do text <- await let remainder = T.dropWhile f text if T.null remainder then dropWhile f else do yield remainder cat
236
dropWhile f = do text <- await let remainder = T.dropWhile f text if T.null remainder then dropWhile f else do yield remainder cat
175
false
true
0
11
82
92
42
50
null
null
sopvop/heist
test/suite/Heist/Compiled/Tests.hs
bsd-3-clause
doctypeTest :: IO () doctypeTest = genericTest "doctype test" "rss" expected where expected = encodeUtf8 "<rss><channel><link>http://www.devalot.com/</link></channel></rss>&#10;"
190
doctypeTest :: IO () doctypeTest = genericTest "doctype test" "rss" expected where expected = encodeUtf8 "<rss><channel><link>http://www.devalot.com/</link></channel></rss>&#10;"
190
doctypeTest = genericTest "doctype test" "rss" expected where expected = encodeUtf8 "<rss><channel><link>http://www.devalot.com/</link></channel></rss>&#10;"
169
false
true
0
6
27
34
16
18
null
null
osa1/chsc
Termination/Generaliser.hs
bsd-3-clause
stackFrameTag' :: Tagged StackFrame -> Tag stackFrameTag' = injectTag 3 . tag
77
stackFrameTag' :: Tagged StackFrame -> Tag stackFrameTag' = injectTag 3 . tag
77
stackFrameTag' = injectTag 3 . tag
34
false
true
0
6
11
25
12
13
null
null
kwrooijen/sdl-game
End/Global/Object.hs
gpl-3.0
moveCamera :: Word32 -> Player -> Camera moveCamera deltaTicks p = Camera (calcCam cxD px screenWidth mapWidthPx) (calcCam cyD py screenHeight mapHeightPx) where (Pos px py) = p^.pos (Camera cx cy) = p^.camera (Vel vx vy) = p^.vel delta = (fI deltaTicks) / 1000.0 cxD = cx + (vx * delta) cyD = cy + (vy * delta) calcCam fc fp s mapPx | fc < 0 = 0 | fp < fI halfScreen = 0 | fp > fI (mapPx - halfScreen) = fI $ mapPx - s | otherwise = fp - fI halfScreen where halfScreen = (s `div` 2)
600
moveCamera :: Word32 -> Player -> Camera moveCamera deltaTicks p = Camera (calcCam cxD px screenWidth mapWidthPx) (calcCam cyD py screenHeight mapHeightPx) where (Pos px py) = p^.pos (Camera cx cy) = p^.camera (Vel vx vy) = p^.vel delta = (fI deltaTicks) / 1000.0 cxD = cx + (vx * delta) cyD = cy + (vy * delta) calcCam fc fp s mapPx | fc < 0 = 0 | fp < fI halfScreen = 0 | fp > fI (mapPx - halfScreen) = fI $ mapPx - s | otherwise = fp - fI halfScreen where halfScreen = (s `div` 2)
600
moveCamera deltaTicks p = Camera (calcCam cxD px screenWidth mapWidthPx) (calcCam cyD py screenHeight mapHeightPx) where (Pos px py) = p^.pos (Camera cx cy) = p^.camera (Vel vx vy) = p^.vel delta = (fI deltaTicks) / 1000.0 cxD = cx + (vx * delta) cyD = cy + (vy * delta) calcCam fc fp s mapPx | fc < 0 = 0 | fp < fI halfScreen = 0 | fp > fI (mapPx - halfScreen) = fI $ mapPx - s | otherwise = fp - fI halfScreen where halfScreen = (s `div` 2)
559
false
true
15
11
218
300
135
165
null
null
RAFIRAF/HASKELL
kk.hs
mit
foo5 ((x1, x2):xs) = (x1:ys, x2:zs) where (ys, zs) = foo5 xs
63
foo5 ((x1, x2):xs) = (x1:ys, x2:zs) where (ys, zs) = foo5 xs
63
foo5 ((x1, x2):xs) = (x1:ys, x2:zs) where (ys, zs) = foo5 xs
63
false
false
0
7
14
54
29
25
null
null
jhance/objection
Language/Objection/CodeGen.hs
gpl-3.0
convertIntComparison CLessEquals = IntSLE
41
convertIntComparison CLessEquals = IntSLE
41
convertIntComparison CLessEquals = IntSLE
41
false
false
0
5
3
9
4
5
null
null
nushio3/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
unpackCStringAppendIdKey = mkPreludeMiscIdUnique 18
56
unpackCStringAppendIdKey = mkPreludeMiscIdUnique 18
56
unpackCStringAppendIdKey = mkPreludeMiscIdUnique 18
56
false
false
0
5
8
9
4
5
null
null
rcook/mlutil
ch03-decision-trees/src/FishDemo.hs
mit
runFishDemos :: IO () runFishDemos = do --renderFigures --testClassify --testEncode return ()
109
runFishDemos :: IO () runFishDemos = do --renderFigures --testClassify --testEncode return ()
109
runFishDemos = do --renderFigures --testClassify --testEncode return ()
87
false
true
0
8
27
27
14
13
null
null
siphayne/CS381
HW1/hw1.hs
mit
add (Succ n) m = Succ (add n m)
31
add (Succ n) m = Succ (add n m)
31
add (Succ n) m = Succ (add n m)
31
false
false
1
7
8
32
13
19
null
null
cdosborn/lit
src/Highlight.hs
gpl-2.0
getLang path = case languagesByFilename path of [] -> "" lst -> head lst
84
getLang path = case languagesByFilename path of [] -> "" lst -> head lst
84
getLang path = case languagesByFilename path of [] -> "" lst -> head lst
84
false
false
2
6
25
35
15
20
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Orders/Updatelineitemshippingdetails.hs
mpl-2.0
-- | The ID of the account that manages the order. This cannot be a -- multi-client account. ousMerchantId :: Lens' OrdersUpdatelineitemshippingdetails Word64 ousMerchantId = lens _ousMerchantId (\ s a -> s{_ousMerchantId = a}) . _Coerce
251
ousMerchantId :: Lens' OrdersUpdatelineitemshippingdetails Word64 ousMerchantId = lens _ousMerchantId (\ s a -> s{_ousMerchantId = a}) . _Coerce
158
ousMerchantId = lens _ousMerchantId (\ s a -> s{_ousMerchantId = a}) . _Coerce
92
true
true
2
8
49
52
25
27
null
null
simonmar/alex
src/Data/Ranged/RangedSet.hs
bsd-3-clause
-- | True if the first argument is a strict subset of the second argument. -- -- Infix precedence is left 5. rSetIsSubsetStrict, (-<-) :: DiscreteOrdered v => RSet v -> RSet v -> Bool rSetIsSubsetStrict rs1 rs2 = rSetIsEmpty (rs1 -!- rs2) && not (rSetIsEmpty (rs2 -!- rs1))
279
rSetIsSubsetStrict, (-<-) :: DiscreteOrdered v => RSet v -> RSet v -> Bool rSetIsSubsetStrict rs1 rs2 = rSetIsEmpty (rs1 -!- rs2) && not (rSetIsEmpty (rs2 -!- rs1))
170
rSetIsSubsetStrict rs1 rs2 = rSetIsEmpty (rs1 -!- rs2) && not (rSetIsEmpty (rs2 -!- rs1))
95
true
true
0
10
54
74
39
35
null
null
ekmett/ermine
src/Ermine/Pretty/G.hs
bsd-2-clause
defaultCxt N (Native _) = "native"
34
defaultCxt N (Native _) = "native"
34
defaultCxt N (Native _) = "native"
34
false
false
0
6
5
19
8
11
null
null
8l/asif
src/Language/FOmega/Parse.hs
mit
-- <|> delta -- The lexer langDef = haskellDef { P.reservedNames = ["Pi"] , P.identStart = letter <|> char '_' , P.identLetter = alphaNum <|> oneOf "_*" }
166
langDef = haskellDef { P.reservedNames = ["Pi"] , P.identStart = letter <|> char '_' , P.identLetter = alphaNum <|> oneOf "_*" }
139
langDef = haskellDef { P.reservedNames = ["Pi"] , P.identStart = letter <|> char '_' , P.identLetter = alphaNum <|> oneOf "_*" }
139
true
false
1
9
39
58
30
28
null
null
RAFIRAF/HASKELL
baby.hs
mit
third :: (a, b, c) -> c third (_,_,z) = z
41
third :: (a, b, c) -> c third (_,_,z) = z
41
third (_,_,z) = z
17
false
true
0
8
10
42
22
20
null
null
copton/ocram
ocram/src/Ocram/Backend/TStack.hs
gpl-2.0
un :: NodeInfo -- {{{2 un = undefNode
37
un :: NodeInfo un = undefNode
29
un = undefNode
14
true
true
0
4
7
12
7
5
null
null
spockwangs/scheme.in.haskell
list6.2.hs
unlicense
eval (Atom s) = case Prelude.lookup s primitives of Just _ -> return $ Atom "#primitive" Nothing -> throwError $ UnboundVar "Unbound variable" s
188
eval (Atom s) = case Prelude.lookup s primitives of Just _ -> return $ Atom "#primitive" Nothing -> throwError $ UnboundVar "Unbound variable" s
188
eval (Atom s) = case Prelude.lookup s primitives of Just _ -> return $ Atom "#primitive" Nothing -> throwError $ UnboundVar "Unbound variable" s
188
false
false
0
9
67
58
26
32
null
null
guoy34/ampersand
src/Database/Design/Ampersand/Input/ADL1/Parser.hs
gpl-3.0
pADLid :: AmpParser String pADLid = pVarid <|> pConid <|> pString
65
pADLid :: AmpParser String pADLid = pVarid <|> pConid <|> pString
65
pADLid = pVarid <|> pConid <|> pString
38
false
true
1
6
10
26
11
15
null
null
Atidot/kafka-conduit
test/Spec.hs
bsd-3-clause
writeKafka :: IO (Maybe KafkaError) writeKafka = do runResourceT $ CC.repeat "hello world!" $$ kafkaSink broker topic 0 kafkaConfig topicConfig
165
writeKafka :: IO (Maybe KafkaError) writeKafka = do runResourceT $ CC.repeat "hello world!" $$ kafkaSink broker topic 0 kafkaConfig topicConfig
165
writeKafka = do runResourceT $ CC.repeat "hello world!" $$ kafkaSink broker topic 0 kafkaConfig topicConfig
129
false
true
0
10
41
47
22
25
null
null
ben-schulz/Idris-dev
src/Idris/Parser/Ops.hs
bsd-3-clause
-- | Backtick operator backtick :: Operator IdrisParser PTerm backtick = Infix (do indentPropHolds gtProp lchar '`'; (n, fc) <- fnName lchar '`' indentPropHolds gtProp return (\x y -> PApp fc (PRef fc [fc] n) [pexp x, pexp y])) AssocNone
321
backtick :: Operator IdrisParser PTerm backtick = Infix (do indentPropHolds gtProp lchar '`'; (n, fc) <- fnName lchar '`' indentPropHolds gtProp return (\x y -> PApp fc (PRef fc [fc] n) [pexp x, pexp y])) AssocNone
298
backtick = Infix (do indentPropHolds gtProp lchar '`'; (n, fc) <- fnName lchar '`' indentPropHolds gtProp return (\x y -> PApp fc (PRef fc [fc] n) [pexp x, pexp y])) AssocNone
259
true
true
1
15
123
116
53
63
null
null
mishun/tangles
src/Math/Topology/KnotTh/Tangle/TangleDef.hs
lgpl-3.0
loopTangle :: Int -> Tangle' 0 a loopTangle n | n < 0 = error "loopTangle: negative number of loops" | otherwise = T Tangle { loopsN = n , vertexN = 0 , involArr = PV.empty , crossArr = V.empty , legsN = 0 }
284
loopTangle :: Int -> Tangle' 0 a loopTangle n | n < 0 = error "loopTangle: negative number of loops" | otherwise = T Tangle { loopsN = n , vertexN = 0 , involArr = PV.empty , crossArr = V.empty , legsN = 0 }
284
loopTangle n | n < 0 = error "loopTangle: negative number of loops" | otherwise = T Tangle { loopsN = n , vertexN = 0 , involArr = PV.empty , crossArr = V.empty , legsN = 0 }
251
false
true
0
9
122
84
44
40
null
null
ryantm/ghc
testsuite/tests/safeHaskell/ghci/C.hs
bsd-3-clause
b :: Int b = 2
14
b :: Int b = 2
14
b = 2
5
false
true
0
6
5
18
7
11
null
null
disnet/jscheck
src/HJS/Interpreter/InterpM.hs
bsd-3-clause
nullValue :: Value nullValue = inj Null
40
nullValue :: Value nullValue = inj Null
39
nullValue = inj Null
20
false
true
0
6
7
21
8
13
null
null
zaxtax/hakaru
haskell/Language/Hakaru/Types/HClasses.hs
bsd-3-clause
sing_HOrd HOrd_Unit = sUnit
35
sing_HOrd HOrd_Unit = sUnit
35
sing_HOrd HOrd_Unit = sUnit
35
false
false
0
5
11
9
4
5
null
null
fizruk/ghcjs
src/Gen2/Foreign.hs
mit
isJSRefTyCon :: DynFlags -> TyCon -> Bool isJSRefTyCon = checkNamedTyCon [jsRefTy]
82
isJSRefTyCon :: DynFlags -> TyCon -> Bool isJSRefTyCon = checkNamedTyCon [jsRefTy]
82
isJSRefTyCon = checkNamedTyCon [jsRefTy]
40
false
true
0
6
10
25
13
12
null
null
holzensp/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
translateOp dflags SameMVarOp = Just (mo_wordEq dflags)
67
translateOp dflags SameMVarOp = Just (mo_wordEq dflags)
67
translateOp dflags SameMVarOp = Just (mo_wordEq dflags)
67
false
false
0
7
18
20
9
11
null
null
rueshyna/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/Aliases/Create.hs
mpl-2.0
-- | Identifier of the course to alias. This identifier can be either the -- Classroom-assigned identifier or an alias. cacCourseId :: Lens' CoursesAliasesCreate Text cacCourseId = lens _cacCourseId (\ s a -> s{_cacCourseId = a})
231
cacCourseId :: Lens' CoursesAliasesCreate Text cacCourseId = lens _cacCourseId (\ s a -> s{_cacCourseId = a})
111
cacCourseId = lens _cacCourseId (\ s a -> s{_cacCourseId = a})
64
true
true
0
9
37
43
23
20
null
null
gromakovsky/Orchid
test/Test/Orchid/CompilerSpec.hs
mit
genSpecCodegenError :: String -> Text -> Spec genSpecCodegenError prName prSource = it ("Throws CodegenException in compiling " ++ prName) $ expectCodegenError prSource
176
genSpecCodegenError :: String -> Text -> Spec genSpecCodegenError prName prSource = it ("Throws CodegenException in compiling " ++ prName) $ expectCodegenError prSource
176
genSpecCodegenError prName prSource = it ("Throws CodegenException in compiling " ++ prName) $ expectCodegenError prSource
130
false
true
0
8
29
41
20
21
null
null
agocorona/tryhplay
examples/atm.hs
gpl-3.0
rand:: IO Double rand= ffi $ toJSString "(function (){return Math.random()}"
76
rand:: IO Double rand= ffi $ toJSString "(function (){return Math.random()}"
76
rand= ffi $ toJSString "(function (){return Math.random()}"
59
false
true
2
6
9
29
11
18
null
null
marangisto/karakul
src/ShakeMCU.hs
bsd-3-clause
main :: IO () main = do let configFile = "build.mk" exists <- D.doesFileExist configFile if exists then shakeArgs shakeOptions{ shakeFiles = buildDir } $ do usingConfigFile configFile want [ buildDir </> "image" <.> "s" ] buildDir </> "image" <.> "elf" %> \out -> do name <- fmap takeBaseName $ liftIO getCurrentDirectory cs <- filterGarbageFiles <$> getDirectoryFiles "" [ "//*.c" ] cpps <- filterGarbageFiles <$> getDirectoryFiles "" [ "//*.cpp" ] asms <- filterGarbageFiles <$> getDirectoryFiles "" [ "//*.asm" ] mcu <- getMCU let objs = [ buildDir </> name </> c <.> "o" | c <- cs ++ cpps ++ asms ] libs <- (map (\l -> buildDir </> l </> l <.> "a")) <$> getLibs mcu need $ objs ++ libs (command, flags) <- ld <$> toolChain () <- cmd command (flags $ objs ++ libs) "-o" [ out ] (command, flags) <- size <$> toolChain cmd command (flags []) [ out ] buildDir </> "image" <.> "hex" %> \out -> do let elf = out -<.> ".elf" need [ elf ] (command, flags) <- objcopy <$> toolChain cmd command (flags []) [ elf ] "-Oihex" [ out ] buildDir </> "image" <.> "bin" %> \out -> do let elf = out -<.> ".elf" need [ elf ] (command, flags) <- objcopy <$> toolChain cmd command (flags []) [ elf ] "-Obinary" [ out ] buildDir </> "image" <.> "s" %> \out -> do let elf = out -<.> ".elf" need [ elf ] (command, flags) <- objdump <$> toolChain cmd (FileStdout out) command (flags []) "-S" [ elf ] buildDir <//> "*.a" %> \out -> do baseDir <- getBaseDir let libName = takeBaseName out let libDir = baseDir </> libName </> "src" cs <- filterGarbageFiles <$> getDirectoryFiles libDir [ "/*.c" ] cpps <- filterGarbageFiles <$> getDirectoryFiles libDir [ "/*.cpp" ] let objs = [ buildDir </> libName </> c <.> "o" | c <- cs ++ cpps ] need objs (command, flags) <- ar <$> toolChain cmd command (flags []) "rcs" out objs let compile tool out = do baseDir <- getBaseDir this <- fmap takeBaseName $ liftIO getCurrentDirectory let src | [ buildDir, lib, name ] <- splitDirectories out , lib /= this = baseDir </> lib </> "src" </> dropExtension name | otherwise = ".." </> dropDirectory1 (dropExtension out) m = out -<.> "m" freq <- getF_CPU (command, flags) <- tool <$> toolChain libs <- getLibs =<< getMCU defs <- getDefs let include = [ "-I" <> baseDir </> lib </> "include" | lib <- libs ] ++ [ "-I." ] define = [ "-D" <> def | def <- defs ] () <- cmd command (flags []) [ "-c", "-Werror", "-Wall", "-Os" ] include define ("-DF_CPU=" ++ show (round freq) ++ "L") [ src ] "-o" [ out ] "-MMD -MF" [ m ] needMakefileDependencies m buildDir <//> "*.c.o" %> compile cc buildDir <//> "*.cpp.o" %> compile cpp buildDir <//> "*.asm.o" %> compile asm phony "upload" $ do tc <- toolChain let payload = case format tc of Hex -> buildDir </> "image" <.> "hex" Binary -> buildDir </> "image" <.> "bin" need [ payload ] board <- getBoard mcu <- getMCU (command, flags) <- programmer board mcu payload cmd command (flags []) phony "reset" $ do mcu <- getMCU board <- getBoard (command, flags) <- reset board mcu cmd command (flags []) phony "ports" $ liftIO $ usbSerials Nothing Nothing >>= mapM_ print phony "clean" $ do putNormal $ "Cleaning files in " ++ buildDir removeFilesAfter buildDir [ "//*" ] else putStrLn $ "no " <> configFile <> " present, bailing out..."
3,973
main :: IO () main = do let configFile = "build.mk" exists <- D.doesFileExist configFile if exists then shakeArgs shakeOptions{ shakeFiles = buildDir } $ do usingConfigFile configFile want [ buildDir </> "image" <.> "s" ] buildDir </> "image" <.> "elf" %> \out -> do name <- fmap takeBaseName $ liftIO getCurrentDirectory cs <- filterGarbageFiles <$> getDirectoryFiles "" [ "//*.c" ] cpps <- filterGarbageFiles <$> getDirectoryFiles "" [ "//*.cpp" ] asms <- filterGarbageFiles <$> getDirectoryFiles "" [ "//*.asm" ] mcu <- getMCU let objs = [ buildDir </> name </> c <.> "o" | c <- cs ++ cpps ++ asms ] libs <- (map (\l -> buildDir </> l </> l <.> "a")) <$> getLibs mcu need $ objs ++ libs (command, flags) <- ld <$> toolChain () <- cmd command (flags $ objs ++ libs) "-o" [ out ] (command, flags) <- size <$> toolChain cmd command (flags []) [ out ] buildDir </> "image" <.> "hex" %> \out -> do let elf = out -<.> ".elf" need [ elf ] (command, flags) <- objcopy <$> toolChain cmd command (flags []) [ elf ] "-Oihex" [ out ] buildDir </> "image" <.> "bin" %> \out -> do let elf = out -<.> ".elf" need [ elf ] (command, flags) <- objcopy <$> toolChain cmd command (flags []) [ elf ] "-Obinary" [ out ] buildDir </> "image" <.> "s" %> \out -> do let elf = out -<.> ".elf" need [ elf ] (command, flags) <- objdump <$> toolChain cmd (FileStdout out) command (flags []) "-S" [ elf ] buildDir <//> "*.a" %> \out -> do baseDir <- getBaseDir let libName = takeBaseName out let libDir = baseDir </> libName </> "src" cs <- filterGarbageFiles <$> getDirectoryFiles libDir [ "/*.c" ] cpps <- filterGarbageFiles <$> getDirectoryFiles libDir [ "/*.cpp" ] let objs = [ buildDir </> libName </> c <.> "o" | c <- cs ++ cpps ] need objs (command, flags) <- ar <$> toolChain cmd command (flags []) "rcs" out objs let compile tool out = do baseDir <- getBaseDir this <- fmap takeBaseName $ liftIO getCurrentDirectory let src | [ buildDir, lib, name ] <- splitDirectories out , lib /= this = baseDir </> lib </> "src" </> dropExtension name | otherwise = ".." </> dropDirectory1 (dropExtension out) m = out -<.> "m" freq <- getF_CPU (command, flags) <- tool <$> toolChain libs <- getLibs =<< getMCU defs <- getDefs let include = [ "-I" <> baseDir </> lib </> "include" | lib <- libs ] ++ [ "-I." ] define = [ "-D" <> def | def <- defs ] () <- cmd command (flags []) [ "-c", "-Werror", "-Wall", "-Os" ] include define ("-DF_CPU=" ++ show (round freq) ++ "L") [ src ] "-o" [ out ] "-MMD -MF" [ m ] needMakefileDependencies m buildDir <//> "*.c.o" %> compile cc buildDir <//> "*.cpp.o" %> compile cpp buildDir <//> "*.asm.o" %> compile asm phony "upload" $ do tc <- toolChain let payload = case format tc of Hex -> buildDir </> "image" <.> "hex" Binary -> buildDir </> "image" <.> "bin" need [ payload ] board <- getBoard mcu <- getMCU (command, flags) <- programmer board mcu payload cmd command (flags []) phony "reset" $ do mcu <- getMCU board <- getBoard (command, flags) <- reset board mcu cmd command (flags []) phony "ports" $ liftIO $ usbSerials Nothing Nothing >>= mapM_ print phony "clean" $ do putNormal $ "Cleaning files in " ++ buildDir removeFilesAfter buildDir [ "//*" ] else putStrLn $ "no " <> configFile <> " present, bailing out..."
3,973
main = do let configFile = "build.mk" exists <- D.doesFileExist configFile if exists then shakeArgs shakeOptions{ shakeFiles = buildDir } $ do usingConfigFile configFile want [ buildDir </> "image" <.> "s" ] buildDir </> "image" <.> "elf" %> \out -> do name <- fmap takeBaseName $ liftIO getCurrentDirectory cs <- filterGarbageFiles <$> getDirectoryFiles "" [ "//*.c" ] cpps <- filterGarbageFiles <$> getDirectoryFiles "" [ "//*.cpp" ] asms <- filterGarbageFiles <$> getDirectoryFiles "" [ "//*.asm" ] mcu <- getMCU let objs = [ buildDir </> name </> c <.> "o" | c <- cs ++ cpps ++ asms ] libs <- (map (\l -> buildDir </> l </> l <.> "a")) <$> getLibs mcu need $ objs ++ libs (command, flags) <- ld <$> toolChain () <- cmd command (flags $ objs ++ libs) "-o" [ out ] (command, flags) <- size <$> toolChain cmd command (flags []) [ out ] buildDir </> "image" <.> "hex" %> \out -> do let elf = out -<.> ".elf" need [ elf ] (command, flags) <- objcopy <$> toolChain cmd command (flags []) [ elf ] "-Oihex" [ out ] buildDir </> "image" <.> "bin" %> \out -> do let elf = out -<.> ".elf" need [ elf ] (command, flags) <- objcopy <$> toolChain cmd command (flags []) [ elf ] "-Obinary" [ out ] buildDir </> "image" <.> "s" %> \out -> do let elf = out -<.> ".elf" need [ elf ] (command, flags) <- objdump <$> toolChain cmd (FileStdout out) command (flags []) "-S" [ elf ] buildDir <//> "*.a" %> \out -> do baseDir <- getBaseDir let libName = takeBaseName out let libDir = baseDir </> libName </> "src" cs <- filterGarbageFiles <$> getDirectoryFiles libDir [ "/*.c" ] cpps <- filterGarbageFiles <$> getDirectoryFiles libDir [ "/*.cpp" ] let objs = [ buildDir </> libName </> c <.> "o" | c <- cs ++ cpps ] need objs (command, flags) <- ar <$> toolChain cmd command (flags []) "rcs" out objs let compile tool out = do baseDir <- getBaseDir this <- fmap takeBaseName $ liftIO getCurrentDirectory let src | [ buildDir, lib, name ] <- splitDirectories out , lib /= this = baseDir </> lib </> "src" </> dropExtension name | otherwise = ".." </> dropDirectory1 (dropExtension out) m = out -<.> "m" freq <- getF_CPU (command, flags) <- tool <$> toolChain libs <- getLibs =<< getMCU defs <- getDefs let include = [ "-I" <> baseDir </> lib </> "include" | lib <- libs ] ++ [ "-I." ] define = [ "-D" <> def | def <- defs ] () <- cmd command (flags []) [ "-c", "-Werror", "-Wall", "-Os" ] include define ("-DF_CPU=" ++ show (round freq) ++ "L") [ src ] "-o" [ out ] "-MMD -MF" [ m ] needMakefileDependencies m buildDir <//> "*.c.o" %> compile cc buildDir <//> "*.cpp.o" %> compile cpp buildDir <//> "*.asm.o" %> compile asm phony "upload" $ do tc <- toolChain let payload = case format tc of Hex -> buildDir </> "image" <.> "hex" Binary -> buildDir </> "image" <.> "bin" need [ payload ] board <- getBoard mcu <- getMCU (command, flags) <- programmer board mcu payload cmd command (flags []) phony "reset" $ do mcu <- getMCU board <- getBoard (command, flags) <- reset board mcu cmd command (flags []) phony "ports" $ liftIO $ usbSerials Nothing Nothing >>= mapM_ print phony "clean" $ do putNormal $ "Cleaning files in " ++ buildDir removeFilesAfter buildDir [ "//*" ] else putStrLn $ "no " <> configFile <> " present, bailing out..."
3,959
false
true
0
23
1,342
1,407
672
735
null
null
three/codeworld
funblocks-client/src/Blocks/Types.hs
apache-2.0
cwCircle = standardFunction "cwCircle" "circle" Nothing [typeNumber, typePicture] ["RADIUS"] colorPicture "Picture of a circle"
127
cwCircle = standardFunction "cwCircle" "circle" Nothing [typeNumber, typePicture] ["RADIUS"] colorPicture "Picture of a circle"
127
cwCircle = standardFunction "cwCircle" "circle" Nothing [typeNumber, typePicture] ["RADIUS"] colorPicture "Picture of a circle"
127
false
false
0
6
13
30
16
14
null
null
scottgw/language-eiffel
Language/Eiffel/Parser/Statement.hs
bsd-3-clause
retry = do keyword TokRetry return Retry
44
retry = do keyword TokRetry return Retry
44
retry = do keyword TokRetry return Retry
44
false
false
0
7
10
18
7
11
null
null
sgillespie/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
pprCLbl (DynamicLinkerLabel {}) = panic "pprCLbl DynamicLinkerLabel"
68
pprCLbl (DynamicLinkerLabel {}) = panic "pprCLbl DynamicLinkerLabel"
68
pprCLbl (DynamicLinkerLabel {}) = panic "pprCLbl DynamicLinkerLabel"
68
false
false
0
6
6
20
9
11
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_LOUT_STRING :: Int wxSTC_LOUT_STRING = 7
46
wxSTC_LOUT_STRING :: Int wxSTC_LOUT_STRING = 7
46
wxSTC_LOUT_STRING = 7
21
false
true
0
6
5
18
7
11
null
null
HackerFoo/peg
Peg/Constraints.hs
gpl-3.0
char :: (Char -> a) -> Char -> a char = id
42
char :: (Char -> a) -> Char -> a char = id
42
char = id
9
false
true
0
8
11
33
15
18
null
null
softwaremechanic/Miscellaneous
Primes/Prime.hs
gpl-2.0
--pop_multiples :: [a] -> a -> [a] pop_multiples [] _ = []
58
pop_multiples [] _ = []
23
pop_multiples [] _ = []
23
true
false
0
6
11
16
8
8
null
null
rueshyna/gogol
gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs
mpl-2.0
-- | Identifies what kind of resource this is. Value: the fixed string -- \"youtube#playlistItemListResponse\". plilrKind :: Lens' PlayListItemListResponse Text plilrKind = lens _plilrKind (\ s a -> s{_plilrKind = a})
219
plilrKind :: Lens' PlayListItemListResponse Text plilrKind = lens _plilrKind (\ s a -> s{_plilrKind = a})
107
plilrKind = lens _plilrKind (\ s a -> s{_plilrKind = a})
58
true
true
0
9
32
43
23
20
null
null
goldfirere/th-desugar
Language/Haskell/TH/Desugar/OMap/Strict.hs
bsd-3-clause
unionWithKey :: Ord k => (k -> v -> v -> v) -> OMap k v -> OMap k v -> OMap k v unionWithKey f = coerce (OM.unionWithL f)
121
unionWithKey :: Ord k => (k -> v -> v -> v) -> OMap k v -> OMap k v -> OMap k v unionWithKey f = coerce (OM.unionWithL f)
121
unionWithKey f = coerce (OM.unionWithL f)
41
false
true
0
10
29
74
35
39
null
null
edsko/cabal
cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/Solver.hs
bsd-3-clause
dbLangs1 :: ExampleDb dbLangs1 = [ Right $ exAv "A" 1 [ExLang Haskell2010] , Right $ exAv "B" 1 [ExLang Haskell98, ExAny "A"] , Right $ exAv "C" 1 [ExLang (UnknownLanguage "Haskell3000"), ExAny "B"] ]
210
dbLangs1 :: ExampleDb dbLangs1 = [ Right $ exAv "A" 1 [ExLang Haskell2010] , Right $ exAv "B" 1 [ExLang Haskell98, ExAny "A"] , Right $ exAv "C" 1 [ExLang (UnknownLanguage "Haskell3000"), ExAny "B"] ]
210
dbLangs1 = [ Right $ exAv "A" 1 [ExLang Haskell2010] , Right $ exAv "B" 1 [ExLang Haskell98, ExAny "A"] , Right $ exAv "C" 1 [ExLang (UnknownLanguage "Haskell3000"), ExAny "B"] ]
188
false
true
0
11
44
89
45
44
null
null
vTurbine/ghc
compiler/main/HscTypes.hs
bsd-3-clause
tyThingId other = pprPanic "tyThingId" (ppr other)
72
tyThingId other = pprPanic "tyThingId" (ppr other)
72
tyThingId other = pprPanic "tyThingId" (ppr other)
72
false
false
0
7
28
20
9
11
null
null
lukemaurer/sequent-core
examples/Contification.hs
bsd-3-clause
-- We would like to handle this case, but it seems to require abstract -- interpretation: We need to fix the type argument to h but it's only ever -- called with an inner-bound tyvar as the type. case11_yes_someday :: [Bool] -> [Bool] case11_yes_someday bs = let k, h :: [a] -> [a] -> [a] {-# NOINLINE k #-} k xs acc = case xs of [] -> acc _ : xs' -> h xs' acc {-# NOINLINE h #-} h xs acc = case xs of [] -> acc x : xs' -> k xs' (x : x : acc) in k bs []
561
case11_yes_someday :: [Bool] -> [Bool] case11_yes_someday bs = let k, h :: [a] -> [a] -> [a] {-# NOINLINE k #-} k xs acc = case xs of [] -> acc _ : xs' -> h xs' acc {-# NOINLINE h #-} h xs acc = case xs of [] -> acc x : xs' -> k xs' (x : x : acc) in k bs []
365
case11_yes_someday bs = let k, h :: [a] -> [a] -> [a] {-# NOINLINE k #-} k xs acc = case xs of [] -> acc _ : xs' -> h xs' acc {-# NOINLINE h #-} h xs acc = case xs of [] -> acc x : xs' -> k xs' (x : x : acc) in k bs []
326
true
true
0
15
212
151
80
71
null
null
sapek/pandoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
inlineLaTeXCommand :: OrgParser String inlineLaTeXCommand = try $ do rest <- getInput case runParser rawLaTeXInline def "source" rest of Right (RawInline _ cs) -> do let len = length cs count len anyChar return cs _ -> mzero
254
inlineLaTeXCommand :: OrgParser String inlineLaTeXCommand = try $ do rest <- getInput case runParser rawLaTeXInline def "source" rest of Right (RawInline _ cs) -> do let len = length cs count len anyChar return cs _ -> mzero
254
inlineLaTeXCommand = try $ do rest <- getInput case runParser rawLaTeXInline def "source" rest of Right (RawInline _ cs) -> do let len = length cs count len anyChar return cs _ -> mzero
215
false
true
0
16
67
90
40
50
null
null
jyp/imbib
lib/SuffixTreeCluster.hs
gpl-2.0
-- | /O(n)/. Returns the path from the 'Edge' in the suffix tree at -- which the given subsequence ends, up to the root of the tree. If -- the subsequence is not found, returns the empty list. -- -- Performance is linear in the length of the query list. findPath :: (Eq a) => [a] -> STree a b -> [Edge a b] findPath = go [] where go me xs (Node mb es) = pfx me es where pfx _ [] = [] pfx me (e@(p, t):es) = case suffix (prefix p) xs of Nothing -> pfx me es Just [] -> e:me Just s -> go (e:me) s t -- select :: SC.STree a b -> Tree Int
677
findPath :: (Eq a) => [a] -> STree a b -> [Edge a b] findPath = go [] where go me xs (Node mb es) = pfx me es where pfx _ [] = [] pfx me (e@(p, t):es) = case suffix (prefix p) xs of Nothing -> pfx me es Just [] -> e:me Just s -> go (e:me) s t -- select :: SC.STree a b -> Tree Int
422
findPath = go [] where go me xs (Node mb es) = pfx me es where pfx _ [] = [] pfx me (e@(p, t):es) = case suffix (prefix p) xs of Nothing -> pfx me es Just [] -> e:me Just s -> go (e:me) s t -- select :: SC.STree a b -> Tree Int
369
true
true
0
12
263
188
97
91
null
null
amccausl/Swish
Swish/HaskellRDF/RDFGraphTest.hs
lgpl-2.1
f10 = getFormulae g2f3
24
f10 = getFormulae g2f3
24
f10 = getFormulae g2f3
24
false
false
1
5
5
12
4
8
null
null
yjwen/hada
test/Num.hs
lgpl-3.0
negU64 :: Word64 -> Word64 negU64 = negate
42
negU64 :: Word64 -> Word64 negU64 = negate
42
negU64 = negate
15
false
true
0
5
7
15
8
7
null
null
isomorphism/webgl
src/Graphics/Rendering/WebGL/Constants.hs
mit
gl_SAMPLE_COVERAGE_VALUE :: GLenum gl_SAMPLE_COVERAGE_VALUE = 0x80AA
68
gl_SAMPLE_COVERAGE_VALUE :: GLenum gl_SAMPLE_COVERAGE_VALUE = 0x80AA
68
gl_SAMPLE_COVERAGE_VALUE = 0x80AA
33
false
true
0
4
5
11
6
5
null
null
freizl/freizl.github.com-old
src/Hakyll/Core/Compiler/Require.hs
bsd-3-clause
-------------------------------------------------------------------------------- loadAllSnapshots :: (Binary a, Typeable a) => Pattern -> Snapshot -> Compiler [Item a] loadAllSnapshots pattern snapshot = do matching <- getMatches pattern mapM (\i -> loadSnapshot i snapshot) matching --------------------------------------------------------------------------------
391
loadAllSnapshots :: (Binary a, Typeable a) => Pattern -> Snapshot -> Compiler [Item a] loadAllSnapshots pattern snapshot = do matching <- getMatches pattern mapM (\i -> loadSnapshot i snapshot) matching --------------------------------------------------------------------------------
310
loadAllSnapshots pattern snapshot = do matching <- getMatches pattern mapM (\i -> loadSnapshot i snapshot) matching --------------------------------------------------------------------------------
206
true
true
0
10
58
81
40
41
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/UI/Text.hs
mit
textGetSelectionLength :: (Parent Text a, Pointer p a, MonadIO m) => p -- ^ Pointer to Text object -> m Word textGetSelectionLength p = liftIO $ do let ptr = parentPointer p fromIntegral <$> [C.exp| unsigned int { $(Text* ptr)->GetSelectionLength() } |] -- | Return selection background color.
302
textGetSelectionLength :: (Parent Text a, Pointer p a, MonadIO m) => p -- ^ Pointer to Text object -> m Word textGetSelectionLength p = liftIO $ do let ptr = parentPointer p fromIntegral <$> [C.exp| unsigned int { $(Text* ptr)->GetSelectionLength() } |] -- | Return selection background color.
302
textGetSelectionLength p = liftIO $ do let ptr = parentPointer p fromIntegral <$> [C.exp| unsigned int { $(Text* ptr)->GetSelectionLength() } |] -- | Return selection background color.
189
false
true
2
10
56
83
41
42
null
null
dorchard/gram_lang
frontend/src/Language/Granule/Checker/Constraints/SymbolicGrades.hs
bsd-3-clause
-- | Times operation on symbolic grades symGradeTimes :: SGrade -> SGrade -> Symbolic SGrade symGradeTimes (SNat n1) (SNat n2) = return $ SNat (n1 * n2)
152
symGradeTimes :: SGrade -> SGrade -> Symbolic SGrade symGradeTimes (SNat n1) (SNat n2) = return $ SNat (n1 * n2)
112
symGradeTimes (SNat n1) (SNat n2) = return $ SNat (n1 * n2)
59
true
true
0
8
26
54
27
27
null
null
clchiou/gwab
lib/Telnet.hs
gpl-3.0
filterTelnet :: StringFilter Packet filterTelnet = (matchByte (== rfc854_IAC) >> ( matchByte' (flip lookup singletons) `mplus` (matchByte' (flip lookup negotiations) >>= \makepkt -> getByte >>= return . makepkt) `mplus` (matchByte (== rfc854_SB) >> readUntilIac' >>= \subopt -> matchByte (== rfc854_IAC) >> matchByte (== rfc854_SE) >> (return $ PacketSubOption subopt)) `mplus` (matchByte (== rfc854_IAC) >> (return $ PacketText [rfc854_IAC])) `mplus` (getByte >>= \c -> fail $ "Could not parse command: " ++ [c]))) `mplus` (readText >>= return . PacketText) where singletons = [ (rfc854_NOP, PacketNop), (rfc854_DATAMARK, PacketDataMark), (rfc854_BREAK, PacketBreak), (rfc854_IP, PacketIp), (rfc854_AO, PacketAo), (rfc854_AYT, PacketAyt), (rfc854_EC, PacketEc), (rfc854_EL, PacketEl), (rfc854_GOAHEAD, PacketGoAhead)] negotiations = [ (rfc854_WILL, PacketWill), (rfc854_WONT, PacketWont), (rfc854_DO, PacketDo), (rfc854_DONT, PacketDont)] readUntilIac' = withInput $ readUntilIac [] -- Text packets may be split in the middle; so we do not insist on -- reading until we see the start of next command. readText = getPrefix (/= rfc854_IAC) -- -- Telnet : Network Virtual Terminal --
1,636
filterTelnet :: StringFilter Packet filterTelnet = (matchByte (== rfc854_IAC) >> ( matchByte' (flip lookup singletons) `mplus` (matchByte' (flip lookup negotiations) >>= \makepkt -> getByte >>= return . makepkt) `mplus` (matchByte (== rfc854_SB) >> readUntilIac' >>= \subopt -> matchByte (== rfc854_IAC) >> matchByte (== rfc854_SE) >> (return $ PacketSubOption subopt)) `mplus` (matchByte (== rfc854_IAC) >> (return $ PacketText [rfc854_IAC])) `mplus` (getByte >>= \c -> fail $ "Could not parse command: " ++ [c]))) `mplus` (readText >>= return . PacketText) where singletons = [ (rfc854_NOP, PacketNop), (rfc854_DATAMARK, PacketDataMark), (rfc854_BREAK, PacketBreak), (rfc854_IP, PacketIp), (rfc854_AO, PacketAo), (rfc854_AYT, PacketAyt), (rfc854_EC, PacketEc), (rfc854_EL, PacketEl), (rfc854_GOAHEAD, PacketGoAhead)] negotiations = [ (rfc854_WILL, PacketWill), (rfc854_WONT, PacketWont), (rfc854_DO, PacketDo), (rfc854_DONT, PacketDont)] readUntilIac' = withInput $ readUntilIac [] -- Text packets may be split in the middle; so we do not insist on -- reading until we see the start of next command. readText = getPrefix (/= rfc854_IAC) -- -- Telnet : Network Virtual Terminal --
1,636
filterTelnet = (matchByte (== rfc854_IAC) >> ( matchByte' (flip lookup singletons) `mplus` (matchByte' (flip lookup negotiations) >>= \makepkt -> getByte >>= return . makepkt) `mplus` (matchByte (== rfc854_SB) >> readUntilIac' >>= \subopt -> matchByte (== rfc854_IAC) >> matchByte (== rfc854_SE) >> (return $ PacketSubOption subopt)) `mplus` (matchByte (== rfc854_IAC) >> (return $ PacketText [rfc854_IAC])) `mplus` (getByte >>= \c -> fail $ "Could not parse command: " ++ [c]))) `mplus` (readText >>= return . PacketText) where singletons = [ (rfc854_NOP, PacketNop), (rfc854_DATAMARK, PacketDataMark), (rfc854_BREAK, PacketBreak), (rfc854_IP, PacketIp), (rfc854_AO, PacketAo), (rfc854_AYT, PacketAyt), (rfc854_EC, PacketEc), (rfc854_EL, PacketEl), (rfc854_GOAHEAD, PacketGoAhead)] negotiations = [ (rfc854_WILL, PacketWill), (rfc854_WONT, PacketWont), (rfc854_DO, PacketDo), (rfc854_DONT, PacketDont)] readUntilIac' = withInput $ readUntilIac [] -- Text packets may be split in the middle; so we do not insist on -- reading until we see the start of next command. readText = getPrefix (/= rfc854_IAC) -- -- Telnet : Network Virtual Terminal --
1,600
false
true
0
18
609
379
226
153
null
null
gianlucagiorgolo/glue-xle
Parsers.hs
mit
sigmaInsideOut = do spaces char '(' spaces feats <- features many1 space fc <- fConstraint subscript char 's' spaces char ')' typeSeparator t <- many1 lower spaces return $ SigmaInsideOut feats (SigmaProjection fc "") t
316
sigmaInsideOut = do spaces char '(' spaces feats <- features many1 space fc <- fConstraint subscript char 's' spaces char ')' typeSeparator t <- many1 lower spaces return $ SigmaInsideOut feats (SigmaProjection fc "") t
316
sigmaInsideOut = do spaces char '(' spaces feats <- features many1 space fc <- fConstraint subscript char 's' spaces char ')' typeSeparator t <- many1 lower spaces return $ SigmaInsideOut feats (SigmaProjection fc "") t
316
false
false
0
10
131
94
37
57
null
null
jeyoor/haskell-learning-challenge
learn_haskell_github_courses/Cis194/src/Lecture03.hs
bsd-3-clause
mapList :: (a -> b) -> List a -> List b mapList _ E = E
55
mapList :: (a -> b) -> List a -> List b mapList _ E = E
55
mapList _ E = E
15
false
true
0
8
15
42
19
23
null
null
Heather/stack
src/Stack/Types/Config.hs
bsd-3-clause
-- | Location of the 00-index.tar file configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) configPackageIndex = liftM (</> $(mkRelFile "00-index.tar")) . configPackageIndexRoot
229
configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) configPackageIndex = liftM (</> $(mkRelFile "00-index.tar")) . configPackageIndexRoot
190
configPackageIndex = liftM (</> $(mkRelFile "00-index.tar")) . configPackageIndexRoot
85
true
true
0
10
30
68
35
33
null
null
ulricha/dsh
src/Database/DSH/NKL/Quote.hs
bsd-3-clause
fromPrim1Q :: NKL.Prim1 TypeQ -> NKL.Prim1 T.Type fromPrim1Q (NKL.Prim1 o t) = NKL.Prim1 o (fromTypeQ t)
104
fromPrim1Q :: NKL.Prim1 TypeQ -> NKL.Prim1 T.Type fromPrim1Q (NKL.Prim1 o t) = NKL.Prim1 o (fromTypeQ t)
104
fromPrim1Q (NKL.Prim1 o t) = NKL.Prim1 o (fromTypeQ t)
54
false
true
0
10
15
57
26
31
null
null
brendanhay/gogol
gogol-cloudtasks/gen/Network/Google/CloudTasks/Types/Product.hs
mpl-2.0
-- | Output only. The state of the queue. \`state\` can only be changed by -- calling PauseQueue, ResumeQueue, or uploading -- [queue.yaml\/xml](https:\/\/cloud.google.com\/appengine\/docs\/python\/config\/queueref). -- UpdateQueue cannot be used to change \`state\`. qState :: Lens' Queue (Maybe QueueState) qState = lens _qState (\ s a -> s{_qState = a})
356
qState :: Lens' Queue (Maybe QueueState) qState = lens _qState (\ s a -> s{_qState = a})
88
qState = lens _qState (\ s a -> s{_qState = a})
47
true
true
2
9
47
58
28
30
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | Creates a value of 'UserProFileList' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'upflEtag' -- -- * 'upflKind' -- -- * 'upflItems' userProFileList :: UserProFileList userProFileList = UserProFileList' {_upflEtag = Nothing, _upflKind = Nothing, _upflItems = Nothing}
369
userProFileList :: UserProFileList userProFileList = UserProFileList' {_upflEtag = Nothing, _upflKind = Nothing, _upflItems = Nothing}
144
userProFileList = UserProFileList' {_upflEtag = Nothing, _upflKind = Nothing, _upflItems = Nothing}
105
true
true
0
6
66
40
28
12
null
null
keera-studios/pang-a-lambda
src/Game/Constants.hs
gpl-3.0
ballSmall = ballMedium / 2
27
ballSmall = ballMedium / 2
27
ballSmall = ballMedium / 2
27
false
false
3
5
5
15
5
10
null
null
ckaestne/CIDE
other/CaseStudies/fgl/CIDEfgl/Data/Graph/Inductive/Example.hs
gpl-3.0
clr508' = mkGraphM (genLNodes 'a' 9) [(1, 2, 4), (1, 8, 8), (2, 3, 8), (2, 8, 11), (3, 4, 7), (3, 6, 4), (3, 9, 2), (4, 5, 9), (4, 6, 14), (5, 6, 10), (6, 7, 2), (7, 8, 1), (7, 9, 6), (8, 9, 7)]
224
clr508' = mkGraphM (genLNodes 'a' 9) [(1, 2, 4), (1, 8, 8), (2, 3, 8), (2, 8, 11), (3, 4, 7), (3, 6, 4), (3, 9, 2), (4, 5, 9), (4, 6, 14), (5, 6, 10), (6, 7, 2), (7, 8, 1), (7, 9, 6), (8, 9, 7)]
224
clr508' = mkGraphM (genLNodes 'a' 9) [(1, 2, 4), (1, 8, 8), (2, 3, 8), (2, 8, 11), (3, 4, 7), (3, 6, 4), (3, 9, 2), (4, 5, 9), (4, 6, 14), (5, 6, 10), (6, 7, 2), (7, 8, 1), (7, 9, 6), (8, 9, 7)]
224
false
false
1
7
77
190
121
69
null
null
graninas/Haskell-Algorithms
Tests/TextRatio3.hs
gpl-3.0
tersCount1 = fst . lettersCount p
34
lettersCount1 = fst . lettersCount
34
lettersCount1 = fst . lettersCount
34
false
false
0
5
6
13
6
7
null
null
cdornan/idiot
Text/RE/PCRE/ByteString/Lazy.hs
bsd-3-clause
-- | find first match in text (?=~) :: LBS.ByteString -> RE -> Match LBS.ByteString (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
179
(?=~) :: LBS.ByteString -> RE -> Match LBS.ByteString (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
149
(?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
83
true
true
0
8
38
60
31
29
null
null
jmlb23/haskell
ch03/return_functions.hs
gpl-3.0
addressLetter name location = nameText ++ " - " ++ location where nameText = (fst name) ++ " " ++ (snd name) -- valemonos de que as cadeas son comparadas caracter a caracter
175
addressLetter name location = nameText ++ " - " ++ location where nameText = (fst name) ++ " " ++ (snd name) -- valemonos de que as cadeas son comparadas caracter a caracter
175
addressLetter name location = nameText ++ " - " ++ location where nameText = (fst name) ++ " " ++ (snd name) -- valemonos de que as cadeas son comparadas caracter a caracter
175
false
false
1
8
34
53
24
29
null
null
PinkFLoyd92/PiAssist
input-script-parser/src/InputModels.hs
gpl-3.0
kicksFromWord :: InputWord -> KickCombination kicksFromWord word | isLK && isMK && isHK = LKMKHK | isLK && isMK = LKMK | isLK && isHK = LKHK | isMK && isHK = MKHK | isLK = LK | isMK = MK | isHK = HK | otherwise = NO_KICKS where isLK = show LK `isInfixOf` word isMK = show MK `isInfixOf` word isHK = show HK `isInfixOf` word
471
kicksFromWord :: InputWord -> KickCombination kicksFromWord word | isLK && isMK && isHK = LKMKHK | isLK && isMK = LKMK | isLK && isHK = LKHK | isMK && isHK = MKHK | isLK = LK | isMK = MK | isHK = HK | otherwise = NO_KICKS where isLK = show LK `isInfixOf` word isMK = show MK `isInfixOf` word isHK = show HK `isInfixOf` word
471
kicksFromWord word | isLK && isMK && isHK = LKMKHK | isLK && isMK = LKMK | isLK && isHK = LKHK | isMK && isHK = MKHK | isLK = LK | isMK = MK | isHK = HK | otherwise = NO_KICKS where isLK = show LK `isInfixOf` word isMK = show MK `isInfixOf` word isHK = show HK `isInfixOf` word
425
false
true
3
9
215
189
85
104
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/XMLHttpRequest.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest.responseType Mozilla XMLHttpRequest.responseType documentation> getResponseType :: (MonadDOM m) => XMLHttpRequest -> m XMLHttpRequestResponseType getResponseType self = liftDOM ((self ^. js "responseType") >>= fromJSValUnchecked)
318
getResponseType :: (MonadDOM m) => XMLHttpRequest -> m XMLHttpRequestResponseType getResponseType self = liftDOM ((self ^. js "responseType") >>= fromJSValUnchecked)
183
getResponseType self = liftDOM ((self ^. js "responseType") >>= fromJSValUnchecked)
85
true
true
0
10
43
56
27
29
null
null
mikehat/blaze-css
src/Text/Blaze/Css21/Style.hs
bsd-3-clause
visibility = B.cssStyle "visibility" "visibility: " . B.stringValue . toString
78
visibility = B.cssStyle "visibility" "visibility: " . B.stringValue . toString
78
visibility = B.cssStyle "visibility" "visibility: " . B.stringValue . toString
78
false
false
1
8
9
27
11
16
null
null