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
jcollard/sinterp
Parser.hs
gpl-3.0
precedent0 = precedent [add, sub, or, gt, lt, eq, cons]
55
precedent0 = precedent [add, sub, or, gt, lt, eq, cons]
55
precedent0 = precedent [add, sub, or, gt, lt, eq, cons]
55
false
false
0
6
9
30
18
12
null
null
rodrigogribeiro/solver
test/Spec.hs
bsd-3-clause
doTest s = testCase ("Testing " ++ s) $ do ctr <- readFile (cases ++ s ++ ".ctr") res <- readFile (cases ++ s ++ ".out") case parser ctr of Left err -> error $ "Error on constraint parser:\n" ++ err Right c -> case parse resParser "" res of Left err' -> error $ "Error on answer parser:\n" ++ show err' Right (tx,vx) -> do r <- solver c case r of Left err'' -> error $ "Error on constraint solver:\n" ++ show err'' Right (tx', vx') -> unless (tx == tx' && vx == vx') (error $ printResults tx tx' vx vx')
851
doTest s = testCase ("Testing " ++ s) $ do ctr <- readFile (cases ++ s ++ ".ctr") res <- readFile (cases ++ s ++ ".out") case parser ctr of Left err -> error $ "Error on constraint parser:\n" ++ err Right c -> case parse resParser "" res of Left err' -> error $ "Error on answer parser:\n" ++ show err' Right (tx,vx) -> do r <- solver c case r of Left err'' -> error $ "Error on constraint solver:\n" ++ show err'' Right (tx', vx') -> unless (tx == tx' && vx == vx') (error $ printResults tx tx' vx vx')
851
doTest s = testCase ("Testing " ++ s) $ do ctr <- readFile (cases ++ s ++ ".ctr") res <- readFile (cases ++ s ++ ".out") case parser ctr of Left err -> error $ "Error on constraint parser:\n" ++ err Right c -> case parse resParser "" res of Left err' -> error $ "Error on answer parser:\n" ++ show err' Right (tx,vx) -> do r <- solver c case r of Left err'' -> error $ "Error on constraint solver:\n" ++ show err'' Right (tx', vx') -> unless (tx == tx' && vx == vx') (error $ printResults tx tx' vx vx')
851
false
false
0
23
451
235
111
124
null
null
sdiehl/ghc
testsuite/tests/dependent/should_compile/dynamic-paper.hs
bsd-3-clause
toDynPair :: DynamicSilly -> DynamicSilly -> DynamicSilly toDynPair = DPairSilly
80
toDynPair :: DynamicSilly -> DynamicSilly -> DynamicSilly toDynPair = DPairSilly
80
toDynPair = DPairSilly
22
false
true
0
6
9
19
10
9
null
null
roberth/uu-helium
src/Helium/Syntax/UHA_Utils.hs
gpl-3.0
enumFromName = nameFromString "$enumFrom"
48
enumFromName = nameFromString "$enumFrom"
48
enumFromName = nameFromString "$enumFrom"
48
false
false
0
5
10
9
4
5
null
null
hvr/text
Data/Text/Foreign.hs
bsd-2-clause
useAsPtr :: Text -> (Ptr Word16 -> I16 -> IO a) -> IO a useAsPtr t@(Text _arr _off len) action = allocaBytes (len * 2) $ \buf -> do unsafeCopyToPtr t buf action (castPtr buf) (fromIntegral len) -- | /O(n)/ Make a mutable copy of a 'Text'.
255
useAsPtr :: Text -> (Ptr Word16 -> I16 -> IO a) -> IO a useAsPtr t@(Text _arr _off len) action = allocaBytes (len * 2) $ \buf -> do unsafeCopyToPtr t buf action (castPtr buf) (fromIntegral len) -- | /O(n)/ Make a mutable copy of a 'Text'.
255
useAsPtr t@(Text _arr _off len) action = allocaBytes (len * 2) $ \buf -> do unsafeCopyToPtr t buf action (castPtr buf) (fromIntegral len) -- | /O(n)/ Make a mutable copy of a 'Text'.
199
false
true
0
11
63
105
51
54
null
null
uuhan/Idris-dev
src/IRTS/Bytecode.hs
bsd-3-clause
bc :: Reg -> SExp -> Bool -> -- returning [BC] bc reg (SV (Glob n)) r = bc reg (SApp False n []) r
104
bc :: Reg -> SExp -> Bool -> -- returning [BC] bc reg (SV (Glob n)) r = bc reg (SApp False n []) r
104
bc reg (SV (Glob n)) r = bc reg (SApp False n []) r
51
false
true
0
9
30
69
34
35
null
null
projectorhq/haskell-liquid
src/Text/Liquid/Renderer.hs
bsd-3-clause
renderTemplate :: Value -> Expr -> Rendering Text -- | Rendering types renderTemplate j (Output f@(Filter _ _)) = applyFilter j f
141
renderTemplate :: Value -> Expr -> Rendering Text renderTemplate j (Output f@(Filter _ _)) = applyFilter j f
119
renderTemplate j (Output f@(Filter _ _)) = applyFilter j f
63
true
true
2
12
33
55
26
29
null
null
percivalgambit/hasked
src/Data/ListLike/Zipper.hs
bsd-3-clause
-- Alias for fromListLikeEnd zipEnd :: (LL.ListLike full item) => full -> Zipper full zipEnd = fromListLikeEnd
110
zipEnd :: (LL.ListLike full item) => full -> Zipper full zipEnd = fromListLikeEnd
81
zipEnd = fromListLikeEnd
24
true
true
0
8
16
38
18
20
null
null
krakrjak/haskell-playground
UTM.hs
gpl-2.0
tape2 = ['1','0','1','0','1']
29
tape2 = ['1','0','1','0','1']
29
tape2 = ['1','0','1','0','1']
29
false
false
0
5
2
21
13
8
null
null
fmapfmapfmap/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/DescribeApps.hs
mpl-2.0
-- | An array of app IDs for the apps to be described. If you use this -- parameter, 'DescribeApps' returns a description of the specified apps. -- Otherwise, it returns a description of every app. daAppIds :: Lens' DescribeApps [Text] daAppIds = lens _daAppIds (\ s a -> s{_daAppIds = a}) . _Default . _Coerce
310
daAppIds :: Lens' DescribeApps [Text] daAppIds = lens _daAppIds (\ s a -> s{_daAppIds = a}) . _Default . _Coerce
112
daAppIds = lens _daAppIds (\ s a -> s{_daAppIds = a}) . _Default . _Coerce
74
true
true
0
11
55
53
30
23
null
null
Saulzar/reflex-gloss-scene
src/Reflex/Gloss/Random.hs
bsd-3-clause
foldRand :: (Reflex t, MonadHold t m, MonadFix m, RandomGen g) => g -> Rand g a -> Event t () -> m (Event t a) foldRand g f = foldGen g (runRand f)
147
foldRand :: (Reflex t, MonadHold t m, MonadFix m, RandomGen g) => g -> Rand g a -> Event t () -> m (Event t a) foldRand g f = foldGen g (runRand f)
147
foldRand g f = foldGen g (runRand f)
36
false
true
0
11
33
91
44
47
null
null
green-haskell/ghc
libraries/base/Data/Typeable.hs
bsd-3-clause
------------------------------------------------------------- -- -- Type-safe cast -- ------------------------------------------------------------- -- | The type-safe cast operation cast :: forall a b. (Typeable a, Typeable b) => a -> Maybe b cast x = if typeRep (Proxy :: Proxy a) == typeRep (Proxy :: Proxy b) then Just $ unsafeCoerce x else Nothing
387
cast :: forall a b. (Typeable a, Typeable b) => a -> Maybe b cast x = if typeRep (Proxy :: Proxy a) == typeRep (Proxy :: Proxy b) then Just $ unsafeCoerce x else Nothing
191
cast x = if typeRep (Proxy :: Proxy a) == typeRep (Proxy :: Proxy b) then Just $ unsafeCoerce x else Nothing
130
true
true
0
9
84
91
50
41
null
null
acowley/ghc
compiler/prelude/THNames.hs
bsd-3-clause
infixEName = libFun (fsLit "infixE") infixEIdKey
58
infixEName = libFun (fsLit "infixE") infixEIdKey
58
infixEName = libFun (fsLit "infixE") infixEIdKey
58
false
false
0
7
15
17
8
9
null
null
achirkin/easytensor
dimensions/test/Numeric/Dimensions/IdxTest.hs
bsd-3-clause
prop_idxsEnumFromThenTo :: Bool -> [(Word, Word, Word)] -> Bool prop_idxsEnumFromThenTo up ins | (xs, ys, SomeDims (KnownDims :: Dims ds)) <- twoIdxsSeq ins , Just ids <- idxsFromWords @ds xs , Just jds <- idxsFromWords @ds ys , lim <- if up then maxBound else minBound :: Idxs ds = take 1000 [ids, jds .. lim] == take 1000 (map toEnum [fromEnum ids, fromEnum jds .. fromEnum lim]) | otherwise = True
426
prop_idxsEnumFromThenTo :: Bool -> [(Word, Word, Word)] -> Bool prop_idxsEnumFromThenTo up ins | (xs, ys, SomeDims (KnownDims :: Dims ds)) <- twoIdxsSeq ins , Just ids <- idxsFromWords @ds xs , Just jds <- idxsFromWords @ds ys , lim <- if up then maxBound else minBound :: Idxs ds = take 1000 [ids, jds .. lim] == take 1000 (map toEnum [fromEnum ids, fromEnum jds .. fromEnum lim]) | otherwise = True
426
prop_idxsEnumFromThenTo up ins | (xs, ys, SomeDims (KnownDims :: Dims ds)) <- twoIdxsSeq ins , Just ids <- idxsFromWords @ds xs , Just jds <- idxsFromWords @ds ys , lim <- if up then maxBound else minBound :: Idxs ds = take 1000 [ids, jds .. lim] == take 1000 (map toEnum [fromEnum ids, fromEnum jds .. fromEnum lim]) | otherwise = True
362
false
true
1
13
97
186
94
92
null
null
DavidAlphaFox/ghc
compiler/simplCore/SimplUtils.hs
bsd-3-clause
argInfoAppArgs :: [ArgSpec] -> [OutExpr] argInfoAppArgs [] = []
92
argInfoAppArgs :: [ArgSpec] -> [OutExpr] argInfoAppArgs [] = []
92
argInfoAppArgs [] = []
51
false
true
0
6
37
28
15
13
null
null
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Util/WindowState.hs
bsd-2-clause
packIntoQuery :: (Window -> X a) -> Query a packIntoQuery = Query . ReaderT
75
packIntoQuery :: (Window -> X a) -> Query a packIntoQuery = Query . ReaderT
75
packIntoQuery = Query . ReaderT
31
false
true
1
9
13
39
17
22
null
null
phischu/fragnix
builtins/base/GHC.IO.Exception.hs
bsd-3-clause
ioException :: IOException -> IO a ioException err = throwIO err
68
ioException :: IOException -> IO a ioException err = throwIO err
68
ioException err = throwIO err
29
false
true
0
7
14
29
12
17
null
null
heathweiss/Tricad
src/Examples/Diffs/FirstDiff.hs
gpl-2.0
smallShapeBuilder = S.newCornerPointsWithDegreesBuilder 45 smallShape
69
smallShapeBuilder = S.newCornerPointsWithDegreesBuilder 45 smallShape
69
smallShapeBuilder = S.newCornerPointsWithDegreesBuilder 45 smallShape
69
false
false
1
6
4
16
6
10
null
null
mortberg/cubicaltt
Connections.hs
mit
showFace :: Face -> String showFace alpha = concat [ "(" ++ show i ++ " = " ++ show d ++ ")" | (i,d) <- toList alpha ]
142
showFace :: Face -> String showFace alpha = concat [ "(" ++ show i ++ " = " ++ show d ++ ")" | (i,d) <- toList alpha ]
142
showFace alpha = concat [ "(" ++ show i ++ " = " ++ show d ++ ")" | (i,d) <- toList alpha ]
115
false
true
0
11
52
63
31
32
null
null
NorfairKing/the-notes
src/Macro/Sets/Macro.hs
gpl-2.0
(=§=) :: Note -> Note -> Note (=§=) = seteq
43
(=§=) :: Note -> Note -> Note (=§=) = seteq
43
(=§=) = seteq
13
false
true
0
8
9
30
15
15
null
null
sdiehl/ghc
compiler/GHC/Stg/Syntax.hs
bsd-3-clause
stgArgType (StgLitArg lit) = literalType lit
44
stgArgType (StgLitArg lit) = literalType lit
44
stgArgType (StgLitArg lit) = literalType lit
44
false
false
0
7
5
18
8
10
null
null
phischu/fragnix
tests/packages/scotty/Text.PrettyPrint.Annotated.HughesPJ.hs
bsd-3-clause
sepNB g p k ys = sep1 g p k ys
32
sepNB g p k ys = sep1 g p k ys
32
sepNB g p k ys = sep1 g p k ys
32
false
false
1
5
12
34
11
23
null
null
joshuaclayton/timeline
src/Timeline/Parser/Graph.hs
mit
stackedBarParser :: Parser TimeSeriesGraph stackedBarParser = do parsedLists <- chartTypeIntroduction "stacked-bar" *> commaDelimitedLists if differentListLengths length parsedLists then fail "Stacked bar items do not have equal lengths" else return $ StackedBarGraph parsedLists
304
stackedBarParser :: Parser TimeSeriesGraph stackedBarParser = do parsedLists <- chartTypeIntroduction "stacked-bar" *> commaDelimitedLists if differentListLengths length parsedLists then fail "Stacked bar items do not have equal lengths" else return $ StackedBarGraph parsedLists
304
stackedBarParser = do parsedLists <- chartTypeIntroduction "stacked-bar" *> commaDelimitedLists if differentListLengths length parsedLists then fail "Stacked bar items do not have equal lengths" else return $ StackedBarGraph parsedLists
261
false
true
1
10
56
58
25
33
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/lens/2019-12-chris-penner-advent-of-optics/test/TestDay01.hs
unlicense
-- alternative : fewer brackets solve2FB :: IO Double solve2FB = do input <- Prelude.readFile "test/01.txt" pure $ input & sumOf (worded . _Show . (takingWhile (> 0) . dropping 1 . iterated) calculateRequiredFuel)
222
solve2FB :: IO Double solve2FB = do input <- Prelude.readFile "test/01.txt" pure $ input & sumOf (worded . _Show . (takingWhile (> 0) . dropping 1 . iterated) calculateRequiredFuel)
190
solve2FB = do input <- Prelude.readFile "test/01.txt" pure $ input & sumOf (worded . _Show . (takingWhile (> 0) . dropping 1 . iterated) calculateRequiredFuel)
168
true
true
0
17
42
82
38
44
null
null
Persi/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkUnused9 = verifyNotTree checkUnusedAssignments "read ''"
66
prop_checkUnused9 = verifyNotTree checkUnusedAssignments "read ''"
66
prop_checkUnused9 = verifyNotTree checkUnusedAssignments "read ''"
66
false
false
1
5
5
14
5
9
null
null
nushio3/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
ppr_expr (HsRnBracketOut e []) = ppr e
38
ppr_expr (HsRnBracketOut e []) = ppr e
38
ppr_expr (HsRnBracketOut e []) = ppr e
38
false
false
0
8
6
22
10
12
null
null
singingwolfboy/citeproc-hs
src/Text/CSL/Input/Bibutils.hs
bsd-3-clause
readBiblioFile' :: FilePath -> BiblioIn -> IO [Reference] readBiblioFile' fin bin | bin == mods_in = readModsCollectionFile fin | otherwise = withTempDir "citeproc" $ \tdir -> do let tfile = tdir </> "bibutils-tmp" param <- bibl_initparams bin mods_out "hs-bibutils" bibl <- bibl_init unsetBOM param setNoSplitTitle param setCharsetIn param bibl_charset_unicode setCharsetOut param bibl_charset_unicode _ <- bibl_read param bibl fin _ <- bibl_write param bibl tfile bibl_free bibl bibl_freeparams param refs <- readModsCollectionFile tfile return $! refs -- | Perform a function in a temporary directory and clean up.
983
readBiblioFile' :: FilePath -> BiblioIn -> IO [Reference] readBiblioFile' fin bin | bin == mods_in = readModsCollectionFile fin | otherwise = withTempDir "citeproc" $ \tdir -> do let tfile = tdir </> "bibutils-tmp" param <- bibl_initparams bin mods_out "hs-bibutils" bibl <- bibl_init unsetBOM param setNoSplitTitle param setCharsetIn param bibl_charset_unicode setCharsetOut param bibl_charset_unicode _ <- bibl_read param bibl fin _ <- bibl_write param bibl tfile bibl_free bibl bibl_freeparams param refs <- readModsCollectionFile tfile return $! refs -- | Perform a function in a temporary directory and clean up.
983
readBiblioFile' fin bin | bin == mods_in = readModsCollectionFile fin | otherwise = withTempDir "citeproc" $ \tdir -> do let tfile = tdir </> "bibutils-tmp" param <- bibl_initparams bin mods_out "hs-bibutils" bibl <- bibl_init unsetBOM param setNoSplitTitle param setCharsetIn param bibl_charset_unicode setCharsetOut param bibl_charset_unicode _ <- bibl_read param bibl fin _ <- bibl_write param bibl tfile bibl_free bibl bibl_freeparams param refs <- readModsCollectionFile tfile return $! refs -- | Perform a function in a temporary directory and clean up.
925
false
true
1
12
452
183
79
104
null
null
borsboom/git-embed
src/Git/Embed.hs
bsd-2-clause
-- | Embed the current Git branch name. embedGitBranch :: Q Exp embedGitBranch = embedGit ["rev-parse", "--abbrev-ref", "HEAD"]
127
embedGitBranch :: Q Exp embedGitBranch = embedGit ["rev-parse", "--abbrev-ref", "HEAD"]
87
embedGitBranch = embedGit ["rev-parse", "--abbrev-ref", "HEAD"]
63
true
true
0
6
17
27
15
12
null
null
karamellpelle/grid
source/Game/LevelPuzzle/Output/Fancy/Screen.hs
gpl-3.0
outputScreenFailure :: GameData -> LevelPuzzleWorld -> RunWorld -> IO () outputScreenFailure gamedata lvl run = do return ()
128
outputScreenFailure :: GameData -> LevelPuzzleWorld -> RunWorld -> IO () outputScreenFailure gamedata lvl run = do return ()
128
outputScreenFailure gamedata lvl run = do return ()
55
false
true
0
9
21
43
20
23
null
null
juodaspaulius/clafer
src/Language/Clafer/Intermediate/TypeSystem.hs
mit
collapseUnion :: IType -> IType collapseUnion (TUnion [t]) = t
65
collapseUnion :: IType -> IType collapseUnion (TUnion [t]) = t
65
collapseUnion (TUnion [t]) = t
30
false
true
0
10
12
33
15
18
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
3131 = 3130
11
3131 = 3130
11
3131 = 3130
11
false
false
1
5
2
10
3
7
null
null
AugustusHuang/hs-learning
elementary.hs
mit
last' (x:xs) = last' xs
23
last' (x:xs) = last' xs
23
last' (x:xs) = last' xs
23
false
false
0
6
4
20
9
11
null
null
CharlesRandles/cryptoChallenge
plaintext.hs
gpl-3.0
threshold :: Double threshold = 1.7
35
threshold :: Double threshold = 1.7
35
threshold = 1.7
15
false
true
0
4
5
11
6
5
null
null
spechub/Hets
LF/Sign.hs
gpl-2.0
getConstantsH (Appl f [a]) = Set.union (getConstantsH f) (getConstantsH a)
76
getConstantsH (Appl f [a]) = Set.union (getConstantsH f) (getConstantsH a)
76
getConstantsH (Appl f [a]) = Set.union (getConstantsH f) (getConstantsH a)
76
false
false
0
8
11
39
19
20
null
null
danoctavian/bit-smuggler
BitSmuggler/src/Network/BitSmuggler/TorrentClientProc.hs
gpl-2.0
athToString ::Sh.FilePath -> String pathToString fp = read . P.drop (P.length $ ("FilePath " :: String)) . show $ fp
118
pathToString ::Sh.FilePath -> String pathToString fp = read . P.drop (P.length $ ("FilePath " :: String)) . show $ fp
118
pathToString fp = read . P.drop (P.length $ ("FilePath " :: String)) . show $ fp
81
false
true
0
11
21
52
27
25
null
null
ganeti-github-testing/ganeti-test-1
src/Ganeti/Constants.hs
bsd-2-clause
secureFileMode :: Int secureFileMode = 0o600
44
secureFileMode :: Int secureFileMode = 0o600
44
secureFileMode = 0o600
22
false
true
0
4
5
11
6
5
null
null
IreneKnapp/Faction
libfaction/Distribution/Simple/PreProcess.hs
bsd-3-clause
ppHsc2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor ppHsc2hs bi lbi = PreProcessor { platformIndependent = False, runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> do (gccProg, _) <- requireProgram verbosity gccProgram (withPrograms lbi) rawSystemProgramConf verbosity hsc2hsProgram (withPrograms lbi) $ [ "--cc=" ++ programPath gccProg , "--ld=" ++ programPath gccProg ] -- Additional gcc options ++ [ "--cflag=" ++ opt | opt <- programDefaultArgs gccProg ++ programOverrideArgs gccProg ] ++ [ "--lflag=" ++ opt | opt <- programDefaultArgs gccProg ++ programOverrideArgs gccProg ] -- OSX frameworks: ++ [ what ++ "=-F" ++ opt | isOSX , opt <- nub (concatMap Installed.frameworkDirs pkgs) , what <- ["--cflag", "--lflag"] ] ++ [ "--lflag=" ++ arg | isOSX , opt <- PD.frameworks bi ++ concatMap Installed.frameworks pkgs , arg <- ["-framework", opt] ] -- Note that on ELF systems, wherever we use -L, we must also use -R -- because presumably that -L dir is not on the normal path for the -- system's dynamic linker. This is needed because hsc2hs works by -- compiling a C program and then running it. ++ [ "--cflag=" ++ opt | opt <- hcDefines (compiler lbi) ] ++ [ "--cflag=" ++ opt | opt <- sysDefines ] -- Options from the current package: ++ [ "--cflag=-I" ++ dir | dir <- PD.includeDirs bi ] ++ [ "--cflag=" ++ opt | opt <- PD.ccOptions bi ++ PD.cppOptions bi ] ++ [ "--lflag=-L" ++ opt | opt <- PD.extraLibDirs bi ] ++ [ "--lflag=-Wl,-R," ++ opt | isELF , opt <- PD.extraLibDirs bi ] ++ [ "--lflag=-l" ++ opt | opt <- PD.extraLibs bi ] ++ [ "--lflag=" ++ opt | opt <- PD.ldOptions bi ] -- Options from dependent packages ++ [ "--cflag=" ++ opt | pkg <- pkgs , opt <- [ "-I" ++ opt | opt <- Installed.includeDirs pkg ] ++ [ opt | opt <- Installed.ccOptions pkg ] ++ [ "-I" ++ autogenModulesDir lbi, "-include", autogenModulesDir lbi </> cppHeaderName ] ] ++ [ "--lflag=" ++ opt | pkg <- pkgs , opt <- [ "-L" ++ opt | opt <- Installed.libraryDirs pkg ] ++ [ "-Wl,-R," ++ opt | isELF , opt <- Installed.libraryDirs pkg ] ++ [ "-l" ++ opt | opt <- Installed.extraLibraries pkg ] ++ [ opt | opt <- Installed.ldOptions pkg ] ] ++ ["-o", outFile, inFile] } where pkgs = PackageIndex.topologicalOrder (packageHacks (installedPkgs lbi)) isOSX = case buildOS of OSX -> True; _ -> False isELF = case buildOS of OSX -> False; Windows -> False; _ -> True; packageHacks = case compilerFlavor (compiler lbi) of GHC -> hackRtsPackage _ -> id -- We don't link in the actual Haskell libraries of our dependencies, so -- the -u flags in the ldOptions of the rts package mean linking fails on -- OS X (it's ld is a tad stricter than gnu ld). Thus we remove the -- ldOptions for GHC's rts package: hackRtsPackage index = case PackageIndex.lookupPackageName index (PackageName "rts") of [(_, [rts])] -> PackageIndex.insert rts { Installed.ldOptions = [] } index _ -> error "No (or multiple) ghc rts package is registered!!"
3,678
ppHsc2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor ppHsc2hs bi lbi = PreProcessor { platformIndependent = False, runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> do (gccProg, _) <- requireProgram verbosity gccProgram (withPrograms lbi) rawSystemProgramConf verbosity hsc2hsProgram (withPrograms lbi) $ [ "--cc=" ++ programPath gccProg , "--ld=" ++ programPath gccProg ] -- Additional gcc options ++ [ "--cflag=" ++ opt | opt <- programDefaultArgs gccProg ++ programOverrideArgs gccProg ] ++ [ "--lflag=" ++ opt | opt <- programDefaultArgs gccProg ++ programOverrideArgs gccProg ] -- OSX frameworks: ++ [ what ++ "=-F" ++ opt | isOSX , opt <- nub (concatMap Installed.frameworkDirs pkgs) , what <- ["--cflag", "--lflag"] ] ++ [ "--lflag=" ++ arg | isOSX , opt <- PD.frameworks bi ++ concatMap Installed.frameworks pkgs , arg <- ["-framework", opt] ] -- Note that on ELF systems, wherever we use -L, we must also use -R -- because presumably that -L dir is not on the normal path for the -- system's dynamic linker. This is needed because hsc2hs works by -- compiling a C program and then running it. ++ [ "--cflag=" ++ opt | opt <- hcDefines (compiler lbi) ] ++ [ "--cflag=" ++ opt | opt <- sysDefines ] -- Options from the current package: ++ [ "--cflag=-I" ++ dir | dir <- PD.includeDirs bi ] ++ [ "--cflag=" ++ opt | opt <- PD.ccOptions bi ++ PD.cppOptions bi ] ++ [ "--lflag=-L" ++ opt | opt <- PD.extraLibDirs bi ] ++ [ "--lflag=-Wl,-R," ++ opt | isELF , opt <- PD.extraLibDirs bi ] ++ [ "--lflag=-l" ++ opt | opt <- PD.extraLibs bi ] ++ [ "--lflag=" ++ opt | opt <- PD.ldOptions bi ] -- Options from dependent packages ++ [ "--cflag=" ++ opt | pkg <- pkgs , opt <- [ "-I" ++ opt | opt <- Installed.includeDirs pkg ] ++ [ opt | opt <- Installed.ccOptions pkg ] ++ [ "-I" ++ autogenModulesDir lbi, "-include", autogenModulesDir lbi </> cppHeaderName ] ] ++ [ "--lflag=" ++ opt | pkg <- pkgs , opt <- [ "-L" ++ opt | opt <- Installed.libraryDirs pkg ] ++ [ "-Wl,-R," ++ opt | isELF , opt <- Installed.libraryDirs pkg ] ++ [ "-l" ++ opt | opt <- Installed.extraLibraries pkg ] ++ [ opt | opt <- Installed.ldOptions pkg ] ] ++ ["-o", outFile, inFile] } where pkgs = PackageIndex.topologicalOrder (packageHacks (installedPkgs lbi)) isOSX = case buildOS of OSX -> True; _ -> False isELF = case buildOS of OSX -> False; Windows -> False; _ -> True; packageHacks = case compilerFlavor (compiler lbi) of GHC -> hackRtsPackage _ -> id -- We don't link in the actual Haskell libraries of our dependencies, so -- the -u flags in the ldOptions of the rts package mean linking fails on -- OS X (it's ld is a tad stricter than gnu ld). Thus we remove the -- ldOptions for GHC's rts package: hackRtsPackage index = case PackageIndex.lookupPackageName index (PackageName "rts") of [(_, [rts])] -> PackageIndex.insert rts { Installed.ldOptions = [] } index _ -> error "No (or multiple) ghc rts package is registered!!"
3,678
ppHsc2hs bi lbi = PreProcessor { platformIndependent = False, runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> do (gccProg, _) <- requireProgram verbosity gccProgram (withPrograms lbi) rawSystemProgramConf verbosity hsc2hsProgram (withPrograms lbi) $ [ "--cc=" ++ programPath gccProg , "--ld=" ++ programPath gccProg ] -- Additional gcc options ++ [ "--cflag=" ++ opt | opt <- programDefaultArgs gccProg ++ programOverrideArgs gccProg ] ++ [ "--lflag=" ++ opt | opt <- programDefaultArgs gccProg ++ programOverrideArgs gccProg ] -- OSX frameworks: ++ [ what ++ "=-F" ++ opt | isOSX , opt <- nub (concatMap Installed.frameworkDirs pkgs) , what <- ["--cflag", "--lflag"] ] ++ [ "--lflag=" ++ arg | isOSX , opt <- PD.frameworks bi ++ concatMap Installed.frameworks pkgs , arg <- ["-framework", opt] ] -- Note that on ELF systems, wherever we use -L, we must also use -R -- because presumably that -L dir is not on the normal path for the -- system's dynamic linker. This is needed because hsc2hs works by -- compiling a C program and then running it. ++ [ "--cflag=" ++ opt | opt <- hcDefines (compiler lbi) ] ++ [ "--cflag=" ++ opt | opt <- sysDefines ] -- Options from the current package: ++ [ "--cflag=-I" ++ dir | dir <- PD.includeDirs bi ] ++ [ "--cflag=" ++ opt | opt <- PD.ccOptions bi ++ PD.cppOptions bi ] ++ [ "--lflag=-L" ++ opt | opt <- PD.extraLibDirs bi ] ++ [ "--lflag=-Wl,-R," ++ opt | isELF , opt <- PD.extraLibDirs bi ] ++ [ "--lflag=-l" ++ opt | opt <- PD.extraLibs bi ] ++ [ "--lflag=" ++ opt | opt <- PD.ldOptions bi ] -- Options from dependent packages ++ [ "--cflag=" ++ opt | pkg <- pkgs , opt <- [ "-I" ++ opt | opt <- Installed.includeDirs pkg ] ++ [ opt | opt <- Installed.ccOptions pkg ] ++ [ "-I" ++ autogenModulesDir lbi, "-include", autogenModulesDir lbi </> cppHeaderName ] ] ++ [ "--lflag=" ++ opt | pkg <- pkgs , opt <- [ "-L" ++ opt | opt <- Installed.libraryDirs pkg ] ++ [ "-Wl,-R," ++ opt | isELF , opt <- Installed.libraryDirs pkg ] ++ [ "-l" ++ opt | opt <- Installed.extraLibraries pkg ] ++ [ opt | opt <- Installed.ldOptions pkg ] ] ++ ["-o", outFile, inFile] } where pkgs = PackageIndex.topologicalOrder (packageHacks (installedPkgs lbi)) isOSX = case buildOS of OSX -> True; _ -> False isELF = case buildOS of OSX -> False; Windows -> False; _ -> True; packageHacks = case compilerFlavor (compiler lbi) of GHC -> hackRtsPackage _ -> id -- We don't link in the actual Haskell libraries of our dependencies, so -- the -u flags in the ldOptions of the rts package mean linking fails on -- OS X (it's ld is a tad stricter than gnu ld). Thus we remove the -- ldOptions for GHC's rts package: hackRtsPackage index = case PackageIndex.lookupPackageName index (PackageName "rts") of [(_, [rts])] -> PackageIndex.insert rts { Installed.ldOptions = [] } index _ -> error "No (or multiple) ghc rts package is registered!!"
3,622
false
true
0
30
1,260
902
466
436
null
null
tonymorris/story-board
src/Graphics/Storyboard/Behavior.hs
bsd-3-clause
evalBehavior :: Cavity Double -> TheBehaviorEnv -> Behavior a -> STM a evalBehavior cavity env (Behavior fn) = fn cavity env
124
evalBehavior :: Cavity Double -> TheBehaviorEnv -> Behavior a -> STM a evalBehavior cavity env (Behavior fn) = fn cavity env
124
evalBehavior cavity env (Behavior fn) = fn cavity env
53
false
true
0
8
20
50
23
27
null
null
rsasse/tamarin-prover
lib/theory/src/Theory.hs
gpl-3.0
-- prettyIntrVariantsSection prettyOpenProtoRule prettyProof -- | Pretty print a closed theory. prettyClosedTheory :: HighlightDocument d => ClosedTheory -> d prettyClosedTheory thy = prettyTheory prettySignatureWithMaude ppInjectiveFactInsts -- (prettyIntrVariantsSection . intruderRules . L.get crcRules) prettyClosedProtoRule prettyIncrementalProof thy where ppInjectiveFactInsts crc = case S.toList $ L.get crcInjectiveFactInsts crc of [] -> emptyDoc tags -> multiComment $ sep [ text "looping facts with injective instances:" , nest 2 $ fsepList (text . showFactTagArity) tags ] -- | Pretty print a closed theory.
793
prettyClosedTheory :: HighlightDocument d => ClosedTheory -> d prettyClosedTheory thy = prettyTheory prettySignatureWithMaude ppInjectiveFactInsts -- (prettyIntrVariantsSection . intruderRules . L.get crcRules) prettyClosedProtoRule prettyIncrementalProof thy where ppInjectiveFactInsts crc = case S.toList $ L.get crcInjectiveFactInsts crc of [] -> emptyDoc tags -> multiComment $ sep [ text "looping facts with injective instances:" , nest 2 $ fsepList (text . showFactTagArity) tags ] -- | Pretty print a closed theory.
696
prettyClosedTheory thy = prettyTheory prettySignatureWithMaude ppInjectiveFactInsts -- (prettyIntrVariantsSection . intruderRules . L.get crcRules) prettyClosedProtoRule prettyIncrementalProof thy where ppInjectiveFactInsts crc = case S.toList $ L.get crcInjectiveFactInsts crc of [] -> emptyDoc tags -> multiComment $ sep [ text "looping facts with injective instances:" , nest 2 $ fsepList (text . showFactTagArity) tags ] -- | Pretty print a closed theory.
633
true
true
0
14
252
117
58
59
null
null
lukexi/ghc-7.8-arm64
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp dflags res (VecIndexOffAddrOp vcat n w) args = do checkVecCompatibility dflags vcat n w doIndexOffAddrOp Nothing ty res args where ty :: CmmType ty = vecVmmType vcat n w
198
emitPrimOp dflags res (VecIndexOffAddrOp vcat n w) args = do checkVecCompatibility dflags vcat n w doIndexOffAddrOp Nothing ty res args where ty :: CmmType ty = vecVmmType vcat n w
198
emitPrimOp dflags res (VecIndexOffAddrOp vcat n w) args = do checkVecCompatibility dflags vcat n w doIndexOffAddrOp Nothing ty res args where ty :: CmmType ty = vecVmmType vcat n w
198
false
false
1
8
47
83
33
50
null
null
backofhan/HaskellExercises
CH23/src/Lib.hs
bsd-3-clause
addResult' :: Integer -> State (DL.DList String) () addResult' n = do xs <- get let result = fizzBuzz n put (DL.snoc xs result) -- Fizzbuzz Differently
160
addResult' :: Integer -> State (DL.DList String) () addResult' n = do xs <- get let result = fizzBuzz n put (DL.snoc xs result) -- Fizzbuzz Differently
160
addResult' n = do xs <- get let result = fizzBuzz n put (DL.snoc xs result) -- Fizzbuzz Differently
108
false
true
0
10
35
69
32
37
null
null
ku-fpg/kansas-amber
legacy/Shallow/LCD.hs
bsd-3-clause
hitachiI2C = I2CHitachi44780 { address = 0x27 -- I2C address of the device , lcdRows = 4 -- 2 rows , lcdCols = 20 -- of 16 columns , dotMode5x10 = False -- Using the standard 5x8 dots }
333
hitachiI2C = I2CHitachi44780 { address = 0x27 -- I2C address of the device , lcdRows = 4 -- 2 rows , lcdCols = 20 -- of 16 columns , dotMode5x10 = False -- Using the standard 5x8 dots }
333
hitachiI2C = I2CHitachi44780 { address = 0x27 -- I2C address of the device , lcdRows = 4 -- 2 rows , lcdCols = 20 -- of 16 columns , dotMode5x10 = False -- Using the standard 5x8 dots }
333
false
false
0
6
186
36
24
12
null
null
phaazon/quaazar
src/Quaazar/Render/Lighting.hs
bsd-3-clause
shadowmapIndexUniform :: Uniform Word32 shadowmapIndexUniform = toUniform ShadowmapIndexSem
91
shadowmapIndexUniform :: Uniform Word32 shadowmapIndexUniform = toUniform ShadowmapIndexSem
91
shadowmapIndexUniform = toUniform ShadowmapIndexSem
51
false
true
0
5
7
17
8
9
null
null
DataStewardshipPortal/ds-form-engine
JQuery.hs
apache-2.0
jqLength :: JQuery -> IO Int jqLength = ffi "(function (jq) { return jq.length; })"
83
jqLength :: JQuery -> IO Int jqLength = ffi "(function (jq) { return jq.length; })"
83
jqLength = ffi "(function (jq) { return jq.length; })"
54
false
true
0
6
14
21
10
11
null
null
swift-nav/plover
src/Language/Plover/Types.hs
mit
intBits U8 = 8
14
intBits U8 = 8
14
intBits U8 = 8
14
false
false
1
5
3
13
4
9
null
null
creichert/persistent
persistent-sqlite/Database/Sqlite.hs
mit
columnInt64 :: Statement -> Int -> IO Int64 columnInt64 (Statement statement) columnIndex = do columnInt64C statement columnIndex
131
columnInt64 :: Statement -> Int -> IO Int64 columnInt64 (Statement statement) columnIndex = do columnInt64C statement columnIndex
131
columnInt64 (Statement statement) columnIndex = do columnInt64C statement columnIndex
87
false
true
0
10
18
46
20
26
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F27.hs
bsd-3-clause
ptr_glTextureImage2DEXT :: FunPtr (GLuint -> GLenum -> GLint -> GLint -> GLsizei -> GLsizei -> GLint -> GLenum -> GLenum -> Ptr a -> IO ()) ptr_glTextureImage2DEXT = unsafePerformIO $ getCommand "glTextureImage2DEXT"
216
ptr_glTextureImage2DEXT :: FunPtr (GLuint -> GLenum -> GLint -> GLint -> GLsizei -> GLsizei -> GLint -> GLenum -> GLenum -> Ptr a -> IO ()) ptr_glTextureImage2DEXT = unsafePerformIO $ getCommand "glTextureImage2DEXT"
216
ptr_glTextureImage2DEXT = unsafePerformIO $ getCommand "glTextureImage2DEXT"
76
false
true
0
18
31
72
35
37
null
null
clockworkdevstudio/Idlewild-Lang
Semantics.hs
bsd-2-clause
localVariableDeclarationSemantics :: Statement -> CodeTransformation () localVariableDeclarationSemantics Statement {statementContents = (expression:_), statementLineNumber = lineNumber} = do symbols <- gets semanticStateSymbols types <- gets semanticStateTypes nameSpace <- gets semanticStateNameSpace let index = Map.size (functionSymbols nameSpace) if nameSpace == NO_NAMESPACE then case statementID expression of EXPRESSION_IDENTIFIER -> do let sourceName = identifierExpressionValue ((head . statementContents) expression) name = removeTypeTag (map toLower sourceName) container = Map.lookup name symbols typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () addVariable (Variable {variableName = name, variableType = (readVariableType sourceName), variableLineNumber = lineNumber, variableIsGlobal = False}) EXPRESSION_ASSIGN -> do let (leftOperand,rightOperand) = getBinaryOperands (statementContents expression) sourceName = identifierExpressionValue (getInitialStatement leftOperand) name = removeTypeTag (map toLower sourceName) container = Map.lookup name symbols typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () expressionSemantics rightOperand addVariable (Variable {variableName = name, variableType = (readVariableType sourceName), variableLineNumber = lineNumber, variableIsGlobal = False}) else case statementID expression of EXPRESSION_IDENTIFIER -> do let sourceName = identifierExpressionValue ((head . statementContents) expression) name = removeTypeTag (map toLower sourceName) container = Map.lookup name (functionSymbols nameSpace) offset = (-8) * ((numPreservedRegisters - 1) + functionNumLocals nameSpace + 1) typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () addLocalAutomaticVariable (LocalAutomaticVariable {localAutomaticVariableName = name, localAutomaticVariableType = (readVariableType sourceName), localAutomaticVariableLineNumber = lineNumber, localAutomaticVariableIsArgument = False, localAutomaticVariableIndex = index, localAutomaticVariableAddress = offset}) EXPRESSION_ASSIGN -> do let (leftOperand,rightOperand) = getBinaryOperands (statementContents expression) sourceName = identifierExpressionValue (getInitialStatement leftOperand) name = removeTypeTag (map toLower sourceName) container = Map.lookup name (functionSymbols nameSpace) offset = (-8) * ((numPreservedRegisters - 1) + functionNumLocals nameSpace + 1) typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () expressionSemantics rightOperand addLocalAutomaticVariable (LocalAutomaticVariable {localAutomaticVariableName = name, localAutomaticVariableType = (readVariableType sourceName), localAutomaticVariableLineNumber = lineNumber, localAutomaticVariableIsArgument = False, localAutomaticVariableIndex = index, localAutomaticVariableAddress = offset})
6,022
localVariableDeclarationSemantics :: Statement -> CodeTransformation () localVariableDeclarationSemantics Statement {statementContents = (expression:_), statementLineNumber = lineNumber} = do symbols <- gets semanticStateSymbols types <- gets semanticStateTypes nameSpace <- gets semanticStateNameSpace let index = Map.size (functionSymbols nameSpace) if nameSpace == NO_NAMESPACE then case statementID expression of EXPRESSION_IDENTIFIER -> do let sourceName = identifierExpressionValue ((head . statementContents) expression) name = removeTypeTag (map toLower sourceName) container = Map.lookup name symbols typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () addVariable (Variable {variableName = name, variableType = (readVariableType sourceName), variableLineNumber = lineNumber, variableIsGlobal = False}) EXPRESSION_ASSIGN -> do let (leftOperand,rightOperand) = getBinaryOperands (statementContents expression) sourceName = identifierExpressionValue (getInitialStatement leftOperand) name = removeTypeTag (map toLower sourceName) container = Map.lookup name symbols typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () expressionSemantics rightOperand addVariable (Variable {variableName = name, variableType = (readVariableType sourceName), variableLineNumber = lineNumber, variableIsGlobal = False}) else case statementID expression of EXPRESSION_IDENTIFIER -> do let sourceName = identifierExpressionValue ((head . statementContents) expression) name = removeTypeTag (map toLower sourceName) container = Map.lookup name (functionSymbols nameSpace) offset = (-8) * ((numPreservedRegisters - 1) + functionNumLocals nameSpace + 1) typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () addLocalAutomaticVariable (LocalAutomaticVariable {localAutomaticVariableName = name, localAutomaticVariableType = (readVariableType sourceName), localAutomaticVariableLineNumber = lineNumber, localAutomaticVariableIsArgument = False, localAutomaticVariableIndex = index, localAutomaticVariableAddress = offset}) EXPRESSION_ASSIGN -> do let (leftOperand,rightOperand) = getBinaryOperands (statementContents expression) sourceName = identifierExpressionValue (getInitialStatement leftOperand) name = removeTypeTag (map toLower sourceName) container = Map.lookup name (functionSymbols nameSpace) offset = (-8) * ((numPreservedRegisters - 1) + functionNumLocals nameSpace + 1) typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () expressionSemantics rightOperand addLocalAutomaticVariable (LocalAutomaticVariable {localAutomaticVariableName = name, localAutomaticVariableType = (readVariableType sourceName), localAutomaticVariableLineNumber = lineNumber, localAutomaticVariableIsArgument = False, localAutomaticVariableIndex = index, localAutomaticVariableAddress = offset})
6,022
localVariableDeclarationSemantics Statement {statementContents = (expression:_), statementLineNumber = lineNumber} = do symbols <- gets semanticStateSymbols types <- gets semanticStateTypes nameSpace <- gets semanticStateNameSpace let index = Map.size (functionSymbols nameSpace) if nameSpace == NO_NAMESPACE then case statementID expression of EXPRESSION_IDENTIFIER -> do let sourceName = identifierExpressionValue ((head . statementContents) expression) name = removeTypeTag (map toLower sourceName) container = Map.lookup name symbols typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () addVariable (Variable {variableName = name, variableType = (readVariableType sourceName), variableLineNumber = lineNumber, variableIsGlobal = False}) EXPRESSION_ASSIGN -> do let (leftOperand,rightOperand) = getBinaryOperands (statementContents expression) sourceName = identifierExpressionValue (getInitialStatement leftOperand) name = removeTypeTag (map toLower sourceName) container = Map.lookup name symbols typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () expressionSemantics rightOperand addVariable (Variable {variableName = name, variableType = (readVariableType sourceName), variableLineNumber = lineNumber, variableIsGlobal = False}) else case statementID expression of EXPRESSION_IDENTIFIER -> do let sourceName = identifierExpressionValue ((head . statementContents) expression) name = removeTypeTag (map toLower sourceName) container = Map.lookup name (functionSymbols nameSpace) offset = (-8) * ((numPreservedRegisters - 1) + functionNumLocals nameSpace + 1) typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () addLocalAutomaticVariable (LocalAutomaticVariable {localAutomaticVariableName = name, localAutomaticVariableType = (readVariableType sourceName), localAutomaticVariableLineNumber = lineNumber, localAutomaticVariableIsArgument = False, localAutomaticVariableIndex = index, localAutomaticVariableAddress = offset}) EXPRESSION_ASSIGN -> do let (leftOperand,rightOperand) = getBinaryOperands (statementContents expression) sourceName = identifierExpressionValue (getInitialStatement leftOperand) name = removeTypeTag (map toLower sourceName) container = Map.lookup name (functionSymbols nameSpace) offset = (-8) * ((numPreservedRegisters - 1) + functionNumLocals nameSpace + 1) typeContainer = Map.lookup (map toLower (isolateCustomTypeTag sourceName)) types if container /= Nothing then throwSemanticError ("Duplicate identifier '" ++ sourceName ++ "'.") expression else return () if isCustomType (readVariableType sourceName) && typeContainer == Nothing then throwSemanticError ("Reference to undeclared type '" ++ isolateCustomTypeTag sourceName ++ "'.") expression else return () expressionSemantics rightOperand addLocalAutomaticVariable (LocalAutomaticVariable {localAutomaticVariableName = name, localAutomaticVariableType = (readVariableType sourceName), localAutomaticVariableLineNumber = lineNumber, localAutomaticVariableIsArgument = False, localAutomaticVariableIndex = index, localAutomaticVariableAddress = offset})
5,950
false
true
0
21
2,285
1,126
573
553
null
null
vTurbine/ghc
compiler/iface/IfaceEnv.hs
bsd-3-clause
extendOrigNameCache :: OrigNameCache -> Name -> OrigNameCache extendOrigNameCache nc name = ASSERT2( isExternalName name, ppr name ) extendNameCache nc (nameModule name) (nameOccName name) name
199
extendOrigNameCache :: OrigNameCache -> Name -> OrigNameCache extendOrigNameCache nc name = ASSERT2( isExternalName name, ppr name ) extendNameCache nc (nameModule name) (nameOccName name) name
199
extendOrigNameCache nc name = ASSERT2( isExternalName name, ppr name ) extendNameCache nc (nameModule name) (nameOccName name) name
137
false
true
0
7
29
63
30
33
null
null
loskutov/logic-hw
Lambdas.hs
mit
rename :: Set String → String → String rename vars var | var ∉ vars = var | otherwise = rename vars (incString var)
131
rename :: Set String → String → String rename vars var | var ∉ vars = var | otherwise = rename vars (incString var)
131
rename vars var | var ∉ vars = var | otherwise = rename vars (incString var)
92
false
true
0
8
39
57
26
31
null
null
mainland/nikola
examples/mandelbrot/Mandelbrot/NikolaV1/Implementation.hs
bsd-3-clause
prettyRGBA limit (_, s) = r + g + b + a where t = fromInt $ ((limit - s) * 255) `quot` limit r = (t `mod` 128 + 64) * 0x1000000 g = (t * 2 `mod` 128 + 64) * 0x10000 b = (t * 3 `mod` 256 ) * 0x100 a = 0xFF
234
prettyRGBA limit (_, s) = r + g + b + a where t = fromInt $ ((limit - s) * 255) `quot` limit r = (t `mod` 128 + 64) * 0x1000000 g = (t * 2 `mod` 128 + 64) * 0x10000 b = (t * 3 `mod` 256 ) * 0x100 a = 0xFF
234
prettyRGBA limit (_, s) = r + g + b + a where t = fromInt $ ((limit - s) * 255) `quot` limit r = (t `mod` 128 + 64) * 0x1000000 g = (t * 2 `mod` 128 + 64) * 0x10000 b = (t * 3 `mod` 256 ) * 0x100 a = 0xFF
234
false
false
4
13
86
144
77
67
null
null
chadbrewbaker/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
findSubshelled [] _ _ = return ()
33
findSubshelled [] _ _ = return ()
33
findSubshelled [] _ _ = return ()
33
false
false
1
6
6
21
9
12
null
null
dongy7/raytracer
src/Math/SceneParams.hs
mit
r :: Scalar r = 0.1
19
r :: Scalar r = 0.1
19
r = 0.1
7
false
true
0
6
5
18
7
11
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
typeSymbolKindConNameKey = mkPreludeTyConUnique 161
52
typeSymbolKindConNameKey = mkPreludeTyConUnique 161
52
typeSymbolKindConNameKey = mkPreludeTyConUnique 161
52
false
false
1
5
4
12
4
8
null
null
r-raymond/purple-muon
src/PurpleMuon/Util/MonadError.hs
gpl-3.0
-- | Lift Either into error monad -- Throws error on `Left` Value. liftEither :: (MonadError e m) => Either e a -> m a liftEither = liftEitherWith identity
155
liftEither :: (MonadError e m) => Either e a -> m a liftEither = liftEitherWith identity
88
liftEither = liftEitherWith identity
36
true
true
0
7
28
39
20
19
null
null
Heather/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
-- | Convert a reflected term to a more suitable form for pattern-matching. -- In particular, the less-interesting bits are elaborated to _ patterns. This -- happens to NameTypes, universe levels, names that are bound but not used, -- and the type annotation field of the P constructor. reflectTTQuotePattern :: [Name] -> Term -> ElabD () reflectTTQuotePattern unq (P _ n _) | n `elem` unq = -- the unquoted names have been claimed as TT already - just use them do fill (Var n) ; solve | otherwise = do tyannot <- claimTy (sMN 0 "pTyAnnot") (Var (reflm "TT")) movelast tyannot -- use a _ pattern here nt <- getNameFrom (sMN 0 "nt") claim nt (Var (reflm "NameType")) movelast nt -- use a _ pattern here n' <- getNameFrom (sMN 0 "n") claim n' (Var (reflm "TTName")) fill $ reflCall "P" [Var nt, Var n', Var tyannot] solve focus n'; reflectNameQuotePattern n
937
reflectTTQuotePattern :: [Name] -> Term -> ElabD () reflectTTQuotePattern unq (P _ n _) | n `elem` unq = -- the unquoted names have been claimed as TT already - just use them do fill (Var n) ; solve | otherwise = do tyannot <- claimTy (sMN 0 "pTyAnnot") (Var (reflm "TT")) movelast tyannot -- use a _ pattern here nt <- getNameFrom (sMN 0 "nt") claim nt (Var (reflm "NameType")) movelast nt -- use a _ pattern here n' <- getNameFrom (sMN 0 "n") claim n' (Var (reflm "TTName")) fill $ reflCall "P" [Var nt, Var n', Var tyannot] solve focus n'; reflectNameQuotePattern n
650
reflectTTQuotePattern unq (P _ n _) | n `elem` unq = -- the unquoted names have been claimed as TT already - just use them do fill (Var n) ; solve | otherwise = do tyannot <- claimTy (sMN 0 "pTyAnnot") (Var (reflm "TT")) movelast tyannot -- use a _ pattern here nt <- getNameFrom (sMN 0 "nt") claim nt (Var (reflm "NameType")) movelast nt -- use a _ pattern here n' <- getNameFrom (sMN 0 "n") claim n' (Var (reflm "TTName")) fill $ reflCall "P" [Var nt, Var n', Var tyannot] solve focus n'; reflectNameQuotePattern n
598
true
true
1
13
234
252
118
134
null
null
expipiplus1/vulkan
src/Vulkan/Core12/Promoted_From_VK_KHR_timeline_semaphore.hs
bsd-3-clause
-- | vkSignalSemaphore - Signal a timeline semaphore on the host -- -- = Description -- -- When 'signalSemaphore' is executed on the host, it defines and -- immediately executes a -- <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-semaphores-signaling semaphore signal operation> -- which sets the timeline semaphore to the given value. -- -- The first synchronization scope is defined by the host execution model, -- but includes execution of 'signalSemaphore' on the host and anything -- that happened-before it. -- -- The second synchronization scope is empty. -- -- == Return Codes -- -- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>] -- -- - 'Vulkan.Core10.Enums.Result.SUCCESS' -- -- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>] -- -- - 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY' -- -- - 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY' -- -- = See Also -- -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_timeline_semaphore VK_KHR_timeline_semaphore>, -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>, -- 'Vulkan.Core10.Handles.Device', 'SemaphoreSignalInfo' signalSemaphore :: forall io . (MonadIO io) => -- | @device@ is the logical device that owns the semaphore. -- -- #VUID-vkSignalSemaphore-device-parameter# @device@ /must/ be a valid -- 'Vulkan.Core10.Handles.Device' handle Device -> -- | @pSignalInfo@ is a pointer to a 'SemaphoreSignalInfo' structure -- containing information about the signal operation. -- -- #VUID-vkSignalSemaphore-pSignalInfo-parameter# @pSignalInfo@ /must/ be a -- valid pointer to a valid 'SemaphoreSignalInfo' structure SemaphoreSignalInfo -> io () signalSemaphore device signalInfo = liftIO . evalContT $ do let vkSignalSemaphorePtr = pVkSignalSemaphore (case device of Device{deviceCmds} -> deviceCmds) lift $ unless (vkSignalSemaphorePtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkSignalSemaphore is null" Nothing Nothing let vkSignalSemaphore' = mkVkSignalSemaphore vkSignalSemaphorePtr pSignalInfo <- ContT $ withCStruct (signalInfo) r <- lift $ traceAroundEvent "vkSignalSemaphore" (vkSignalSemaphore' (deviceHandle (device)) pSignalInfo) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) -- | VkPhysicalDeviceTimelineSemaphoreFeatures - Structure describing -- timeline semaphore features that can be supported by an implementation -- -- = Members -- -- This structure describes the following feature: -- -- = Description -- -- If the 'PhysicalDeviceTimelineSemaphoreFeatures' structure is included -- in the @pNext@ chain of the -- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2' -- structure passed to -- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2', -- it is filled in to indicate whether each corresponding feature is -- supported. 'PhysicalDeviceTimelineSemaphoreFeatures' /can/ also be used -- in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to -- selectively enable these features. -- -- == Valid Usage (Implicit) -- -- = See Also -- -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_timeline_semaphore VK_KHR_timeline_semaphore>, -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>, -- 'Vulkan.Core10.FundamentalTypes.Bool32', -- 'Vulkan.Core10.Enums.StructureType.StructureType'
3,980
signalSemaphore :: forall io . (MonadIO io) => -- | @device@ is the logical device that owns the semaphore. -- -- #VUID-vkSignalSemaphore-device-parameter# @device@ /must/ be a valid -- 'Vulkan.Core10.Handles.Device' handle Device -> -- | @pSignalInfo@ is a pointer to a 'SemaphoreSignalInfo' structure -- containing information about the signal operation. -- -- #VUID-vkSignalSemaphore-pSignalInfo-parameter# @pSignalInfo@ /must/ be a -- valid pointer to a valid 'SemaphoreSignalInfo' structure SemaphoreSignalInfo -> io () signalSemaphore device signalInfo = liftIO . evalContT $ do let vkSignalSemaphorePtr = pVkSignalSemaphore (case device of Device{deviceCmds} -> deviceCmds) lift $ unless (vkSignalSemaphorePtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkSignalSemaphore is null" Nothing Nothing let vkSignalSemaphore' = mkVkSignalSemaphore vkSignalSemaphorePtr pSignalInfo <- ContT $ withCStruct (signalInfo) r <- lift $ traceAroundEvent "vkSignalSemaphore" (vkSignalSemaphore' (deviceHandle (device)) pSignalInfo) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) -- | VkPhysicalDeviceTimelineSemaphoreFeatures - Structure describing -- timeline semaphore features that can be supported by an implementation -- -- = Members -- -- This structure describes the following feature: -- -- = Description -- -- If the 'PhysicalDeviceTimelineSemaphoreFeatures' structure is included -- in the @pNext@ chain of the -- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2' -- structure passed to -- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2', -- it is filled in to indicate whether each corresponding feature is -- supported. 'PhysicalDeviceTimelineSemaphoreFeatures' /can/ also be used -- in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to -- selectively enable these features. -- -- == Valid Usage (Implicit) -- -- = See Also -- -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_timeline_semaphore VK_KHR_timeline_semaphore>, -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>, -- 'Vulkan.Core10.FundamentalTypes.Bool32', -- 'Vulkan.Core10.Enums.StructureType.StructureType'
2,589
signalSemaphore device signalInfo = liftIO . evalContT $ do let vkSignalSemaphorePtr = pVkSignalSemaphore (case device of Device{deviceCmds} -> deviceCmds) lift $ unless (vkSignalSemaphorePtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkSignalSemaphore is null" Nothing Nothing let vkSignalSemaphore' = mkVkSignalSemaphore vkSignalSemaphorePtr pSignalInfo <- ContT $ withCStruct (signalInfo) r <- lift $ traceAroundEvent "vkSignalSemaphore" (vkSignalSemaphore' (deviceHandle (device)) pSignalInfo) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) -- | VkPhysicalDeviceTimelineSemaphoreFeatures - Structure describing -- timeline semaphore features that can be supported by an implementation -- -- = Members -- -- This structure describes the following feature: -- -- = Description -- -- If the 'PhysicalDeviceTimelineSemaphoreFeatures' structure is included -- in the @pNext@ chain of the -- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2' -- structure passed to -- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2', -- it is filled in to indicate whether each corresponding feature is -- supported. 'PhysicalDeviceTimelineSemaphoreFeatures' /can/ also be used -- in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to -- selectively enable these features. -- -- == Valid Usage (Implicit) -- -- = See Also -- -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_timeline_semaphore VK_KHR_timeline_semaphore>, -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>, -- 'Vulkan.Core10.FundamentalTypes.Bool32', -- 'Vulkan.Core10.Enums.StructureType.StructureType'
1,828
true
true
1
18
642
287
172
115
null
null
bitemyapp/roshask
Tests/TopicWindow.hs
bsd-3-clause
-- Monoid on Int with (+) test1 = forever . showTopic . fmap ((`div` 10) . getSum) $ slidingWindow 10 (Sum <$> addNoise 3 currentMinute)
144
test1 = forever . showTopic . fmap ((`div` 10) . getSum) $ slidingWindow 10 (Sum <$> addNoise 3 currentMinute)
118
test1 = forever . showTopic . fmap ((`div` 10) . getSum) $ slidingWindow 10 (Sum <$> addNoise 3 currentMinute)
118
true
false
0
10
32
52
28
24
null
null
ryzhyk/cocoon
cocoon/MiniNet/MiniNet.hs
apache-2.0
formatMAC :: Integer -> String formatMAC i = ( showHex b0 . colon . showHex b1 . colon . showHex b2 . colon . showHex b3 . colon . showHex b4 . colon . showHex b5) "" where colon = showString ":" b5 = bitSlice i 7 0 b4 = bitSlice i 15 8 b3 = bitSlice i 23 16 b2 = bitSlice i 31 24 b1 = bitSlice i 39 32 b0 = bitSlice i 47 40
383
formatMAC :: Integer -> String formatMAC i = ( showHex b0 . colon . showHex b1 . colon . showHex b2 . colon . showHex b3 . colon . showHex b4 . colon . showHex b5) "" where colon = showString ":" b5 = bitSlice i 7 0 b4 = bitSlice i 15 8 b3 = bitSlice i 23 16 b2 = bitSlice i 31 24 b1 = bitSlice i 39 32 b0 = bitSlice i 47 40
383
formatMAC i = ( showHex b0 . colon . showHex b1 . colon . showHex b2 . colon . showHex b3 . colon . showHex b4 . colon . showHex b5) "" where colon = showString ":" b5 = bitSlice i 7 0 b4 = bitSlice i 15 8 b3 = bitSlice i 23 16 b2 = bitSlice i 31 24 b1 = bitSlice i 39 32 b0 = bitSlice i 47 40
352
false
true
4
17
136
179
80
99
null
null
dysinger/amazonka
gen/src/Gen/AST.hs
mpl-2.0
requests :: Input -> HashSet Text -> State (HashMap Text Data) Input requests inp ss = do os <- Map.traverseWithKey go (inp ^. inpOperations) return $! inp & inpOperations .~ os where go :: Text -> Input.Operation -> State (HashMap Text Data) Input.Operation go n o = do rq <- update n (o ^. oInput) rs <- update (n <> "Response") (o ^. oOutput) return $! o & oInput .~ rq & oOutput .~ rs update :: Text -> Maybe Ref -> State (HashMap Text Data) (Maybe Ref) update _ Nothing = return Nothing update n (Just r) = do let k = r ^. refShape md <- gets (Map.lookup k) case md of Just d | Set.member k ss -> copy n r d Just d -> move n k r d Nothing -> return Nothing move :: Text -> Text -> Ref -> Data -> State (HashMap Text Data) (Maybe Ref) move n k r d = modify (Map.delete k) >> copy n r d copy :: Text -> Ref -> Data -> State (HashMap Text Data) (Maybe Ref) copy k r d = do modify (Map.insert k (dataRename k d)) return (Just (r & refShape .~ k))
1,230
requests :: Input -> HashSet Text -> State (HashMap Text Data) Input requests inp ss = do os <- Map.traverseWithKey go (inp ^. inpOperations) return $! inp & inpOperations .~ os where go :: Text -> Input.Operation -> State (HashMap Text Data) Input.Operation go n o = do rq <- update n (o ^. oInput) rs <- update (n <> "Response") (o ^. oOutput) return $! o & oInput .~ rq & oOutput .~ rs update :: Text -> Maybe Ref -> State (HashMap Text Data) (Maybe Ref) update _ Nothing = return Nothing update n (Just r) = do let k = r ^. refShape md <- gets (Map.lookup k) case md of Just d | Set.member k ss -> copy n r d Just d -> move n k r d Nothing -> return Nothing move :: Text -> Text -> Ref -> Data -> State (HashMap Text Data) (Maybe Ref) move n k r d = modify (Map.delete k) >> copy n r d copy :: Text -> Ref -> Data -> State (HashMap Text Data) (Maybe Ref) copy k r d = do modify (Map.insert k (dataRename k d)) return (Just (r & refShape .~ k))
1,230
requests inp ss = do os <- Map.traverseWithKey go (inp ^. inpOperations) return $! inp & inpOperations .~ os where go :: Text -> Input.Operation -> State (HashMap Text Data) Input.Operation go n o = do rq <- update n (o ^. oInput) rs <- update (n <> "Response") (o ^. oOutput) return $! o & oInput .~ rq & oOutput .~ rs update :: Text -> Maybe Ref -> State (HashMap Text Data) (Maybe Ref) update _ Nothing = return Nothing update n (Just r) = do let k = r ^. refShape md <- gets (Map.lookup k) case md of Just d | Set.member k ss -> copy n r d Just d -> move n k r d Nothing -> return Nothing move :: Text -> Text -> Ref -> Data -> State (HashMap Text Data) (Maybe Ref) move n k r d = modify (Map.delete k) >> copy n r d copy :: Text -> Ref -> Data -> State (HashMap Text Data) (Maybe Ref) copy k r d = do modify (Map.insert k (dataRename k d)) return (Just (r & refShape .~ k))
1,161
false
true
0
14
482
539
250
289
null
null
svoisen/hs_tagger
Tagger/Tag.hs
mit
unTrigramize :: [[Pair]] -> [Pair] unTrigramize [] = []
61
unTrigramize :: [[Pair]] -> [Pair] unTrigramize [] = []
61
unTrigramize [] = []
26
false
true
0
7
14
31
17
14
null
null
rrnewton/stack
src/Data/Aeson/Extended.hs
bsd-3-clause
jsonSubWarningsT :: Traversable t => WarningParser (t (a, [JSONWarning])) -> WarningParser (t a) jsonSubWarningsT f = Traversable.mapM (jsonSubWarnings . return) =<< f
179
jsonSubWarningsT :: Traversable t => WarningParser (t (a, [JSONWarning])) -> WarningParser (t a) jsonSubWarningsT f = Traversable.mapM (jsonSubWarnings . return) =<< f
179
jsonSubWarningsT f = Traversable.mapM (jsonSubWarnings . return) =<< f
74
false
true
0
11
33
72
35
37
null
null
green-haskell/ghc
compiler/basicTypes/DataCon.hs
bsd-3-clause
isBanged :: HsBang -> Bool isBanged HsNoBang = False
64
isBanged :: HsBang -> Bool isBanged HsNoBang = False
64
isBanged HsNoBang = False
37
false
true
0
5
20
18
9
9
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/enumFromThen_2.hs
mit
primModNatS (Succ x) Zero = error
33
primModNatS (Succ x) Zero = error
33
primModNatS (Succ x) Zero = error
33
false
false
0
7
5
17
8
9
null
null
syanidar/Sophy
src/Foundation/BitBoard.hs
bsd-3-clause
attack :: Direction -> EmptyMap -> PieceMap -> BitBoard attack North x y = (y''.|.y''`shiftL`32.&.x'')`shiftL`8 where y' = y.|.y`shiftL`8.&.x x' = x.&.x`shiftL`8 y'' = y'.|.y'`shiftL`16.&.x' x'' = x'.&.x'`shiftL`16
262
attack :: Direction -> EmptyMap -> PieceMap -> BitBoard attack North x y = (y''.|.y''`shiftL`32.&.x'')`shiftL`8 where y' = y.|.y`shiftL`8.&.x x' = x.&.x`shiftL`8 y'' = y'.|.y'`shiftL`16.&.x' x'' = x'.&.x'`shiftL`16
262
attack North x y = (y''.|.y''`shiftL`32.&.x'')`shiftL`8 where y' = y.|.y`shiftL`8.&.x x' = x.&.x`shiftL`8 y'' = y'.|.y'`shiftL`16.&.x' x'' = x'.&.x'`shiftL`16
206
false
true
3
14
75
130
70
60
null
null
vluukkal/aspreify
testaspparse.hs
mit
trel7 = TestCase $ assertEqual "rel 7" (Plain (Const "r") [] True) (wrapparser_bl' rel "" "r, s, not t")
104
trel7 = TestCase $ assertEqual "rel 7" (Plain (Const "r") [] True) (wrapparser_bl' rel "" "r, s, not t")
104
trel7 = TestCase $ assertEqual "rel 7" (Plain (Const "r") [] True) (wrapparser_bl' rel "" "r, s, not t")
104
false
false
1
10
18
48
22
26
null
null
AntoineSavage/haskell
Puzzles/src/Data/Sudoku.hs
gpl-2.0
newDomain :: [(Pos,Domain)] -> [(Pos,Domain)] newDomain xs = let (ys,zs) = partition (\(_,vs) -> length vs == 1) xs f (k,vs) = (k, vs \\ concatMap snd ys) in ys ++ map f zs
180
newDomain :: [(Pos,Domain)] -> [(Pos,Domain)] newDomain xs = let (ys,zs) = partition (\(_,vs) -> length vs == 1) xs f (k,vs) = (k, vs \\ concatMap snd ys) in ys ++ map f zs
180
newDomain xs = let (ys,zs) = partition (\(_,vs) -> length vs == 1) xs f (k,vs) = (k, vs \\ concatMap snd ys) in ys ++ map f zs
134
false
true
0
13
41
118
64
54
null
null
tjakway/ghcjvm
compiler/coreSyn/TrieMap.hs
bsd-3-clause
trieMapView _ = Nothing
23
trieMapView _ = Nothing
23
trieMapView _ = Nothing
23
false
false
0
4
3
10
4
6
null
null
begriffs/esqueleto
src/Database/Esqueleto/Internal/Sql.hs
bsd-3-clause
from16P :: Proxy (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) -> Proxy ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p)) from16P = const Proxy
131
from16P :: Proxy (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) -> Proxy ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p)) from16P = const Proxy
131
from16P = const Proxy
21
false
true
0
9
10
150
92
58
null
null
bartoszw/yhaslo
Handler/Util.hs
bsd-3-clause
presentLoan :: Loan -> ValidMonad InstalmentPlan presentLoan l = (runWithIPP (IPP (freqS l) (roundingS l)) . newLoanI) l
120
presentLoan :: Loan -> ValidMonad InstalmentPlan presentLoan l = (runWithIPP (IPP (freqS l) (roundingS l)) . newLoanI) l
120
presentLoan l = (runWithIPP (IPP (freqS l) (roundingS l)) . newLoanI) l
71
false
true
0
12
17
54
26
28
null
null
guoy34/ampersand
src/Database/Design/Ampersand/Basics/Auxiliaries.hs
gpl-3.0
-- Convert list of a's with associated b's to a list of b's with associated a's. -- Each b in the result is unique, and so is each a per b, eg.: -- converse [(1,[2,2,3]),(1,[3,4]),(2,[4,5])] == [(2,[1]),(3,[1]),(4,[1,2]),(5,[2])] converse :: forall a b . (Ord a, Ord b) => [(a, [b])] -> [(b, [a])] converse aBss = let asPerB ::(Ord a, Ord b) => Map b (Set a) asPerB = foldl (.) id [ Map.insertWith Set.union b (Set.singleton a) | (a,bs) <- aBss, b <- bs ] $ Map.empty in Map.toList $ fmap Set.toList asPerB
546
converse :: forall a b . (Ord a, Ord b) => [(a, [b])] -> [(b, [a])] converse aBss = let asPerB ::(Ord a, Ord b) => Map b (Set a) asPerB = foldl (.) id [ Map.insertWith Set.union b (Set.singleton a) | (a,bs) <- aBss, b <- bs ] $ Map.empty in Map.toList $ fmap Set.toList asPerB
314
converse aBss = let asPerB ::(Ord a, Ord b) => Map b (Set a) asPerB = foldl (.) id [ Map.insertWith Set.union b (Set.singleton a) | (a,bs) <- aBss, b <- bs ] $ Map.empty in Map.toList $ fmap Set.toList asPerB
246
true
true
0
15
133
180
98
82
null
null
GregorySchwartz/fasta
src/Data/Fasta/ByteString/Parse.hs
gpl-3.0
fastaCLIP' :: A.Parser FastaSequence fastaCLIP' = do header <- A.takeWhile (\x -> x /= '\n' && x /= '\r') A.endOfLine fseq <- A.manyTill anyButSpace (void (A.char '>') CA.<|> A.endOfInput) return FastaSequence { fastaHeader = header , fastaSeq = B.pack fseq }
300
fastaCLIP' :: A.Parser FastaSequence fastaCLIP' = do header <- A.takeWhile (\x -> x /= '\n' && x /= '\r') A.endOfLine fseq <- A.manyTill anyButSpace (void (A.char '>') CA.<|> A.endOfInput) return FastaSequence { fastaHeader = header , fastaSeq = B.pack fseq }
300
fastaCLIP' = do header <- A.takeWhile (\x -> x /= '\n' && x /= '\r') A.endOfLine fseq <- A.manyTill anyButSpace (void (A.char '>') CA.<|> A.endOfInput) return FastaSequence { fastaHeader = header , fastaSeq = B.pack fseq }
263
false
true
0
14
81
114
56
58
null
null
flocc-net/flocc
v0.1/Compiler/Back/ControlTemplates.hs
apache-2.0
ifT t n = terr' t n
19
ifT t n = terr' t n
19
ifT t n = terr' t n
19
false
false
1
5
6
20
7
13
null
null
markus1189/SmartCheck
qc-tests/Tests.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- If you take from v a sub-value v' at index i, then replace v' at index i, you -- get v back. prop_getReplaceIdem :: Tree Int -> Q.NonNegative Int -> Q.NonNegative Int -> Bool prop_getReplaceIdem v (Q.NonNegative i) (Q.NonNegative j) = let x = getAtIdx v idx dep in case x of Nothing -> True Just st -> rep st where idx = Idx i j rep (SubT v') = replaceAtIdx v idx v' == Just v -------------------------------------------------------------------------------- -- Morally, getAtIdx v idx Nothing == rootLabel $ getIdxForest (subTypes v) idx -- -- That is, they return the same value, except getIdxForest returns the whole -- tree.
734
prop_getReplaceIdem :: Tree Int -> Q.NonNegative Int -> Q.NonNegative Int -> Bool prop_getReplaceIdem v (Q.NonNegative i) (Q.NonNegative j) = let x = getAtIdx v idx dep in case x of Nothing -> True Just st -> rep st where idx = Idx i j rep (SubT v') = replaceAtIdx v idx v' == Just v -------------------------------------------------------------------------------- -- Morally, getAtIdx v idx Nothing == rootLabel $ getIdxForest (subTypes v) idx -- -- That is, they return the same value, except getIdxForest returns the whole -- tree.
556
prop_getReplaceIdem v (Q.NonNegative i) (Q.NonNegative j) = let x = getAtIdx v idx dep in case x of Nothing -> True Just st -> rep st where idx = Idx i j rep (SubT v') = replaceAtIdx v idx v' == Just v -------------------------------------------------------------------------------- -- Morally, getAtIdx v idx Nothing == rootLabel $ getIdxForest (subTypes v) idx -- -- That is, they return the same value, except getIdxForest returns the whole -- tree.
472
true
true
2
9
131
148
73
75
null
null
synsem/texhs
src/Text/Doc/Writer/Epub.hs
gpl-3.0
-- Try to read the cover image. readCoverImage :: Maybe FilePath -> IO (Maybe File) readCoverImage Nothing = return Nothing
123
readCoverImage :: Maybe FilePath -> IO (Maybe File) readCoverImage Nothing = return Nothing
91
readCoverImage Nothing = return Nothing
39
true
true
0
8
19
34
16
18
null
null
sgillespie/ghc
compiler/typecheck/TcPatSyn.hs
bsd-3-clause
-- Walk the whole pattern and for all ConPatOuts, collect the -- existentially-bound type variables and evidence binding variables. -- -- These are used in computing the type of a pattern synonym and also -- in generating matcher functions, since success continuations need -- to be passed these pattern-bound evidences. tcCollectEx :: LPat Id -> ( ([Var], VarSet) -- Existentially-bound type variables as a -- deterministically ordered list and a set. -- See Note [Deterministic FV] in FV , [EvVar] ) tcCollectEx pat = let (fv, evs) = go pat in (fvVarListVarSet fv, evs) where go :: LPat Id -> (FV, [EvVar]) go = go1 . unLoc go1 :: Pat Id -> (FV, [EvVar]) go1 (LazyPat p) = go p go1 (AsPat _ p) = go p go1 (ParPat p) = go p go1 (BangPat p) = go p go1 (ListPat ps _ _) = mergeMany . map go $ ps go1 (TuplePat ps _ _) = mergeMany . map go $ ps go1 (SumPat p _ _ _) = go p go1 (PArrPat ps _) = mergeMany . map go $ ps go1 (ViewPat _ p _) = go p go1 con@ConPatOut{} = merge (FV.mkFVs (pat_tvs con), pat_dicts con) $ goConDetails $ pat_args con go1 (SigPatOut p _) = go p go1 (CoPat _ p _) = go1 p go1 (NPlusKPat n k _ geq subtract _) = pprPanic "TODO: NPlusKPat" $ ppr n $$ ppr k $$ ppr geq $$ ppr subtract go1 _ = empty goConDetails :: HsConPatDetails Id -> (FV, [EvVar]) goConDetails (PrefixCon ps) = mergeMany . map go $ ps goConDetails (InfixCon p1 p2) = go p1 `merge` go p2 goConDetails (RecCon HsRecFields{ rec_flds = flds }) = mergeMany . map goRecFd $ flds goRecFd :: LHsRecField Id (LPat Id) -> (FV, [EvVar]) goRecFd (L _ HsRecField{ hsRecFieldArg = p }) = go p merge (vs1, evs1) (vs2, evs2) = (vs1 `unionFV` vs2, evs1 ++ evs2) mergeMany = foldr merge empty empty = (emptyFV, [])
1,982
tcCollectEx :: LPat Id -> ( ([Var], VarSet) -- Existentially-bound type variables as a -- deterministically ordered list and a set. -- See Note [Deterministic FV] in FV , [EvVar] ) tcCollectEx pat = let (fv, evs) = go pat in (fvVarListVarSet fv, evs) where go :: LPat Id -> (FV, [EvVar]) go = go1 . unLoc go1 :: Pat Id -> (FV, [EvVar]) go1 (LazyPat p) = go p go1 (AsPat _ p) = go p go1 (ParPat p) = go p go1 (BangPat p) = go p go1 (ListPat ps _ _) = mergeMany . map go $ ps go1 (TuplePat ps _ _) = mergeMany . map go $ ps go1 (SumPat p _ _ _) = go p go1 (PArrPat ps _) = mergeMany . map go $ ps go1 (ViewPat _ p _) = go p go1 con@ConPatOut{} = merge (FV.mkFVs (pat_tvs con), pat_dicts con) $ goConDetails $ pat_args con go1 (SigPatOut p _) = go p go1 (CoPat _ p _) = go1 p go1 (NPlusKPat n k _ geq subtract _) = pprPanic "TODO: NPlusKPat" $ ppr n $$ ppr k $$ ppr geq $$ ppr subtract go1 _ = empty goConDetails :: HsConPatDetails Id -> (FV, [EvVar]) goConDetails (PrefixCon ps) = mergeMany . map go $ ps goConDetails (InfixCon p1 p2) = go p1 `merge` go p2 goConDetails (RecCon HsRecFields{ rec_flds = flds }) = mergeMany . map goRecFd $ flds goRecFd :: LHsRecField Id (LPat Id) -> (FV, [EvVar]) goRecFd (L _ HsRecField{ hsRecFieldArg = p }) = go p merge (vs1, evs1) (vs2, evs2) = (vs1 `unionFV` vs2, evs1 ++ evs2) mergeMany = foldr merge empty empty = (emptyFV, [])
1,661
tcCollectEx pat = let (fv, evs) = go pat in (fvVarListVarSet fv, evs) where go :: LPat Id -> (FV, [EvVar]) go = go1 . unLoc go1 :: Pat Id -> (FV, [EvVar]) go1 (LazyPat p) = go p go1 (AsPat _ p) = go p go1 (ParPat p) = go p go1 (BangPat p) = go p go1 (ListPat ps _ _) = mergeMany . map go $ ps go1 (TuplePat ps _ _) = mergeMany . map go $ ps go1 (SumPat p _ _ _) = go p go1 (PArrPat ps _) = mergeMany . map go $ ps go1 (ViewPat _ p _) = go p go1 con@ConPatOut{} = merge (FV.mkFVs (pat_tvs con), pat_dicts con) $ goConDetails $ pat_args con go1 (SigPatOut p _) = go p go1 (CoPat _ p _) = go1 p go1 (NPlusKPat n k _ geq subtract _) = pprPanic "TODO: NPlusKPat" $ ppr n $$ ppr k $$ ppr geq $$ ppr subtract go1 _ = empty goConDetails :: HsConPatDetails Id -> (FV, [EvVar]) goConDetails (PrefixCon ps) = mergeMany . map go $ ps goConDetails (InfixCon p1 p2) = go p1 `merge` go p2 goConDetails (RecCon HsRecFields{ rec_flds = flds }) = mergeMany . map goRecFd $ flds goRecFd :: LHsRecField Id (LPat Id) -> (FV, [EvVar]) goRecFd (L _ HsRecField{ hsRecFieldArg = p }) = go p merge (vs1, evs1) (vs2, evs2) = (vs1 `unionFV` vs2, evs1 ++ evs2) mergeMany = foldr merge empty empty = (emptyFV, [])
1,420
true
true
0
11
626
715
365
350
null
null
zaxtax/hakaru
haskell/Examples/Slam.hs
bsd-3-clause
-- ^ vel, alpha vel :: (Base repr) => repr Steering -> repr Vel vel steer = unpair steer $ \v _ -> v
101
vel :: (Base repr) => repr Steering -> repr Vel vel steer = unpair steer $ \v _ -> v
84
vel steer = unpair steer $ \v _ -> v
36
true
true
0
7
24
48
24
24
null
null
brendanhay/gogol
gogol-customsearch/gen/Network/Google/CustomSearch/Types/Product.hs
mpl-2.0
-- | The character encoding supported for search results. sqnpiOutputEncoding :: Lens' SearchQueriesNextPageItem (Maybe Text) sqnpiOutputEncoding = lens _sqnpiOutputEncoding (\ s a -> s{_sqnpiOutputEncoding = a})
220
sqnpiOutputEncoding :: Lens' SearchQueriesNextPageItem (Maybe Text) sqnpiOutputEncoding = lens _sqnpiOutputEncoding (\ s a -> s{_sqnpiOutputEncoding = a})
162
sqnpiOutputEncoding = lens _sqnpiOutputEncoding (\ s a -> s{_sqnpiOutputEncoding = a})
94
true
true
1
9
33
52
25
27
null
null
LudvikGalois/Fay-IFS
Sierpinski.hs
gpl-3.0
simulateIFS :: IFS -> (Double,Double) -> [Probability] -> [(Double,Double)] simulateIFS _ _ [] = []
99
simulateIFS :: IFS -> (Double,Double) -> [Probability] -> [(Double,Double)] simulateIFS _ _ [] = []
99
simulateIFS _ _ [] = []
23
false
true
0
9
14
52
29
23
null
null
bixuanzju/full-version
src/Syntax.hs
gpl-3.0
isVal (F{}) = True
18
isVal (F{}) = True
18
isVal (F{}) = True
18
false
false
0
7
3
16
8
8
null
null
mariefarrell/Hets
Common/Doc.hs
gpl-2.0
makeLabel :: LabelKind -> TextKind -> String -> Id -> Doc makeLabel l k s i = Text (IdLabel l k i) s
100
makeLabel :: LabelKind -> TextKind -> String -> Id -> Doc makeLabel l k s i = Text (IdLabel l k i) s
100
makeLabel l k s i = Text (IdLabel l k i) s
42
false
true
0
8
22
51
25
26
null
null
jean-edouard/manager
xenmgr/Vm/Templates.hs
gpl-2.0
getChildServiceVmTemplate :: String -> IO ConfigTemplate getChildServiceVmTemplate tag = getAnyVmTemplate ("child-" ++ tag)
123
getChildServiceVmTemplate :: String -> IO ConfigTemplate getChildServiceVmTemplate tag = getAnyVmTemplate ("child-" ++ tag)
123
getChildServiceVmTemplate tag = getAnyVmTemplate ("child-" ++ tag)
66
false
true
0
7
12
31
15
16
null
null
spechub/Hets
ExtModal/Parse_AS.hs
gpl-2.0
rigor :: AParser st Bool rigor = (asKey rigidS >> return True) <|> (asKey flexibleS >> return False)
108
rigor :: AParser st Bool rigor = (asKey rigidS >> return True) <|> (asKey flexibleS >> return False)
108
rigor = (asKey rigidS >> return True) <|> (asKey flexibleS >> return False)
83
false
true
0
8
25
46
22
24
null
null
hon1nbo/dotfiles
.scripts/arch/desktop/xmonad/xmonad-config/xmonad.hs
mit
------------------------------------------------------------------------ -- Workspaces -- The default number of workspaces (virtual screens) and their names. -- myWorkspaces = ["1:term","2:web","3:code","4:vm","5:media"] ++ map show [6..9]
239
myWorkspaces = ["1:term","2:web","3:code","4:vm","5:media"] ++ map show [6..9]
78
myWorkspaces = ["1:term","2:web","3:code","4:vm","5:media"] ++ map show [6..9]
78
true
false
0
7
21
39
24
15
null
null
nushio3/ghc
compiler/utils/Outputable.hs
bsd-3-clause
colon = docToSDoc $ Pretty.colon
37
colon = docToSDoc $ Pretty.colon
37
colon = docToSDoc $ Pretty.colon
37
false
false
0
6
9
12
6
6
null
null
arekfu/project_euler
p0102/p0102.hs
mit
eol = char '\n'
15
eol = char '\n'
15
eol = char '\n'
15
false
false
1
5
3
12
4
8
null
null
GaloisInc/sk-dev-platform
libs/lobster/src/Lobster/Symbion.hs
bsd-3-clause
deleteNodes :: (Eq a) => [a] -> LGraph a -> LGraph a deleteNodes xs g = foldr deleteNode g xs
93
deleteNodes :: (Eq a) => [a] -> LGraph a -> LGraph a deleteNodes xs g = foldr deleteNode g xs
93
deleteNodes xs g = foldr deleteNode g xs
40
false
true
0
8
19
49
24
25
null
null
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/Bare/OfType.hs
bsd-3-clause
mkSpecType :: SourcePos -> BareType -> BareM SpecType mkSpecType l t = mkSpecType' l (ty_preds $ toRTypeRep t) t
114
mkSpecType :: SourcePos -> BareType -> BareM SpecType mkSpecType l t = mkSpecType' l (ty_preds $ toRTypeRep t) t
114
mkSpecType l t = mkSpecType' l (ty_preds $ toRTypeRep t) t
60
false
true
0
8
20
44
21
23
null
null
bos/text
tests/Tests/Properties/Builder.hs
bsd-2-clause
tb_decimal_word64 (a::Word64) = tb_decimal a
44
tb_decimal_word64 (a::Word64) = tb_decimal a
44
tb_decimal_word64 (a::Word64) = tb_decimal a
44
false
false
0
7
4
19
9
10
null
null
DatePaper616/code
BoolCalc.hs
apache-2.0
(.*.) :: Int -> Map.Map a Int -> Map.Map a Int (.*.) x y = Map.map ((*) x) y
77
(.*.) :: Int -> Map.Map a Int -> Map.Map a Int (.*.) x y = Map.map ((*) x) y
76
(.*.) x y = Map.map ((*) x) y
29
false
true
0
9
19
63
31
32
null
null
mpickering/HaRe
src/Language/Haskell/Refact/Utils/Variables.hs
bsd-3-clause
defines:: GHC.Name -> GHC.LHsBind GHC.Name -> Bool defines n (GHC.L _ (GHC.FunBind (GHC.L _ pname) _ _ _ _ _)) = GHC.nameUnique pname == GHC.nameUnique n
154
defines:: GHC.Name -> GHC.LHsBind GHC.Name -> Bool defines n (GHC.L _ (GHC.FunBind (GHC.L _ pname) _ _ _ _ _)) = GHC.nameUnique pname == GHC.nameUnique n
154
defines n (GHC.L _ (GHC.FunBind (GHC.L _ pname) _ _ _ _ _)) = GHC.nameUnique pname == GHC.nameUnique n
103
false
true
0
11
26
91
42
49
null
null
yliu120/K3
src/Language/K3/Parser.hs
apache-2.0
iArrow :: String -> K3Parser Identifier iArrow k = iPrefix k <* symbol "->"
75
iArrow :: String -> K3Parser Identifier iArrow k = iPrefix k <* symbol "->"
75
iArrow k = iPrefix k <* symbol "->"
35
false
true
0
6
13
31
14
17
null
null
qrilka/xlsx
src/Codec/Xlsx/Writer.hs
mit
relsCT :: Text relsCT = "application/vnd.openxmlformats-package.relationships+xml"
82
relsCT :: Text relsCT = "application/vnd.openxmlformats-package.relationships+xml"
82
relsCT = "application/vnd.openxmlformats-package.relationships+xml"
67
false
true
0
4
5
11
6
5
null
null
brendanhay/amazonka-limited
src/Network/AWS/Internal/Signing.hs
mpl-2.0
signed :: StdMethod -> ByteString -> ByteString -> ByteString -> [Header] -> RequestBody -> Request signed meth host path qs hs body = def { secure = True , method = BS.pack $ show meth , host = host , port = 443 , path = path , queryString = qs , requestHeaders = hs , requestBody = body , checkStatus = \_ _ _ -> Nothing }
461
signed :: StdMethod -> ByteString -> ByteString -> ByteString -> [Header] -> RequestBody -> Request signed meth host path qs hs body = def { secure = True , method = BS.pack $ show meth , host = host , port = 443 , path = path , queryString = qs , requestHeaders = hs , requestBody = body , checkStatus = \_ _ _ -> Nothing }
461
signed meth host path qs hs body = def { secure = True , method = BS.pack $ show meth , host = host , port = 443 , path = path , queryString = qs , requestHeaders = hs , requestBody = body , checkStatus = \_ _ _ -> Nothing }
319
false
true
0
10
204
125
72
53
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
-- These PrimOps are NOPs in Cmm nopOp :: PrimOp -> Bool nopOp Int2WordOp = True
85
nopOp :: PrimOp -> Bool nopOp Int2WordOp = True
51
nopOp Int2WordOp = True
27
true
true
0
5
20
19
10
9
null
null
mstksg/hledger
hledger-lib/Hledger/Read/TimedotReader.hs
gpl-3.0
tests_Hledger_Read_TimedotReader = TestList [ ]
48
tests_Hledger_Read_TimedotReader = TestList [ ]
48
tests_Hledger_Read_TimedotReader = TestList [ ]
48
false
false
0
6
5
11
5
6
null
null
joshcough/L5-Haskell
src/L/Registers.hs
mit
rsi, rdi, rbp, rsp, rax, rbx, rcx, rdx, r8, r9, r10, r11, r12, r13, r14, r15 :: AsRegister t => t rsi = _Register # Rsi
119
rsi, rdi, rbp, rsp, rax, rbx, rcx, rdx, r8, r9, r10, r11, r12, r13, r14, r15 :: AsRegister t => t rsi = _Register # Rsi
119
rsi = _Register # Rsi
21
false
true
11
6
25
73
41
32
null
null
Regulareveryday/our_sorting_algos
.stack-work/dist/b7fec021/build/autogen/Paths_our_sorting_algos.hs
bsd-3-clause
getLibDir = catchIO (getEnv "our_sorting_algos_libdir") (\_ -> return libdir)
77
getLibDir = catchIO (getEnv "our_sorting_algos_libdir") (\_ -> return libdir)
77
getLibDir = catchIO (getEnv "our_sorting_algos_libdir") (\_ -> return libdir)
77
false
false
1
8
8
32
14
18
null
null
anand-singh/either
src/Data/Either/Combinators.hs
bsd-3-clause
-- | The 'mapBoth' function takes two functions and applies the first if iff the value -- takes the form @'Left' _@ and the second if the value takes the form @'Right' _@. -- -- Using @Data.Bifunctor@: -- -- @ -- 'mapBoth' = bimap -- @ -- -- Using @Control.Arrow@: -- -- @ -- 'mapBoth' = ('Control.Arrow.+++') -- @ -- -- >>> mapBoth (*2) (*3) (Left 4) -- Left 8 -- -- >>> mapBoth (*2) (*3) (Right 4) -- Right 12 mapBoth :: (a -> c) -> (b -> d) -> Either a b -> Either c d mapBoth f _ (Left x) = Left (f x)
506
mapBoth :: (a -> c) -> (b -> d) -> Either a b -> Either c d mapBoth f _ (Left x) = Left (f x)
94
mapBoth f _ (Left x) = Left (f x)
34
true
true
0
8
107
89
54
35
null
null
kylcarte/type-combinators-quote
src/Data/Type/Quote.hs
bsd-3-clause
-- List Util {{{ readMaybeList :: Read a => String -> [a] readMaybeList = maybeToList . readMaybe
98
readMaybeList :: Read a => String -> [a] readMaybeList = maybeToList . readMaybe
80
readMaybeList = maybeToList . readMaybe
39
true
true
0
7
17
30
16
14
null
null