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
BartAdv/Idris-dev
src/Idris/Error.hs
bsd-3-clause
warnDisamb ist (PLam _ _ _ t b) = warnDisamb ist t >> warnDisamb ist b
70
warnDisamb ist (PLam _ _ _ t b) = warnDisamb ist t >> warnDisamb ist b
70
warnDisamb ist (PLam _ _ _ t b) = warnDisamb ist t >> warnDisamb ist b
70
false
false
0
7
15
40
18
22
null
null
dysinger/amazonka
amazonka-dynamodb/gen/Network/AWS/DynamoDB/CreateTable.hs
mpl-2.0
-- | The name of the table to create. ctTableName :: Lens' CreateTable Text ctTableName = lens _ctTableName (\s a -> s { _ctTableName = a })
140
ctTableName :: Lens' CreateTable Text ctTableName = lens _ctTableName (\s a -> s { _ctTableName = a })
102
ctTableName = lens _ctTableName (\s a -> s { _ctTableName = a })
64
true
true
1
9
26
43
22
21
null
null
fpco/cabal
Cabal/Distribution/Simple/Utils.hs
bsd-3-clause
comparing :: Ord a => (b -> a) -> b -> b -> Ordering comparing p x y = p x `compare` p y
88
comparing :: Ord a => (b -> a) -> b -> b -> Ordering comparing p x y = p x `compare` p y
88
comparing p x y = p x `compare` p y
35
false
true
0
8
23
56
28
28
null
null
nbrunt/JSHOP
src/old/ver1/prototype.hs
mit
-- Empty for loop expression e.g. for(;;) emptyFor = "for\\(;\\)"
74
emptyFor = "for\\(;\\)"
25
emptyFor = "for\\(;\\)"
25
true
false
1
5
18
11
4
7
null
null
keera-studios/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qGraphicsSceneFromPtr :: Ptr (TQGraphicsScene a) -> IO (QGraphicsScene a) qGraphicsSceneFromPtr p = objectFromPtr qtc_QGraphicsScene_getFinalizer p
149
qGraphicsSceneFromPtr :: Ptr (TQGraphicsScene a) -> IO (QGraphicsScene a) qGraphicsSceneFromPtr p = objectFromPtr qtc_QGraphicsScene_getFinalizer p
149
qGraphicsSceneFromPtr p = objectFromPtr qtc_QGraphicsScene_getFinalizer p
75
false
true
0
8
16
41
19
22
null
null
brendanhay/gogol
gogol-deploymentmanager/gen/Network/Google/Resource/DeploymentManager/Deployments/Stop.hs
mpl-2.0
-- | OAuth access token. dsAccessToken :: Lens' DeploymentsStop (Maybe Text) dsAccessToken = lens _dsAccessToken (\ s a -> s{_dsAccessToken = a})
153
dsAccessToken :: Lens' DeploymentsStop (Maybe Text) dsAccessToken = lens _dsAccessToken (\ s a -> s{_dsAccessToken = a})
128
dsAccessToken = lens _dsAccessToken (\ s a -> s{_dsAccessToken = a})
76
true
true
0
9
29
48
25
23
null
null
themoritz/cabal
cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs
bsd-3-clause
exFlagged :: ExampleFlagName -> [ExampleDependency] -> [ExampleDependency] -> ExampleDependency exFlagged n t e = ExFlagged n (Buildable t) (Buildable e)
163
exFlagged :: ExampleFlagName -> [ExampleDependency] -> [ExampleDependency] -> ExampleDependency exFlagged n t e = ExFlagged n (Buildable t) (Buildable e)
163
exFlagged n t e = ExFlagged n (Buildable t) (Buildable e)
57
false
true
0
9
29
61
29
32
null
null
mpickering/HaRe
src/Language/Haskell/Refact/Utils/Variables.hs
bsd-3-clause
rdrName2Name :: GHC.Located GHC.RdrName -> RefactGhc GHC.Name rdrName2Name ln = do nameMap <- getRefactNameMap return (rdrName2NamePure nameMap ln)
151
rdrName2Name :: GHC.Located GHC.RdrName -> RefactGhc GHC.Name rdrName2Name ln = do nameMap <- getRefactNameMap return (rdrName2NamePure nameMap ln)
151
rdrName2Name ln = do nameMap <- getRefactNameMap return (rdrName2NamePure nameMap ln)
89
false
true
0
9
21
51
23
28
null
null
paulbarbu/haskell-ground
rpn.hs
apache-2.0
parseItem (x:y:xs) "^" = y**x :xs
33
parseItem (x:y:xs) "^" = y**x :xs
33
parseItem (x:y:xs) "^" = y**x :xs
33
false
false
0
8
5
30
15
15
null
null
sdiehl/ghc
compiler/utils/UniqDFM.hs
bsd-3-clause
addToUDFM_C :: Uniquable key => (elt -> elt -> elt) -- old -> new -> result -> UniqDFM elt -- old -> key -> elt -- new -> UniqDFM elt -- result addToUDFM_C f m k v = addToUDFM_Directly_C f m (getUnique k) v
214
addToUDFM_C :: Uniquable key => (elt -> elt -> elt) -- old -> new -> result -> UniqDFM elt -- old -> key -> elt -- new -> UniqDFM elt addToUDFM_C f m k v = addToUDFM_Directly_C f m (getUnique k) v
204
addToUDFM_C f m k v = addToUDFM_Directly_C f m (getUnique k) v
62
true
true
0
11
51
83
41
42
null
null
beni55/haste-compiler
libraries/ghc-7.10/base/Numeric.hs
bsd-3-clause
-- | Show /non-negative/ 'Integral' numbers in base 8. showOct :: (Integral a, Show a) => a -> ShowS showOct = showIntAtBase 8 intToDigit
138
showOct :: (Integral a, Show a) => a -> ShowS showOct = showIntAtBase 8 intToDigit
83
showOct = showIntAtBase 8 intToDigit
37
true
true
0
6
24
36
19
17
null
null
input-output-hk/cardano-sl
explorer/frontend/nix/generate-frontend-deps.hs
apache-2.0
---------------------------------------------------------------------------- -- | Run a shell command only if the destination file is out of date -- with respect to the source file. cachedShell :: [FilePath] -> FilePath -> (FilePath -> Shell ()) -> Shell () cachedShell srcs dst action = needsChange srcs dst >>= \case True -> do printf ("Generating " % fp % "\n") dst tmp <- mktempfile "." (tt $ basename dst) action tmp whenM (testpath dst) $ rm dst input tmp & stampFile srcs & output dst False -> printf (fp % " is already up to date according to " % s % "\n") dst (T.intercalate ", " $ map tt srcs) -- | A file needs a change if its hash doesn't match or it doesn't exist.
718
cachedShell :: [FilePath] -> FilePath -> (FilePath -> Shell ()) -> Shell () cachedShell srcs dst action = needsChange srcs dst >>= \case True -> do printf ("Generating " % fp % "\n") dst tmp <- mktempfile "." (tt $ basename dst) action tmp whenM (testpath dst) $ rm dst input tmp & stampFile srcs & output dst False -> printf (fp % " is already up to date according to " % s % "\n") dst (T.intercalate ", " $ map tt srcs) -- | A file needs a change if its hash doesn't match or it doesn't exist.
535
cachedShell srcs dst action = needsChange srcs dst >>= \case True -> do printf ("Generating " % fp % "\n") dst tmp <- mktempfile "." (tt $ basename dst) action tmp whenM (testpath dst) $ rm dst input tmp & stampFile srcs & output dst False -> printf (fp % " is already up to date according to " % s % "\n") dst (T.intercalate ", " $ map tt srcs) -- | A file needs a change if its hash doesn't match or it doesn't exist.
459
true
true
2
12
163
204
96
108
null
null
Rathcke/uni
ap/advanced programming/assignment2/SalsaParser.hs
gpl-3.0
reserved :: [String] reserved = ["toggle", "hidden", "circle", "rectangle"]
75
reserved :: [String] reserved = ["toggle", "hidden", "circle", "rectangle"]
75
reserved = ["toggle", "hidden", "circle", "rectangle"]
54
false
true
0
5
8
26
16
10
null
null
bovinespirit/enummapmap
test/EnumMapMapVsIntMap.hs
bsd-3-clause
runProp4 :: Eq t => (IM.IntMap Int -> t) -> (TestMap4 -> t) -> Int -> Int -> Int -> [(Int, Int)] -> Bool runProp4 f g k1 k2 k3 list = f (IM.fromList list) == g (EMM.fromList $ list2l4 k1 k2 k3 list)
268
runProp4 :: Eq t => (IM.IntMap Int -> t) -> (TestMap4 -> t) -> Int -> Int -> Int -> [(Int, Int)] -> Bool runProp4 f g k1 k2 k3 list = f (IM.fromList list) == g (EMM.fromList $ list2l4 k1 k2 k3 list)
268
runProp4 f g k1 k2 k3 list = f (IM.fromList list) == g (EMM.fromList $ list2l4 k1 k2 k3 list)
97
false
true
0
13
113
119
60
59
null
null
39aldo39/klfc
scripts/Usage.hs
gpl-3.0
addSubTitles (x:x'@('#':_):xs) | all isSpace x = x : x' : addSubTitles xs | otherwise = x : ("#" ⊕ x' ⊕ "#") : addSubTitles xs
130
addSubTitles (x:x'@('#':_):xs) | all isSpace x = x : x' : addSubTitles xs | otherwise = x : ("#" ⊕ x' ⊕ "#") : addSubTitles xs
130
addSubTitles (x:x'@('#':_):xs) | all isSpace x = x : x' : addSubTitles xs | otherwise = x : ("#" ⊕ x' ⊕ "#") : addSubTitles xs
130
false
false
1
11
29
81
40
41
null
null
GaloisInc/ivory
ivory-model-check/src/Ivory/ModelCheck/CVC4.hs
bsd-3-clause
store :: Expr -> Expr -> Expr store = Store
43
store :: Expr -> Expr -> Expr store = Store
43
store = Store
13
false
true
0
8
9
26
11
15
null
null
peter-fogg/pardoc
src/Text/Pandoc/Pretty.hs
gpl-2.0
-- | A carriage return. Does nothing if we're at the beginning of -- a line; otherwise inserts a newline. cr :: Doc cr = Doc $ singleton CarriageReturn
152
cr :: Doc cr = Doc $ singleton CarriageReturn
45
cr = Doc $ singleton CarriageReturn
35
true
true
0
6
29
26
12
14
null
null
AKST/jo
source/test/JoScript/Pass/LexerTest.hs
mit
tests :: [Test] tests = [ TestLabel "JoScript.Pass.Lexer (integers)" lexerUnsignedInteger , TestLabel "JoScript.Pass.Lexer (floats)" lexerUnsignedFloat , TestLabel "JoScript.Pass.Lexer (signed integers)" lexerSignedInteger , TestLabel "JoScript.Pass.Lexer (signed floats)" lexerSignedFloat ]
319
tests :: [Test] tests = [ TestLabel "JoScript.Pass.Lexer (integers)" lexerUnsignedInteger , TestLabel "JoScript.Pass.Lexer (floats)" lexerUnsignedFloat , TestLabel "JoScript.Pass.Lexer (signed integers)" lexerSignedInteger , TestLabel "JoScript.Pass.Lexer (signed floats)" lexerSignedFloat ]
319
tests = [ TestLabel "JoScript.Pass.Lexer (integers)" lexerUnsignedInteger , TestLabel "JoScript.Pass.Lexer (floats)" lexerUnsignedFloat , TestLabel "JoScript.Pass.Lexer (signed integers)" lexerSignedInteger , TestLabel "JoScript.Pass.Lexer (signed floats)" lexerSignedFloat ]
303
false
true
0
6
55
46
24
22
null
null
bravit/Idris-dev
src/Idris/Core/CaseTree.hs
bsd-3-clause
isConstType (Str _) StrType = True
34
isConstType (Str _) StrType = True
34
isConstType (Str _) StrType = True
34
false
false
1
6
5
19
8
11
null
null
cutsea110/aop
src/StudyICBICSort.hs
bsd-3-clause
swap :: Ord a => (a, [a]) -> (a, [a]) swap (x, xs) = case break (x<) xs of (xs', []) -> (x, xs') (xs', y:ys) -> (x, xs') <+> swap (y, ys) where (x, xs) <+> (y, ys) = (y, xs++[x]++ys)
192
swap :: Ord a => (a, [a]) -> (a, [a]) swap (x, xs) = case break (x<) xs of (xs', []) -> (x, xs') (xs', y:ys) -> (x, xs') <+> swap (y, ys) where (x, xs) <+> (y, ys) = (y, xs++[x]++ys)
192
swap (x, xs) = case break (x<) xs of (xs', []) -> (x, xs') (xs', y:ys) -> (x, xs') <+> swap (y, ys) where (x, xs) <+> (y, ys) = (y, xs++[x]++ys)
154
false
true
0
14
51
164
92
72
null
null
eagletmt/ghc-mod
GHCMod.hs
bsd-3-clause
usage :: String usage = "ghc-mod version " ++ showVersion version ++ "\n" ++ "Usage:\n" ++ "\t ghc-mod list" ++ ghcOptHelp ++ "[-l]\n" ++ "\t ghc-mod lang [-l]\n" ++ "\t ghc-mod flag [-l]\n" ++ "\t ghc-mod browse" ++ ghcOptHelp ++ "[-l] [-o] [-d] <module> [<module> ...]\n" ++ "\t ghc-mod check" ++ ghcOptHelp ++ "<HaskellFile>\n" ++ "\t ghc-mod expand" ++ ghcOptHelp ++ "<HaskellFile>\n" ++ "\t ghc-mod debug" ++ ghcOptHelp ++ "<HaskellFile>\n" ++ "\t ghc-mod info" ++ ghcOptHelp ++ "<HaskellFile> <module> <expression>\n" ++ "\t ghc-mod type" ++ ghcOptHelp ++ "<HaskellFile> <module> <line-no> <column-no>\n" ++ "\t ghc-mod lint [-h opt] <HaskellFile>\n" ++ "\t ghc-mod boot\n" ++ "\t ghc-mod help\n"
809
usage :: String usage = "ghc-mod version " ++ showVersion version ++ "\n" ++ "Usage:\n" ++ "\t ghc-mod list" ++ ghcOptHelp ++ "[-l]\n" ++ "\t ghc-mod lang [-l]\n" ++ "\t ghc-mod flag [-l]\n" ++ "\t ghc-mod browse" ++ ghcOptHelp ++ "[-l] [-o] [-d] <module> [<module> ...]\n" ++ "\t ghc-mod check" ++ ghcOptHelp ++ "<HaskellFile>\n" ++ "\t ghc-mod expand" ++ ghcOptHelp ++ "<HaskellFile>\n" ++ "\t ghc-mod debug" ++ ghcOptHelp ++ "<HaskellFile>\n" ++ "\t ghc-mod info" ++ ghcOptHelp ++ "<HaskellFile> <module> <expression>\n" ++ "\t ghc-mod type" ++ ghcOptHelp ++ "<HaskellFile> <module> <line-no> <column-no>\n" ++ "\t ghc-mod lint [-h opt] <HaskellFile>\n" ++ "\t ghc-mod boot\n" ++ "\t ghc-mod help\n"
809
usage = "ghc-mod version " ++ showVersion version ++ "\n" ++ "Usage:\n" ++ "\t ghc-mod list" ++ ghcOptHelp ++ "[-l]\n" ++ "\t ghc-mod lang [-l]\n" ++ "\t ghc-mod flag [-l]\n" ++ "\t ghc-mod browse" ++ ghcOptHelp ++ "[-l] [-o] [-d] <module> [<module> ...]\n" ++ "\t ghc-mod check" ++ ghcOptHelp ++ "<HaskellFile>\n" ++ "\t ghc-mod expand" ++ ghcOptHelp ++ "<HaskellFile>\n" ++ "\t ghc-mod debug" ++ ghcOptHelp ++ "<HaskellFile>\n" ++ "\t ghc-mod info" ++ ghcOptHelp ++ "<HaskellFile> <module> <expression>\n" ++ "\t ghc-mod type" ++ ghcOptHelp ++ "<HaskellFile> <module> <line-no> <column-no>\n" ++ "\t ghc-mod lint [-h opt] <HaskellFile>\n" ++ "\t ghc-mod boot\n" ++ "\t ghc-mod help\n"
793
false
true
26
7
212
150
66
84
null
null
mightymoose/liquidhaskell
tests/neg/RG.hs
bsd-3-clause
test :: () test = generic_accept_stable proves_reflexivity
58
test :: () test = generic_accept_stable proves_reflexivity
58
test = generic_accept_stable proves_reflexivity
47
false
true
0
5
6
16
8
8
null
null
hsyl20/ViperVM
haskus-system/src/lib/Haskus/System/Linux/Graphics/State.hs
bsd-3-clause
rawGet :: MonadInIO m => Handle -> StructGetConnector -> FlowT '[InvalidParam,InvalidProperty,EntryNotFound] m (StructGetConnector,Connector) rawGet hdl res2 = do let allocaArray' :: (MonadInIO m, Integral c, Storable a) => c -> (Ptr a -> m b) -> m b allocaArray' n = allocaArray (fromIntegral n) allocaArray' (connModesCount res2) $ \(ms :: Ptr StructMode) -> allocaArray' (connPropsCount res2) $ \(ps :: Ptr Word32) -> allocaArray' (connPropsCount res2) $ \(pvs :: Ptr Word64) -> allocaArray' (connEncodersCount res2) $ \(es:: Ptr Word32) -> do let cv = fromIntegral . ptrToWordPtr res3 = res2 { connEncodersPtr = cv es , connModesPtr = cv ms , connPropsPtr = cv ps , connPropValuesPtr = cv pvs } res4 <- liftFlowT <| getConnector' hdl res3 (res4,) <|| liftFlowT <| parseRes hdl res2 res4
1,053
rawGet :: MonadInIO m => Handle -> StructGetConnector -> FlowT '[InvalidParam,InvalidProperty,EntryNotFound] m (StructGetConnector,Connector) rawGet hdl res2 = do let allocaArray' :: (MonadInIO m, Integral c, Storable a) => c -> (Ptr a -> m b) -> m b allocaArray' n = allocaArray (fromIntegral n) allocaArray' (connModesCount res2) $ \(ms :: Ptr StructMode) -> allocaArray' (connPropsCount res2) $ \(ps :: Ptr Word32) -> allocaArray' (connPropsCount res2) $ \(pvs :: Ptr Word64) -> allocaArray' (connEncodersCount res2) $ \(es:: Ptr Word32) -> do let cv = fromIntegral . ptrToWordPtr res3 = res2 { connEncodersPtr = cv es , connModesPtr = cv ms , connPropsPtr = cv ps , connPropValuesPtr = cv pvs } res4 <- liftFlowT <| getConnector' hdl res3 (res4,) <|| liftFlowT <| parseRes hdl res2 res4
1,053
rawGet hdl res2 = do let allocaArray' :: (MonadInIO m, Integral c, Storable a) => c -> (Ptr a -> m b) -> m b allocaArray' n = allocaArray (fromIntegral n) allocaArray' (connModesCount res2) $ \(ms :: Ptr StructMode) -> allocaArray' (connPropsCount res2) $ \(ps :: Ptr Word32) -> allocaArray' (connPropsCount res2) $ \(pvs :: Ptr Word64) -> allocaArray' (connEncodersCount res2) $ \(es:: Ptr Word32) -> do let cv = fromIntegral . ptrToWordPtr res3 = res2 { connEncodersPtr = cv es , connModesPtr = cv ms , connPropsPtr = cv ps , connPropValuesPtr = cv pvs } res4 <- liftFlowT <| getConnector' hdl res3 (res4,) <|| liftFlowT <| parseRes hdl res2 res4
911
false
true
0
22
387
335
168
167
null
null
cocreature/leksah
src/IDE/Package.hs
gpl-2.0
interactiveFlag :: Text -> Bool -> Text interactiveFlag name f = (if f then "-f" else "-fno-") <> name
102
interactiveFlag :: Text -> Bool -> Text interactiveFlag name f = (if f then "-f" else "-fno-") <> name
102
interactiveFlag name f = (if f then "-f" else "-fno-") <> name
62
false
true
0
8
18
45
22
23
null
null
brendanhay/gogol
gogol-doubleclick-search/gen/Network/Google/Resource/DoubleClickSearch/Conversion/Patch.hs
mpl-2.0
-- | Last date (inclusive) on which to retrieve conversions. Format is -- yyyymmdd. cpEndDate :: Lens' ConversionPatch Int32 cpEndDate = lens _cpEndDate (\ s a -> s{_cpEndDate = a}) . _Coerce
199
cpEndDate :: Lens' ConversionPatch Int32 cpEndDate = lens _cpEndDate (\ s a -> s{_cpEndDate = a}) . _Coerce
115
cpEndDate = lens _cpEndDate (\ s a -> s{_cpEndDate = a}) . _Coerce
74
true
true
0
9
39
52
26
26
null
null
ekr/tamarin-prover
src/Web/Theory.hs
gpl-3.0
isInterestingMethod :: ProofMethod -> Bool isInterestingMethod (Sorry _) = True
79
isInterestingMethod :: ProofMethod -> Bool isInterestingMethod (Sorry _) = True
79
isInterestingMethod (Sorry _) = True
36
false
true
0
7
9
24
12
12
null
null
tomjefferys/fuligite
test/Test.hs
mit
testClosure = hyaliteTest "Test simple closure" $ testScript % "(var mkAdd (fn {n} (fn {m} (+ m n))))" % "(var add2 (mkAdd 2))" % "(add2 3)" % (Lit $ I 5) % "(add2 10)" % (Lit $ I 12)
206
testClosure = hyaliteTest "Test simple closure" $ testScript % "(var mkAdd (fn {n} (fn {m} (+ m n))))" % "(var add2 (mkAdd 2))" % "(add2 3)" % (Lit $ I 5) % "(add2 10)" % (Lit $ I 12)
206
testClosure = hyaliteTest "Test simple closure" $ testScript % "(var mkAdd (fn {n} (fn {m} (+ m n))))" % "(var add2 (mkAdd 2))" % "(add2 3)" % (Lit $ I 5) % "(add2 10)" % (Lit $ I 12)
206
false
false
7
8
61
67
28
39
null
null
worksap-ate/aws-sdk
Cloud/AWS/EC2/Params.hs
bsd-3-clause
privateIpAddressesParam :: Text -> [IPv4] -> QueryParam privateIpAddressesParam name = (name |.#.) . map (\a -> ["PrivateIpAddress" |= a])
142
privateIpAddressesParam :: Text -> [IPv4] -> QueryParam privateIpAddressesParam name = (name |.#.) . map (\a -> ["PrivateIpAddress" |= a])
142
privateIpAddressesParam name = (name |.#.) . map (\a -> ["PrivateIpAddress" |= a])
86
false
true
0
10
22
51
28
23
null
null
zporky/langs-and-paradigms
projects/EJULOK/Haskell/StateMachine.hs
mit
state_T1_3_5 ("", o) = o
24
state_T1_3_5 ("", o) = o
24
state_T1_3_5 ("", o) = o
24
false
false
0
5
4
16
8
8
null
null
KaneTW/knxd-native-client
src/KNXd/Client/Internal/Types.hs
mit
fromPacketType BusmonitorPacket = 20
36
fromPacketType BusmonitorPacket = 20
36
fromPacketType BusmonitorPacket = 20
36
false
false
0
5
3
9
4
5
null
null
AlexanderPankiv/ghc
compiler/basicTypes/IdInfo.hs
bsd-3-clause
-- | Assumes that the 'Id' has CAF references: definitely safe vanillaCafInfo :: CafInfo vanillaCafInfo = MayHaveCafRefs
120
vanillaCafInfo :: CafInfo vanillaCafInfo = MayHaveCafRefs
57
vanillaCafInfo = MayHaveCafRefs
31
true
true
0
4
16
12
7
5
null
null
AubreyEAnderson/shellcheck
ShellCheck/Parser.hs
gpl-3.0
prop_readScript4 = isWarning readScript "#!/usr/bin/perl\nfoo=("
64
prop_readScript4 = isWarning readScript "#!/usr/bin/perl\nfoo=("
64
prop_readScript4 = isWarning readScript "#!/usr/bin/perl\nfoo=("
64
false
false
0
5
4
11
5
6
null
null
prl-tokyo/bigul-configuration-adaptation
Transformations/src/BiFlux/DTD/TypeDef.hs
mit
notPrelude n = n
24
notPrelude n = n
24
notPrelude n = n
24
false
false
0
5
11
9
4
5
null
null
shnarazk/profileAnalyzer
GHC/ProfileAnalyzer/ParseProfile.hs
gpl-3.0
skipLine = optional (many1 (noneOf "\n")) >> newline
52
skipLine = optional (many1 (noneOf "\n")) >> newline
52
skipLine = optional (many1 (noneOf "\n")) >> newline
52
false
false
0
10
7
25
12
13
null
null
ArturB/Multilinear
test/all/GPU.hs
gpl-3.0
formConstructorError :: Char -> Positive (Small Int) -> Tensor Double -> Property formConstructorError = ConstructorsTests.formConstructorError
143
formConstructorError :: Char -> Positive (Small Int) -> Tensor Double -> Property formConstructorError = ConstructorsTests.formConstructorError
143
formConstructorError = ConstructorsTests.formConstructorError
61
false
true
0
10
14
44
19
25
null
null
shlevy/ghc
compiler/simplCore/SetLevels.hs
bsd-3-clause
-- extendCaseBndrEnv adds the mapping case-bndr->scrut-var if it can -- See Note [Binder-swap during float-out] extendCaseBndrEnv :: LevelEnv -> Id -- Pre-cloned case binder -> Expr LevelledBndr -- Post-cloned scrutinee -> LevelEnv extendCaseBndrEnv le@(LE { le_subst = subst, le_env = id_env }) case_bndr (Var scrut_var) = le { le_subst = extendSubstWithVar subst case_bndr scrut_var , le_env = add_id id_env (case_bndr, scrut_var) }
538
extendCaseBndrEnv :: LevelEnv -> Id -- Pre-cloned case binder -> Expr LevelledBndr -- Post-cloned scrutinee -> LevelEnv extendCaseBndrEnv le@(LE { le_subst = subst, le_env = id_env }) case_bndr (Var scrut_var) = le { le_subst = extendSubstWithVar subst case_bndr scrut_var , le_env = add_id id_env (case_bndr, scrut_var) }
426
extendCaseBndrEnv le@(LE { le_subst = subst, le_env = id_env }) case_bndr (Var scrut_var) = le { le_subst = extendSubstWithVar subst case_bndr scrut_var , le_env = add_id id_env (case_bndr, scrut_var) }
235
true
true
0
10
165
96
54
42
null
null
pparkkin/eta
compiler/ETA/Prelude/PrelNames.hs
bsd-3-clause
-- Module GHC.Num numClassName, fromIntegerName, minusName, negateName :: Name numClassName = clsQual gHC_NUM (fsLit "Num") numClassKey
148
numClassName, fromIntegerName, minusName, negateName :: Name numClassName = clsQual gHC_NUM (fsLit "Num") numClassKey
130
numClassName = clsQual gHC_NUM (fsLit "Num") numClassKey
69
true
true
0
7
28
31
19
12
null
null
begriffs/postgrest
src/PostgREST/Auth.hs
mit
jwkFromSecret :: ByteString -> JWK jwkFromSecret key = fromKeyMaterial km & jwkUse ?~ Sig & jwkAlg ?~ JWSAlg HS256 where km = OctKeyMaterial (OctKeyParameters (JOSE.Types.Base64Octets key))
202
jwkFromSecret :: ByteString -> JWK jwkFromSecret key = fromKeyMaterial km & jwkUse ?~ Sig & jwkAlg ?~ JWSAlg HS256 where km = OctKeyMaterial (OctKeyParameters (JOSE.Types.Base64Octets key))
202
jwkFromSecret key = fromKeyMaterial km & jwkUse ?~ Sig & jwkAlg ?~ JWSAlg HS256 where km = OctKeyMaterial (OctKeyParameters (JOSE.Types.Base64Octets key))
167
false
true
4
10
38
68
32
36
null
null
atsukotakahashi/wi
src/library/Yi/Syntax/Paren.hs
gpl-2.0
tokenToStroke :: TT -> Stroke tokenToStroke = fmap tokenToStyle . tokToSpan
75
tokenToStroke :: TT -> Stroke tokenToStroke = fmap tokenToStyle . tokToSpan
75
tokenToStroke = fmap tokenToStyle . tokToSpan
45
false
true
0
6
10
22
11
11
null
null
peter-fogg/pardoc
src/Text/Pandoc/Writers/Docx.hs
gpl-2.0
inlineToOpenXML opts (Span (_,classes,kvs) ils) | "insertion" `elem` classes = do defaultAuthor <- gets stChangesAuthor defaultDate <- gets stChangesDate let author = fromMaybe defaultAuthor (lookup "author" kvs) date = fromMaybe defaultDate (lookup "date" kvs) insId <- gets stInsId modify $ \s -> s{stInsId = (insId + 1)} x <- inlinesToOpenXML opts ils return [ mknode "w:ins" [("w:id", (show insId)), ("w:author", author), ("w:date", date)] x ] | "deletion" `elem` classes = do defaultAuthor <- gets stChangesAuthor defaultDate <- gets stChangesDate let author = fromMaybe defaultAuthor (lookup "author" kvs) date = fromMaybe defaultDate (lookup "date" kvs) delId <- gets stDelId modify $ \s -> s{stDelId = (delId + 1)} modify $ \s -> s{stInDel = True} x <- inlinesToOpenXML opts ils modify $ \s -> s{stInDel = False} return [ mknode "w:del" [("w:id", (show delId)), ("w:author", author), ("w:date", date)] x ] | otherwise = do let off x = withTextProp (mknode x [("w:val","0")] ()) ((if "csl-no-emph" `elem` classes then off "w:i" else id) . (if "csl-no-strong" `elem` classes then off "w:b" else id) . (if "csl-no-smallcaps" `elem` classes then off "w:smallCaps" else id)) $ inlinesToOpenXML opts ils
1,461
inlineToOpenXML opts (Span (_,classes,kvs) ils) | "insertion" `elem` classes = do defaultAuthor <- gets stChangesAuthor defaultDate <- gets stChangesDate let author = fromMaybe defaultAuthor (lookup "author" kvs) date = fromMaybe defaultDate (lookup "date" kvs) insId <- gets stInsId modify $ \s -> s{stInsId = (insId + 1)} x <- inlinesToOpenXML opts ils return [ mknode "w:ins" [("w:id", (show insId)), ("w:author", author), ("w:date", date)] x ] | "deletion" `elem` classes = do defaultAuthor <- gets stChangesAuthor defaultDate <- gets stChangesDate let author = fromMaybe defaultAuthor (lookup "author" kvs) date = fromMaybe defaultDate (lookup "date" kvs) delId <- gets stDelId modify $ \s -> s{stDelId = (delId + 1)} modify $ \s -> s{stInDel = True} x <- inlinesToOpenXML opts ils modify $ \s -> s{stInDel = False} return [ mknode "w:del" [("w:id", (show delId)), ("w:author", author), ("w:date", date)] x ] | otherwise = do let off x = withTextProp (mknode x [("w:val","0")] ()) ((if "csl-no-emph" `elem` classes then off "w:i" else id) . (if "csl-no-strong" `elem` classes then off "w:b" else id) . (if "csl-no-smallcaps" `elem` classes then off "w:smallCaps" else id)) $ inlinesToOpenXML opts ils
1,461
inlineToOpenXML opts (Span (_,classes,kvs) ils) | "insertion" `elem` classes = do defaultAuthor <- gets stChangesAuthor defaultDate <- gets stChangesDate let author = fromMaybe defaultAuthor (lookup "author" kvs) date = fromMaybe defaultDate (lookup "date" kvs) insId <- gets stInsId modify $ \s -> s{stInsId = (insId + 1)} x <- inlinesToOpenXML opts ils return [ mknode "w:ins" [("w:id", (show insId)), ("w:author", author), ("w:date", date)] x ] | "deletion" `elem` classes = do defaultAuthor <- gets stChangesAuthor defaultDate <- gets stChangesDate let author = fromMaybe defaultAuthor (lookup "author" kvs) date = fromMaybe defaultDate (lookup "date" kvs) delId <- gets stDelId modify $ \s -> s{stDelId = (delId + 1)} modify $ \s -> s{stInDel = True} x <- inlinesToOpenXML opts ils modify $ \s -> s{stInDel = False} return [ mknode "w:del" [("w:id", (show delId)), ("w:author", author), ("w:date", date)] x ] | otherwise = do let off x = withTextProp (mknode x [("w:val","0")] ()) ((if "csl-no-emph" `elem` classes then off "w:i" else id) . (if "csl-no-strong" `elem` classes then off "w:b" else id) . (if "csl-no-smallcaps" `elem` classes then off "w:smallCaps" else id)) $ inlinesToOpenXML opts ils
1,461
false
false
2
15
440
540
278
262
null
null
siddhanathan/ghc
libraries/base/Data/OldList.hs
bsd-3-clause
sort = sortBy compare
21
sort = sortBy compare
21
sort = sortBy compare
21
false
false
1
5
3
12
4
8
null
null
javgh/bridgewalker
src/Rebalancer.hs
bsd-3-clause
getConfFile :: FilePath -> FilePath getConfFile home = home </> ".bridgewalker/workingfund"
91
getConfFile :: FilePath -> FilePath getConfFile home = home </> ".bridgewalker/workingfund"
91
getConfFile home = home </> ".bridgewalker/workingfund"
55
false
true
0
5
10
22
11
11
null
null
chainone/HForgeAPIClient
app/Main.hs
bsd-3-clause
generateViewingConfigFileString :: OxygenClientToken -> String -> String generateViewingConfigFileString token docURN = "var documentURN = 'urn:" ++ docURN ++ "'; var token = \"" ++ access_token token ++ "\";"
209
generateViewingConfigFileString :: OxygenClientToken -> String -> String generateViewingConfigFileString token docURN = "var documentURN = 'urn:" ++ docURN ++ "'; var token = \"" ++ access_token token ++ "\";"
209
generateViewingConfigFileString token docURN = "var documentURN = 'urn:" ++ docURN ++ "'; var token = \"" ++ access_token token ++ "\";"
136
false
true
0
8
27
43
21
22
null
null
da-x/Algorithm-W-Step-By-Step
Lamdu/Infer/Internal/Monad.hs
gpl-3.0
narrowTVScope :: (Monad m, VarKind t) => SkolemScope -> T.Var t -> InferCtx m () narrowTVScope skolems varName = ctxState . inferSkolemsInScope . skolemsInScopeMap . Lens.at varName . Lens._Just . Scope.skolemScopeVars %= TV.intersection (skolems ^. Scope.skolemScopeVars) & Infer
292
narrowTVScope :: (Monad m, VarKind t) => SkolemScope -> T.Var t -> InferCtx m () narrowTVScope skolems varName = ctxState . inferSkolemsInScope . skolemsInScopeMap . Lens.at varName . Lens._Just . Scope.skolemScopeVars %= TV.intersection (skolems ^. Scope.skolemScopeVars) & Infer
292
narrowTVScope skolems varName = ctxState . inferSkolemsInScope . skolemsInScopeMap . Lens.at varName . Lens._Just . Scope.skolemScopeVars %= TV.intersection (skolems ^. Scope.skolemScopeVars) & Infer
211
false
true
2
10
49
104
50
54
null
null
sopvop/cabal
cabal-install/Distribution/Client/List.hs
bsd-3-clause
showPackageSummaryInfo :: PackageDisplayInfo -> String showPackageSummaryInfo pkginfo = renderStyle (style {lineLength = 80, ribbonsPerLine = 1}) $ char '*' <+> disp (pkgName pkginfo) $+$ (nest 4 $ vcat [ maybeShow (synopsis pkginfo) "Synopsis:" reflowParagraphs , text "Default available version:" <+> case selectedSourcePkg pkginfo of Nothing -> text "[ Not available from any configured repository ]" Just pkg -> disp (packageVersion pkg) , text "Installed versions:" <+> case installedVersions pkginfo of [] | hasLib pkginfo -> text "[ Not installed ]" | otherwise -> text "[ Unknown ]" versions -> dispTopVersions 4 (preferredVersions pkginfo) versions , maybeShow (homepage pkginfo) "Homepage:" text , text "License: " <+> text (display (license pkginfo)) ]) $+$ text "" where maybeShow [] _ _ = empty maybeShow l s f = text s <+> (f l)
1,024
showPackageSummaryInfo :: PackageDisplayInfo -> String showPackageSummaryInfo pkginfo = renderStyle (style {lineLength = 80, ribbonsPerLine = 1}) $ char '*' <+> disp (pkgName pkginfo) $+$ (nest 4 $ vcat [ maybeShow (synopsis pkginfo) "Synopsis:" reflowParagraphs , text "Default available version:" <+> case selectedSourcePkg pkginfo of Nothing -> text "[ Not available from any configured repository ]" Just pkg -> disp (packageVersion pkg) , text "Installed versions:" <+> case installedVersions pkginfo of [] | hasLib pkginfo -> text "[ Not installed ]" | otherwise -> text "[ Unknown ]" versions -> dispTopVersions 4 (preferredVersions pkginfo) versions , maybeShow (homepage pkginfo) "Homepage:" text , text "License: " <+> text (display (license pkginfo)) ]) $+$ text "" where maybeShow [] _ _ = empty maybeShow l s f = text s <+> (f l)
1,024
showPackageSummaryInfo pkginfo = renderStyle (style {lineLength = 80, ribbonsPerLine = 1}) $ char '*' <+> disp (pkgName pkginfo) $+$ (nest 4 $ vcat [ maybeShow (synopsis pkginfo) "Synopsis:" reflowParagraphs , text "Default available version:" <+> case selectedSourcePkg pkginfo of Nothing -> text "[ Not available from any configured repository ]" Just pkg -> disp (packageVersion pkg) , text "Installed versions:" <+> case installedVersions pkginfo of [] | hasLib pkginfo -> text "[ Not installed ]" | otherwise -> text "[ Unknown ]" versions -> dispTopVersions 4 (preferredVersions pkginfo) versions , maybeShow (homepage pkginfo) "Homepage:" text , text "License: " <+> text (display (license pkginfo)) ]) $+$ text "" where maybeShow [] _ _ = empty maybeShow l s f = text s <+> (f l)
969
false
true
10
16
311
309
140
169
null
null
shlevy/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp _ [] PrefetchAddrOp3 args = doPrefetchAddrOp 3 args
76
emitPrimOp _ [] PrefetchAddrOp3 args = doPrefetchAddrOp 3 args
76
emitPrimOp _ [] PrefetchAddrOp3 args = doPrefetchAddrOp 3 args
76
false
false
1
5
22
26
10
16
null
null
thomkoehler/FunLang
src/TIM/Compiler.hs
bsd-3-clause
compileToInstructions :: Expr -> TimCompilerEnv -> [Instruction] compileToInstructions (EAp e0 e1) env = Push (compileToAMode e1 env) : compileToInstructions e0 env
164
compileToInstructions :: Expr -> TimCompilerEnv -> [Instruction] compileToInstructions (EAp e0 e1) env = Push (compileToAMode e1 env) : compileToInstructions e0 env
164
compileToInstructions (EAp e0 e1) env = Push (compileToAMode e1 env) : compileToInstructions e0 env
99
false
true
0
8
20
55
27
28
null
null
zeniuseducation/poly-euler
Alfa/haskell/tutorial/one.hs
epl-1.0
nlattice :: Int -> Int nlattice n = if even n then div n 2 else 3*n + 1
71
nlattice :: Int -> Int nlattice n = if even n then div n 2 else 3*n + 1
71
nlattice n = if even n then div n 2 else 3*n + 1
48
false
true
0
7
18
42
21
21
null
null
bgamari/unordered-containers
tests/HashMapProperties.hs
bsd-3-clause
pReadShow :: [(Key, Int)] -> Bool pReadShow xs = M.fromList xs == read (show (M.fromList xs))
93
pReadShow :: [(Key, Int)] -> Bool pReadShow xs = M.fromList xs == read (show (M.fromList xs))
93
pReadShow xs = M.fromList xs == read (show (M.fromList xs))
59
false
true
0
11
15
53
27
26
null
null
rlupton20/vanguard-dataplane
app/Command/Control.hs
gpl-3.0
develop :: Connection -> Controller (Either Int Response) develop connection = do env <- ask liftIO $ do cv <- newCommVar let message = Direct connection cv message `passTo` (commandQueue env) c <- takeCommVar cv return . Right $ ConnectingWith c
270
develop :: Connection -> Controller (Either Int Response) develop connection = do env <- ask liftIO $ do cv <- newCommVar let message = Direct connection cv message `passTo` (commandQueue env) c <- takeCommVar cv return . Right $ ConnectingWith c
270
develop connection = do env <- ask liftIO $ do cv <- newCommVar let message = Direct connection cv message `passTo` (commandQueue env) c <- takeCommVar cv return . Right $ ConnectingWith c
212
false
true
0
14
64
107
48
59
null
null
bergmark/purescript
src/Language/PureScript/CodeGen/Common.hs
mit
identCharToString ':' = "$colon"
32
identCharToString ':' = "$colon"
32
identCharToString ':' = "$colon"
32
false
false
0
5
3
9
4
5
null
null
tchagnon/cs636-raytracer
a3/RayTracer.hs
apache-2.0
-- Calculate the diffuse and specular light intesity of a single light diffSpec :: Material -> Vec3f -> Vec3f -> Vec3f -> Light -> Color diffSpec mat ixPt nVec vVec light = let kd = Material.kd mat in let ks = Material.ks mat in let n = Material.n mat in let iL = color light in let lVec = norm ((position light)-ixPt) in let rVec = norm (((2 * (nVec `dot0` lVec)) `svMul` nVec) - lVec) in let cosT = nVec `dot0` lVec in let cosP = (rVec `dot0` vVec) ** n in (kd * cosT + ks * cosP) `svMul` iL
650
diffSpec :: Material -> Vec3f -> Vec3f -> Vec3f -> Light -> Color diffSpec mat ixPt nVec vVec light = let kd = Material.kd mat in let ks = Material.ks mat in let n = Material.n mat in let iL = color light in let lVec = norm ((position light)-ixPt) in let rVec = norm (((2 * (nVec `dot0` lVec)) `svMul` nVec) - lVec) in let cosT = nVec `dot0` lVec in let cosP = (rVec `dot0` vVec) ** n in (kd * cosT + ks * cosP) `svMul` iL
579
diffSpec mat ixPt nVec vVec light = let kd = Material.kd mat in let ks = Material.ks mat in let n = Material.n mat in let iL = color light in let lVec = norm ((position light)-ixPt) in let rVec = norm (((2 * (nVec `dot0` lVec)) `svMul` nVec) - lVec) in let cosT = nVec `dot0` lVec in let cosP = (rVec `dot0` vVec) ** n in (kd * cosT + ks * cosP) `svMul` iL
513
true
true
0
27
258
240
122
118
null
null
fpco/stackage-sandbox
main/Sandbox.hs
mit
getPackageDb :: IO Text getPackageDb = parsePackageDb >>= \mdb -> case mdb of Just packageDb -> return packageDb Nothing -> throwIO $ PackageDbNotFound
155
getPackageDb :: IO Text getPackageDb = parsePackageDb >>= \mdb -> case mdb of Just packageDb -> return packageDb Nothing -> throwIO $ PackageDbNotFound
155
getPackageDb = parsePackageDb >>= \mdb -> case mdb of Just packageDb -> return packageDb Nothing -> throwIO $ PackageDbNotFound
131
false
true
3
7
26
47
24
23
null
null
jimcrayne/lmdb-bindings
Database/LMDB/Macros.hs
agpl-3.0
-- delete fake = () bindings gen (ValD _ (NormalB (ConE x )) []) r st | x=='xxx = r st
91
gen (ValD _ (NormalB (ConE x )) []) r st | x=='xxx = r st
62
gen (ValD _ (NormalB (ConE x )) []) r st | x=='xxx = r st
62
true
false
1
10
25
50
24
26
null
null
abakst/liquidhaskell
benchmarks/icfp15/neg/DBMovies.hs
bsd-3-clause
movie3 = mkMovie (S Persepolis) (S Paronnaud) (I 8) (I 2007)
62
movie3 = mkMovie (S Persepolis) (S Paronnaud) (I 8) (I 2007)
62
movie3 = mkMovie (S Persepolis) (S Paronnaud) (I 8) (I 2007)
62
false
false
0
7
12
39
19
20
null
null
jean-edouard/manager
rpc-proxy/Bouncer.hs
gpl-2.0
reverseRoute :: (ReceiveMessages Channel b, SendMessages Channel a) => Route a b -> Route b a reverseRoute (Route from to) = Route to from
138
reverseRoute :: (ReceiveMessages Channel b, SendMessages Channel a) => Route a b -> Route b a reverseRoute (Route from to) = Route to from
138
reverseRoute (Route from to) = Route to from
44
false
true
0
7
23
60
29
31
null
null
nevrenato/Hets_Fork
CASL/capa.hs
gpl-2.0
main :: IO () main = exec lineParser fileParser
47
main :: IO () main = exec lineParser fileParser
47
main = exec lineParser fileParser
33
false
true
1
6
8
24
10
14
null
null
nomeata/ghc
compiler/main/HscMain.hs
bsd-3-clause
hscNormalIface :: ModGuts -> Maybe Fingerprint -> Hsc (ModIface, Bool, ModDetails, CgGuts) hscNormalIface simpl_result mb_old_iface = do hsc_env <- getHscEnv (cg_guts, details) <- {-# SCC "CoreTidy" #-} liftIO $ tidyProgram hsc_env simpl_result -- BUILD THE NEW ModIface and ModDetails -- and emit external core if necessary -- This has to happen *after* code gen so that the back-end -- info has been set. Not yet clear if it matters waiting -- until after code output (new_iface, no_change) <- {-# SCC "MkFinalIface" #-} ioMsgMaybe $ mkIface hsc_env mb_old_iface details simpl_result -- Emit external core -- This should definitely be here and not after CorePrep, -- because CorePrep produces unqualified constructor wrapper declarations, -- so its output isn't valid External Core (without some preprocessing). liftIO $ emitExternalCore (hsc_dflags hsc_env) cg_guts liftIO $ dumpIfaceStats hsc_env -- Return the prepared code. return (new_iface, no_change, details, cg_guts) -------------------------------------------------------------- -- BackEnd combinators --------------------------------------------------------------
1,285
hscNormalIface :: ModGuts -> Maybe Fingerprint -> Hsc (ModIface, Bool, ModDetails, CgGuts) hscNormalIface simpl_result mb_old_iface = do hsc_env <- getHscEnv (cg_guts, details) <- {-# SCC "CoreTidy" #-} liftIO $ tidyProgram hsc_env simpl_result -- BUILD THE NEW ModIface and ModDetails -- and emit external core if necessary -- This has to happen *after* code gen so that the back-end -- info has been set. Not yet clear if it matters waiting -- until after code output (new_iface, no_change) <- {-# SCC "MkFinalIface" #-} ioMsgMaybe $ mkIface hsc_env mb_old_iface details simpl_result -- Emit external core -- This should definitely be here and not after CorePrep, -- because CorePrep produces unqualified constructor wrapper declarations, -- so its output isn't valid External Core (without some preprocessing). liftIO $ emitExternalCore (hsc_dflags hsc_env) cg_guts liftIO $ dumpIfaceStats hsc_env -- Return the prepared code. return (new_iface, no_change, details, cg_guts) -------------------------------------------------------------- -- BackEnd combinators --------------------------------------------------------------
1,285
hscNormalIface simpl_result mb_old_iface = do hsc_env <- getHscEnv (cg_guts, details) <- {-# SCC "CoreTidy" #-} liftIO $ tidyProgram hsc_env simpl_result -- BUILD THE NEW ModIface and ModDetails -- and emit external core if necessary -- This has to happen *after* code gen so that the back-end -- info has been set. Not yet clear if it matters waiting -- until after code output (new_iface, no_change) <- {-# SCC "MkFinalIface" #-} ioMsgMaybe $ mkIface hsc_env mb_old_iface details simpl_result -- Emit external core -- This should definitely be here and not after CorePrep, -- because CorePrep produces unqualified constructor wrapper declarations, -- so its output isn't valid External Core (without some preprocessing). liftIO $ emitExternalCore (hsc_dflags hsc_env) cg_guts liftIO $ dumpIfaceStats hsc_env -- Return the prepared code. return (new_iface, no_change, details, cg_guts) -------------------------------------------------------------- -- BackEnd combinators --------------------------------------------------------------
1,164
false
true
0
11
305
163
87
76
null
null
jBugman/fun-lang
src/Fun/Desugar.hs
mit
swapAddImport :: E -> (E -> Bool) -> E -> ([E], [E]) -> ([E], [E]) swapAddImport imp cond to (imports, decls) = mapAccumR go imports decls where go :: [E] -> E -> ([E], E) go imps ex | cond ex = (addImport imps, updatePos ex to) | L xs <- ex = L <$> mapAccumR go imps xs | otherwise = (imps, ex) addImport :: [E] -> [E] addImport xs = ordNub $ imp : xs
429
swapAddImport :: E -> (E -> Bool) -> E -> ([E], [E]) -> ([E], [E]) swapAddImport imp cond to (imports, decls) = mapAccumR go imports decls where go :: [E] -> E -> ([E], E) go imps ex | cond ex = (addImport imps, updatePos ex to) | L xs <- ex = L <$> mapAccumR go imps xs | otherwise = (imps, ex) addImport :: [E] -> [E] addImport xs = ordNub $ imp : xs
429
swapAddImport imp cond to (imports, decls) = mapAccumR go imports decls where go :: [E] -> E -> ([E], E) go imps ex | cond ex = (addImport imps, updatePos ex to) | L xs <- ex = L <$> mapAccumR go imps xs | otherwise = (imps, ex) addImport :: [E] -> [E] addImport xs = ordNub $ imp : xs
362
false
true
1
12
153
230
117
113
null
null
olwrapper/olwrapper
wrapper/OpenLayers/Func.hs
bsd-3-clause
-- | add a layer to the map, and remove all layers before inserting (baselayer has now index 0) addBaseLayer :: MapSource -> Fay () addBaseLayer s = void $ do removeLayers addMapLayer s -- | add a MapSource to the map
225
addBaseLayer :: MapSource -> Fay () addBaseLayer s = void $ do removeLayers addMapLayer s -- | add a MapSource to the map
129
addBaseLayer s = void $ do removeLayers addMapLayer s -- | add a MapSource to the map
93
true
true
0
9
49
43
19
24
null
null
anchor/purescript-ui-sandbox
server/Main.hs
bsd-3-clause
doGetResources :: Maybe HttpHeader -> EitherT (Int, String) IO GetResourceResult doGetResources t = liftIO $ tryGetResources t
126
doGetResources :: Maybe HttpHeader -> EitherT (Int, String) IO GetResourceResult doGetResources t = liftIO $ tryGetResources t
126
doGetResources t = liftIO $ tryGetResources t
45
false
true
2
8
16
46
21
25
null
null
gitfoxi/vcd-haskell
app/hus-custom-wavetable.hs
agpl-3.0
parseOpts :: OptionsParser Opts parseOpts = Opts <$> argument auto ( metavar "XMODE" <> help "X mode number from 1 to 8") <*> argument str ( metavar "HUSFILE.hus" <> value "" <> help "A Horizontal-Uncompressed State file") <*> strOption ( long "wavetable" <> short 'w' <> value "" <> metavar "FILENAME" <> help "Wavetable generated by previous run. We'll only add to it")
440
parseOpts :: OptionsParser Opts parseOpts = Opts <$> argument auto ( metavar "XMODE" <> help "X mode number from 1 to 8") <*> argument str ( metavar "HUSFILE.hus" <> value "" <> help "A Horizontal-Uncompressed State file") <*> strOption ( long "wavetable" <> short 'w' <> value "" <> metavar "FILENAME" <> help "Wavetable generated by previous run. We'll only add to it")
440
parseOpts = Opts <$> argument auto ( metavar "XMODE" <> help "X mode number from 1 to 8") <*> argument str ( metavar "HUSFILE.hus" <> value "" <> help "A Horizontal-Uncompressed State file") <*> strOption ( long "wavetable" <> short 'w' <> value "" <> metavar "FILENAME" <> help "Wavetable generated by previous run. We'll only add to it")
408
false
true
8
11
131
113
52
61
null
null
ezyang/ghc
testsuite/tests/parser/should_fail/readFail001.hs
bsd-3-clause
reca a = recb a
15
reca a = recb a
15
reca a = recb a
15
false
false
1
5
4
16
5
11
null
null
forste/haReFork
refactorer/RefacMerge.hs
bsd-3-clause
findDefNameAndExp toks beginPos endPos t = fromMaybe (defaultPNT, defaultExp) (applyTU (once_tdTU (failTU `adhocTU` inMatch `adhocTU` inPat)) t) --CAN NOT USE 'once_tdTU' here. where --The selected sub-expression is in the rhs of a match inMatch (match@(HsMatch loc1 pnt pats rhs ds)::HsMatchP) | locToExp2 beginPos endPos toks rhs /= defaultExp = Just (pnt, locToExp2 beginPos endPos toks rhs) inMatch _ = Nothing --The selected sub-expression is in the rhs of a pattern-binding inPat (pat@(Dec (HsPatBind loc1 ps rhs ds))::HsDeclP) | locToExp2 beginPos endPos toks rhs /= defaultExp = if isSimplePatBind pat then Just (patToPNT ps, locToExp2 beginPos endPos toks rhs) else error "A complex pattern binding can not be generalised!" inPat _ = Nothing
982
findDefNameAndExp toks beginPos endPos t = fromMaybe (defaultPNT, defaultExp) (applyTU (once_tdTU (failTU `adhocTU` inMatch `adhocTU` inPat)) t) --CAN NOT USE 'once_tdTU' here. where --The selected sub-expression is in the rhs of a match inMatch (match@(HsMatch loc1 pnt pats rhs ds)::HsMatchP) | locToExp2 beginPos endPos toks rhs /= defaultExp = Just (pnt, locToExp2 beginPos endPos toks rhs) inMatch _ = Nothing --The selected sub-expression is in the rhs of a pattern-binding inPat (pat@(Dec (HsPatBind loc1 ps rhs ds))::HsDeclP) | locToExp2 beginPos endPos toks rhs /= defaultExp = if isSimplePatBind pat then Just (patToPNT ps, locToExp2 beginPos endPos toks rhs) else error "A complex pattern binding can not be generalised!" inPat _ = Nothing
982
findDefNameAndExp toks beginPos endPos t = fromMaybe (defaultPNT, defaultExp) (applyTU (once_tdTU (failTU `adhocTU` inMatch `adhocTU` inPat)) t) --CAN NOT USE 'once_tdTU' here. where --The selected sub-expression is in the rhs of a match inMatch (match@(HsMatch loc1 pnt pats rhs ds)::HsMatchP) | locToExp2 beginPos endPos toks rhs /= defaultExp = Just (pnt, locToExp2 beginPos endPos toks rhs) inMatch _ = Nothing --The selected sub-expression is in the rhs of a pattern-binding inPat (pat@(Dec (HsPatBind loc1 ps rhs ds))::HsDeclP) | locToExp2 beginPos endPos toks rhs /= defaultExp = if isSimplePatBind pat then Just (patToPNT ps, locToExp2 beginPos endPos toks rhs) else error "A complex pattern binding can not be generalised!" inPat _ = Nothing
982
false
false
0
14
343
235
120
115
null
null
reinh/Hask8080
src/Hask8080/CPU.hs
mit
reg16 :: Reg16 -> Lens' Processor Address reg16 SP = sp
55
reg16 :: Reg16 -> Lens' Processor Address reg16 SP = sp
55
reg16 SP = sp
13
false
true
0
6
10
23
11
12
null
null
fmapfmapfmap/amazonka
amazonka-cognito-sync/gen/Network/AWS/CognitoSync/Types.hs
mpl-2.0
-- | An exception thrown when a bulk publish operation is requested less than -- 24 hours after a previous bulk publish operation completed successfully. _AlreadyStreamedException :: AsError a => Getting (First ServiceError) a ServiceError _AlreadyStreamedException = _ServiceError . hasStatus 400 . hasCode "AlreadyStreamed"
329
_AlreadyStreamedException :: AsError a => Getting (First ServiceError) a ServiceError _AlreadyStreamedException = _ServiceError . hasStatus 400 . hasCode "AlreadyStreamed"
175
_AlreadyStreamedException = _ServiceError . hasStatus 400 . hasCode "AlreadyStreamed"
89
true
true
0
8
47
47
23
24
null
null
vito/hummus
src/Control/Monad/CC.hs
bsd-3-clause
-- ----- -- These originally had types like: -- -- ((a -> m b) -> m b) -> m a -- -- but I came to the conclusion that it would be convenient to be able to pass -- in monadically typed values. -- As a specific example, this makes the difference between -- -- > shift q (\f -> f (dref p)) -- -- and -- -- > join $ shift q (\f -> f (dref p)) -- -- In other words, one can expressed in terms of the other (I think), but -- the fact that one has to insert a 'join' /outside/ the shift, and not -- anywhere near where the sub-continuation is actually used is rather -- odd, and difficult to remember compared to the difference between: -- -- > shift q (\f -> f (return pureValue)) -- -- and -- -- > shift q (\f -> f pureValue) -- ----- -- | The traditional /shift/ counterpart to the above 'reset'. Reifies the -- subcontinuation into a function, keeping both the subcontinuation, and -- the resulting computation delimited by the given prompt. shift :: (MonadDelimitedCont p s m) => p b -> ((m a -> m b) -> m b) -> m a shift p f = withSubCont p $ \sk -> pushPrompt p $ f (\a -> pushPrompt p $ pushSubCont sk a)
1,138
shift :: (MonadDelimitedCont p s m) => p b -> ((m a -> m b) -> m b) -> m a shift p f = withSubCont p $ \sk -> pushPrompt p $ f (\a -> pushPrompt p $ pushSubCont sk a)
198
shift p f = withSubCont p $ \sk -> pushPrompt p $ f (\a -> pushPrompt p $ pushSubCont sk a)
123
true
true
0
12
260
137
81
56
null
null
Blaisorblade/Haskell-Adaptive
Control/Monad/Adaptive/OrderedList.hs
bsd-3-clause
delete r = unlessM (deleted r) $ do ifM (mop lbase (==) (l r)) (error "OrderedList.delete on base element") (do inM (CircularList.delete (deR r)) update (\ (_,i) -> (True,i)) r adjsize (-1) checkinvariant)
305
delete r = unlessM (deleted r) $ do ifM (mop lbase (==) (l r)) (error "OrderedList.delete on base element") (do inM (CircularList.delete (deR r)) update (\ (_,i) -> (True,i)) r adjsize (-1) checkinvariant)
305
delete r = unlessM (deleted r) $ do ifM (mop lbase (==) (l r)) (error "OrderedList.delete on base element") (do inM (CircularList.delete (deR r)) update (\ (_,i) -> (True,i)) r adjsize (-1) checkinvariant)
305
false
false
0
16
132
121
60
61
null
null
snoyberg/ghc
compiler/utils/Pretty.hs
bsd-3-clause
-- p can't be Empty, so no need for mkNest aboveNest (NilAbove p) g k q = nilAbove_ (aboveNest p g k q)
111
aboveNest (NilAbove p) g k q = nilAbove_ (aboveNest p g k q)
67
aboveNest (NilAbove p) g k q = nilAbove_ (aboveNest p g k q)
67
true
false
0
7
30
37
18
19
null
null
rubik/moodle-to-latex
src/Moodle/Translator.hs
bsd-3-clause
toLatex (Function "pi" []) = "\\pi"
35
toLatex (Function "pi" []) = "\\pi"
35
toLatex (Function "pi" []) = "\\pi"
35
false
false
0
8
5
19
9
10
null
null
AndrewBrinker/scheme
src/Scheme/Eval.hs
mit
cons [x1, x2] = return $ DottedList [x1] x2
43
cons [x1, x2] = return $ DottedList [x1] x2
43
cons [x1, x2] = return $ DottedList [x1] x2
43
false
false
2
6
8
29
14
15
null
null
AlexanderPankiv/ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
pragRuleD :: String -> [RuleBndrQ] -> ExpQ -> ExpQ -> Phases -> DecQ pragRuleD n bndrs lhs rhs phases = do bndrs1 <- sequence bndrs lhs1 <- lhs rhs1 <- rhs return $ PragmaD $ RuleP n bndrs1 lhs1 rhs1 phases
236
pragRuleD :: String -> [RuleBndrQ] -> ExpQ -> ExpQ -> Phases -> DecQ pragRuleD n bndrs lhs rhs phases = do bndrs1 <- sequence bndrs lhs1 <- lhs rhs1 <- rhs return $ PragmaD $ RuleP n bndrs1 lhs1 rhs1 phases
236
pragRuleD n bndrs lhs rhs phases = do bndrs1 <- sequence bndrs lhs1 <- lhs rhs1 <- rhs return $ PragmaD $ RuleP n bndrs1 lhs1 rhs1 phases
167
false
true
0
9
70
97
44
53
null
null
lobachevzky/pathtracer
src/Conversion.hs
bsd-3-clause
repa3ToText :: (R.Source r Double) => Array r DIM3 Double -> TL.Text repa3ToText = imageToText . repa3ToImage
113
repa3ToText :: (R.Source r Double) => Array r DIM3 Double -> TL.Text repa3ToText = imageToText . repa3ToImage
113
repa3ToText = imageToText . repa3ToImage
40
false
true
0
7
20
45
22
23
null
null
mettekou/ghc
compiler/simplCore/SetLevels.hs
bsd-3-clause
lvlExpr :: LevelEnv -- Context -> CoreExprWithFVs -- Input expression -> LvlM LevelledExpr -- Result expression {- The @ctxt_lvl@ is, roughly, the level of the innermost enclosing binder. Here's an example v = \x -> ...\y -> let r = case (..x..) of ..x.. in .. When looking at the rhs of @r@, @ctxt_lvl@ will be 1 because that's the level of @r@, even though it's inside a level-2 @\y@. It's important that @ctxt_lvl@ is 1 and not 2 in @r@'s rhs, because we don't want @lvlExpr@ to turn the scrutinee of the @case@ into an MFE --- because it isn't a *maximal* free expression. If there were another lambda in @r@'s rhs, it would get level-2 as well. -} lvlExpr env (_, AnnType ty) = return (Type (substTy (le_subst env) ty))
846
lvlExpr :: LevelEnv -- Context -> CoreExprWithFVs -- Input expression -> LvlM LevelledExpr lvlExpr env (_, AnnType ty) = return (Type (substTy (le_subst env) ty))
199
lvlExpr env (_, AnnType ty) = return (Type (substTy (le_subst env) ty))
75
true
true
0
11
253
63
33
30
null
null
QuickChick/Luck
luck/src/Outer/Types.hs
mit
equate :: OTcType' -> OTcType' -> String -> TcMonad () equate t1 t2 s | t1 == t2 = return () | otherwise = tell [Equal t1 t2 s]
143
equate :: OTcType' -> OTcType' -> String -> TcMonad () equate t1 t2 s | t1 == t2 = return () | otherwise = tell [Equal t1 t2 s]
143
equate t1 t2 s | t1 == t2 = return () | otherwise = tell [Equal t1 t2 s]
88
false
true
0
9
44
72
33
39
null
null
j-rock/rayt
src/Ray/Shape.hs
mit
-- U,V coordinates for a given position on a shape -- #419begin -- #type=1 -- #src=http://stackoverflow.com/questions/18663755/how-to-convert-a-3d-point-on-a-plane-to-uv-coordinates -- #419end getShapeUV :: Shape -> V3 -> (Double, Double) getShapeUV (Plane n _) p = let (u, v) = getUVBasisForNormal n in (u .*. p, v .*. p)
334
getShapeUV :: Shape -> V3 -> (Double, Double) getShapeUV (Plane n _) p = let (u, v) = getUVBasisForNormal n in (u .*. p, v .*. p)
137
getShapeUV (Plane n _) p = let (u, v) = getUVBasisForNormal n in (u .*. p, v .*. p)
91
true
true
0
10
56
84
44
40
null
null
rblaze/haskell-dbus
lib/DBus/Internal/Address.hs
apache-2.0
getSessionAddress :: IO (Maybe Address) getSessionAddress = lookupEnv "DBUS_SESSION_BUS_ADDRESS" >>= \case Just addrs -> pure (parseAddresses addrs >>= listToMaybe) Nothing -> (>>= parseFallback) <$> lookupEnv "XDG_RUNTIME_DIR" where parseFallback dir = parseAddress ("unix:path=" ++ dir ++ "/bus") -- | Returns the address in the environment variable -- @DBUS_STARTER_ADDRESS@, which must be set. -- -- Returns 'Nothing' if @DBUS_STARTER_ADDRESS@ is unset or contains an -- invalid address.
506
getSessionAddress :: IO (Maybe Address) getSessionAddress = lookupEnv "DBUS_SESSION_BUS_ADDRESS" >>= \case Just addrs -> pure (parseAddresses addrs >>= listToMaybe) Nothing -> (>>= parseFallback) <$> lookupEnv "XDG_RUNTIME_DIR" where parseFallback dir = parseAddress ("unix:path=" ++ dir ++ "/bus") -- | Returns the address in the environment variable -- @DBUS_STARTER_ADDRESS@, which must be set. -- -- Returns 'Nothing' if @DBUS_STARTER_ADDRESS@ is unset or contains an -- invalid address.
506
getSessionAddress = lookupEnv "DBUS_SESSION_BUS_ADDRESS" >>= \case Just addrs -> pure (parseAddresses addrs >>= listToMaybe) Nothing -> (>>= parseFallback) <$> lookupEnv "XDG_RUNTIME_DIR" where parseFallback dir = parseAddress ("unix:path=" ++ dir ++ "/bus") -- | Returns the address in the environment variable -- @DBUS_STARTER_ADDRESS@, which must be set. -- -- Returns 'Nothing' if @DBUS_STARTER_ADDRESS@ is unset or contains an -- invalid address.
466
false
true
1
12
79
101
50
51
null
null
matt76k/mi
src/Language/MI/TH.hs
mit
pTypeClassName = (:) <$> upper <*> many1 alphaNum
49
pTypeClassName = (:) <$> upper <*> many1 alphaNum
49
pTypeClassName = (:) <$> upper <*> many1 alphaNum
49
false
false
0
6
7
19
10
9
null
null
fmapfmapfmap/amazonka
amazonka-cloudfront/gen/Network/AWS/CloudFront/Types/Product.hs
mpl-2.0
-- | Creates a value of 'InvalidationBatch' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ibPaths' -- -- * 'ibCallerReference' invalidationBatch :: Paths -- ^ 'ibPaths' -> Text -- ^ 'ibCallerReference' -> InvalidationBatch invalidationBatch pPaths_ pCallerReference_ = InvalidationBatch' { _ibPaths = pPaths_ , _ibCallerReference = pCallerReference_ }
467
invalidationBatch :: Paths -- ^ 'ibPaths' -> Text -- ^ 'ibCallerReference' -> InvalidationBatch invalidationBatch pPaths_ pCallerReference_ = InvalidationBatch' { _ibPaths = pPaths_ , _ibCallerReference = pCallerReference_ }
252
invalidationBatch pPaths_ pCallerReference_ = InvalidationBatch' { _ibPaths = pPaths_ , _ibCallerReference = pCallerReference_ }
144
true
true
0
8
92
56
32
24
null
null
vikraman/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
ppr_sig (ClassOpSig is_deflt vars ty) | is_deflt = text "default" <+> pprVarSig (map unLoc vars) (ppr ty) | otherwise = pprVarSig (map unLoc vars) (ppr ty)
190
ppr_sig (ClassOpSig is_deflt vars ty) | is_deflt = text "default" <+> pprVarSig (map unLoc vars) (ppr ty) | otherwise = pprVarSig (map unLoc vars) (ppr ty)
190
ppr_sig (ClassOpSig is_deflt vars ty) | is_deflt = text "default" <+> pprVarSig (map unLoc vars) (ppr ty) | otherwise = pprVarSig (map unLoc vars) (ppr ty)
190
false
false
1
9
60
78
36
42
null
null
imalsogreg/flycap
tests/memVid.hs
bsd-3-clause
main = do c <- hCreateC cameraInit c -- cameraStop c -> when/how?! GLFW.init GLFW.defaultWindowHints Just win <- GLFW.createWindow 1024 1024 "testing images" Nothing Nothing GLFW.makeContextCurrent (Just win) GLFW.setKeyCallback win (Just (keyPressed c)) --GLFW.setWindowRefreshCallback win (Just display) GLFW.setFramebufferSizeCallback win (Just resize) GLFW.setWindowCloseCallback win (Just (shutdown c)) tex <- initGL forever $ do GLFW.pollEvents i <- hRetBuff c -- gives us a CImage --old system using hRetrieveBuffer, which gives us an FCImage, and JuicyPixels -- im <-getImage i -- gives us a JImage with Y8 Pixel --let image = (JPTypes.promoteImage im :: JPTypes.Image JPTypes.PixelRGB8) --change to RGB8 Pixel t <- loadTex i tex destroyImage i display t -- deleting image: GLFW.swapBuffers win
871
main = do c <- hCreateC cameraInit c -- cameraStop c -> when/how?! GLFW.init GLFW.defaultWindowHints Just win <- GLFW.createWindow 1024 1024 "testing images" Nothing Nothing GLFW.makeContextCurrent (Just win) GLFW.setKeyCallback win (Just (keyPressed c)) --GLFW.setWindowRefreshCallback win (Just display) GLFW.setFramebufferSizeCallback win (Just resize) GLFW.setWindowCloseCallback win (Just (shutdown c)) tex <- initGL forever $ do GLFW.pollEvents i <- hRetBuff c -- gives us a CImage --old system using hRetrieveBuffer, which gives us an FCImage, and JuicyPixels -- im <-getImage i -- gives us a JImage with Y8 Pixel --let image = (JPTypes.promoteImage im :: JPTypes.Image JPTypes.PixelRGB8) --change to RGB8 Pixel t <- loadTex i tex destroyImage i display t -- deleting image: GLFW.swapBuffers win
871
main = do c <- hCreateC cameraInit c -- cameraStop c -> when/how?! GLFW.init GLFW.defaultWindowHints Just win <- GLFW.createWindow 1024 1024 "testing images" Nothing Nothing GLFW.makeContextCurrent (Just win) GLFW.setKeyCallback win (Just (keyPressed c)) --GLFW.setWindowRefreshCallback win (Just display) GLFW.setFramebufferSizeCallback win (Just resize) GLFW.setWindowCloseCallback win (Just (shutdown c)) tex <- initGL forever $ do GLFW.pollEvents i <- hRetBuff c -- gives us a CImage --old system using hRetrieveBuffer, which gives us an FCImage, and JuicyPixels -- im <-getImage i -- gives us a JImage with Y8 Pixel --let image = (JPTypes.promoteImage im :: JPTypes.Image JPTypes.PixelRGB8) --change to RGB8 Pixel t <- loadTex i tex destroyImage i display t -- deleting image: GLFW.swapBuffers win
871
false
false
1
12
179
198
86
112
null
null
peterkmurphy/preference
src/OurTests/TestStuff.hs
bsd-3-clause
testFilterminindexes23 = filterminindexes [0,1] [2, 1, 2] @?= [1]
65
testFilterminindexes23 = filterminindexes [0,1] [2, 1, 2] @?= [1]
65
testFilterminindexes23 = filterminindexes [0,1] [2, 1, 2] @?= [1]
65
false
false
0
7
8
33
19
14
null
null
cshung/MiscLab
Haskell99/q11.hs
mit
encodeModified :: (Eq a) => [a] -> [Entry a] encodeModified x = let simplify :: (Eq a) => (a, Int) -> Entry a simplify (x, 1) = Single x simplify (x, c) = (Multiple c x) in map simplify $ encode x
217
encodeModified :: (Eq a) => [a] -> [Entry a] encodeModified x = let simplify :: (Eq a) => (a, Int) -> Entry a simplify (x, 1) = Single x simplify (x, c) = (Multiple c x) in map simplify $ encode x
217
encodeModified x = let simplify :: (Eq a) => (a, Int) -> Entry a simplify (x, 1) = Single x simplify (x, c) = (Multiple c x) in map simplify $ encode x
171
false
true
0
11
62
118
61
57
null
null
javgh/watchdog
Control/Watchdog.hs
bsd-3-clause
-- | Set the maximum delay in microseconds. When a task fails to execute -- properly multiple times in quick succession, the delay is doubled each time -- until it stays constant at the maximum delay. The default is 300 seconds. setMaximumDelay :: Int -> WatchdogAction e () setMaximumDelay delay = modify (\conf -> conf { wcMaximumDelay = delay })
348
setMaximumDelay :: Int -> WatchdogAction e () setMaximumDelay delay = modify (\conf -> conf { wcMaximumDelay = delay })
119
setMaximumDelay delay = modify (\conf -> conf { wcMaximumDelay = delay })
73
true
true
0
9
59
47
26
21
null
null
alexander-at-github/eta
compiler/ETA/TypeCheck/TcEvidence.hs
bsd-3-clause
evVarsOfTerm (EvTupleMk evs) = evVarsOfTerms evs
53
evVarsOfTerm (EvTupleMk evs) = evVarsOfTerms evs
53
evVarsOfTerm (EvTupleMk evs) = evVarsOfTerms evs
53
false
false
0
6
10
19
8
11
null
null
tsahyt/heuristic-search
src/Data/Search/Forward/Beam.hs
lgpl-3.0
beamLocal' :: forall a c t. (Foldable t, Hashable a, Ord a, Ord c) => Natural -- ^ Beam width -> (a -> t a) -- ^ Successor function -> (a -> c) -- ^ Heuristic function -> (a -> Bool) -- ^ Goal check -> a -- ^ Starting node -> Maybe a beamLocal' width neighbor heuristic goal root = let q0 = insert root (heuristic root) (empty width) in evalState search q0 where search :: State (LBeam a c) (Maybe a) search = nextView <$> get >>= \case Nothing -> pure Nothing Just (x, b) -> if goal x then pure (Just x) else do let xs = neighbor x put $ foldl' (flip (ap insert heuristic)) b xs search
857
beamLocal' :: forall a c t. (Foldable t, Hashable a, Ord a, Ord c) => Natural -- ^ Beam width -> (a -> t a) -- ^ Successor function -> (a -> c) -- ^ Heuristic function -> (a -> Bool) -- ^ Goal check -> a -- ^ Starting node -> Maybe a beamLocal' width neighbor heuristic goal root = let q0 = insert root (heuristic root) (empty width) in evalState search q0 where search :: State (LBeam a c) (Maybe a) search = nextView <$> get >>= \case Nothing -> pure Nothing Just (x, b) -> if goal x then pure (Just x) else do let xs = neighbor x put $ foldl' (flip (ap insert heuristic)) b xs search
857
beamLocal' width neighbor heuristic goal root = let q0 = insert root (heuristic root) (empty width) in evalState search q0 where search :: State (LBeam a c) (Maybe a) search = nextView <$> get >>= \case Nothing -> pure Nothing Just (x, b) -> if goal x then pure (Just x) else do let xs = neighbor x put $ foldl' (flip (ap insert heuristic)) b xs search
459
false
true
1
17
392
273
137
136
null
null
tjakway/ghcjvm
compiler/main/HscMain.hs
bsd-3-clause
hscCheckSafeImports :: TcGblEnv -> Hsc TcGblEnv hscCheckSafeImports tcg_env = do dflags <- getDynFlags tcg_env' <- checkSafeImports dflags tcg_env checkRULES dflags tcg_env' where checkRULES dflags tcg_env' = do case safeLanguageOn dflags of True -> do -- XSafe: we nuke user written RULES logWarnings $ warns dflags (tcg_rules tcg_env') return tcg_env' { tcg_rules = [] } False -- SafeInferred: user defined RULES, so not safe | safeInferOn dflags && not (null $ tcg_rules tcg_env') -> markUnsafeInfer tcg_env' $ warns dflags (tcg_rules tcg_env') -- Trustworthy OR SafeInferred: with no RULES | otherwise -> return tcg_env' warns dflags rules = listToBag $ map (warnRules dflags) rules warnRules dflags (L loc (HsRule n _ _ _ _ _ _)) = mkPlainWarnMsg dflags loc $ text "Rule \"" <> ftext (snd $ unLoc n) <> text "\" ignored" $+$ text "User defined rules are disabled under Safe Haskell" -- | Validate that safe imported modules are actually safe. For modules in the -- HomePackage (the package the module we are compiling in resides) this just -- involves checking its trust type is 'Safe' or 'Trustworthy'. For modules -- that reside in another package we also must check that the external pacakge -- is trusted. See the Note [Safe Haskell Trust Check] above for more -- information. -- -- The code for this is quite tricky as the whole algorithm is done in a few -- distinct phases in different parts of the code base. See -- RnNames.rnImportDecl for where package trust dependencies for a module are -- collected and unioned. Specifically see the Note [RnNames . Tracking Trust -- Transitively] and the Note [RnNames . Trust Own Package].
1,864
hscCheckSafeImports :: TcGblEnv -> Hsc TcGblEnv hscCheckSafeImports tcg_env = do dflags <- getDynFlags tcg_env' <- checkSafeImports dflags tcg_env checkRULES dflags tcg_env' where checkRULES dflags tcg_env' = do case safeLanguageOn dflags of True -> do -- XSafe: we nuke user written RULES logWarnings $ warns dflags (tcg_rules tcg_env') return tcg_env' { tcg_rules = [] } False -- SafeInferred: user defined RULES, so not safe | safeInferOn dflags && not (null $ tcg_rules tcg_env') -> markUnsafeInfer tcg_env' $ warns dflags (tcg_rules tcg_env') -- Trustworthy OR SafeInferred: with no RULES | otherwise -> return tcg_env' warns dflags rules = listToBag $ map (warnRules dflags) rules warnRules dflags (L loc (HsRule n _ _ _ _ _ _)) = mkPlainWarnMsg dflags loc $ text "Rule \"" <> ftext (snd $ unLoc n) <> text "\" ignored" $+$ text "User defined rules are disabled under Safe Haskell" -- | Validate that safe imported modules are actually safe. For modules in the -- HomePackage (the package the module we are compiling in resides) this just -- involves checking its trust type is 'Safe' or 'Trustworthy'. For modules -- that reside in another package we also must check that the external pacakge -- is trusted. See the Note [Safe Haskell Trust Check] above for more -- information. -- -- The code for this is quite tricky as the whole algorithm is done in a few -- distinct phases in different parts of the code base. See -- RnNames.rnImportDecl for where package trust dependencies for a module are -- collected and unioned. Specifically see the Note [RnNames . Tracking Trust -- Transitively] and the Note [RnNames . Trust Own Package].
1,864
hscCheckSafeImports tcg_env = do dflags <- getDynFlags tcg_env' <- checkSafeImports dflags tcg_env checkRULES dflags tcg_env' where checkRULES dflags tcg_env' = do case safeLanguageOn dflags of True -> do -- XSafe: we nuke user written RULES logWarnings $ warns dflags (tcg_rules tcg_env') return tcg_env' { tcg_rules = [] } False -- SafeInferred: user defined RULES, so not safe | safeInferOn dflags && not (null $ tcg_rules tcg_env') -> markUnsafeInfer tcg_env' $ warns dflags (tcg_rules tcg_env') -- Trustworthy OR SafeInferred: with no RULES | otherwise -> return tcg_env' warns dflags rules = listToBag $ map (warnRules dflags) rules warnRules dflags (L loc (HsRule n _ _ _ _ _ _)) = mkPlainWarnMsg dflags loc $ text "Rule \"" <> ftext (snd $ unLoc n) <> text "\" ignored" $+$ text "User defined rules are disabled under Safe Haskell" -- | Validate that safe imported modules are actually safe. For modules in the -- HomePackage (the package the module we are compiling in resides) this just -- involves checking its trust type is 'Safe' or 'Trustworthy'. For modules -- that reside in another package we also must check that the external pacakge -- is trusted. See the Note [Safe Haskell Trust Check] above for more -- information. -- -- The code for this is quite tricky as the whole algorithm is done in a few -- distinct phases in different parts of the code base. See -- RnNames.rnImportDecl for where package trust dependencies for a module are -- collected and unioned. Specifically see the Note [RnNames . Tracking Trust -- Transitively] and the Note [RnNames . Trust Own Package].
1,816
false
true
0
17
493
292
141
151
null
null
brendanhay/gogol
gogol-vision/gen/Network/Google/Vision/Types/Product.hs
mpl-2.0
-- | The Celebrity\'s display name. gcvvcDisplayName :: Lens' GoogleCloudVisionV1p4beta1Celebrity (Maybe Text) gcvvcDisplayName = lens _gcvvcDisplayName (\ s a -> s{_gcvvcDisplayName = a})
196
gcvvcDisplayName :: Lens' GoogleCloudVisionV1p4beta1Celebrity (Maybe Text) gcvvcDisplayName = lens _gcvvcDisplayName (\ s a -> s{_gcvvcDisplayName = a})
160
gcvvcDisplayName = lens _gcvvcDisplayName (\ s a -> s{_gcvvcDisplayName = a})
85
true
true
1
9
30
51
25
26
null
null
daewon/til
exercism/haskell/robot-simulator/src/Robot.hs
mpl-2.0
simulate :: Robot -> String -> Robot simulate r@(Robot bear pos) cmds = foldl simulate' r cmds where simulate' r@(Robot North (x, y)) 'A' = r { pos = (x, succ y) } simulate' r@(Robot South (x, y)) 'A' = r { pos = (x, pred y) } simulate' r@(Robot East (x, y)) 'A' = r { pos = (succ x, y) } simulate' r@(Robot West (x, y)) 'A' = r { pos = (pred x, y) } simulate' r@(Robot dir _) 'L' = r { dir = turnLeft dir } simulate' r@(Robot dir _) 'R' = r { dir = turnRight dir }
491
simulate :: Robot -> String -> Robot simulate r@(Robot bear pos) cmds = foldl simulate' r cmds where simulate' r@(Robot North (x, y)) 'A' = r { pos = (x, succ y) } simulate' r@(Robot South (x, y)) 'A' = r { pos = (x, pred y) } simulate' r@(Robot East (x, y)) 'A' = r { pos = (succ x, y) } simulate' r@(Robot West (x, y)) 'A' = r { pos = (pred x, y) } simulate' r@(Robot dir _) 'L' = r { dir = turnLeft dir } simulate' r@(Robot dir _) 'R' = r { dir = turnRight dir }
491
simulate r@(Robot bear pos) cmds = foldl simulate' r cmds where simulate' r@(Robot North (x, y)) 'A' = r { pos = (x, succ y) } simulate' r@(Robot South (x, y)) 'A' = r { pos = (x, pred y) } simulate' r@(Robot East (x, y)) 'A' = r { pos = (succ x, y) } simulate' r@(Robot West (x, y)) 'A' = r { pos = (pred x, y) } simulate' r@(Robot dir _) 'L' = r { dir = turnLeft dir } simulate' r@(Robot dir _) 'R' = r { dir = turnRight dir }
454
false
true
11
12
129
309
155
154
null
null
wowofbob/backprop-nn
main.hs
mit
xorSamples = [xorSample1, xorSample2, xorSample3]
49
xorSamples = [xorSample1, xorSample2, xorSample3]
49
xorSamples = [xorSample1, xorSample2, xorSample3]
49
false
false
1
5
4
18
9
9
null
null
vTurbine/ghc
compiler/ghci/ByteCodeGen.hs
bsd-3-clause
atomPrimRep (AnnLit l) = typePrimRep (literalType l)
65
atomPrimRep (AnnLit l) = typePrimRep (literalType l)
65
atomPrimRep (AnnLit l) = typePrimRep (literalType l)
65
false
false
0
7
19
24
11
13
null
null
turingjump/bookkeeper
src/Bookkeeper/Internal.hs
bsd-3-clause
(%:) :: ( Modifiable field val val' old new) => Key field -> (val -> val') -> Book' old -> Book new (%:) = modify
115
(%:) :: ( Modifiable field val val' old new) => Key field -> (val -> val') -> Book' old -> Book new (%:) = modify
115
(%:) = modify
13
false
true
0
9
26
60
32
28
null
null
tidalcycles/tidal-midi
Sound/Tidal/MIDI/Tanzbar.hs
gpl-3.0
(cb_tune, cb_tune_p) = pF "cb_tune" (Just 0)
44
(cb_tune, cb_tune_p) = pF "cb_tune" (Just 0)
44
(cb_tune, cb_tune_p) = pF "cb_tune" (Just 0)
44
false
false
0
7
6
24
12
12
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/FloodlightActivityGroups/List.hs
mpl-2.0
-- | Order of sorted results, default is ASCENDING. faglSortOrder :: Lens' FloodlightActivityGroupsList (Maybe FloodlightActivityGroupsListSortOrder) faglSortOrder = lens _faglSortOrder (\ s a -> s{_faglSortOrder = a})
226
faglSortOrder :: Lens' FloodlightActivityGroupsList (Maybe FloodlightActivityGroupsListSortOrder) faglSortOrder = lens _faglSortOrder (\ s a -> s{_faglSortOrder = a})
174
faglSortOrder = lens _faglSortOrder (\ s a -> s{_faglSortOrder = a})
76
true
true
0
9
33
48
25
23
null
null
ezyang/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
hsExprNeedsParens (HsVar {}) = False
45
hsExprNeedsParens (HsVar {}) = False
45
hsExprNeedsParens (HsVar {}) = False
45
false
false
0
7
13
16
8
8
null
null
quchen/fgl
Data/Graph/Inductive/Graph.hs
bsd-3-clause
delNode :: (Graph gr) => Node -> gr a b -> gr a b delNode v = delNodes [v]
74
delNode :: (Graph gr) => Node -> gr a b -> gr a b delNode v = delNodes [v]
74
delNode v = delNodes [v]
24
false
true
0
8
18
47
23
24
null
null
deadfoxygrandpa/Elm
Setup.hs
bsd-3-clause
-- Part 1 -- ------ -- Add a build callout -- We need to build elm-doc and run it because that generates the file "docs.json" -- needs by Libraries.hs which is part of the elm library and executable -- Unfort. there seems to be no way to tell cabal that: -- (a) elm-doc generates docs.json, and -- (b) elm (library) depends on docs.json -- Therefore, we either use make instead (or a script), or hack around in cabal -- Part 2 -- ------ -- Add a post-build callout. -- We need to build the runtime.js after we've built elm (because we use elm to generate some of the JavaScript), -- but before cabal does the install file copy step -- Assumptions -- Elm.cabal expects the generated files to end up in dist/data -- git won't look in dist + cabal will clean it rtsDir :: LocalBuildInfo -> FilePath rtsDir lbi = "data"
821
rtsDir :: LocalBuildInfo -> FilePath rtsDir lbi = "data"
56
rtsDir lbi = "data"
19
true
true
0
7
157
41
27
14
null
null
ChrisBlom/Signs
src/Signs/Inference.hs
mit
ti env (CaseO o f d) = do tA <- newTyVar "z" tB <- newTyVar "y" (subO, typO) <- ti env o subO' <- (doSub subO typO) `mgu` (Option tA) (subF, typF) <- ti env f subF' <- (doSub subF typF) `mgu` (tA :-> tB) (subD, typD) <- ti env d subD' <- (doSub subD typD) `mgu` (tB) return ( subD' `composeSubst` subF' `composeSubst` subO' , tB)
356
ti env (CaseO o f d) = do tA <- newTyVar "z" tB <- newTyVar "y" (subO, typO) <- ti env o subO' <- (doSub subO typO) `mgu` (Option tA) (subF, typF) <- ti env f subF' <- (doSub subF typF) `mgu` (tA :-> tB) (subD, typD) <- ti env d subD' <- (doSub subD typD) `mgu` (tB) return ( subD' `composeSubst` subF' `composeSubst` subO' , tB)
356
ti env (CaseO o f d) = do tA <- newTyVar "z" tB <- newTyVar "y" (subO, typO) <- ti env o subO' <- (doSub subO typO) `mgu` (Option tA) (subF, typF) <- ti env f subF' <- (doSub subF typF) `mgu` (tA :-> tB) (subD, typD) <- ti env d subD' <- (doSub subD typD) `mgu` (tB) return ( subD' `composeSubst` subF' `composeSubst` subO' , tB)
356
false
false
0
10
93
198
101
97
null
null
dsalisbury/xmobar
src/Xmobar.hs
bsd-3-clause
-- | Runs the ReaderT runX :: XConf -> X () -> IO () runX xc f = runReaderT f xc
80
runX :: XConf -> X () -> IO () runX xc f = runReaderT f xc
58
runX xc f = runReaderT f xc
27
true
true
0
8
20
40
19
21
null
null
tidalcycles/tidal-midi
Sound/Tidal/MIDI/CC.hs
gpl-3.0
(cc27, cc27_p) = pF "cc27" (Just 0)
35
(cc27, cc27_p) = pF "cc27" (Just 0)
35
(cc27, cc27_p) = pF "cc27" (Just 0)
35
false
false
0
6
6
25
12
13
null
null