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
spechub/Hets
CASL/CCC/FreeTypes.hs
gpl-2.0
getNefsorts :: Set.Set SORT -> Set.Set SORT -> Set.Set SORT -> (Set.Set SORT, [OP_SYMB]) -> Set.Set SORT getNefsorts oldSorts nSorts esorts (srts, cons) = Set.difference fsorts $ inhabited oldSorts cons where fsorts = Set.difference (Set.intersection nSorts srts) esorts
278
getNefsorts :: Set.Set SORT -> Set.Set SORT -> Set.Set SORT -> (Set.Set SORT, [OP_SYMB]) -> Set.Set SORT getNefsorts oldSorts nSorts esorts (srts, cons) = Set.difference fsorts $ inhabited oldSorts cons where fsorts = Set.difference (Set.intersection nSorts srts) esorts
278
getNefsorts oldSorts nSorts esorts (srts, cons) = Set.difference fsorts $ inhabited oldSorts cons where fsorts = Set.difference (Set.intersection nSorts srts) esorts
171
false
true
0
12
45
115
56
59
null
null
snoyberg/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
shouldInlinePrimOp dflags CloneSmallArrayOp [src, src_off, (CmmLit (CmmInt n w))] | wordsToBytes dflags (asUnsigned w n) <= fromIntegral (maxInlineAllocSize dflags) = Just $ \ [res] -> emitCloneSmallArray mkSMAP_FROZEN_infoLabel res src src_off (fromInteger n)
268
shouldInlinePrimOp dflags CloneSmallArrayOp [src, src_off, (CmmLit (CmmInt n w))] | wordsToBytes dflags (asUnsigned w n) <= fromIntegral (maxInlineAllocSize dflags) = Just $ \ [res] -> emitCloneSmallArray mkSMAP_FROZEN_infoLabel res src src_off (fromInteger n)
268
shouldInlinePrimOp dflags CloneSmallArrayOp [src, src_off, (CmmLit (CmmInt n w))] | wordsToBytes dflags (asUnsigned w n) <= fromIntegral (maxInlineAllocSize dflags) = Just $ \ [res] -> emitCloneSmallArray mkSMAP_FROZEN_infoLabel res src src_off (fromInteger n)
268
false
false
0
11
39
97
48
49
null
null
kalouantonis/kriek
src/hs/Kriek/Scanner.hs
mit
scanList f = left (Expected "List")
35
scanList f = left (Expected "List")
35
scanList f = left (Expected "List")
35
false
false
0
7
5
18
8
10
null
null
DavidAlphaFox/bittorrent
src/Network/BitTorrent/Tracker/Message.hs
bsd-3-clause
connectId, announceId, scrapeId, errorId :: MessageId connectId = 0
68
connectId, announceId, scrapeId, errorId :: MessageId connectId = 0
68
connectId = 0
14
false
true
5
5
9
29
12
17
null
null
vrtree/pedestal
app/Types.hs
bsd-3-clause
-- Offset of frame behind painting roomOffset :: V3 GLfloat roomOffset = V3 0 (roomHeight/2) 0
94
roomOffset :: V3 GLfloat roomOffset = V3 0 (roomHeight/2) 0
59
roomOffset = V3 0 (roomHeight/2) 0
34
true
true
0
7
15
29
15
14
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\xF930' = "\x64C4"
33
decomposeChar '\xF930' = "\x64C4"
33
decomposeChar '\xF930' = "\x64C4"
33
false
false
0
4
3
10
4
6
null
null
mrehayden1/lji
src/LJI/Output.hs
bsd-3-clause
-- Constants ---- barLength :: Dur barLength = (1 % 1)
55
barLength :: Dur barLength = (1 % 1)
36
barLength = (1 % 1)
19
true
true
0
7
11
26
12
14
null
null
mrak/coreutils.hs
src/tr/Args.hs
mit
c2w8 :: Char -> Word8 c2w8 = fromIntegral . ord
47
c2w8 :: Char -> Word8 c2w8 = fromIntegral . ord
47
c2w8 = fromIntegral . ord
25
false
true
0
5
9
19
10
9
null
null
alexander-at-github/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
tagOf_PrimOp NoDuplicateOp = _ILIT(362)
39
tagOf_PrimOp NoDuplicateOp = _ILIT(362)
39
tagOf_PrimOp NoDuplicateOp = _ILIT(362)
39
false
false
0
6
3
15
7
8
null
null
skogsbaer/HTF
tests/real-bbt/SortByPrevTime.hs
lgpl-2.1
test_fast :: IO () test_fast = return ()
40
test_fast :: IO () test_fast = return ()
40
test_fast = return ()
21
false
true
0
6
7
21
10
11
null
null
spinda/liquidhaskell
src/Language/Haskell/Liquid/Desugar710/DsCCall.hs
bsd-3-clause
dsCCall :: CLabelString -- C routine to invoke -> [CoreExpr] -- Arguments (desugared) -> Safety -- Safety of the call -> Type -- Type of the result: IO t -> DsM CoreExpr -- Result, of type ??? dsCCall lbl args may_gc result_ty = do (unboxed_args, arg_wrappers) <- mapAndUnzipM unboxArg args (ccall_result_ty, res_wrapper) <- boxResult result_ty uniq <- newUnique dflags <- getDynFlags let target = StaticTarget lbl Nothing True the_fcall = CCall (CCallSpec target CCallConv may_gc) the_prim_app = mkFCall dflags uniq the_fcall unboxed_args ccall_result_ty return (foldr ($) (res_wrapper the_prim_app) arg_wrappers)
736
dsCCall :: CLabelString -- C routine to invoke -> [CoreExpr] -- Arguments (desugared) -> Safety -- Safety of the call -> Type -- Type of the result: IO t -> DsM CoreExpr dsCCall lbl args may_gc result_ty = do (unboxed_args, arg_wrappers) <- mapAndUnzipM unboxArg args (ccall_result_ty, res_wrapper) <- boxResult result_ty uniq <- newUnique dflags <- getDynFlags let target = StaticTarget lbl Nothing True the_fcall = CCall (CCallSpec target CCallConv may_gc) the_prim_app = mkFCall dflags uniq the_fcall unboxed_args ccall_result_ty return (foldr ($) (res_wrapper the_prim_app) arg_wrappers)
712
dsCCall lbl args may_gc result_ty = do (unboxed_args, arg_wrappers) <- mapAndUnzipM unboxArg args (ccall_result_ty, res_wrapper) <- boxResult result_ty uniq <- newUnique dflags <- getDynFlags let target = StaticTarget lbl Nothing True the_fcall = CCall (CCallSpec target CCallConv may_gc) the_prim_app = mkFCall dflags uniq the_fcall unboxed_args ccall_result_ty return (foldr ($) (res_wrapper the_prim_app) arg_wrappers)
494
true
true
0
13
210
174
86
88
null
null
jchl/icfp2014
src/GCC.hs
mit
parseInstruction "CEQ" [] = CEQ
31
parseInstruction "CEQ" [] = CEQ
31
parseInstruction "CEQ" [] = CEQ
31
false
false
1
5
4
18
6
12
null
null
sinelaw/lamdu
Lamdu/Sugar/Convert.hs
gpl-3.0
rewriteFieldParamTypes :: MonadA m => ExprIRef.ExpressionIM m -> [ExprField m] -> T m () rewriteFieldParamTypes paramTypeI fields = ExprIRef.writeExprBody paramTypeI . Expr.BodyRecord $ Expr.Record KType fields
216
rewriteFieldParamTypes :: MonadA m => ExprIRef.ExpressionIM m -> [ExprField m] -> T m () rewriteFieldParamTypes paramTypeI fields = ExprIRef.writeExprBody paramTypeI . Expr.BodyRecord $ Expr.Record KType fields
216
rewriteFieldParamTypes paramTypeI fields = ExprIRef.writeExprBody paramTypeI . Expr.BodyRecord $ Expr.Record KType fields
125
false
true
0
9
31
71
33
38
null
null
rgleichman/roshask
src/executable/Parse.hs
bsd-3-clause
simpleFieldAssoc :: [(MsgType, ByteString)] simpleFieldAssoc = map (id &&& B.pack . map toLower . tail . show) simpleFieldTypes
151
simpleFieldAssoc :: [(MsgType, ByteString)] simpleFieldAssoc = map (id &&& B.pack . map toLower . tail . show) simpleFieldTypes
151
simpleFieldAssoc = map (id &&& B.pack . map toLower . tail . show) simpleFieldTypes
107
false
true
0
11
41
55
27
28
null
null
Peaker/bindings-GLFW
Test.hs
bsd-2-clause
giveItTime :: IO () giveItTime = threadDelay 500000
51
giveItTime :: IO () giveItTime = threadDelay 500000
51
giveItTime = threadDelay 500000
31
false
true
0
6
7
19
9
10
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
1303 = 1302
11
1303 = 1302
11
1303 = 1302
11
false
false
1
5
2
10
3
7
null
null
a-suenami/yesod-sample
devel.hs
mit
main :: IO () main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app loop
171
main :: IO () main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app loop
171
main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app loop
157
false
true
0
10
38
58
27
31
null
null
kishoredbn/barrelfish
tools/skate/CAbsSyntax.hs
mit
pp_unit (GVarDecl sc cs ts s (Just e)) = [ printf "%s%s%s = %s;" (pp_scopespec sc) (pp_constspec cs) (pp_typespec ts s) (pp_expr e) ]
205
pp_unit (GVarDecl sc cs ts s (Just e)) = [ printf "%s%s%s = %s;" (pp_scopespec sc) (pp_constspec cs) (pp_typespec ts s) (pp_expr e) ]
205
pp_unit (GVarDecl sc cs ts s (Just e)) = [ printf "%s%s%s = %s;" (pp_scopespec sc) (pp_constspec cs) (pp_typespec ts s) (pp_expr e) ]
205
false
false
0
8
95
70
34
36
null
null
Szczyp/lolstats
Main.hs
gpl-3.0
mainApp :: App GameInfo mainApp = getSummonerId >>= getCurrentGame
66
mainApp :: App GameInfo mainApp = getSummonerId >>= getCurrentGame
66
mainApp = getSummonerId >>= getCurrentGame
42
false
true
0
6
8
24
10
14
null
null
apyrgio/ganeti
src/Ganeti/Query/Filter.hs
bsd-2-clause
regexpFilter _ x = Bad . ParameterError $ "Invalid field value used in regexp matching,\ \ expecting string but got '" ++ show (pp_value x) ++ "'"
156
regexpFilter _ x = Bad . ParameterError $ "Invalid field value used in regexp matching,\ \ expecting string but got '" ++ show (pp_value x) ++ "'"
156
regexpFilter _ x = Bad . ParameterError $ "Invalid field value used in regexp matching,\ \ expecting string but got '" ++ show (pp_value x) ++ "'"
156
false
false
1
9
36
38
17
21
null
null
sopvop/cabal
cabal-install/Distribution/Solver/Types/ComponentDeps.hs
bsd-3-clause
-- | All dependencies of a package. -- -- This is just a synonym for 'fold', but perhaps a use of 'flatDeps' is more -- obvious than a use of 'fold', and moreover this avoids introducing lots of -- @#ifdef@s for 7.10 just for the use of 'fold'. flatDeps :: Monoid a => ComponentDeps a -> a flatDeps = fold
305
flatDeps :: Monoid a => ComponentDeps a -> a flatDeps = fold
60
flatDeps = fold
15
true
true
0
8
59
37
18
19
null
null
ezyang/ghc
compiler/main/TidyPgm.hs
bsd-3-clause
run :: DFFV () -> [Id] run (DFFV m) = case m emptyVarSet (emptyVarSet, []) of ((_,ids),_) -> ids
113
run :: DFFV () -> [Id] run (DFFV m) = case m emptyVarSet (emptyVarSet, []) of ((_,ids),_) -> ids
113
run (DFFV m) = case m emptyVarSet (emptyVarSet, []) of ((_,ids),_) -> ids
90
false
true
0
9
35
72
37
35
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
185 = 184
9
185 = 184
9
185 = 184
9
false
false
1
5
2
10
3
7
null
null
fffej/HS-Poker
LookupPatternMatch.hs
bsd-3-clause
getValueFromProduct 492745 = 4773
33
getValueFromProduct 492745 = 4773
33
getValueFromProduct 492745 = 4773
33
false
false
0
5
3
9
4
5
null
null
sajith/cis194
hw04/HOP.hs
mit
foldTree :: [a] -> Tree a foldTree = foldr add Leaf
51
foldTree :: [a] -> Tree a foldTree = foldr add Leaf
51
foldTree = foldr add Leaf
25
false
true
0
7
10
33
14
19
null
null
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/TransformFeedback2.hs
bsd-3-clause
gl_TRANSFORM_FEEDBACK_BUFFER_PAUSED :: GLenum gl_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23
90
gl_TRANSFORM_FEEDBACK_BUFFER_PAUSED :: GLenum gl_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23
90
gl_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23
44
false
true
0
4
5
11
6
5
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
isUnitTy = is_tc unitTyConKey
35
isUnitTy = is_tc unitTyConKey
35
isUnitTy = is_tc unitTyConKey
35
false
false
1
5
9
13
4
9
null
null
randen/cabal
cabal-install/Distribution/Client/Install.hs
bsd-3-clause
planPackages :: Compiler -> Platform -> Maybe SandboxPackageInfo -> Solver -> ConfigFlags -> ConfigExFlags -> InstallFlags -> InstalledPackageIndex -> SourcePackageDb -> [PackageSpecifier SourcePackage] -> Progress String String InstallPlan planPackages comp platform mSandboxPkgInfo solver configFlags configExFlags installFlags installedPkgIndex sourcePkgDb pkgSpecifiers = resolveDependencies platform (compilerInfo comp) solver resolverParams >>= if onlyDeps then pruneInstallPlan pkgSpecifiers else return where resolverParams = setMaxBackjumps (if maxBackjumps < 0 then Nothing else Just maxBackjumps) . setIndependentGoals independentGoals . setReorderGoals reorderGoals . setAvoidReinstalls avoidReinstalls . setShadowPkgs shadowPkgs . setStrongFlags strongFlags . setPreferenceDefault (if upgradeDeps then PreferAllLatest else PreferLatestForSelected) . removeUpperBounds allowNewer . addPreferences -- preferences from the config file or command line [ PackageVersionPreference name ver | Dependency name ver <- configPreferences configExFlags ] . addConstraints -- version constraints from the config file or command line [ LabeledPackageConstraint (userToPackageConstraint pc) src | (pc, src) <- configExConstraints configExFlags ] . addConstraints --FIXME: this just applies all flags to all targets which -- is silly. We should check if the flags are appropriate [ let pc = PackageConstraintFlags (pkgSpecifierTarget pkgSpecifier) flags in LabeledPackageConstraint pc ConstraintSourceConfigFlagOrTarget | let flags = configConfigurationsFlags configFlags , not (null flags) , pkgSpecifier <- pkgSpecifiers ] . addConstraints [ let pc = PackageConstraintStanzas (pkgSpecifierTarget pkgSpecifier) stanzas in LabeledPackageConstraint pc ConstraintSourceConfigFlagOrTarget | pkgSpecifier <- pkgSpecifiers ] . maybe id applySandboxInstallPolicy mSandboxPkgInfo . (if reinstall then reinstallTargets else id) $ standardInstallPolicy installedPkgIndex sourcePkgDb pkgSpecifiers stanzas = concat [ if testsEnabled then [TestStanzas] else [] , if benchmarksEnabled then [BenchStanzas] else [] ] testsEnabled = fromFlagOrDefault False $ configTests configFlags benchmarksEnabled = fromFlagOrDefault False $ configBenchmarks configFlags reinstall = fromFlag (installOverrideReinstall installFlags) || fromFlag (installReinstall installFlags) reorderGoals = fromFlag (installReorderGoals installFlags) independentGoals = fromFlag (installIndependentGoals installFlags) avoidReinstalls = fromFlag (installAvoidReinstalls installFlags) shadowPkgs = fromFlag (installShadowPkgs installFlags) strongFlags = fromFlag (installStrongFlags installFlags) maxBackjumps = fromFlag (installMaxBackjumps installFlags) upgradeDeps = fromFlag (installUpgradeDeps installFlags) onlyDeps = fromFlag (installOnlyDeps installFlags) allowNewer = fromFlag (configAllowNewer configExFlags) -- | Remove the provided targets from the install plan.
3,752
planPackages :: Compiler -> Platform -> Maybe SandboxPackageInfo -> Solver -> ConfigFlags -> ConfigExFlags -> InstallFlags -> InstalledPackageIndex -> SourcePackageDb -> [PackageSpecifier SourcePackage] -> Progress String String InstallPlan planPackages comp platform mSandboxPkgInfo solver configFlags configExFlags installFlags installedPkgIndex sourcePkgDb pkgSpecifiers = resolveDependencies platform (compilerInfo comp) solver resolverParams >>= if onlyDeps then pruneInstallPlan pkgSpecifiers else return where resolverParams = setMaxBackjumps (if maxBackjumps < 0 then Nothing else Just maxBackjumps) . setIndependentGoals independentGoals . setReorderGoals reorderGoals . setAvoidReinstalls avoidReinstalls . setShadowPkgs shadowPkgs . setStrongFlags strongFlags . setPreferenceDefault (if upgradeDeps then PreferAllLatest else PreferLatestForSelected) . removeUpperBounds allowNewer . addPreferences -- preferences from the config file or command line [ PackageVersionPreference name ver | Dependency name ver <- configPreferences configExFlags ] . addConstraints -- version constraints from the config file or command line [ LabeledPackageConstraint (userToPackageConstraint pc) src | (pc, src) <- configExConstraints configExFlags ] . addConstraints --FIXME: this just applies all flags to all targets which -- is silly. We should check if the flags are appropriate [ let pc = PackageConstraintFlags (pkgSpecifierTarget pkgSpecifier) flags in LabeledPackageConstraint pc ConstraintSourceConfigFlagOrTarget | let flags = configConfigurationsFlags configFlags , not (null flags) , pkgSpecifier <- pkgSpecifiers ] . addConstraints [ let pc = PackageConstraintStanzas (pkgSpecifierTarget pkgSpecifier) stanzas in LabeledPackageConstraint pc ConstraintSourceConfigFlagOrTarget | pkgSpecifier <- pkgSpecifiers ] . maybe id applySandboxInstallPolicy mSandboxPkgInfo . (if reinstall then reinstallTargets else id) $ standardInstallPolicy installedPkgIndex sourcePkgDb pkgSpecifiers stanzas = concat [ if testsEnabled then [TestStanzas] else [] , if benchmarksEnabled then [BenchStanzas] else [] ] testsEnabled = fromFlagOrDefault False $ configTests configFlags benchmarksEnabled = fromFlagOrDefault False $ configBenchmarks configFlags reinstall = fromFlag (installOverrideReinstall installFlags) || fromFlag (installReinstall installFlags) reorderGoals = fromFlag (installReorderGoals installFlags) independentGoals = fromFlag (installIndependentGoals installFlags) avoidReinstalls = fromFlag (installAvoidReinstalls installFlags) shadowPkgs = fromFlag (installShadowPkgs installFlags) strongFlags = fromFlag (installStrongFlags installFlags) maxBackjumps = fromFlag (installMaxBackjumps installFlags) upgradeDeps = fromFlag (installUpgradeDeps installFlags) onlyDeps = fromFlag (installOnlyDeps installFlags) allowNewer = fromFlag (configAllowNewer configExFlags) -- | Remove the provided targets from the install plan.
3,752
planPackages comp platform mSandboxPkgInfo solver configFlags configExFlags installFlags installedPkgIndex sourcePkgDb pkgSpecifiers = resolveDependencies platform (compilerInfo comp) solver resolverParams >>= if onlyDeps then pruneInstallPlan pkgSpecifiers else return where resolverParams = setMaxBackjumps (if maxBackjumps < 0 then Nothing else Just maxBackjumps) . setIndependentGoals independentGoals . setReorderGoals reorderGoals . setAvoidReinstalls avoidReinstalls . setShadowPkgs shadowPkgs . setStrongFlags strongFlags . setPreferenceDefault (if upgradeDeps then PreferAllLatest else PreferLatestForSelected) . removeUpperBounds allowNewer . addPreferences -- preferences from the config file or command line [ PackageVersionPreference name ver | Dependency name ver <- configPreferences configExFlags ] . addConstraints -- version constraints from the config file or command line [ LabeledPackageConstraint (userToPackageConstraint pc) src | (pc, src) <- configExConstraints configExFlags ] . addConstraints --FIXME: this just applies all flags to all targets which -- is silly. We should check if the flags are appropriate [ let pc = PackageConstraintFlags (pkgSpecifierTarget pkgSpecifier) flags in LabeledPackageConstraint pc ConstraintSourceConfigFlagOrTarget | let flags = configConfigurationsFlags configFlags , not (null flags) , pkgSpecifier <- pkgSpecifiers ] . addConstraints [ let pc = PackageConstraintStanzas (pkgSpecifierTarget pkgSpecifier) stanzas in LabeledPackageConstraint pc ConstraintSourceConfigFlagOrTarget | pkgSpecifier <- pkgSpecifiers ] . maybe id applySandboxInstallPolicy mSandboxPkgInfo . (if reinstall then reinstallTargets else id) $ standardInstallPolicy installedPkgIndex sourcePkgDb pkgSpecifiers stanzas = concat [ if testsEnabled then [TestStanzas] else [] , if benchmarksEnabled then [BenchStanzas] else [] ] testsEnabled = fromFlagOrDefault False $ configTests configFlags benchmarksEnabled = fromFlagOrDefault False $ configBenchmarks configFlags reinstall = fromFlag (installOverrideReinstall installFlags) || fromFlag (installReinstall installFlags) reorderGoals = fromFlag (installReorderGoals installFlags) independentGoals = fromFlag (installIndependentGoals installFlags) avoidReinstalls = fromFlag (installAvoidReinstalls installFlags) shadowPkgs = fromFlag (installShadowPkgs installFlags) strongFlags = fromFlag (installStrongFlags installFlags) maxBackjumps = fromFlag (installMaxBackjumps installFlags) upgradeDeps = fromFlag (installUpgradeDeps installFlags) onlyDeps = fromFlag (installOnlyDeps installFlags) allowNewer = fromFlag (configAllowNewer configExFlags) -- | Remove the provided targets from the install plan.
3,381
false
true
18
17
1,148
685
328
357
null
null
siddhanathan/ghc
libraries/base/Text/Printf.hs
bsd-3-clause
stoi :: String -> (Int, String) stoi cs = let (as, cs') = span isDigit cs in case as of "" -> (0, cs') _ -> (read as, cs') -- Figure out the FormatAdjustment, given: -- width, precision, left-adjust, zero-fill
224
stoi :: String -> (Int, String) stoi cs = let (as, cs') = span isDigit cs in case as of "" -> (0, cs') _ -> (read as, cs') -- Figure out the FormatAdjustment, given: -- width, precision, left-adjust, zero-fill
224
stoi cs = let (as, cs') = span isDigit cs in case as of "" -> (0, cs') _ -> (read as, cs') -- Figure out the FormatAdjustment, given: -- width, precision, left-adjust, zero-fill
192
false
true
0
12
54
86
44
42
null
null
nevrenato/HetsAlloy
Logic/Logic.hs
gpl-2.0
statError :: Language lid => lid -> String -> a statError lid = error . statErrMsg lid
86
statError :: Language lid => lid -> String -> a statError lid = error . statErrMsg lid
86
statError lid = error . statErrMsg lid
38
false
true
1
9
16
42
18
24
null
null
DanielSchuessler/logic-TPTP
Codec/TPTP/QuickCheck.hs
gpl-3.0
argsFreq :: (Int -> Gen a) -> Gen a argsFreq f = frequency [ (10,f 0) , (10,f 1) , (10,f 2) , (2 ,f 3) , (2 ,f 4) , (1, f 15) ]
271
argsFreq :: (Int -> Gen a) -> Gen a argsFreq f = frequency [ (10,f 0) , (10,f 1) , (10,f 2) , (2 ,f 3) , (2 ,f 4) , (1, f 15) ]
271
argsFreq f = frequency [ (10,f 0) , (10,f 1) , (10,f 2) , (2 ,f 3) , (2 ,f 4) , (1, f 15) ]
235
false
true
0
8
178
106
58
48
null
null
aretoky/egison2
hs-src/Compiler/egisonc.hs
mit
showUsage :: IO () showUsage = do putStrLn "egisonc: no input files"
70
showUsage :: IO () showUsage = do putStrLn "egisonc: no input files"
70
showUsage = do putStrLn "egisonc: no input files"
51
false
true
0
7
13
22
10
12
null
null
ganeti/ganeti
test/hs/Test/Ganeti/Rpc.hs
bsd-2-clause
genInstanceConsoleInfoParams :: Gen Rpc.InstanceConsoleInfoParams genInstanceConsoleInfoParams = Rpc.InstanceConsoleInfoParams <$> genInst <*> arbitrary <*> arbitrary <*> genHvParams <*> arbitrary
198
genInstanceConsoleInfoParams :: Gen Rpc.InstanceConsoleInfoParams genInstanceConsoleInfoParams = Rpc.InstanceConsoleInfoParams <$> genInst <*> arbitrary <*> arbitrary <*> genHvParams <*> arbitrary
198
genInstanceConsoleInfoParams = Rpc.InstanceConsoleInfoParams <$> genInst <*> arbitrary <*> arbitrary <*> genHvParams <*> arbitrary
132
false
true
0
10
18
38
19
19
null
null
brendanhay/gogol
gogol-servicecontrol/gen/Network/Google/ServiceControl/Types/Product.hs
mpl-2.0
-- | The labels associated with the peer. pLabels :: Lens' Peer (Maybe PeerLabels) pLabels = lens _pLabels (\ s a -> s{_pLabels = a})
133
pLabels :: Lens' Peer (Maybe PeerLabels) pLabels = lens _pLabels (\ s a -> s{_pLabels = a})
91
pLabels = lens _pLabels (\ s a -> s{_pLabels = a})
50
true
true
0
9
24
46
25
21
null
null
spetz911/progames
nehe-tuts-0.2.3/lesson07.hs
mit
keyPressed l f zd xs ys (GLFW.CharKey 'l') d = keyPressed l f zd xs ys (GLFW.CharKey 'L') d
93
keyPressed l f zd xs ys (GLFW.CharKey 'l') d = keyPressed l f zd xs ys (GLFW.CharKey 'L') d
93
keyPressed l f zd xs ys (GLFW.CharKey 'l') d = keyPressed l f zd xs ys (GLFW.CharKey 'L') d
93
false
false
0
8
20
52
25
27
null
null
sonyandy/tnt
Control/Monad/Code/Internal.hs
bsd-3-clause
ldcClass = ldcInsn lookupClass
30
ldcClass = ldcInsn lookupClass
30
ldcClass = ldcInsn lookupClass
30
false
false
0
5
3
9
4
5
null
null
alanz/hroq
src/Data/Concurrent/Queue/Roq/Mnesia.hs
bsd-3-clause
do_change_table_copy_type s bucket storageType = do logm $ "HroqMnesia.change_table_copy_type undefined for:" ++ (show (bucket,storageType)) return s
153
do_change_table_copy_type s bucket storageType = do logm $ "HroqMnesia.change_table_copy_type undefined for:" ++ (show (bucket,storageType)) return s
153
do_change_table_copy_type s bucket storageType = do logm $ "HroqMnesia.change_table_copy_type undefined for:" ++ (show (bucket,storageType)) return s
153
false
false
0
10
19
42
20
22
null
null
urbanslug/ghc
compiler/llvmGen/Llvm/Types.hs
bsd-3-clause
fixEndian = id
14
fixEndian = id
14
fixEndian = id
14
false
false
0
4
2
6
3
3
null
null
geophf/1HaskellADay
exercises/HAD/Y2017/M10/D02/Solution.hs
mit
-- and with the RawNames, raw2pers and insertPers you can insert the persons {-- >>> let rns = catMaybes (zipWith art2RawNames ixarts articles) >>> rns [Raw {fromArticle = 1, text = "Cuomo, Mario M"}, Raw {fromArticle = 2, text = "Reagan, Ronald Wilson"}, Raw {fromArticle = 3, text = "Obama, Barack Cameron, David"}, Raw {fromArticle = 4, text = "Armstrong, Karen"}, Raw {fromArticle = 5, text = "Cuomo, Mario M"}, Raw {fromArticle = 7, text = "Rivlin, Reuven"}, Raw {fromArticle = 8, text = "Francis (Pope)"}, Raw {fromArticle = 10, text = "Yingluck Shinawatra"}, Raw {fromArticle = 11, text = "Baraka, Amiri"}] >>> let pers = concatMap raw2persons rns >>> ixpers <- insertPers conn pers >>> length ixpers 10 --} -- Pivot tables --------------------------------------------------------------- {-- Last week you were able to scan the database, extract rows of name(s), parse the names, then store them as parsed entities in the database connected to the source article via a join-table. These join tables, also known as 'pivot tables,' are prevalent and follow a certain structure. Instead of the specific ArticlePersonJoin structure, we'll declare and use the general Pivot type here. data Pivot = Pvt { srcIx, trgId :: Integer } deriving (Eq, Ord, Show) joinValue :: Indexed i => i -> Index -> Pivot joinValue i j = Pvt (idx i) (idx j) -- and now we need a pivot-inserter instance ToRow Pivot where toRow (Pvt i j) = map toField [i,j] -- and to insert the pivots is simply using the pivot table insert statement, -- in this case insertArtPersJoinStmt, with the inserter function. -- Do that. How many name-pivots did you insert? >>> inserter conn insertArtPersJoinStmt (zipWith joinValue pers ixpers) --} -- The Pivot table functionality will be moved to Store.SQL.Util.Pivots {-- BONUS ----------------------------------------------------------------- Create an ETL process that automates all the steps here, from article extract from the compressed archive to storing all the above in the PostgreSQL database --} etlProcess :: FilePath -> Connection -> IO () etlProcess archive conn = do blocks <- extractBlocks <$> BL.readFile archive ixblks <- insertBlocks conn blocks let articles = join (zipWith block2Article ixblks blocks) ixarts <- insertArts conn articles let rns = catMaybes (zipWith art2RawNames ixarts articles) let pers = concatMap raw2persons rns ixpers <- insertPers conn pers inserter conn insertArtPersJoinStmt (zipWith joinValue pers ixpers) {-- >>> connectInfo ConnectInfo {connectHost = "...", ...} >>> conn <- connect it >>> etlProcess (dir ++ arts) conn >>> close conn $ select count(1) from article; 11 Sweet! --}
2,688
etlProcess :: FilePath -> Connection -> IO () etlProcess archive conn = do blocks <- extractBlocks <$> BL.readFile archive ixblks <- insertBlocks conn blocks let articles = join (zipWith block2Article ixblks blocks) ixarts <- insertArts conn articles let rns = catMaybes (zipWith art2RawNames ixarts articles) let pers = concatMap raw2persons rns ixpers <- insertPers conn pers inserter conn insertArtPersJoinStmt (zipWith joinValue pers ixpers) {-- >>> connectInfo ConnectInfo {connectHost = "...", ...} >>> conn <- connect it >>> etlProcess (dir ++ arts) conn >>> close conn $ select count(1) from article; 11 Sweet! --}
648
etlProcess archive conn = do blocks <- extractBlocks <$> BL.readFile archive ixblks <- insertBlocks conn blocks let articles = join (zipWith block2Article ixblks blocks) ixarts <- insertArts conn articles let rns = catMaybes (zipWith art2RawNames ixarts articles) let pers = concatMap raw2persons rns ixpers <- insertPers conn pers inserter conn insertArtPersJoinStmt (zipWith joinValue pers ixpers) {-- >>> connectInfo ConnectInfo {connectHost = "...", ...} >>> conn <- connect it >>> etlProcess (dir ++ arts) conn >>> close conn $ select count(1) from article; 11 Sweet! --}
602
true
true
0
13
461
171
79
92
null
null
nevrenato/Hets_Fork
CSL/Keywords.hs
gpl-2.0
quotientS :: String quotientS = "quotient"
42
quotientS :: String quotientS = "quotient"
42
quotientS = "quotient"
22
false
true
0
6
5
18
7
11
null
null
nbloomf/feivel
src/Feivel/Eval/EvalM.hs
gpl-3.0
parsePaths :: String -> EvalM [FilePath] parsePaths "" = return []
67
parsePaths :: String -> EvalM [FilePath] parsePaths "" = return []
67
parsePaths "" = return []
26
false
true
0
8
11
34
15
19
null
null
girving/duck
duck/ToLir.hs
bsd-3-clause
progs :: Prog -> [(ModuleName, [Ir.Decl])] -> Prog progs = foldl' (\p (name,decls) -> prog p name decls)
104
progs :: Prog -> [(ModuleName, [Ir.Decl])] -> Prog progs = foldl' (\p (name,decls) -> prog p name decls)
104
progs = foldl' (\p (name,decls) -> prog p name decls)
53
false
true
0
11
17
66
34
32
null
null
alphaHeavy/hlint
data/Default.hs
gpl-2.0
warn "Use infix" = X.intersect x y ==> x `X.intersect` y where _ = not (isInfixApp original) && not (isParen result) -- MATHS
126
warn "Use infix" = X.intersect x y ==> x `X.intersect` y where _ = not (isInfixApp original) && not (isParen result) -- MATHS
126
warn "Use infix" = X.intersect x y ==> x `X.intersect` y where _ = not (isInfixApp original) && not (isParen result) -- MATHS
126
false
false
2
8
23
60
27
33
null
null
kowey/GenI
src/NLP/GenI/Polarity.hs
gpl-2.0
-- Automatic polarity detection -- ---------------------------- suggestPolFeatures :: [TagElem] -> [Text] suggestPolFeatures tes = let -- only initial trees need be counted; in aux trees, the -- root node is implicitly canceled by the foot node rfeats, sfeats :: [Flist GeniVal] rfeats = map (gdown.root.ttree) $ filter (\t -> ttype t == Initial) tes sfeats = [ concat s | s <- map substTops tes, (not.null) s ] -- attrs :: Flist GeniVal -> [Text] attrs avs = [ a | AvPair a v <- avs, isJust (gConstraints v) ] theAttributes = map attrs $ rfeats ++ sfeats in if null theAttributes then [] else foldr1 intersect theAttributes
676
suggestPolFeatures :: [TagElem] -> [Text] suggestPolFeatures tes = let -- only initial trees need be counted; in aux trees, the -- root node is implicitly canceled by the foot node rfeats, sfeats :: [Flist GeniVal] rfeats = map (gdown.root.ttree) $ filter (\t -> ttype t == Initial) tes sfeats = [ concat s | s <- map substTops tes, (not.null) s ] -- attrs :: Flist GeniVal -> [Text] attrs avs = [ a | AvPair a v <- avs, isJust (gConstraints v) ] theAttributes = map attrs $ rfeats ++ sfeats in if null theAttributes then [] else foldr1 intersect theAttributes
612
suggestPolFeatures tes = let -- only initial trees need be counted; in aux trees, the -- root node is implicitly canceled by the foot node rfeats, sfeats :: [Flist GeniVal] rfeats = map (gdown.root.ttree) $ filter (\t -> ttype t == Initial) tes sfeats = [ concat s | s <- map substTops tes, (not.null) s ] -- attrs :: Flist GeniVal -> [Text] attrs avs = [ a | AvPair a v <- avs, isJust (gConstraints v) ] theAttributes = map attrs $ rfeats ++ sfeats in if null theAttributes then [] else foldr1 intersect theAttributes
570
true
true
0
14
159
209
109
100
null
null
damoxc/ganeti
src/Ganeti/Query/Filter.hs
gpl-2.0
evaluateFilter c mb a (NotFilter flt) = not <$> evaluateFilter c mb a flt
76
evaluateFilter c mb a (NotFilter flt) = not <$> evaluateFilter c mb a flt
76
evaluateFilter c mb a (NotFilter flt) = not <$> evaluateFilter c mb a flt
76
false
false
2
7
16
35
16
19
null
null
bitemyapp/serials
server/Serials/Model/User.hs
mit
findByEmail :: Text -> App (Maybe User) findByEmail email = do us <- runDb $ table # getAll emailIndex [expr email] return $ headMay us
139
findByEmail :: Text -> App (Maybe User) findByEmail email = do us <- runDb $ table # getAll emailIndex [expr email] return $ headMay us
139
findByEmail email = do us <- runDb $ table # getAll emailIndex [expr email] return $ headMay us
99
false
true
0
11
28
63
29
34
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/BatchComputeEnvironmentComputeResources.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-computeresources.html#cfn-batch-computeenvironment-computeresources-bidpercentage bcecrBidPercentage :: Lens' BatchComputeEnvironmentComputeResources (Maybe (Val Integer)) bcecrBidPercentage = lens _batchComputeEnvironmentComputeResourcesBidPercentage (\s a -> s { _batchComputeEnvironmentComputeResourcesBidPercentage = a })
432
bcecrBidPercentage :: Lens' BatchComputeEnvironmentComputeResources (Maybe (Val Integer)) bcecrBidPercentage = lens _batchComputeEnvironmentComputeResourcesBidPercentage (\s a -> s { _batchComputeEnvironmentComputeResourcesBidPercentage = a })
243
bcecrBidPercentage = lens _batchComputeEnvironmentComputeResourcesBidPercentage (\s a -> s { _batchComputeEnvironmentComputeResourcesBidPercentage = a })
153
true
true
0
9
22
52
28
24
null
null
verement/etamoo
src/MOO/Database/LambdaMOO.hs
bsd-3-clause
type_none = 6
16
type_none = 6
16
type_none = 6
16
false
false
0
4
5
6
3
3
null
null
dmitmel/goiteens-hw-in-haskell
Utils/Data/List/Utils.hs
apache-2.0
deleteAt 0 (x:xs) = xs
22
deleteAt 0 (x:xs) = xs
22
deleteAt 0 (x:xs) = xs
22
false
false
0
6
4
20
9
11
null
null
jwiegley/ghc-release
libraries/containers/Data/IntMap/Strict.hs
gpl-3.0
mapMaybeWithKey _ Nil = Nil
27
mapMaybeWithKey _ Nil = Nil
27
mapMaybeWithKey _ Nil = Nil
27
false
false
0
5
4
11
5
6
null
null
phadej/HUnit
Test/HUnit/Base.hs
bsd-3-clause
testCaseCount (TestLabel _ t) = testCaseCount t
47
testCaseCount (TestLabel _ t) = testCaseCount t
47
testCaseCount (TestLabel _ t) = testCaseCount t
47
false
false
0
6
6
21
9
12
null
null
DougBurke/swish
tests/RDFRulesetTest.hs
lgpl-2.1
r1s :: [RDFRule] r1s = [ r11, r12 ]
36
r1s :: [RDFRule] r1s = [ r11, r12 ]
36
r1s = [ r11, r12 ]
19
false
true
0
7
9
27
13
14
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F30.hs
bsd-3-clause
-- glVertexAttrib4hNV ---------------------------------------------------------- -- | The vector equivalent of this command is 'glVertexAttrib4hvNV'. glVertexAttrib4hNV :: MonadIO m => GLuint -- ^ @index@. -> GLhalfNV -- ^ @x@ of type @Half16NV@. -> GLhalfNV -- ^ @y@ of type @Half16NV@. -> GLhalfNV -- ^ @z@ of type @Half16NV@. -> GLhalfNV -- ^ @w@ of type @Half16NV@. -> m () glVertexAttrib4hNV v1 v2 v3 v4 v5 = liftIO $ dyn908 ptr_glVertexAttrib4hNV v1 v2 v3 v4 v5
482
glVertexAttrib4hNV :: MonadIO m => GLuint -- ^ @index@. -> GLhalfNV -- ^ @x@ of type @Half16NV@. -> GLhalfNV -- ^ @y@ of type @Half16NV@. -> GLhalfNV -- ^ @z@ of type @Half16NV@. -> GLhalfNV -- ^ @w@ of type @Half16NV@. -> m () glVertexAttrib4hNV v1 v2 v3 v4 v5 = liftIO $ dyn908 ptr_glVertexAttrib4hNV v1 v2 v3 v4 v5
331
glVertexAttrib4hNV v1 v2 v3 v4 v5 = liftIO $ dyn908 ptr_glVertexAttrib4hNV v1 v2 v3 v4 v5
89
true
true
0
13
87
82
42
40
null
null
sdiehl/ghc
testsuite/tests/typecheck/should_compile/T13822.hs
bsd-3-clause
-- Previously failed with: -- -- v.hs:43:16: error: -- • Couldn't match kind ‘k’ with ‘'STAR’ -- ‘k’ is a rigid type variable bound by -- the inferred type of -- maybeInt :: (I 'TInt ~ Int, I 'TMaybe ~ Maybe) => -- TyRep 'STAR ('TApp 'TMaybe 'TInt) -> Maybe Int -- at v.hs:25:3 -- When matching the kind of ‘'TMaybe’ -- Expected type: Maybe Int -- Actual type: I ('TApp 'TMaybe 'TInt) -- • In the expression: zero rep :: Maybe Int -- In an equation for ‘maybeInt’: maybeInt rep = zero rep :: Maybe Int -- • Relevant bindings include -- rep :: TyRep 'STAR ('TApp 'TMaybe 'TInt) (bound at v.hs:43:10) -- maybeInt :: TyRep 'STAR ('TApp 'TMaybe 'TInt) -> Maybe Int -- (bound at v.hs:43:1) -- Failed, modules loaded: none. maybeInt rep = zero rep :: Maybe Int
868
maybeInt rep = zero rep :: Maybe Int
36
maybeInt rep = zero rep :: Maybe Int
36
true
false
1
5
254
39
27
12
null
null
Chiel92/ants
simulation/Caching.hs
gpl-2.0
toPointEdge :: Float -> Int -> Pos -> Point toPointEdge scale edge pos = let grad = 30 + 60 * edge f i = let r = i * pi / 180 x = (scale * 0.5 * cos r) / cos (pi / 6) y = (scale * 0.5 * sin r) in FPos (x, negate y) in fposToPoint $ toFPos scale pos + f (fromIntegral grad)
342
toPointEdge :: Float -> Int -> Pos -> Point toPointEdge scale edge pos = let grad = 30 + 60 * edge f i = let r = i * pi / 180 x = (scale * 0.5 * cos r) / cos (pi / 6) y = (scale * 0.5 * sin r) in FPos (x, negate y) in fposToPoint $ toFPos scale pos + f (fromIntegral grad)
342
toPointEdge scale edge pos = let grad = 30 + 60 * edge f i = let r = i * pi / 180 x = (scale * 0.5 * cos r) / cos (pi / 6) y = (scale * 0.5 * sin r) in FPos (x, negate y) in fposToPoint $ toFPos scale pos + f (fromIntegral grad)
298
false
true
0
16
138
162
80
82
null
null
RAFIRAF/HASKELL
Functionally Solving Problems/take.hs
mit
drop' n (x:xs) = drop' (n-1) xs
31
drop' n (x:xs) = drop' (n-1) xs
31
drop' n (x:xs) = drop' (n-1) xs
31
false
false
0
7
6
32
15
17
null
null
deepakjois/hs-logo
tests/Diagrams/TwoD/Path/Turtle/Tests.hs
bsd-3-clause
movesRight :: Turtle -> Property movesRight t = isPenDown t ==> abs(endX - startX) < 0.0001 && abs(endY - startY) < 0.0001 where x = 2.0 turn = 90 t' = t # forward x # right turn # forward x # right turn # forward x # right turn # forward x (unp2 -> (startX, startY)) = penPos t (unp2 -> (endX, endY)) = penPos t' -- | When the trail is empty, @currTrail@ always remains empty and no new paths -- are added
612
movesRight :: Turtle -> Property movesRight t = isPenDown t ==> abs(endX - startX) < 0.0001 && abs(endY - startY) < 0.0001 where x = 2.0 turn = 90 t' = t # forward x # right turn # forward x # right turn # forward x # right turn # forward x (unp2 -> (startX, startY)) = penPos t (unp2 -> (endX, endY)) = penPos t' -- | When the trail is empty, @currTrail@ always remains empty and no new paths -- are added
612
movesRight t = isPenDown t ==> abs(endX - startX) < 0.0001 && abs(endY - startY) < 0.0001 where x = 2.0 turn = 90 t' = t # forward x # right turn # forward x # right turn # forward x # right turn # forward x (unp2 -> (startX, startY)) = penPos t (unp2 -> (endX, endY)) = penPos t' -- | When the trail is empty, @currTrail@ always remains empty and no new paths -- are added
566
false
true
6
19
290
181
88
93
null
null
brendanhay/gogol
gogol-bigquerydatatransfer/gen/Network/Google/Resource/BigQueryDataTransfer/Projects/TransferConfigs/List.hs
mpl-2.0
-- | Page size. The default page size is the maximum value of 1000 results. ptclPageSize :: Lens' ProjectsTransferConfigsList (Maybe Int32) ptclPageSize = lens _ptclPageSize (\ s a -> s{_ptclPageSize = a}) . mapping _Coerce
231
ptclPageSize :: Lens' ProjectsTransferConfigsList (Maybe Int32) ptclPageSize = lens _ptclPageSize (\ s a -> s{_ptclPageSize = a}) . mapping _Coerce
155
ptclPageSize = lens _ptclPageSize (\ s a -> s{_ptclPageSize = a}) . mapping _Coerce
91
true
true
2
8
42
60
28
32
null
null
jwiegley/ghc-release
utils/haddock/src/Haddock/Backends/Xhtml/Utils.hs
gpl-3.0
dcolon, arrow, darrow, forallSymbol :: Bool -> Html dcolon unicode = toHtml (if unicode then "∷" else "::")
107
dcolon, arrow, darrow, forallSymbol :: Bool -> Html dcolon unicode = toHtml (if unicode then "∷" else "::")
107
dcolon unicode = toHtml (if unicode then "∷" else "::")
55
false
true
5
7
17
49
23
26
null
null
blanu/arbre-go
Arbre/Short.hs
gpl-2.0
prnt :: Expression -> Expression prnt exp = exp
47
prnt :: Expression -> Expression prnt exp = exp
47
prnt exp = exp
14
false
true
0
7
8
24
10
14
null
null
ksaveljev/hake-2
src/Game/GameItems.hs
bsd-3-clause
powerArmorType :: Ref EdictT -> Quake Int powerArmorType edictRef = do edict <- readRef edictRef case edict^.eClient of Nothing -> return Constants.powerArmorNone Just (Ref gClientIdx) -> do Just gClient <- preuse $ gameBaseGlobals.gbGame.glClients.ix gClientIdx GItemReference powerShieldIndex <- use $ gameItemsGlobals.giPowerShieldIndex GItemReference powerScreenIndex <- use $ gameItemsGlobals.giPowerScreenIndex itemList <- use $ gameBaseGlobals.gbItemList let powerShield = itemList V.! powerShieldIndex powerScreen = itemList V.! powerScreenIndex return $ if | (edict^.eFlags) .&. Constants.flPowerArmor == 0 -> Constants.powerArmorNone | (gClient^.gcPers.cpInventory) UV.! (powerShield^.giIndex) > 0 -> Constants.powerArmorShield | (gClient^.gcPers.cpInventory) UV.! (powerScreen^.giIndex) > 0 -> Constants.powerArmorScreen | otherwise -> Constants.powerArmorNone
1,024
powerArmorType :: Ref EdictT -> Quake Int powerArmorType edictRef = do edict <- readRef edictRef case edict^.eClient of Nothing -> return Constants.powerArmorNone Just (Ref gClientIdx) -> do Just gClient <- preuse $ gameBaseGlobals.gbGame.glClients.ix gClientIdx GItemReference powerShieldIndex <- use $ gameItemsGlobals.giPowerShieldIndex GItemReference powerScreenIndex <- use $ gameItemsGlobals.giPowerScreenIndex itemList <- use $ gameBaseGlobals.gbItemList let powerShield = itemList V.! powerShieldIndex powerScreen = itemList V.! powerScreenIndex return $ if | (edict^.eFlags) .&. Constants.flPowerArmor == 0 -> Constants.powerArmorNone | (gClient^.gcPers.cpInventory) UV.! (powerShield^.giIndex) > 0 -> Constants.powerArmorShield | (gClient^.gcPers.cpInventory) UV.! (powerScreen^.giIndex) > 0 -> Constants.powerArmorScreen | otherwise -> Constants.powerArmorNone
1,024
powerArmorType edictRef = do edict <- readRef edictRef case edict^.eClient of Nothing -> return Constants.powerArmorNone Just (Ref gClientIdx) -> do Just gClient <- preuse $ gameBaseGlobals.gbGame.glClients.ix gClientIdx GItemReference powerShieldIndex <- use $ gameItemsGlobals.giPowerShieldIndex GItemReference powerScreenIndex <- use $ gameItemsGlobals.giPowerScreenIndex itemList <- use $ gameBaseGlobals.gbItemList let powerShield = itemList V.! powerShieldIndex powerScreen = itemList V.! powerScreenIndex return $ if | (edict^.eFlags) .&. Constants.flPowerArmor == 0 -> Constants.powerArmorNone | (gClient^.gcPers.cpInventory) UV.! (powerShield^.giIndex) > 0 -> Constants.powerArmorShield | (gClient^.gcPers.cpInventory) UV.! (powerScreen^.giIndex) > 0 -> Constants.powerArmorScreen | otherwise -> Constants.powerArmorNone
982
false
true
0
21
245
285
135
150
null
null
EXio4/ircah
src/IRC/NickTracking.hs
mit
changeNick _ newnick trk -- passthru means the UID hasn't been added to the bimap (aka someone we didn't know changed nick) = addNick newnick trk
149
changeNick _ newnick trk -- passthru means the UID hasn't been added to the bimap (aka someone we didn't know changed nick) = addNick newnick trk
149
changeNick _ newnick trk -- passthru means the UID hasn't been added to the bimap (aka someone we didn't know changed nick) = addNick newnick trk
149
false
false
1
5
29
19
8
11
null
null
palf/haskellSDL2Examples
common/lib/Common.hs
gpl-2.0
isContinue :: Maybe SDL.Event -> Bool isContinue = maybe True (not . isQuitEvent)
81
isContinue :: Maybe SDL.Event -> Bool isContinue = maybe True (not . isQuitEvent)
81
isContinue = maybe True (not . isQuitEvent)
43
false
true
0
8
12
40
17
23
null
null
databrary/databrary
src/DatabraryMain.hs
agpl-3.0
opts :: [Opt.OptDescr Flag] opts = [ Opt.Option "c" ["config"] (Opt.ReqArg FlagConfig "FILE") "Path to configuration file [./databrary.conf]" , Opt.Option "w" ["webgen"] (Opt.NoArg FlagWeb) "Generate web assets only" , Opt.Option "e" ["ezid"] (Opt.NoArg FlagEZID) "Update EZID DOIs" ]
292
opts :: [Opt.OptDescr Flag] opts = [ Opt.Option "c" ["config"] (Opt.ReqArg FlagConfig "FILE") "Path to configuration file [./databrary.conf]" , Opt.Option "w" ["webgen"] (Opt.NoArg FlagWeb) "Generate web assets only" , Opt.Option "e" ["ezid"] (Opt.NoArg FlagEZID) "Update EZID DOIs" ]
292
opts = [ Opt.Option "c" ["config"] (Opt.ReqArg FlagConfig "FILE") "Path to configuration file [./databrary.conf]" , Opt.Option "w" ["webgen"] (Opt.NoArg FlagWeb) "Generate web assets only" , Opt.Option "e" ["ezid"] (Opt.NoArg FlagEZID) "Update EZID DOIs" ]
264
false
true
0
9
45
96
50
46
null
null
houshuang/frame
src/Data/Frame/Instances.hs
mit
select :: Int -> HDataFrame a k -> HDataFrame a k select k = _alter (VG.singleton . (VG.! k)) (VG.singleton . (VG.! k))
119
select :: Int -> HDataFrame a k -> HDataFrame a k select k = _alter (VG.singleton . (VG.! k)) (VG.singleton . (VG.! k))
119
select k = _alter (VG.singleton . (VG.! k)) (VG.singleton . (VG.! k))
69
false
true
0
8
22
71
36
35
null
null
brendanhay/gogol
gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Versions/Undelete.hs
mpl-2.0
-- | GTM ContainerVersion\'s API relative path. Example: -- accounts\/{account_id}\/containers\/{container_id}\/versions\/{version_id} acvuPath :: Lens' AccountsContainersVersionsUndelete Text acvuPath = lens _acvuPath (\ s a -> s{_acvuPath = a})
246
acvuPath :: Lens' AccountsContainersVersionsUndelete Text acvuPath = lens _acvuPath (\ s a -> s{_acvuPath = a})
111
acvuPath = lens _acvuPath (\ s a -> s{_acvuPath = a})
53
true
true
0
9
25
41
23
18
null
null
bgamari/shaking-up-ghc
src/Main.hs
bsd-3-clause
main :: IO () main = do -- Provide access to command line arguments and some user settings through -- Shake's type-indexed map 'shakeExtra'. argsMap <- CommandLine.cmdLineArgsMap let extra = insertExtra UserSettings.buildProgressColour $ insertExtra UserSettings.successColour $ insertExtra (VerboseCommand UserSettings.verboseCommand) argsMap BuildRoot buildRoot = CommandLine.lookupBuildRoot argsMap rebuild = [ (RebuildLater, buildRoot -/- "stage0//*") | CommandLine.lookupFreeze1 argsMap ] options :: ShakeOptions options = shakeOptions { shakeChange = ChangeModtimeAndDigest , shakeFiles = buildRoot -/- Base.shakeFilesDir , shakeProgress = progressSimple , shakeRebuild = rebuild , shakeTimings = True , shakeExtra = extra } rules :: Rules () rules = do Rules.buildRules Rules.Documentation.documentationRules Rules.Clean.cleanRules Rules.Nofib.nofibRules Rules.oracleRules Rules.Selftest.selftestRules Rules.SourceDist.sourceDistRules Rules.Test.testRules Rules.topLevelTargets shakeArgsWith options CommandLine.optDescrs $ \_ targets -> do Environment.setupEnvironment return . Just $ if null targets then rules else want targets >> withoutActions rules
1,534
main :: IO () main = do -- Provide access to command line arguments and some user settings through -- Shake's type-indexed map 'shakeExtra'. argsMap <- CommandLine.cmdLineArgsMap let extra = insertExtra UserSettings.buildProgressColour $ insertExtra UserSettings.successColour $ insertExtra (VerboseCommand UserSettings.verboseCommand) argsMap BuildRoot buildRoot = CommandLine.lookupBuildRoot argsMap rebuild = [ (RebuildLater, buildRoot -/- "stage0//*") | CommandLine.lookupFreeze1 argsMap ] options :: ShakeOptions options = shakeOptions { shakeChange = ChangeModtimeAndDigest , shakeFiles = buildRoot -/- Base.shakeFilesDir , shakeProgress = progressSimple , shakeRebuild = rebuild , shakeTimings = True , shakeExtra = extra } rules :: Rules () rules = do Rules.buildRules Rules.Documentation.documentationRules Rules.Clean.cleanRules Rules.Nofib.nofibRules Rules.oracleRules Rules.Selftest.selftestRules Rules.SourceDist.sourceDistRules Rules.Test.testRules Rules.topLevelTargets shakeArgsWith options CommandLine.optDescrs $ \_ targets -> do Environment.setupEnvironment return . Just $ if null targets then rules else want targets >> withoutActions rules
1,534
main = do -- Provide access to command line arguments and some user settings through -- Shake's type-indexed map 'shakeExtra'. argsMap <- CommandLine.cmdLineArgsMap let extra = insertExtra UserSettings.buildProgressColour $ insertExtra UserSettings.successColour $ insertExtra (VerboseCommand UserSettings.verboseCommand) argsMap BuildRoot buildRoot = CommandLine.lookupBuildRoot argsMap rebuild = [ (RebuildLater, buildRoot -/- "stage0//*") | CommandLine.lookupFreeze1 argsMap ] options :: ShakeOptions options = shakeOptions { shakeChange = ChangeModtimeAndDigest , shakeFiles = buildRoot -/- Base.shakeFilesDir , shakeProgress = progressSimple , shakeRebuild = rebuild , shakeTimings = True , shakeExtra = extra } rules :: Rules () rules = do Rules.buildRules Rules.Documentation.documentationRules Rules.Clean.cleanRules Rules.Nofib.nofibRules Rules.oracleRules Rules.Selftest.selftestRules Rules.SourceDist.sourceDistRules Rules.Test.testRules Rules.topLevelTargets shakeArgsWith options CommandLine.optDescrs $ \_ targets -> do Environment.setupEnvironment return . Just $ if null targets then rules else want targets >> withoutActions rules
1,520
false
true
1
15
501
290
146
144
null
null
haskell-servant/servant-swagger
src/Servant/Swagger/Internal.hs
bsd-3-clause
mkEndpointNoContentVerb :: forall proxy method. (SwaggerMethod method) => FilePath -- ^ Endpoint path. -> proxy (NoContentVerb method) -- ^ Method -> Swagger mkEndpointNoContentVerb path _ = mempty & paths.at path ?~ (mempty & method ?~ (mempty & at code ?~ Inline mempty)) where method = swaggerMethod (Proxy :: Proxy method) code = 204 -- hardcoded in servant-server -- | Add parameter to every operation in the spec.
502
mkEndpointNoContentVerb :: forall proxy method. (SwaggerMethod method) => FilePath -- ^ Endpoint path. -> proxy (NoContentVerb method) -- ^ Method -> Swagger mkEndpointNoContentVerb path _ = mempty & paths.at path ?~ (mempty & method ?~ (mempty & at code ?~ Inline mempty)) where method = swaggerMethod (Proxy :: Proxy method) code = 204 -- hardcoded in servant-server -- | Add parameter to every operation in the spec.
502
mkEndpointNoContentVerb path _ = mempty & paths.at path ?~ (mempty & method ?~ (mempty & at code ?~ Inline mempty)) where method = swaggerMethod (Proxy :: Proxy method) code = 204 -- hardcoded in servant-server -- | Add parameter to every operation in the spec.
314
false
true
3
12
149
122
62
60
null
null
mbezjak/grailsproject
test/Tests/Parser/Properties.hs
mit
testOnlyComments :: Test testOnlyComments = testProperties "only-comments" []
77
testOnlyComments :: Test testOnlyComments = testProperties "only-comments" []
77
testOnlyComments = testProperties "only-comments" []
52
false
true
0
6
7
18
9
9
null
null
osa1/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
highestFC (PMetavar fc _) = Just fc
35
highestFC (PMetavar fc _) = Just fc
35
highestFC (PMetavar fc _) = Just fc
35
false
false
0
6
6
21
9
12
null
null
joshcough/Scrabble
src/Scrabble/ReplHelpers.hs
mit
unsafeNewBag :: Bag unsafeNewBag = unsafePerformIO newBag
57
unsafeNewBag :: Bag unsafeNewBag = unsafePerformIO newBag
57
unsafeNewBag = unsafePerformIO newBag
37
false
true
0
5
6
14
7
7
null
null
andorp/bead
src/Bead/View/Pagelets.hs
bsd-3-clause
bootStrapDocument :: UserState -> IHtml -> IHtml bootStrapDocument state body' = do body <- body' return $ do docType H.html $ do H.head $ do H.meta ! A.charset "utf-8" H.title "BE-AD Assignment Management System" H.link ! A.rel "shortcut icon" ! A.href "icon.ico" H.meta ! A.name "viewport" ! A.content "width=device-width, initial-scale=1.0" H.meta ! A.name "description" ! A.content "" H.meta ! A.name "author" ! A.content "" js "/jquery.js" css "/jquery-ui.css" js "/jquery-ui.js" js "/moment.js" css "/bootstrap.min.css" css "/bootstrap.custombutton.css" js "/bootstrap.min.js" css "/bootstrap-combobox.css" js "/bootstrap-combobox.js" css "/bootstrap-datetimepicker.min.css" js "/bootstrap-datetimepicker.min.js" js "/fay/DynamicContents.js" when (needKaTeXBy state) $ do css "/katex/katex.min.css" js "/katex/katex.min.js" H.script $ fromString $ unwords [ "window.onload = function(){ var mathElements = document.getElementsByClassName(\"math\");" , "for (var i=0; i < mathElements.length; i++) {" , "var texText = mathElements[i].firstChild;" , "katex.render(texText.data, mathElements[i]);" , "}}" ] H.body $ body where needKaTeXBy (UserState { page = p }) = P.isPage texPages p where texPages = [ P.isSubmission, P.isSubmissionList, P.isSubmissionDetails , P.isNewGroupAssignmentPreview, P.isNewCourseAssignmentPreview , P.isModifyAssignmentPreview ] needKaTeXBy _ = False
1,742
bootStrapDocument :: UserState -> IHtml -> IHtml bootStrapDocument state body' = do body <- body' return $ do docType H.html $ do H.head $ do H.meta ! A.charset "utf-8" H.title "BE-AD Assignment Management System" H.link ! A.rel "shortcut icon" ! A.href "icon.ico" H.meta ! A.name "viewport" ! A.content "width=device-width, initial-scale=1.0" H.meta ! A.name "description" ! A.content "" H.meta ! A.name "author" ! A.content "" js "/jquery.js" css "/jquery-ui.css" js "/jquery-ui.js" js "/moment.js" css "/bootstrap.min.css" css "/bootstrap.custombutton.css" js "/bootstrap.min.js" css "/bootstrap-combobox.css" js "/bootstrap-combobox.js" css "/bootstrap-datetimepicker.min.css" js "/bootstrap-datetimepicker.min.js" js "/fay/DynamicContents.js" when (needKaTeXBy state) $ do css "/katex/katex.min.css" js "/katex/katex.min.js" H.script $ fromString $ unwords [ "window.onload = function(){ var mathElements = document.getElementsByClassName(\"math\");" , "for (var i=0; i < mathElements.length; i++) {" , "var texText = mathElements[i].firstChild;" , "katex.render(texText.data, mathElements[i]);" , "}}" ] H.body $ body where needKaTeXBy (UserState { page = p }) = P.isPage texPages p where texPages = [ P.isSubmission, P.isSubmissionList, P.isSubmissionDetails , P.isNewGroupAssignmentPreview, P.isNewCourseAssignmentPreview , P.isModifyAssignmentPreview ] needKaTeXBy _ = False
1,742
bootStrapDocument state body' = do body <- body' return $ do docType H.html $ do H.head $ do H.meta ! A.charset "utf-8" H.title "BE-AD Assignment Management System" H.link ! A.rel "shortcut icon" ! A.href "icon.ico" H.meta ! A.name "viewport" ! A.content "width=device-width, initial-scale=1.0" H.meta ! A.name "description" ! A.content "" H.meta ! A.name "author" ! A.content "" js "/jquery.js" css "/jquery-ui.css" js "/jquery-ui.js" js "/moment.js" css "/bootstrap.min.css" css "/bootstrap.custombutton.css" js "/bootstrap.min.js" css "/bootstrap-combobox.css" js "/bootstrap-combobox.js" css "/bootstrap-datetimepicker.min.css" js "/bootstrap-datetimepicker.min.js" js "/fay/DynamicContents.js" when (needKaTeXBy state) $ do css "/katex/katex.min.css" js "/katex/katex.min.js" H.script $ fromString $ unwords [ "window.onload = function(){ var mathElements = document.getElementsByClassName(\"math\");" , "for (var i=0; i < mathElements.length; i++) {" , "var texText = mathElements[i].firstChild;" , "katex.render(texText.data, mathElements[i]);" , "}}" ] H.body $ body where needKaTeXBy (UserState { page = p }) = P.isPage texPages p where texPages = [ P.isSubmission, P.isSubmissionList, P.isSubmissionDetails , P.isNewGroupAssignmentPreview, P.isNewCourseAssignmentPreview , P.isModifyAssignmentPreview ] needKaTeXBy _ = False
1,693
false
true
0
23
520
391
173
218
null
null
oldmanmike/vulkan
generate/src/Write/Type/Struct.hs
bsd-3-clause
writePokeMember :: StructType -> MemberInfo -> Doc writePokeMember st mi = [qc|poke (ptr `plusPtr` {miOffset mi}) ({sanitizedName (miMember mi)} (poked :: {stName st}))|]
173
writePokeMember :: StructType -> MemberInfo -> Doc writePokeMember st mi = [qc|poke (ptr `plusPtr` {miOffset mi}) ({sanitizedName (miMember mi)} (poked :: {stName st}))|]
173
writePokeMember st mi = [qc|poke (ptr `plusPtr` {miOffset mi}) ({sanitizedName (miMember mi)} (poked :: {stName st}))|]
122
false
true
0
6
25
28
16
12
null
null
onurzdg/clicklac
src/Database/PostgreSQL/Simple/Lifted/Transaction.hs
bsd-3-clause
withTransactionModeRetry :: (PostgresClient m) => TransactionMode -> (SqlError -> Bool) -> m a -> m a withTransactionModeRetry mode shouldRetry act = mask $ \restore -> retryLoop $ try $ do a <- restore act commit return a where retryLoop :: (PostgresClient m) => m (Either SomeException a) -> m a retryLoop act' = do beginMode mode r <- act' case r of Left e -> do rollback case fmap shouldRetry (fromException e) of Just True -> retryLoop act' _ -> throwIO e Right a -> return a
705
withTransactionModeRetry :: (PostgresClient m) => TransactionMode -> (SqlError -> Bool) -> m a -> m a withTransactionModeRetry mode shouldRetry act = mask $ \restore -> retryLoop $ try $ do a <- restore act commit return a where retryLoop :: (PostgresClient m) => m (Either SomeException a) -> m a retryLoop act' = do beginMode mode r <- act' case r of Left e -> do rollback case fmap shouldRetry (fromException e) of Just True -> retryLoop act' _ -> throwIO e Right a -> return a
705
withTransactionModeRetry mode shouldRetry act = mask $ \restore -> retryLoop $ try $ do a <- restore act commit return a where retryLoop :: (PostgresClient m) => m (Either SomeException a) -> m a retryLoop act' = do beginMode mode r <- act' case r of Left e -> do rollback case fmap shouldRetry (fromException e) of Just True -> retryLoop act' _ -> throwIO e Right a -> return a
503
false
true
6
16
311
226
100
126
null
null
projectorhq/haskell-liquid
test/Text/Liquid/ParserTests.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- * TagWith -------------------------------------------------------------------------------- case_tagWith_1 = parseOnly (tagWith ifStart ifStart) "{% if if %}" @?= Right "if"
257
case_tagWith_1 = parseOnly (tagWith ifStart ifStart) "{% if if %}" @?= Right "if"
81
case_tagWith_1 = parseOnly (tagWith ifStart ifStart) "{% if if %}" @?= Right "if"
81
true
false
1
8
18
33
15
18
null
null
mjakob/hgrib
src/Data/Grib.hs
gpl-3.0
-- |Get the value for a key as a float. getDouble :: Key -> GribIO Double getDouble key = getHandle >>= liftIO . flip gribGetDouble key
135
getDouble :: Key -> GribIO Double getDouble key = getHandle >>= liftIO . flip gribGetDouble key
95
getDouble key = getHandle >>= liftIO . flip gribGetDouble key
61
true
true
0
6
25
35
17
18
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeRegions.hs
mpl-2.0
-- | Information about one or more regions. drrRegions :: Lens' DescribeRegionsResponse [Region] drrRegions = lens _drrRegions (\s a -> s { _drrRegions = a }) . _List
166
drrRegions :: Lens' DescribeRegionsResponse [Region] drrRegions = lens _drrRegions (\s a -> s { _drrRegions = a }) . _List
122
drrRegions = lens _drrRegions (\s a -> s { _drrRegions = a }) . _List
69
true
true
0
10
27
47
26
21
null
null
nek0/affection
examples/example02/Main.hs
lgpl-3.0
load :: IO UserData load = do -- emptyMatrix <- zero 60 60 liftIO $ logIO A.Debug "init GLEW" _ <- glewInit liftIO $ logIO A.Debug "making random" randList <- mapM (\_ -> randomRIO (0,1)) [0 .. (3599 :: Int)] liftIO $ logIO A.Debug "creating context" nanoCtx <- createGL3 (S.fromList [Antialias, StencilStrokes, NanoVG.Debug]) let fullMatrix = fromList 60 60 randList -- logIO A.Debug $ prettyMatrix fullMatrix empty1 <- newTVarIO [] -- ([] :: [(UUID, WindowMessage -> Affection ())]) empty3 <- newTVarIO [] -- ([] :: [(UUID, KeyboardMessage -> Affection ())]) (\life food time nextStep -> UserData { subsystems = Subsystems (Window empty1) (Keyboard empty3) , lifeMat = life , foodMat = food , timeMat = time , nano = nanoCtx , doNextStep = nextStep } ) <$> newMVar fullMatrix <*> newMVar (fromList 60 60 (repeat maxFood)) <*> newMVar (M.zero 60 60) <*> newMVar True
951
load :: IO UserData load = do -- emptyMatrix <- zero 60 60 liftIO $ logIO A.Debug "init GLEW" _ <- glewInit liftIO $ logIO A.Debug "making random" randList <- mapM (\_ -> randomRIO (0,1)) [0 .. (3599 :: Int)] liftIO $ logIO A.Debug "creating context" nanoCtx <- createGL3 (S.fromList [Antialias, StencilStrokes, NanoVG.Debug]) let fullMatrix = fromList 60 60 randList -- logIO A.Debug $ prettyMatrix fullMatrix empty1 <- newTVarIO [] -- ([] :: [(UUID, WindowMessage -> Affection ())]) empty3 <- newTVarIO [] -- ([] :: [(UUID, KeyboardMessage -> Affection ())]) (\life food time nextStep -> UserData { subsystems = Subsystems (Window empty1) (Keyboard empty3) , lifeMat = life , foodMat = food , timeMat = time , nano = nanoCtx , doNextStep = nextStep } ) <$> newMVar fullMatrix <*> newMVar (fromList 60 60 (repeat maxFood)) <*> newMVar (M.zero 60 60) <*> newMVar True
951
load = do -- emptyMatrix <- zero 60 60 liftIO $ logIO A.Debug "init GLEW" _ <- glewInit liftIO $ logIO A.Debug "making random" randList <- mapM (\_ -> randomRIO (0,1)) [0 .. (3599 :: Int)] liftIO $ logIO A.Debug "creating context" nanoCtx <- createGL3 (S.fromList [Antialias, StencilStrokes, NanoVG.Debug]) let fullMatrix = fromList 60 60 randList -- logIO A.Debug $ prettyMatrix fullMatrix empty1 <- newTVarIO [] -- ([] :: [(UUID, WindowMessage -> Affection ())]) empty3 <- newTVarIO [] -- ([] :: [(UUID, KeyboardMessage -> Affection ())]) (\life food time nextStep -> UserData { subsystems = Subsystems (Window empty1) (Keyboard empty3) , lifeMat = life , foodMat = food , timeMat = time , nano = nanoCtx , doNextStep = nextStep } ) <$> newMVar fullMatrix <*> newMVar (fromList 60 60 (repeat maxFood)) <*> newMVar (M.zero 60 60) <*> newMVar True
931
false
true
0
18
227
309
155
154
null
null
osa1/sequent-core
src/Language/SequentCore/Lint.hs
bsd-3-clause
eitherToMaybe (Right _) = Nothing
33
eitherToMaybe (Right _) = Nothing
33
eitherToMaybe (Right _) = Nothing
33
false
false
0
7
4
15
7
8
null
null
green-haskell/ghc
compiler/typecheck/TcGenGenerics.hs
bsd-3-clause
mkProd_P gk _ vars = mkM1_P (foldBal prod appVars) -- These M1s are meta-information for the constructor where appVars = map (wrapArg_P gk) vars prod a b = prodDataCon_RDR `nlConPat` [a,b]
219
mkProd_P gk _ vars = mkM1_P (foldBal prod appVars) -- These M1s are meta-information for the constructor where appVars = map (wrapArg_P gk) vars prod a b = prodDataCon_RDR `nlConPat` [a,b]
219
mkProd_P gk _ vars = mkM1_P (foldBal prod appVars) -- These M1s are meta-information for the constructor where appVars = map (wrapArg_P gk) vars prod a b = prodDataCon_RDR `nlConPat` [a,b]
219
false
false
1
8
61
67
34
33
null
null
ak1t0/Clover
src/Lexer.hs
bsd-3-clause
integer :: Parser Integer integer = Token.integer lexer
55
integer :: Parser Integer integer = Token.integer lexer
55
integer = Token.integer lexer
29
false
true
0
6
7
25
10
15
null
null
li-zhirui/EoplLangs
test/InferredLang/ParserSuite.hs
bsd-3-clause
testParseProc :: Test testParseProc = TestList [ testEq "Parse proc expression" (ProcExpr [("x", Just TypeInt)] (VarExpr "x")) "proc (x: int) x" , testEq "Parse proc expression with multi parameters" (ProcExpr [("x", Just TypeInt), ("y", Just TypeBool)] (VarExpr "x")) "proc (x: int, y: bool) x" , testEq "Parse call expression" (CallExpr (ProcExpr [("f", Just $ TypeProc [TypeInt, TypeInt] (TypeProc [TypeBool] TypeBool))] (CallExpr (VarExpr "f") [CallExpr (VarExpr "f") [constNum 77]])) [ProcExpr [("x", Just TypeBool)] (BinOpExpr Sub (VarExpr "x") (constNum 11))]) "(proc (f: ((int, int) -> ((bool) -> bool))) (f (f 77)) proc (x: bool) -(x,11))" ]
780
testParseProc :: Test testParseProc = TestList [ testEq "Parse proc expression" (ProcExpr [("x", Just TypeInt)] (VarExpr "x")) "proc (x: int) x" , testEq "Parse proc expression with multi parameters" (ProcExpr [("x", Just TypeInt), ("y", Just TypeBool)] (VarExpr "x")) "proc (x: int, y: bool) x" , testEq "Parse call expression" (CallExpr (ProcExpr [("f", Just $ TypeProc [TypeInt, TypeInt] (TypeProc [TypeBool] TypeBool))] (CallExpr (VarExpr "f") [CallExpr (VarExpr "f") [constNum 77]])) [ProcExpr [("x", Just TypeBool)] (BinOpExpr Sub (VarExpr "x") (constNum 11))]) "(proc (f: ((int, int) -> ((bool) -> bool))) (f (f 77)) proc (x: bool) -(x,11))" ]
780
testParseProc = TestList [ testEq "Parse proc expression" (ProcExpr [("x", Just TypeInt)] (VarExpr "x")) "proc (x: int) x" , testEq "Parse proc expression with multi parameters" (ProcExpr [("x", Just TypeInt), ("y", Just TypeBool)] (VarExpr "x")) "proc (x: int, y: bool) x" , testEq "Parse call expression" (CallExpr (ProcExpr [("f", Just $ TypeProc [TypeInt, TypeInt] (TypeProc [TypeBool] TypeBool))] (CallExpr (VarExpr "f") [CallExpr (VarExpr "f") [constNum 77]])) [ProcExpr [("x", Just TypeBool)] (BinOpExpr Sub (VarExpr "x") (constNum 11))]) "(proc (f: ((int, int) -> ((bool) -> bool))) (f (f 77)) proc (x: bool) -(x,11))" ]
758
false
true
0
17
223
235
124
111
null
null
BartAdv/Idris-dev
src/Idris/ElabQuasiquote.hs
bsd-3-clause
extractTUnquotes n (TCheck t) = extract1 n TCheck t
51
extractTUnquotes n (TCheck t) = extract1 n TCheck t
51
extractTUnquotes n (TCheck t) = extract1 n TCheck t
51
false
false
0
6
8
26
11
15
null
null
mariefarrell/Hets
Static/FromXml.hs
gpl-2.0
getTypeAndMorphism1 :: LogicGraph -> DGraph -> G_sign -> XLink -> ResultT IO (GMorphism, DGLinkType) getTypeAndMorphism1 lg dg sg1 xLk = do (sg2, lTp) <- getTypeAndMorAux lg dg sg1 xLk mr' <- liftR $ getGMorphism lg sg2 (mr_name xLk) (mapping xLk) return (mr', lTp) {- depending on the type of the link, the correct DGLinkType and the signature for the (external) morphism are extracted here -}
409
getTypeAndMorphism1 :: LogicGraph -> DGraph -> G_sign -> XLink -> ResultT IO (GMorphism, DGLinkType) getTypeAndMorphism1 lg dg sg1 xLk = do (sg2, lTp) <- getTypeAndMorAux lg dg sg1 xLk mr' <- liftR $ getGMorphism lg sg2 (mr_name xLk) (mapping xLk) return (mr', lTp) {- depending on the type of the link, the correct DGLinkType and the signature for the (external) morphism are extracted here -}
409
getTypeAndMorphism1 lg dg sg1 xLk = do (sg2, lTp) <- getTypeAndMorAux lg dg sg1 xLk mr' <- liftR $ getGMorphism lg sg2 (mr_name xLk) (mapping xLk) return (mr', lTp) {- depending on the type of the link, the correct DGLinkType and the signature for the (external) morphism are extracted here -}
306
false
true
0
11
79
115
57
58
null
null
kfish/hogg
Codec/Container/Ogg/Chain.hs
bsd-3-clause
chainAddSkeleton :: OggChain -> IO OggChain chainAddSkeleton chain = do serialno <- genSerial return $ chainAddSkeleton' serialno chain -- | Add a Skeleton logical bitstream with a given serialno to an OggChain
215
chainAddSkeleton :: OggChain -> IO OggChain chainAddSkeleton chain = do serialno <- genSerial return $ chainAddSkeleton' serialno chain -- | Add a Skeleton logical bitstream with a given serialno to an OggChain
215
chainAddSkeleton chain = do serialno <- genSerial return $ chainAddSkeleton' serialno chain -- | Add a Skeleton logical bitstream with a given serialno to an OggChain
171
false
true
0
8
36
41
19
22
null
null
bos/statistics
Statistics/Sample.hs
bsd-2-clause
-- | Unbiased estimate of a sample's variance. fastVarianceUnbiased :: (G.Vector v Double) => v Double -> Double fastVarianceUnbiased = fini . fastVar where fini (T1 n _m s) | n > 1 = s / fromIntegral (n - 1) | otherwise = 0
251
fastVarianceUnbiased :: (G.Vector v Double) => v Double -> Double fastVarianceUnbiased = fini . fastVar where fini (T1 n _m s) | n > 1 = s / fromIntegral (n - 1) | otherwise = 0
204
fastVarianceUnbiased = fini . fastVar where fini (T1 n _m s) | n > 1 = s / fromIntegral (n - 1) | otherwise = 0
138
true
true
0
9
70
90
44
46
null
null
svenssonjoel/EmbArBB
Intel/ArBB/Language.hs
bsd-3-clause
shift2D :: Exp ISize -> Exp ISize -> Exp (DVector Dim2 a) -> Exp (DVector Dim2 a) shift2D (E i) (E j) (E v) = E $ Op ShiftConst [v,i,j]
136
shift2D :: Exp ISize -> Exp ISize -> Exp (DVector Dim2 a) -> Exp (DVector Dim2 a) shift2D (E i) (E j) (E v) = E $ Op ShiftConst [v,i,j]
135
shift2D (E i) (E j) (E v) = E $ Op ShiftConst [v,i,j]
53
false
true
0
10
30
94
46
48
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV :: GLenum gl_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B
110
gl_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV :: GLenum gl_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B
110
gl_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B
54
false
true
0
4
5
11
6
5
null
null
GaloisInc/halvm-ghc
compiler/hsSyn/HsImpExp.hs
bsd-3-clause
pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc pprImpExp name = type_pref <+> pprPrefixOcc name where occ = occName name type_pref | isTcOcc occ && isSymOcc occ = text "type" | otherwise = empty
259
pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc pprImpExp name = type_pref <+> pprPrefixOcc name where occ = occName name type_pref | isTcOcc occ && isSymOcc occ = text "type" | otherwise = empty
259
pprImpExp name = type_pref <+> pprPrefixOcc name where occ = occName name type_pref | isTcOcc occ && isSymOcc occ = text "type" | otherwise = empty
191
false
true
1
9
79
88
39
49
null
null
keithodulaigh/Hets
utils/DrIFT-src/UserRulesHetCATS.hs
gpl-2.0
makeGetPosFn :: Body -> Doc makeGetPosFn b = let (r, vs) = mapAccumL accFun True (types b) p = text "p" accFun f t = if f && t == posLC then (False, p) else (f, text "_") in ppCons' b vs <+> rArrow <+> if r then text "nullRange" else p
286
makeGetPosFn :: Body -> Doc makeGetPosFn b = let (r, vs) = mapAccumL accFun True (types b) p = text "p" accFun f t = if f && t == posLC then (False, p) else (f, text "_") in ppCons' b vs <+> rArrow <+> if r then text "nullRange" else p
286
makeGetPosFn b = let (r, vs) = mapAccumL accFun True (types b) p = text "p" accFun f t = if f && t == posLC then (False, p) else (f, text "_") in ppCons' b vs <+> rArrow <+> if r then text "nullRange" else p
258
false
true
0
11
102
122
63
59
null
null
aquatir/remember_java_api
code-sample-haskell/hello_world/func_magic/monads.hs
mit
-- Guards are used in conjunction with MonadPlus (Monad + Monoid typeclass) in lists to make list compherension works... Oh magic haskell! guardWorks = guard (5 > 2) >> return "cool" :: [String]
194
guardWorks = guard (5 > 2) >> return "cool" :: [String]
55
guardWorks = guard (5 > 2) >> return "cool" :: [String]
55
true
false
2
7
32
34
16
18
null
null
gcross/habit-of-fate
sources/library/HabitOfFate/Testing/Server.hs
agpl-3.0
createGroup group_id group = putGroup group_id group >>= (@?= ResourceCreated)
78
createGroup group_id group = putGroup group_id group >>= (@?= ResourceCreated)
78
createGroup group_id group = putGroup group_id group >>= (@?= ResourceCreated)
78
false
false
0
6
9
24
12
12
null
null
lucasdicioccio/mill
Tools/Mill/Query.hs
mit
passTest :: Test -> ByteString -> Bool passTest (EqualString !s1) s2 = {-# SCC "passTest.=" #-} s1 == s2
107
passTest :: Test -> ByteString -> Bool passTest (EqualString !s1) s2 = {-# SCC "passTest.=" #-} s1 == s2
107
passTest (EqualString !s1) s2 = {-# SCC "passTest.=" #-} s1 == s2
67
false
true
0
8
21
36
18
18
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxLANGUAGE_TAMIL :: Int wxLANGUAGE_TAMIL = 202
46
wxLANGUAGE_TAMIL :: Int wxLANGUAGE_TAMIL = 202
46
wxLANGUAGE_TAMIL = 202
22
false
true
0
6
5
18
7
11
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Input/InputConstants.hs
mit
keyF21 :: Int keyF21 = fromIntegral $ [C.pure| int {KEY_F21} |]
63
keyF21 :: Int keyF21 = fromIntegral $ [C.pure| int {KEY_F21} |]
63
keyF21 = fromIntegral $ [C.pure| int {KEY_F21} |]
49
false
true
0
6
10
21
13
8
null
null
markflorisson/hpack
testrepo/bytestring-0.9.1.9/Data/ByteString/Lazy.hs
bsd-3-clause
head (Chunk c _) = S.unsafeHead c
33
head (Chunk c _) = S.unsafeHead c
33
head (Chunk c _) = S.unsafeHead c
33
false
false
0
7
6
22
10
12
null
null
qpliu/esolang
DGOL/hs/interp/Link.hs
gpl-3.0
locError :: Ast.Location -> String -> Either String a locError (Ast.Location filename lineNumber line) msg = Left (filename ++ ":" ++ show lineNumber ++ " " ++ msg ++ ": " ++ line)
184
locError :: Ast.Location -> String -> Either String a locError (Ast.Location filename lineNumber line) msg = Left (filename ++ ":" ++ show lineNumber ++ " " ++ msg ++ ": " ++ line)
184
locError (Ast.Location filename lineNumber line) msg = Left (filename ++ ":" ++ show lineNumber ++ " " ++ msg ++ ": " ++ line)
130
false
true
0
12
36
76
37
39
null
null
vaibhav276/scheme-compiler
src/Parser.hs
mit
unpackStr (Bool s) = return $ show s
36
unpackStr (Bool s) = return $ show s
36
unpackStr (Bool s) = return $ show s
36
false
false
0
7
7
22
10
12
null
null
daleooo/barrelfish
hake/Path.hs
mit
(./.) :: String -> String -> String root ./. path = relToDir path root
70
(./.) :: String -> String -> String root ./. path = relToDir path root
70
root ./. path = relToDir path root
34
false
true
0
6
13
32
16
16
null
null
agomezl/TicTacToe
src/Client/Util.hs
mit
tryConnect :: Int -> Socket -> HostAddress -> IO () tryConnect 0 sock host = connect sock (SockAddrInet 5441 host)
114
tryConnect :: Int -> Socket -> HostAddress -> IO () tryConnect 0 sock host = connect sock (SockAddrInet 5441 host)
114
tryConnect 0 sock host = connect sock (SockAddrInet 5441 host)
62
false
true
0
9
19
48
23
25
null
null