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
AlephAlpha/Samau
src/Samau/Parser.hs
gpl-2.0
float :: Parser Double float = fractional <|> (+) <$> integer <*> (try fractional <|> char '.' *> return 0)
107
float :: Parser Double float = fractional <|> (+) <$> integer <*> (try fractional <|> char '.' *> return 0)
107
float = fractional <|> (+) <$> integer <*> (try fractional <|> char '.' *> return 0)
84
false
true
5
10
19
58
27
31
null
null
joelburget/haste-compiler
Tests/IntegerToFromString.hs
bsd-3-clause
runTest :: IO String runTest = case fromS "3450834053468865983456093" of Just x -> return $ toS $ x + (1 :: Integer)
122
runTest :: IO String runTest = case fromS "3450834053468865983456093" of Just x -> return $ toS $ x + (1 :: Integer)
122
runTest = case fromS "3450834053468865983456093" of Just x -> return $ toS $ x + (1 :: Integer)
101
false
true
0
10
27
54
25
29
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DeleteVpnConnection.hs
mpl-2.0
-- | Checks whether you have the required permissions for the action, without -- actually making the request, and provides an error response. If you have the -- required permissions, the error response is 'DryRunOperation'. Otherwise, it is 'UnauthorizedOperation'. dvcDryRun :: Lens' DeleteVpnConnection (Maybe Bool) dvcDryRun = lens _dvcDryRun (\s a -> s { _dvcDryRun = a })
376
dvcDryRun :: Lens' DeleteVpnConnection (Maybe Bool) dvcDryRun = lens _dvcDryRun (\s a -> s { _dvcDryRun = a })
110
dvcDryRun = lens _dvcDryRun (\s a -> s { _dvcDryRun = a })
58
true
true
0
9
57
48
27
21
null
null
GaloisInc/halvm-ghc
compiler/main/HscTypes.hs
bsd-3-clause
-- | Retrieve the compiled byte-code if possible. Panic if it is a file-based linkable byteCodeOfObject :: Unlinked -> CompiledByteCode byteCodeOfObject (BCOs bc) = bc
167
byteCodeOfObject :: Unlinked -> CompiledByteCode byteCodeOfObject (BCOs bc) = bc
80
byteCodeOfObject (BCOs bc) = bc
31
true
true
0
6
24
29
14
15
null
null
GaloisInc/ivory
ivory-backend-c/src/Ivory/Compile/C/Gen.hs
bsd-3-clause
---------------------------------------- toExpr _ (I.ExpToIx e maxSz) = [cexp| $exp:(toExpr I.ixRep e ) % $exp:maxSz |]
121
toExpr _ (I.ExpToIx e maxSz) = [cexp| $exp:(toExpr I.ixRep e ) % $exp:maxSz |]
80
toExpr _ (I.ExpToIx e maxSz) = [cexp| $exp:(toExpr I.ixRep e ) % $exp:maxSz |]
80
true
false
0
8
16
26
15
11
null
null
jecisc/TP_PF_L3
PF-TP4/tp4_PF_ferlicot.hs
mit
completAux h xs = (Noeud c v ag ad, zs) where (ag, ys) = completAux (h-1) xs (ad, zs) = completAux (h-1) (tail ys) (c,v) = head ys -- L'arbre n contiens 2^n -1 noeud, donc pour 20 on a 1048575 noeuds. --Question 10 -- La fonction est repeat.
297
completAux h xs = (Noeud c v ag ad, zs) where (ag, ys) = completAux (h-1) xs (ad, zs) = completAux (h-1) (tail ys) (c,v) = head ys -- L'arbre n contiens 2^n -1 noeud, donc pour 20 on a 1048575 noeuds. --Question 10 -- La fonction est repeat.
297
completAux h xs = (Noeud c v ag ad, zs) where (ag, ys) = completAux (h-1) xs (ad, zs) = completAux (h-1) (tail ys) (c,v) = head ys -- L'arbre n contiens 2^n -1 noeud, donc pour 20 on a 1048575 noeuds. --Question 10 -- La fonction est repeat.
297
false
false
1
7
104
106
54
52
null
null
masaedw/PuddingX
src/Pudding/Words.hs
bsd-3-clause
-- pudding procedure ok :: Monad m => ByteString -> PProc m ok msg = tell . pure $ append "> " msg
99
ok :: Monad m => ByteString -> PProc m ok msg = tell . pure $ append "> " msg
77
ok msg = tell . pure $ append "> " msg
38
true
true
0
7
23
45
21
24
null
null
anammari/pandoc
src/Text/Pandoc/Readers/RST.hs
gpl-2.0
-- | Parse reStructuredText string and return Pandoc document. readRST :: ParserState -- ^ Parser state, including options for parser -> String -- ^ String to parse (assuming @'\n'@ line endings) -> Pandoc readRST state s = (readWith parseRST) state (s ++ "\n\n")
284
readRST :: ParserState -- ^ Parser state, including options for parser -> String -- ^ String to parse (assuming @'\n'@ line endings) -> Pandoc readRST state s = (readWith parseRST) state (s ++ "\n\n")
221
readRST state s = (readWith parseRST) state (s ++ "\n\n")
57
true
true
0
7
63
45
24
21
null
null
pbevin/toycss
src/HtmlDoc.hs
gpl-2.0
domHeight :: DomNode -> Size domHeight = height . properties
60
domHeight :: DomNode -> Size domHeight = height . properties
60
domHeight = height . properties
31
false
true
1
7
9
27
11
16
null
null
sjakobi/brick
programs/VisibilityDemo.hs
bsd-3-clause
initialState :: St initialState = St 1 1 (1, 1)
47
initialState :: St initialState = St 1 1 (1, 1)
47
initialState = St 1 1 (1, 1)
28
false
true
0
6
9
24
13
11
null
null
binesiyu/ifl
examples/ch05/Prettify.hs
mit
{-- /snippet hcat --} {-- snippet fsep --} fsep :: [Doc] -> Doc fsep = fold (</>)
82
fsep :: [Doc] -> Doc fsep = fold (</>)
38
fsep = fold (</>)
17
true
true
0
7
17
32
16
16
null
null
headprogrammingczar/cabal
Cabal/Distribution/Simple/GHCJS.hs
bsd-3-clause
buildLib, replLib :: Verbosity -> Cabal.Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO () buildLib = buildOrReplLib False
211
buildLib, replLib :: Verbosity -> Cabal.Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO () buildLib = buildOrReplLib False
211
buildLib = buildOrReplLib False
31
false
true
0
12
58
56
28
28
null
null
rcook/hqdsl
src/spec/RenderSpec.hs
mit
spec :: Spec spec = do describe "dummy" $ do it "dummy" $ do True `shouldBe` True
93
spec :: Spec spec = do describe "dummy" $ do it "dummy" $ do True `shouldBe` True
93
spec = do describe "dummy" $ do it "dummy" $ do True `shouldBe` True
80
false
true
0
14
28
47
20
27
null
null
fcharlie/hgit
src/Git/Store/ObjectStore.hs
bsd-3-clause
updateHead refs = do let maybeHead = findHead refs unless (isNothing maybeHead) $ let sha1 = C.unpack $ getObjId $ fromJust maybeHead ref = maybe "refs/heads/master" (C.unpack . getRefName) $ findRef sha1 refs in do createRef ref sha1 createSymRef "HEAD" ref where isCommit ob = objectType ob == OBJ_COMMIT findHead = find (\Ref{..} -> "HEAD" == getRefName) findRef sha = find (\Ref{..} -> ("HEAD" /= getRefName && sha == (C.unpack getObjId))) -- ref: refs/heads/master
578
updateHead refs = do let maybeHead = findHead refs unless (isNothing maybeHead) $ let sha1 = C.unpack $ getObjId $ fromJust maybeHead ref = maybe "refs/heads/master" (C.unpack . getRefName) $ findRef sha1 refs in do createRef ref sha1 createSymRef "HEAD" ref where isCommit ob = objectType ob == OBJ_COMMIT findHead = find (\Ref{..} -> "HEAD" == getRefName) findRef sha = find (\Ref{..} -> ("HEAD" /= getRefName && sha == (C.unpack getObjId))) -- ref: refs/heads/master
578
updateHead refs = do let maybeHead = findHead refs unless (isNothing maybeHead) $ let sha1 = C.unpack $ getObjId $ fromJust maybeHead ref = maybe "refs/heads/master" (C.unpack . getRefName) $ findRef sha1 refs in do createRef ref sha1 createSymRef "HEAD" ref where isCommit ob = objectType ob == OBJ_COMMIT findHead = find (\Ref{..} -> "HEAD" == getRefName) findRef sha = find (\Ref{..} -> ("HEAD" /= getRefName && sha == (C.unpack getObjId))) -- ref: refs/heads/master
578
false
false
4
16
182
211
95
116
null
null
silkapp/json-schema
tests/Main.hs
bsd-3-clause
case_constructorListField = do bidir "[1,2,3]" (P [1,2,3]) eq (S.Array S.unboundedLength False (S.Number S.unbounded)) (schema (Proxy :: Proxy P)) valid $ P [1,2,3]
175
case_constructorListField = do bidir "[1,2,3]" (P [1,2,3]) eq (S.Array S.unboundedLength False (S.Number S.unbounded)) (schema (Proxy :: Proxy P)) valid $ P [1,2,3]
175
case_constructorListField = do bidir "[1,2,3]" (P [1,2,3]) eq (S.Array S.unboundedLength False (S.Number S.unbounded)) (schema (Proxy :: Proxy P)) valid $ P [1,2,3]
175
false
false
1
13
32
99
48
51
null
null
turboMaCk/Dotfiles
xmonad/xmonad.hs
mit
myLayoutHook = Docks.avoidStruts $ smartBorders $ workspaceDir "/home/marek" $ windowNavigation $ tall ||| F.fullscreenFull (boringAuto Simplest) where space = smartSpacing 5 tall = Tabbed.addTabs shrinkText tabbedConf $ space $ subLayout [] Simplest $ boringWindows $ ResizableTall 1 (3 / 100) (1 / 2) [] -- wide = -- boringAuto $ -- space $ -- Mirror $ ResizableTall 1 (2 / 100) (5 / 6) [] -- threeCol = -- Tabbed.addTabs shrinkText tabbedConf $ -- space $ -- subLayout [] Simplest $ -- boringWindows $ -- ThreeColMid 1 (3 / 100) (2 / 3)
814
myLayoutHook = Docks.avoidStruts $ smartBorders $ workspaceDir "/home/marek" $ windowNavigation $ tall ||| F.fullscreenFull (boringAuto Simplest) where space = smartSpacing 5 tall = Tabbed.addTabs shrinkText tabbedConf $ space $ subLayout [] Simplest $ boringWindows $ ResizableTall 1 (3 / 100) (1 / 2) [] -- wide = -- boringAuto $ -- space $ -- Mirror $ ResizableTall 1 (2 / 100) (5 / 6) [] -- threeCol = -- Tabbed.addTabs shrinkText tabbedConf $ -- space $ -- subLayout [] Simplest $ -- boringWindows $ -- ThreeColMid 1 (3 / 100) (2 / 3)
814
myLayoutHook = Docks.avoidStruts $ smartBorders $ workspaceDir "/home/marek" $ windowNavigation $ tall ||| F.fullscreenFull (boringAuto Simplest) where space = smartSpacing 5 tall = Tabbed.addTabs shrinkText tabbedConf $ space $ subLayout [] Simplest $ boringWindows $ ResizableTall 1 (3 / 100) (1 / 2) [] -- wide = -- boringAuto $ -- space $ -- Mirror $ ResizableTall 1 (2 / 100) (5 / 6) [] -- threeCol = -- Tabbed.addTabs shrinkText tabbedConf $ -- space $ -- subLayout [] Simplest $ -- boringWindows $ -- ThreeColMid 1 (3 / 100) (2 / 3)
814
false
false
1
10
367
123
65
58
null
null
ganeti-github-testing/ganeti-test-1
src/Ganeti/Constants.hs
bsd-2-clause
nvNodenettest :: String nvNodenettest = "node-net-test"
55
nvNodenettest :: String nvNodenettest = "node-net-test"
55
nvNodenettest = "node-net-test"
31
false
true
0
4
5
11
6
5
null
null
themoritz/cabal
cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs
bsd-3-clause
extractInstallPlan :: CI.SolverInstallPlan.SolverInstallPlan -> [(ExamplePkgName, ExamplePkgVersion)] extractInstallPlan = catMaybes . map confPkg . CI.SolverInstallPlan.toList where confPkg :: CI.SolverInstallPlan.SolverPlanPackage -> Maybe (String, Int) confPkg (CI.SolverInstallPlan.Configured pkg) = Just $ srcPkg pkg confPkg _ = Nothing srcPkg :: SolverPackage UnresolvedPkgLoc -> (String, Int) srcPkg cpkg = let C.PackageIdentifier pn ver = packageInfoId (solverPkgSource cpkg) in (C.unPackageName pn, head (C.versionNumbers ver)) {------------------------------------------------------------------------------- Auxiliary -------------------------------------------------------------------------------} -- | Run Progress computation
826
extractInstallPlan :: CI.SolverInstallPlan.SolverInstallPlan -> [(ExamplePkgName, ExamplePkgVersion)] extractInstallPlan = catMaybes . map confPkg . CI.SolverInstallPlan.toList where confPkg :: CI.SolverInstallPlan.SolverPlanPackage -> Maybe (String, Int) confPkg (CI.SolverInstallPlan.Configured pkg) = Just $ srcPkg pkg confPkg _ = Nothing srcPkg :: SolverPackage UnresolvedPkgLoc -> (String, Int) srcPkg cpkg = let C.PackageIdentifier pn ver = packageInfoId (solverPkgSource cpkg) in (C.unPackageName pn, head (C.versionNumbers ver)) {------------------------------------------------------------------------------- Auxiliary -------------------------------------------------------------------------------} -- | Run Progress computation
826
extractInstallPlan = catMaybes . map confPkg . CI.SolverInstallPlan.toList where confPkg :: CI.SolverInstallPlan.SolverPlanPackage -> Maybe (String, Int) confPkg (CI.SolverInstallPlan.Configured pkg) = Just $ srcPkg pkg confPkg _ = Nothing srcPkg :: SolverPackage UnresolvedPkgLoc -> (String, Int) srcPkg cpkg = let C.PackageIdentifier pn ver = packageInfoId (solverPkgSource cpkg) in (C.unPackageName pn, head (C.versionNumbers ver)) {------------------------------------------------------------------------------- Auxiliary -------------------------------------------------------------------------------} -- | Run Progress computation
705
false
true
0
12
153
192
94
98
null
null
olsner/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
eqName = varQual gHC_CLASSES (fsLit "==") eqClassOpKey
70
eqName = varQual gHC_CLASSES (fsLit "==") eqClassOpKey
70
eqName = varQual gHC_CLASSES (fsLit "==") eqClassOpKey
70
false
false
0
7
22
19
9
10
null
null
rueshyna/gogol
gogol-slides/gen/Network/Google/Resource/Slides/Presentations/Get.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). pgUploadType :: Lens' PresentationsGet (Maybe Text) pgUploadType = lens _pgUploadType (\ s a -> s{_pgUploadType = a})
190
pgUploadType :: Lens' PresentationsGet (Maybe Text) pgUploadType = lens _pgUploadType (\ s a -> s{_pgUploadType = a})
119
pgUploadType = lens _pgUploadType (\ s a -> s{_pgUploadType = a})
67
true
true
1
9
28
50
25
25
null
null
farnoy/torrent
src/Network/BitTorrent/BitField.hs
bsd-3-clause
-- | /O(1)/ Get the status of a single piece. get :: BitField -> Word32 -> Bool get (BitField field _) ix = testBit word (7 - fromIntegral ix `rem` 8) where byteIx = fromIntegral $ ix `quot` 8 word = B.index field byteIx
233
get :: BitField -> Word32 -> Bool get (BitField field _) ix = testBit word (7 - fromIntegral ix `rem` 8) where byteIx = fromIntegral $ ix `quot` 8 word = B.index field byteIx
187
get (BitField field _) ix = testBit word (7 - fromIntegral ix `rem` 8) where byteIx = fromIntegral $ ix `quot` 8 word = B.index field byteIx
153
true
true
2
10
56
95
45
50
null
null
svenssonjoel/GCDObsidian
Obsidian/GCDObsidian/AddOn/SortLang.hs
bsd-3-clause
compile :: (a :-> b) -> a -> Kernel b compile (Pure f) = pure f
66
compile :: (a :-> b) -> a -> Kernel b compile (Pure f) = pure f
66
compile (Pure f) = pure f
28
false
true
0
7
18
41
20
21
null
null
iphydf/hs-toxcore
src/Network/Tox/Network/MonadRandomBytes.hs
gpl-3.0
randomKey :: forall m a. (MonadRandomBytes m, Key.CryptoNumber a) => m (Key a) randomKey = randomBinary get $ Key.encodedByteSize (Proxy :: Proxy a)
148
randomKey :: forall m a. (MonadRandomBytes m, Key.CryptoNumber a) => m (Key a) randomKey = randomBinary get $ Key.encodedByteSize (Proxy :: Proxy a)
148
randomKey = randomBinary get $ Key.encodedByteSize (Proxy :: Proxy a)
69
false
true
0
9
22
64
33
31
null
null
gitfoxi/ascii-vector-avc
JtagStateMachine.hs
gpl-2.0
jtagStateTrans PauseDr True = Exit2Dr
44
jtagStateTrans PauseDr True = Exit2Dr
44
jtagStateTrans PauseDr True = Exit2Dr
44
false
false
0
5
11
11
5
6
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
{- - The periapsis of the orbit, in meters, from the center of mass of the body being orbited.For the periapsis altitude reported on the in-game map view, use <see cref="M:SpaceCenter.Orbit.PeriapsisAltitude" />. -} getOrbitPeriapsis :: KRPCHS.SpaceCenter.Orbit -> RPCContext (Double) getOrbitPeriapsis thisArg = do let r = makeRequest "SpaceCenter" "Orbit_get_Periapsis" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
451
getOrbitPeriapsis :: KRPCHS.SpaceCenter.Orbit -> RPCContext (Double) getOrbitPeriapsis thisArg = do let r = makeRequest "SpaceCenter" "Orbit_get_Periapsis" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
233
getOrbitPeriapsis thisArg = do let r = makeRequest "SpaceCenter" "Orbit_get_Periapsis" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
164
true
true
0
13
71
73
33
40
null
null
mgsloan/panopti
src/Utils.hs
bsd-3-clause
preferOk :: ParseResult a -> Maybe a preferOk = rightToMaybe . parseResultToEither
82
preferOk :: ParseResult a -> Maybe a preferOk = rightToMaybe . parseResultToEither
82
preferOk = rightToMaybe . parseResultToEither
45
false
true
0
6
11
25
12
13
null
null
wavewave/madgraph-auto-dataset
src/HEP/Automation/MadGraph/Dataset/Set20110316set6.hs
gpl-3.0
my_csetup :: ClusterSetup my_csetup = CS { cluster = Parallel 3 }
65
my_csetup :: ClusterSetup my_csetup = CS { cluster = Parallel 3 }
65
my_csetup = CS { cluster = Parallel 3 }
39
false
true
0
7
11
22
12
10
null
null
li-zhirui/EoplLangs
test/ExceptionLang/EvaluatorSuite.hs
bsd-3-clause
testCond :: Test testCond = TestList [ testEq "Eval true branch of if expression" (ExprNum 3) "if zero? (0) then 3 else 4" , testEq "Eval false branch of if expression" (ExprNum 4) "if zero? (5) then 3 else 4" , testEq "Eval nested if expression" (ExprNum 2) "if zero? (1) then 1 else if zero? (0) then 2 else 3" ]
388
testCond :: Test testCond = TestList [ testEq "Eval true branch of if expression" (ExprNum 3) "if zero? (0) then 3 else 4" , testEq "Eval false branch of if expression" (ExprNum 4) "if zero? (5) then 3 else 4" , testEq "Eval nested if expression" (ExprNum 2) "if zero? (1) then 1 else if zero? (0) then 2 else 3" ]
388
testCond = TestList [ testEq "Eval true branch of if expression" (ExprNum 3) "if zero? (0) then 3 else 4" , testEq "Eval false branch of if expression" (ExprNum 4) "if zero? (5) then 3 else 4" , testEq "Eval nested if expression" (ExprNum 2) "if zero? (1) then 1 else if zero? (0) then 2 else 3" ]
371
false
true
0
9
135
69
32
37
null
null
abuiles/turbinado-blog
tmp/dependencies/utf8-string-0.3.3/Data/ByteString/Lazy/UTF8.hs
bsd-3-clause
lines' :: B.ByteString -> [B.ByteString] lines' bs | B.null bs = []
68
lines' :: B.ByteString -> [B.ByteString] lines' bs | B.null bs = []
68
lines' bs | B.null bs = []
27
false
true
0
9
12
38
18
20
null
null
locaweb/leela
src/warpdrive/src/Leela/Test/TestEndpoint.hs
apache-2.0
suite :: TestTree suite = testGroup "Endpoint" [ testGroup "TCP" [ testCase "host + port" $ (loadEndpointStr "tcp://localhost:50021") @?= (Just $ TCP "localhost" 50021 "") , testCase "host + port + path" $ (loadEndpointStr "tcp://localhost:50021/path") @?= (Just $ TCP "localhost" 50021 "/path") ] , testGroup "UDP" [ testCase "host + port" $ (loadEndpointStr "udp://localhost:50021") @?= (Just $ UDP "localhost" 50021 "") , testCase "host + port + path" $ (loadEndpointStr "udp://localhost:50021/path") @?= (Just $ UDP "localhost" 50021 "/path") ] ]
612
suite :: TestTree suite = testGroup "Endpoint" [ testGroup "TCP" [ testCase "host + port" $ (loadEndpointStr "tcp://localhost:50021") @?= (Just $ TCP "localhost" 50021 "") , testCase "host + port + path" $ (loadEndpointStr "tcp://localhost:50021/path") @?= (Just $ TCP "localhost" 50021 "/path") ] , testGroup "UDP" [ testCase "host + port" $ (loadEndpointStr "udp://localhost:50021") @?= (Just $ UDP "localhost" 50021 "") , testCase "host + port + path" $ (loadEndpointStr "udp://localhost:50021/path") @?= (Just $ UDP "localhost" 50021 "/path") ] ]
612
suite = testGroup "Endpoint" [ testGroup "TCP" [ testCase "host + port" $ (loadEndpointStr "tcp://localhost:50021") @?= (Just $ TCP "localhost" 50021 "") , testCase "host + port + path" $ (loadEndpointStr "tcp://localhost:50021/path") @?= (Just $ TCP "localhost" 50021 "/path") ] , testGroup "UDP" [ testCase "host + port" $ (loadEndpointStr "udp://localhost:50021") @?= (Just $ UDP "localhost" 50021 "") , testCase "host + port + path" $ (loadEndpointStr "udp://localhost:50021/path") @?= (Just $ UDP "localhost" 50021 "/path") ] ]
594
false
true
0
11
141
169
84
85
null
null
romanb/amazonka
amazonka-lambda/gen/Network/AWS/Lambda/DeleteEventSourceMapping.hs
mpl-2.0
-- | The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is the -- source of events. desmrEventSourceArn :: Lens' DeleteEventSourceMappingResponse (Maybe Text) desmrEventSourceArn = lens _desmrEventSourceArn (\s a -> s { _desmrEventSourceArn = a })
265
desmrEventSourceArn :: Lens' DeleteEventSourceMappingResponse (Maybe Text) desmrEventSourceArn = lens _desmrEventSourceArn (\s a -> s { _desmrEventSourceArn = a })
167
desmrEventSourceArn = lens _desmrEventSourceArn (\s a -> s { _desmrEventSourceArn = a })
92
true
true
0
9
41
47
26
21
null
null
cosmo0920/hs-mongo
tests/Factory/User.hs
mit
-- setup/teardown withUsers :: IO a -> IO a withUsers = bracket_ setup teardown where setup = withDB dbName $ insertMany collectionName [ [ "name" =: "test user1" , "email" =: ["mail1" =: "test@example.com", "mail2" =: "test@test.jp"]], [ "name" =: "test user2" , "email" =: ["mail1" =: "example@test.com", "mail2" =: "example@test.net"]]] teardown = withDB dbName $ delete (select [] $ collectionName) -- setup/teardown
455
withUsers :: IO a -> IO a withUsers = bracket_ setup teardown where setup = withDB dbName $ insertMany collectionName [ [ "name" =: "test user1" , "email" =: ["mail1" =: "test@example.com", "mail2" =: "test@test.jp"]], [ "name" =: "test user2" , "email" =: ["mail1" =: "example@test.com", "mail2" =: "example@test.net"]]] teardown = withDB dbName $ delete (select [] $ collectionName) -- setup/teardown
437
withUsers = bracket_ setup teardown where setup = withDB dbName $ insertMany collectionName [ [ "name" =: "test user1" , "email" =: ["mail1" =: "test@example.com", "mail2" =: "test@test.jp"]], [ "name" =: "test user2" , "email" =: ["mail1" =: "example@test.com", "mail2" =: "example@test.net"]]] teardown = withDB dbName $ delete (select [] $ collectionName) -- setup/teardown
411
true
true
1
11
97
144
73
71
null
null
andreagenso/java2scala
src/J2s/Ast/Semantic.hs
apache-2.0
sem_BlockStatement_BlockStatementLocalVariableDeclarationStatement = BlockStatementLocalVariableDeclarationStatement
119
sem_BlockStatement_BlockStatementLocalVariableDeclarationStatement = BlockStatementLocalVariableDeclarationStatement
119
sem_BlockStatement_BlockStatementLocalVariableDeclarationStatement = BlockStatementLocalVariableDeclarationStatement
119
false
false
0
4
5
6
3
3
null
null
aburnett88/HSat
src/HSat/Problem/Instances/CNF/Internal.hs
mit
noUnicodeAnd,unicodeAnd,noUnicodeOr,unicodeOr :: String noUnicodeAnd = "/\\"
109
noUnicodeAnd,unicodeAnd,noUnicodeOr,unicodeOr :: String noUnicodeAnd = "/\\"
109
noUnicodeAnd = "/\\"
53
false
true
0
4
38
17
12
5
null
null
beni55/haste-compiler
libraries/ghc-7.8/base/Data/Data.hs
bsd-3-clause
-- | Test for a non-representable type isNorepType :: DataType -> Bool isNorepType dt = case datarep dt of NoRep -> True _ -> False ------------------------------------------------------------------------------ -- -- Convenience for qualified type constructors -- ------------------------------------------------------------------------------ -- | Gets the unqualified type constructor: -- drop *.*.*... before name --
466
isNorepType :: DataType -> Bool isNorepType dt = case datarep dt of NoRep -> True _ -> False ------------------------------------------------------------------------------ -- -- Convenience for qualified type constructors -- ------------------------------------------------------------------------------ -- | Gets the unqualified type constructor: -- drop *.*.*... before name --
427
isNorepType dt = case datarep dt of NoRep -> True _ -> False ------------------------------------------------------------------------------ -- -- Convenience for qualified type constructors -- ------------------------------------------------------------------------------ -- | Gets the unqualified type constructor: -- drop *.*.*... before name --
395
true
true
0
8
95
52
28
24
null
null
olsner/ghc
compiler/prelude/THNames.hs
bsd-3-clause
sourceLazyName = libFun (fsLit "sourceLazy") sourceLazyKey
74
sourceLazyName = libFun (fsLit "sourceLazy") sourceLazyKey
74
sourceLazyName = libFun (fsLit "sourceLazy") sourceLazyKey
74
false
false
0
7
21
17
8
9
null
null
abakst/brisk-prelude
examples/Managed00.hs
bsd-3-clause
foobert :: ProcessId -> Process DataNodeResponse foobert p = call p Bloop
73
foobert :: ProcessId -> Process DataNodeResponse foobert p = call p Bloop
73
foobert p = call p Bloop
24
false
true
0
7
11
32
13
19
null
null
ammanvedi/haskell-nim-game
nim_game.hs
mit
display_gameai xs player | sum xs == 0 && player == 1 = putStrLn $ "winner is Player 1" | sum xs == 0 && player == 2 = putStrLn $ "winner is The Computer"
177
display_gameai xs player | sum xs == 0 && player == 1 = putStrLn $ "winner is Player 1" | sum xs == 0 && player == 2 = putStrLn $ "winner is The Computer"
177
display_gameai xs player | sum xs == 0 && player == 1 = putStrLn $ "winner is Player 1" | sum xs == 0 && player == 2 = putStrLn $ "winner is The Computer"
177
false
false
0
11
57
68
30
38
null
null
jrahm/Beowulf
Beowulf/Style/Colors.hs
bsd-2-clause
beige :: ColorT beige = Hex 0xF5F5DC
36
beige :: ColorT beige = Hex 0xF5F5DC
36
beige = Hex 0xF5F5DC
20
false
true
0
5
6
14
7
7
null
null
prowdsponsor/mangopay
mangopay/src/Web/MangoPay/Monad.hs
bsd-3-clause
-- | Run a 'ResourceT' inside a 'MangoPayT'. runResourceInMp :: (MPUsableMonad m) => MangoPayT (R.ResourceT m) a -> MangoPayT m a runResourceInMp (Mp inner) = Mp $ ask >>= lift . R.runResourceT . runReaderT inner
247
runResourceInMp :: (MPUsableMonad m) => MangoPayT (R.ResourceT m) a -> MangoPayT m a runResourceInMp (Mp inner) = Mp $ ask >>= lift . R.runResourceT . runReaderT inner
202
runResourceInMp (Mp inner) = Mp $ ask >>= lift . R.runResourceT . runReaderT inner
82
true
true
0
10
69
73
36
37
null
null
informatikr/passphrase
Crypto/Passphrase.hs
bsd-3-clause
getPass :: Dict -> IO ByteString getPass d = do ws <- getWords d ixs <- getRandIxs 4 return . unwords $ map (\ix -> ws !! (ix `rem` length ws)) ixs where getRandIxs n = do (Right ixs, _) <- runGet (replicateM n getRandIx) <$> getEntropy (n*2) return ixs getRandIx = do x <- fromIntegral <$> getWord8 y <- fromIntegral <$> getWord8 return $ 256 * x + y
415
getPass :: Dict -> IO ByteString getPass d = do ws <- getWords d ixs <- getRandIxs 4 return . unwords $ map (\ix -> ws !! (ix `rem` length ws)) ixs where getRandIxs n = do (Right ixs, _) <- runGet (replicateM n getRandIx) <$> getEntropy (n*2) return ixs getRandIx = do x <- fromIntegral <$> getWord8 y <- fromIntegral <$> getWord8 return $ 256 * x + y
415
getPass d = do ws <- getWords d ixs <- getRandIxs 4 return . unwords $ map (\ix -> ws !! (ix `rem` length ws)) ixs where getRandIxs n = do (Right ixs, _) <- runGet (replicateM n getRandIx) <$> getEntropy (n*2) return ixs getRandIx = do x <- fromIntegral <$> getWord8 y <- fromIntegral <$> getWord8 return $ 256 * x + y
382
false
true
0
14
133
181
86
95
null
null
brendanhay/gogol
gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs
mpl-2.0
-- | Creates a value of 'WorkerShutdownNotice' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'wsnReason' workerShutdownNotice :: WorkerShutdownNotice workerShutdownNotice = WorkerShutdownNotice' {_wsnReason = Nothing}
308
workerShutdownNotice :: WorkerShutdownNotice workerShutdownNotice = WorkerShutdownNotice' {_wsnReason = Nothing}
116
workerShutdownNotice = WorkerShutdownNotice' {_wsnReason = Nothing}
67
true
true
0
6
46
24
16
8
null
null
robdockins/edison
edison-core/src/Data/Edison/Seq/Defaults.hs
mit
dropMatch :: (Eq a,MonadPlus m) => [a] -> [a] -> m [a] dropMatch [] ys = return ys
82
dropMatch :: (Eq a,MonadPlus m) => [a] -> [a] -> m [a] dropMatch [] ys = return ys
82
dropMatch [] ys = return ys
27
false
true
0
9
17
56
29
27
null
null
ndmitchell/tagsoup
src/Text/HTML/TagSoup2/Parser.hs
bsd-3-clause
-- 8.2.4.3 Tag open state tagOpen S{..} = case hd of '!' -> markupDeclOpen tl '/' -> closeTagOpen tl _ | isAlpha hd -> Tag & hd & tagName (if isScript s then TypeScript else TypeNormal) tl '>' -> errSeen "<>" & '<' & '>' & dat tl '?' -> neilXmlTagOpen tl -- NEIL _ -> errSeen "<" & '<' & dat s
318
tagOpen S{..} = case hd of '!' -> markupDeclOpen tl '/' -> closeTagOpen tl _ | isAlpha hd -> Tag & hd & tagName (if isScript s then TypeScript else TypeNormal) tl '>' -> errSeen "<>" & '<' & '>' & dat tl '?' -> neilXmlTagOpen tl -- NEIL _ -> errSeen "<" & '<' & dat s
292
tagOpen S{..} = case hd of '!' -> markupDeclOpen tl '/' -> closeTagOpen tl _ | isAlpha hd -> Tag & hd & tagName (if isScript s then TypeScript else TypeNormal) tl '>' -> errSeen "<>" & '<' & '>' & dat tl '?' -> neilXmlTagOpen tl -- NEIL _ -> errSeen "<" & '<' & dat s
292
true
false
0
13
87
134
63
71
null
null
beni55/haste-compiler
libraries/ghc-7.10/ghc-prim/GHC/Prim.hs
bsd-3-clause
writeStablePtrArray# :: MutableByteArray# s -> Int# -> StablePtr# a -> State# s -> State# s writeStablePtrArray# = let x = x in x
129
writeStablePtrArray# :: MutableByteArray# s -> Int# -> StablePtr# a -> State# s -> State# s writeStablePtrArray# = let x = x in x
129
writeStablePtrArray# = let x = x in x
37
false
true
0
10
22
56
24
32
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/GlobalEventHandlers.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.ontransitionend Mozilla GlobalEventHandlers.ontransitionend documentation> transitionEnd :: (IsGlobalEventHandlers self, IsEventTarget self) => EventName self TransitionEvent transitionEnd = unsafeEventName (toJSString "transitionend")
341
transitionEnd :: (IsGlobalEventHandlers self, IsEventTarget self) => EventName self TransitionEvent transitionEnd = unsafeEventName (toJSString "transitionend")
190
transitionEnd = unsafeEventName (toJSString "transitionend")
60
true
true
0
7
51
44
22
22
null
null
5outh/cypher
src/Cypher/Request.hs
mit
payload :: Aeson.ToJSON a => a -> Endo Request payload ps req = req { requestBody = RequestBodyLBS (Aeson.encode ps) }
118
payload :: Aeson.ToJSON a => a -> Endo Request payload ps req = req { requestBody = RequestBodyLBS (Aeson.encode ps) }
118
payload ps req = req { requestBody = RequestBodyLBS (Aeson.encode ps) }
71
false
true
0
10
20
51
25
26
null
null
fmthoma/ghc
compiler/types/Type.hs
bsd-3-clause
splitFunTy :: Type -> (Type, Type) -- ^ Attempts to extract the argument and result types from a type, and -- panics if that is not possible. See also 'splitFunTy_maybe' splitFunTy ty | Just ty' <- coreView ty = splitFunTy ty'
226
splitFunTy :: Type -> (Type, Type) splitFunTy ty | Just ty' <- coreView ty = splitFunTy ty'
91
splitFunTy ty | Just ty' <- coreView ty = splitFunTy ty'
56
true
true
0
9
40
45
22
23
null
null
chadbrewbaker/shellcheck
ShellCheck/Parser.hs
gpl-3.0
variableChars = upper <|> lower <|> digit <|> oneOf "_"
55
variableChars = upper <|> lower <|> digit <|> oneOf "_"
55
variableChars = upper <|> lower <|> digit <|> oneOf "_"
55
false
false
4
6
9
27
12
15
null
null
kernelim/leveldb-haskell
src/Data/Stream/Monadic.hs
bsd-3-clause
unzip :: (Functor m, Monad m) => Stream m (a, b) -> m ([a], [b]) unzip = foldr (\ (a,b) ~(as,bs) -> (a:as, b:bs)) ([],[])
121
unzip :: (Functor m, Monad m) => Stream m (a, b) -> m ([a], [b]) unzip = foldr (\ (a,b) ~(as,bs) -> (a:as, b:bs)) ([],[])
121
unzip = foldr (\ (a,b) ~(as,bs) -> (a:as, b:bs)) ([],[])
56
false
true
0
10
24
113
62
51
null
null
emmanueltouzery/imprint
src/GtkViewModel.hs
mit
-- TODO code duplication in next 3 functions listModelRemoveItem :: Eq a => ListModel a -> Model a -> IO () listModelRemoveItem listModel itemModel = do curItem <- readIORef $ currentItem listModel when (curItem == Just itemModel) $ -- removing the current item! modifyIORef (currentItem listModel) $ const Nothing modifyIORef (items listModel) $ filter ((/=contents itemModel) . contents) readIORef (removedCallbacks listModel) >>= mapM_ ($ itemModel)
484
listModelRemoveItem :: Eq a => ListModel a -> Model a -> IO () listModelRemoveItem listModel itemModel = do curItem <- readIORef $ currentItem listModel when (curItem == Just itemModel) $ -- removing the current item! modifyIORef (currentItem listModel) $ const Nothing modifyIORef (items listModel) $ filter ((/=contents itemModel) . contents) readIORef (removedCallbacks listModel) >>= mapM_ ($ itemModel)
439
listModelRemoveItem listModel itemModel = do curItem <- readIORef $ currentItem listModel when (curItem == Just itemModel) $ -- removing the current item! modifyIORef (currentItem listModel) $ const Nothing modifyIORef (items listModel) $ filter ((/=contents itemModel) . contents) readIORef (removedCallbacks listModel) >>= mapM_ ($ itemModel)
376
true
true
0
12
96
150
70
80
null
null
soundcloud/haskell-kubernetes
lib/Kubernetes/Model/V1/ContainerPort.hs
mit
mkContainerPort :: Integer -> ContainerPort mkContainerPort xcontainerPortx = ContainerPort Nothing Nothing xcontainerPortx Nothing Nothing
139
mkContainerPort :: Integer -> ContainerPort mkContainerPort xcontainerPortx = ContainerPort Nothing Nothing xcontainerPortx Nothing Nothing
139
mkContainerPort xcontainerPortx = ContainerPort Nothing Nothing xcontainerPortx Nothing Nothing
95
false
true
0
5
13
29
14
15
null
null
brentonashworth/sitecheck
src/Network/SiteCheck/Data.hs
bsd-3-clause
popStack :: State -> (Maybe Link, State) popStack (State v (x:xs)) = (Just x, (State v xs))
91
popStack :: State -> (Maybe Link, State) popStack (State v (x:xs)) = (Just x, (State v xs))
91
popStack (State v (x:xs)) = (Just x, (State v xs))
50
false
true
0
11
16
65
32
33
null
null
nlinker/haskell-you-could
src/Main.hs
mit
decode C A A = Gln
18
decode C A A = Gln
18
decode C A A = Gln
18
false
false
0
5
5
13
6
7
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
3083 = 3082
11
3083 = 3082
11
3083 = 3082
11
false
false
1
5
2
10
3
7
null
null
rfranek/duckling
Duckling/Time/IT/Rules.hs
bsd-3-clause
ruleNamedmonth12 :: Rule ruleNamedmonth12 = Rule { name = "named-month" , pattern = [ regex "dicembre|dic\\.?" ] , prod = \_ -> tt $ month 12 }
159
ruleNamedmonth12 :: Rule ruleNamedmonth12 = Rule { name = "named-month" , pattern = [ regex "dicembre|dic\\.?" ] , prod = \_ -> tt $ month 12 }
159
ruleNamedmonth12 = Rule { name = "named-month" , pattern = [ regex "dicembre|dic\\.?" ] , prod = \_ -> tt $ month 12 }
134
false
true
0
10
42
59
30
29
null
null
mydaum/cabal
cabal-install/Distribution/Client/ProjectConfig/Legacy.hs
bsd-3-clause
dispRelaxDeps (RelaxDepsSome pkgs) = Disp.fsep . Disp.punctuate Disp.comma . map disp $ pkgs
139
dispRelaxDeps (RelaxDepsSome pkgs) = Disp.fsep . Disp.punctuate Disp.comma . map disp $ pkgs
139
dispRelaxDeps (RelaxDepsSome pkgs) = Disp.fsep . Disp.punctuate Disp.comma . map disp $ pkgs
139
false
false
0
9
59
39
18
21
null
null
keithshep/txt-sushi
Database/TxtSushi/SQLFunctionDefinitions.hs
bsd-3-clause
concatenateFunction :: SQLFunction concatenateFunction = SQLFunction { functionName = "||", minArgCount = 2, argCountIsFixed = True, applyFunction = catExprs . checkArgCount concatenateFunction, functionGrammar = binaryInfixGrammar concatenateFunction, functionDescription = "performs string concatenation of the left and right strings"} where catExprs [arg1, arg2] = StringExpression $ (coerceString arg1) ++ (coerceString arg2) catExprs _ = internalError
529
concatenateFunction :: SQLFunction concatenateFunction = SQLFunction { functionName = "||", minArgCount = 2, argCountIsFixed = True, applyFunction = catExprs . checkArgCount concatenateFunction, functionGrammar = binaryInfixGrammar concatenateFunction, functionDescription = "performs string concatenation of the left and right strings"} where catExprs [arg1, arg2] = StringExpression $ (coerceString arg1) ++ (coerceString arg2) catExprs _ = internalError
529
concatenateFunction = SQLFunction { functionName = "||", minArgCount = 2, argCountIsFixed = True, applyFunction = catExprs . checkArgCount concatenateFunction, functionGrammar = binaryInfixGrammar concatenateFunction, functionDescription = "performs string concatenation of the left and right strings"} where catExprs [arg1, arg2] = StringExpression $ (coerceString arg1) ++ (coerceString arg2) catExprs _ = internalError
494
false
true
1
8
125
104
58
46
null
null
cchalmers/shaped
src/Data/Dense/Generic.hs
bsd-3-clause
-- Clamp clampPeeks :: Shape f => (f Int -> f Int) -> Focused f a -> a clampPeeks f (Focused x (Delayed l ixF)) = ixF $! clampIndex l (f x)
140
clampPeeks :: Shape f => (f Int -> f Int) -> Focused f a -> a clampPeeks f (Focused x (Delayed l ixF)) = ixF $! clampIndex l (f x)
130
clampPeeks f (Focused x (Delayed l ixF)) = ixF $! clampIndex l (f x)
68
true
true
0
9
32
81
39
42
null
null
snoyberg/ghc
testsuite/tests/concurrent/prog001/Thread.hs
bsd-3-clause
t5 m (a:1:0:y) (1:1:x) = putMVar m 70
37
t5 m (a:1:0:y) (1:1:x) = putMVar m 70
37
t5 m (a:1:0:y) (1:1:x) = putMVar m 70
37
false
false
0
8
7
48
22
26
null
null
abbradar/gameoflife
Main.hs
bsd-3-clause
events _ _ w = w
16
events _ _ w = w
16
events _ _ w = w
16
false
false
0
5
5
13
6
7
null
null
spechub/Hets
CMDL/DgCommands.hs
gpl-2.0
-- | Wraps Result structure around the result of a dg all style command wrapResultDgAll :: (LibName -> LibEnv -> LibEnv) -> LibName -> LibEnv -> Result LibEnv wrapResultDgAll fn lib_name = return . fn lib_name
225
wrapResultDgAll :: (LibName -> LibEnv -> LibEnv) -> LibName -> LibEnv -> Result LibEnv wrapResultDgAll fn lib_name = return . fn lib_name
153
wrapResultDgAll fn lib_name = return . fn lib_name
50
true
true
0
8
51
50
25
25
null
null
erochest/gitreview-core
Github/Review/Types.hs
apache-2.0
ghUserError :: String -> GithubInteractionT Error IO a ghUserError = hoistEitherT . left . UserError
100
ghUserError :: String -> GithubInteractionT Error IO a ghUserError = hoistEitherT . left . UserError
100
ghUserError = hoistEitherT . left . UserError
45
false
true
0
6
14
30
15
15
null
null
SwiftsNamesake/Elrond
src/Elrond/Client.hs
mit
-------------------------------------------------------------------------------------------------------------------------------------------- -- Functions -------------------------------------------------------------------------------------------------------------------------------------------- -- | start :: IO () start = do manager <- newManager defaultManagerSettings request <- parseUrl "http://192.168.1.88:8000/flic.html" forM [(1::Int)..5] $ \n -> do printf "\n\n---- %s %d %s\n\n" "Request" n (replicate 60 '-') response <- httpLbs request manager printf "The status code was '%s'.\n" (show . statusCode $ responseStatus response) printf "The response body was '%s'.\n" (C.unpack $ responseBody response) threadDelay $ round (2.5 * 10^6) return ()
787
start :: IO () start = do manager <- newManager defaultManagerSettings request <- parseUrl "http://192.168.1.88:8000/flic.html" forM [(1::Int)..5] $ \n -> do printf "\n\n---- %s %d %s\n\n" "Request" n (replicate 60 '-') response <- httpLbs request manager printf "The status code was '%s'.\n" (show . statusCode $ responseStatus response) printf "The response body was '%s'.\n" (C.unpack $ responseBody response) threadDelay $ round (2.5 * 10^6) return ()
486
start = do manager <- newManager defaultManagerSettings request <- parseUrl "http://192.168.1.88:8000/flic.html" forM [(1::Int)..5] $ \n -> do printf "\n\n---- %s %d %s\n\n" "Request" n (replicate 60 '-') response <- httpLbs request manager printf "The status code was '%s'.\n" (show . statusCode $ responseStatus response) printf "The response body was '%s'.\n" (C.unpack $ responseBody response) threadDelay $ round (2.5 * 10^6) return ()
471
true
true
0
15
103
169
80
89
null
null
olorin/amazonka
amazonka-iam/gen/Network/AWS/IAM/ListEntitiesForPolicy.hs
mpl-2.0
-- | Creates a value of 'ListEntitiesForPolicyResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'lefprsPolicyGroups' -- -- * 'lefprsPolicyRoles' -- -- * 'lefprsMarker' -- -- * 'lefprsPolicyUsers' -- -- * 'lefprsIsTruncated' -- -- * 'lefprsResponseStatus' listEntitiesForPolicyResponse :: Int -- ^ 'lefprsResponseStatus' -> ListEntitiesForPolicyResponse listEntitiesForPolicyResponse pResponseStatus_ = ListEntitiesForPolicyResponse' { _lefprsPolicyGroups = Nothing , _lefprsPolicyRoles = Nothing , _lefprsMarker = Nothing , _lefprsPolicyUsers = Nothing , _lefprsIsTruncated = Nothing , _lefprsResponseStatus = pResponseStatus_ }
761
listEntitiesForPolicyResponse :: Int -- ^ 'lefprsResponseStatus' -> ListEntitiesForPolicyResponse listEntitiesForPolicyResponse pResponseStatus_ = ListEntitiesForPolicyResponse' { _lefprsPolicyGroups = Nothing , _lefprsPolicyRoles = Nothing , _lefprsMarker = Nothing , _lefprsPolicyUsers = Nothing , _lefprsIsTruncated = Nothing , _lefprsResponseStatus = pResponseStatus_ }
413
listEntitiesForPolicyResponse pResponseStatus_ = ListEntitiesForPolicyResponse' { _lefprsPolicyGroups = Nothing , _lefprsPolicyRoles = Nothing , _lefprsMarker = Nothing , _lefprsPolicyUsers = Nothing , _lefprsIsTruncated = Nothing , _lefprsResponseStatus = pResponseStatus_ }
307
true
true
0
7
130
81
52
29
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Advertisers/List.hs
mpl-2.0
-- | User profile ID associated with this request. allProFileId :: Lens' AdvertisersList Int64 allProFileId = lens _allProFileId (\ s a -> s{_allProFileId = a}) . _Coerce
178
allProFileId :: Lens' AdvertisersList Int64 allProFileId = lens _allProFileId (\ s a -> s{_allProFileId = a}) . _Coerce
127
allProFileId = lens _allProFileId (\ s a -> s{_allProFileId = a}) . _Coerce
83
true
true
0
10
34
46
24
22
null
null
beni55/fay
src/tests/Test/Desugar.hs
bsd-3-clause
testDeclarations :: [DesugarTest] testDeclarations = [T "LambdaCase" "import Prelude; f = \\gen0 -> case gen0 of { _ -> 2 }" "import Prelude; f = \\case { _ -> 2 }" ,T "MultiWayIf" "import Prelude; f = case () of { _ | True -> 1 | False -> 2 }" "import Prelude; f = if | True -> 1 | False -> 2" ,T "TupleCon" "import Prelude; f = \\gen0 gen1 gen2 -> (gen0, gen1, gen2)" "import Prelude; f = (,,)" ,T "Do" "import Prelude; f = (>>=) x (\\gen0 -> (>>) y z)" "import Prelude; f = do { gen0 <- x; y; z }" ,T "TupleSection" "import Prelude; f = \\gen0 gen1 -> (gen0,2,gen1)" "import Prelude; f = (,2,)" ,T "ImplicitPrelude1" -- Add missing Prelude import "import Prelude" "" ,T "ImplicitPrelude2" -- Keep existing Prelude import "import Prelude ()" "import Prelude ()" ,T "ImplicitPrelude3" -- Keep existing qualified import "import qualified Prelude" "import qualified Prelude" ,T "NoImplicitPrelude" "{-# LANGUAGE NoImplicitPrelude #-}" "{-# LANGUAGE NoImplicitPrelude #-}" ,T "OperatorSectionRight" "import Prelude; f = \\gen0 -> g gen0 x" "import Prelude; f = (`g` x)" ,T "OperatorSectionLeft" "import Prelude; f = \\gen0 -> g x gen0" "import Prelude; f = (x `g`)" ,T "InfixOpOp" "import Prelude; f = (+) x y" "import Prelude; f = x + y" ,T "InfixOpFun" "import Prelude; f = g x y" "import Prelude; f = x `g` y" ,T "InfixOpCons" "import Prelude; f = (:) x y" "import Prelude; f = x : y" ,T "ExpParen" "import Prelude; f = x y" "import Prelude; f = (x (y))" ,T "PatParen" "import Prelude; f x = y" "import Prelude; f (x) = y" ,T "PatInfixOp" "import Prelude; f ((:) x y) = z" "import Prelude; f (x : y) = z" ,T "PatFieldPun" "import Prelude; f R { x = x } = y" "import Prelude; f R { x } = y" ,T "PatField" "import Prelude; f = R { x = x }" "import Prelude; f = R { x }" ,T "FFITopLevel" "import Prelude; f :: Int; f = ffi \"1\" :: Int" "import Prelude; f :: Int; f = ffi \"1\"" ,T "FFIWhere" "import Prelude; f = () where x :: Int; x = ffi \"1\" :: Int" "import Prelude; f = () where x :: Int; x = ffi \"1\"" ]
2,263
testDeclarations :: [DesugarTest] testDeclarations = [T "LambdaCase" "import Prelude; f = \\gen0 -> case gen0 of { _ -> 2 }" "import Prelude; f = \\case { _ -> 2 }" ,T "MultiWayIf" "import Prelude; f = case () of { _ | True -> 1 | False -> 2 }" "import Prelude; f = if | True -> 1 | False -> 2" ,T "TupleCon" "import Prelude; f = \\gen0 gen1 gen2 -> (gen0, gen1, gen2)" "import Prelude; f = (,,)" ,T "Do" "import Prelude; f = (>>=) x (\\gen0 -> (>>) y z)" "import Prelude; f = do { gen0 <- x; y; z }" ,T "TupleSection" "import Prelude; f = \\gen0 gen1 -> (gen0,2,gen1)" "import Prelude; f = (,2,)" ,T "ImplicitPrelude1" -- Add missing Prelude import "import Prelude" "" ,T "ImplicitPrelude2" -- Keep existing Prelude import "import Prelude ()" "import Prelude ()" ,T "ImplicitPrelude3" -- Keep existing qualified import "import qualified Prelude" "import qualified Prelude" ,T "NoImplicitPrelude" "{-# LANGUAGE NoImplicitPrelude #-}" "{-# LANGUAGE NoImplicitPrelude #-}" ,T "OperatorSectionRight" "import Prelude; f = \\gen0 -> g gen0 x" "import Prelude; f = (`g` x)" ,T "OperatorSectionLeft" "import Prelude; f = \\gen0 -> g x gen0" "import Prelude; f = (x `g`)" ,T "InfixOpOp" "import Prelude; f = (+) x y" "import Prelude; f = x + y" ,T "InfixOpFun" "import Prelude; f = g x y" "import Prelude; f = x `g` y" ,T "InfixOpCons" "import Prelude; f = (:) x y" "import Prelude; f = x : y" ,T "ExpParen" "import Prelude; f = x y" "import Prelude; f = (x (y))" ,T "PatParen" "import Prelude; f x = y" "import Prelude; f (x) = y" ,T "PatInfixOp" "import Prelude; f ((:) x y) = z" "import Prelude; f (x : y) = z" ,T "PatFieldPun" "import Prelude; f R { x = x } = y" "import Prelude; f R { x } = y" ,T "PatField" "import Prelude; f = R { x = x }" "import Prelude; f = R { x }" ,T "FFITopLevel" "import Prelude; f :: Int; f = ffi \"1\" :: Int" "import Prelude; f :: Int; f = ffi \"1\"" ,T "FFIWhere" "import Prelude; f = () where x :: Int; x = ffi \"1\" :: Int" "import Prelude; f = () where x :: Int; x = ffi \"1\"" ]
2,263
testDeclarations = [T "LambdaCase" "import Prelude; f = \\gen0 -> case gen0 of { _ -> 2 }" "import Prelude; f = \\case { _ -> 2 }" ,T "MultiWayIf" "import Prelude; f = case () of { _ | True -> 1 | False -> 2 }" "import Prelude; f = if | True -> 1 | False -> 2" ,T "TupleCon" "import Prelude; f = \\gen0 gen1 gen2 -> (gen0, gen1, gen2)" "import Prelude; f = (,,)" ,T "Do" "import Prelude; f = (>>=) x (\\gen0 -> (>>) y z)" "import Prelude; f = do { gen0 <- x; y; z }" ,T "TupleSection" "import Prelude; f = \\gen0 gen1 -> (gen0,2,gen1)" "import Prelude; f = (,2,)" ,T "ImplicitPrelude1" -- Add missing Prelude import "import Prelude" "" ,T "ImplicitPrelude2" -- Keep existing Prelude import "import Prelude ()" "import Prelude ()" ,T "ImplicitPrelude3" -- Keep existing qualified import "import qualified Prelude" "import qualified Prelude" ,T "NoImplicitPrelude" "{-# LANGUAGE NoImplicitPrelude #-}" "{-# LANGUAGE NoImplicitPrelude #-}" ,T "OperatorSectionRight" "import Prelude; f = \\gen0 -> g gen0 x" "import Prelude; f = (`g` x)" ,T "OperatorSectionLeft" "import Prelude; f = \\gen0 -> g x gen0" "import Prelude; f = (x `g`)" ,T "InfixOpOp" "import Prelude; f = (+) x y" "import Prelude; f = x + y" ,T "InfixOpFun" "import Prelude; f = g x y" "import Prelude; f = x `g` y" ,T "InfixOpCons" "import Prelude; f = (:) x y" "import Prelude; f = x : y" ,T "ExpParen" "import Prelude; f = x y" "import Prelude; f = (x (y))" ,T "PatParen" "import Prelude; f x = y" "import Prelude; f (x) = y" ,T "PatInfixOp" "import Prelude; f ((:) x y) = z" "import Prelude; f (x : y) = z" ,T "PatFieldPun" "import Prelude; f R { x = x } = y" "import Prelude; f R { x } = y" ,T "PatField" "import Prelude; f = R { x = x }" "import Prelude; f = R { x }" ,T "FFITopLevel" "import Prelude; f :: Int; f = ffi \"1\" :: Int" "import Prelude; f :: Int; f = ffi \"1\"" ,T "FFIWhere" "import Prelude; f = () where x :: Int; x = ffi \"1\" :: Int" "import Prelude; f = () where x :: Int; x = ffi \"1\"" ]
2,229
false
true
0
6
644
227
116
111
null
null
Gabriel439/Haskell-Dhall-Library
dhall/ghcjs-src/Dhall/Import/HTTP.hs
bsd-3-clause
originHeadersFileExpr :: IO (Expr Src Import) originHeadersFileExpr = return Missing
84
originHeadersFileExpr :: IO (Expr Src Import) originHeadersFileExpr = return Missing
84
originHeadersFileExpr = return Missing
38
false
true
0
7
9
25
12
13
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Graphics/OctreeQuery.hs
mit
octreeQuerySetViewMask :: (Parent OctreeQuery a, Pointer ptr a, MonadIO m) => ptr -- ^ Pointer to 'OctreeQuery' or ascenstor -> Word -> m () octreeQuerySetViewMask p v = liftIO $ do let ptr = parentPointer p v' = fromIntegral v [C.exp| void { $(OctreeQuery* ptr)->viewMask_ = $(unsigned int v') } |]
315
octreeQuerySetViewMask :: (Parent OctreeQuery a, Pointer ptr a, MonadIO m) => ptr -- ^ Pointer to 'OctreeQuery' or ascenstor -> Word -> m () octreeQuerySetViewMask p v = liftIO $ do let ptr = parentPointer p v' = fromIntegral v [C.exp| void { $(OctreeQuery* ptr)->viewMask_ = $(unsigned int v') } |]
315
octreeQuerySetViewMask p v = liftIO $ do let ptr = parentPointer p v' = fromIntegral v [C.exp| void { $(OctreeQuery* ptr)->viewMask_ = $(unsigned int v') } |]
168
false
true
0
11
66
89
45
44
null
null
markus-git/signal
src/Signal/Core/Stream.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- ** -- | Run stream to produce transition action run :: Stream instr a -> Program instr a run (Stream init) = join init
203
run :: Stream instr a -> Program instr a run (Stream init) = join init
70
run (Stream init) = join init
29
true
true
0
7
26
40
20
20
null
null
takoeight0821/malgo
src/Malgo/Refine/Space.hs
bsd-3-clause
decomposable (TyRecord _) = True
32
decomposable (TyRecord _) = True
32
decomposable (TyRecord _) = True
32
false
false
0
7
4
15
7
8
null
null
bitemyapp/ganeti
src/Ganeti/OpCodes.hs
bsd-2-clause
opSummaryVal OpInstanceMove { opInstanceName = s } = Just s
59
opSummaryVal OpInstanceMove { opInstanceName = s } = Just s
59
opSummaryVal OpInstanceMove { opInstanceName = s } = Just s
59
false
false
0
8
9
21
10
11
null
null
mkovacs/ipoly
Poly.hs
gpl-3.0
gV :: (Num x) => VTerm n x -> x degV (VMul v s) = 1 + degS s
63
degV :: (Num x) => VTerm n x -> x degV (VMul v s) = 1 + degS s
62
degV (VMul v s) = 1 + degS s
28
false
true
0
7
21
47
23
24
null
null
comonoidial/ALFIN
Backend/OptimizeAsm.hs
mit
setFirstEval :: [(FName, Int)] -> [Parameter] -> AsmBlock -> (AsmBlock, Maybe Int) setFirstEval fes vs (AsmBlock xs t) = case (dropWhile (not . withCtrlStmt) xs) of [] -> let (t',e) = setFirstEvalTerm fes vs t in (AsmBlock xs t', e) (x:_) -> let (t',_) = setFirstEvalTerm fes vs t in (AsmBlock xs t', firstEvalStmt fes vs x)
331
setFirstEval :: [(FName, Int)] -> [Parameter] -> AsmBlock -> (AsmBlock, Maybe Int) setFirstEval fes vs (AsmBlock xs t) = case (dropWhile (not . withCtrlStmt) xs) of [] -> let (t',e) = setFirstEvalTerm fes vs t in (AsmBlock xs t', e) (x:_) -> let (t',_) = setFirstEvalTerm fes vs t in (AsmBlock xs t', firstEvalStmt fes vs x)
331
setFirstEval fes vs (AsmBlock xs t) = case (dropWhile (not . withCtrlStmt) xs) of [] -> let (t',e) = setFirstEvalTerm fes vs t in (AsmBlock xs t', e) (x:_) -> let (t',_) = setFirstEvalTerm fes vs t in (AsmBlock xs t', firstEvalStmt fes vs x)
248
false
true
0
12
63
184
93
91
null
null
lennart96/printer
control/SendCmd.hs
mit
main :: IO () main = do (device:cmds) <- getArgs port <- hOpenSerial device $ defaultSerialSettings { timeout = 60000 } forM_ cmds $ communicate port hClose port
177
main :: IO () main = do (device:cmds) <- getArgs port <- hOpenSerial device $ defaultSerialSettings { timeout = 60000 } forM_ cmds $ communicate port hClose port
177
main = do (device:cmds) <- getArgs port <- hOpenSerial device $ defaultSerialSettings { timeout = 60000 } forM_ cmds $ communicate port hClose port
163
false
true
0
10
43
71
33
38
null
null
snoyberg/ghc
compiler/basicTypes/VarEnv.hs
bsd-3-clause
mkVarEnv_Directly= listToUFM_Directly
37
mkVarEnv_Directly= listToUFM_Directly
37
mkVarEnv_Directly= listToUFM_Directly
37
false
false
0
4
1
6
3
3
null
null
jaapweel/piffle
src/CC.hs
gpl-2.0
tStat (For a b c s) = [For (tMaybeExp a) (tMaybeExp b) (tMaybeExp c) (tStat1 s)]
84
tStat (For a b c s) = [For (tMaybeExp a) (tMaybeExp b) (tMaybeExp c) (tStat1 s)]
84
tStat (For a b c s) = [For (tMaybeExp a) (tMaybeExp b) (tMaybeExp c) (tStat1 s)]
84
false
false
0
8
19
57
28
29
null
null
ulrikrasmussen/TwelfParser
src/Language/Twelf/Lexer.hs
bsd-3-clause
rightArrow :: (Stream s m Char) => ParsecT s u m String rightArrow = atomic "->"
80
rightArrow :: (Stream s m Char) => ParsecT s u m String rightArrow = atomic "->"
80
rightArrow = atomic "->"
24
false
true
0
6
15
36
18
18
null
null
fmapfmapfmap/amazonka
amazonka-iam/gen/Network/AWS/IAM/Types/Product.hs
mpl-2.0
-- | The stable and unique string identifying the instance profile. For more -- information about IDs, see -- <http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM Identifiers> -- in the /Using IAM/ guide. ipInstanceProfileId :: Lens' InstanceProfile Text ipInstanceProfileId = lens _ipInstanceProfileId (\ s a -> s{_ipInstanceProfileId = a})
364
ipInstanceProfileId :: Lens' InstanceProfile Text ipInstanceProfileId = lens _ipInstanceProfileId (\ s a -> s{_ipInstanceProfileId = a})
136
ipInstanceProfileId = lens _ipInstanceProfileId (\ s a -> s{_ipInstanceProfileId = a})
86
true
true
0
9
43
43
25
18
null
null
SWP-Ubau-SoSe2014-Haskell/SWPSoSe14
src/RailEditor/TextAreaContentUtils.hs
mit
-- | moves Contents into a Direction moveChar :: TAC.TextAreaContent -> TAC.Position -> TAC.Direction -> IO() moveChar area from dir = do x <- TAC.getCell area from unless (isNothing x) $ do let cell = fromJust x to = calculateDest from dir TAC.putCell area to cell TAC.deleteCell area from return () -- | moves amount of Characters of one line in range from Pos x to last char in line
424
moveChar :: TAC.TextAreaContent -> TAC.Position -> TAC.Direction -> IO() moveChar area from dir = do x <- TAC.getCell area from unless (isNothing x) $ do let cell = fromJust x to = calculateDest from dir TAC.putCell area to cell TAC.deleteCell area from return () -- | moves amount of Characters of one line in range from Pos x to last char in line
387
moveChar area from dir = do x <- TAC.getCell area from unless (isNothing x) $ do let cell = fromJust x to = calculateDest from dir TAC.putCell area to cell TAC.deleteCell area from return () -- | moves amount of Characters of one line in range from Pos x to last char in line
308
true
true
0
13
108
126
57
69
null
null
c089/haskell-craft3e
Chapter5Exercises.hs
mit
------------------------------------------------------------------------------- -- Exercise 5.18 ------------------------------------------------------------------------------- doubleAll :: [Integer] -> [Integer] doubleAll l = [ 2*e | e <- l ]
244
doubleAll :: [Integer] -> [Integer] doubleAll l = [ 2*e | e <- l ]
66
doubleAll l = [ 2*e | e <- l ]
30
true
true
0
7
20
42
24
18
null
null
zaquest/redflare
src/Network/RedEclipse/RedFlare.hs
mit
uncolorString ('\f':'z':cs) = uncolorString $ drop 2 cs
55
uncolorString ('\f':'z':cs) = uncolorString $ drop 2 cs
55
uncolorString ('\f':'z':cs) = uncolorString $ drop 2 cs
55
false
false
0
7
7
25
12
13
null
null
jtojnar/hulk
src/Hulk/Client.hs
bsd-3-clause
validChannel _ = False
22
validChannel _ = False
22
validChannel _ = False
22
false
false
0
4
3
10
4
6
null
null
gnn/Hets
ExtModal/Ship.hs
gpl-2.0
lastNotPrim :: [Foltl] -> Bool lastNotPrim l = not (null l) && not (isPrimFoltl $ last l)
89
lastNotPrim :: [Foltl] -> Bool lastNotPrim l = not (null l) && not (isPrimFoltl $ last l)
89
lastNotPrim l = not (null l) && not (isPrimFoltl $ last l)
58
false
true
0
9
16
52
24
28
null
null
disnet/jscheck
src/Checker.hs
bsd-3-clause
runChecker input = parse_now input (\p -> if (check_now p (runExtractor p)) then Good "You know how to use your types." else Warning "Either you forgot to use the right types or you entered a malformed javascript code.")
246
runChecker input = parse_now input (\p -> if (check_now p (runExtractor p)) then Good "You know how to use your types." else Warning "Either you forgot to use the right types or you entered a malformed javascript code.")
246
runChecker input = parse_now input (\p -> if (check_now p (runExtractor p)) then Good "You know how to use your types." else Warning "Either you forgot to use the right types or you entered a malformed javascript code.")
246
false
false
1
12
63
53
25
28
null
null
rueshyna/gogol
gogol-genomics/gen/Network/Google/Resource/Genomics/ReadGroupSets/Patch.hs
mpl-2.0
-- | OAuth access token. rgspAccessToken :: Lens' ReadGroupSetsPatch (Maybe Text) rgspAccessToken = lens _rgspAccessToken (\ s a -> s{_rgspAccessToken = a})
164
rgspAccessToken :: Lens' ReadGroupSetsPatch (Maybe Text) rgspAccessToken = lens _rgspAccessToken (\ s a -> s{_rgspAccessToken = a})
139
rgspAccessToken = lens _rgspAccessToken (\ s a -> s{_rgspAccessToken = a})
82
true
true
0
8
29
49
25
24
null
null
travitch/dalvik
src/Dalvik/SSA/Internal/BasicBlocks.hs
bsd-3-clause
-- | Given the index of an Instruction in the instruction vector and a -- raw Dalvik offset, compute the instruction referenced by the -- relative offset. Raw offsets are in units of @ushort@, which do -- **not** correspond one-to-one with instructions. instructionAtRawOffsetFrom :: (Integral a) => BasicBlocks -> Int -> a -> Maybe Instruction instructionAtRawOffsetFrom bbs ix offset = envInstVec (bbEnv bbs) V.!? targetIndex where targetIndex = resolveOffsetFrom (bbEnv bbs) ix (fromIntegral offset) -- | Find the targets of the terminator (or fallthrough) instruction -- in the named basic block. Each target is tagged with the condition -- under which that branch is taken.
689
instructionAtRawOffsetFrom :: (Integral a) => BasicBlocks -> Int -> a -> Maybe Instruction instructionAtRawOffsetFrom bbs ix offset = envInstVec (bbEnv bbs) V.!? targetIndex where targetIndex = resolveOffsetFrom (bbEnv bbs) ix (fromIntegral offset) -- | Find the targets of the terminator (or fallthrough) instruction -- in the named basic block. Each target is tagged with the condition -- under which that branch is taken.
434
instructionAtRawOffsetFrom bbs ix offset = envInstVec (bbEnv bbs) V.!? targetIndex where targetIndex = resolveOffsetFrom (bbEnv bbs) ix (fromIntegral offset) -- | Find the targets of the terminator (or fallthrough) instruction -- in the named basic block. Each target is tagged with the condition -- under which that branch is taken.
343
true
true
0
9
115
91
48
43
null
null
ford-prefect/haskell-gi
lib/Data/GI/CodeGen/CodeGen.hs
lgpl-2.1
genAPI n (APIObject o) = genObject n o
38
genAPI n (APIObject o) = genObject n o
38
genAPI n (APIObject o) = genObject n o
38
false
false
0
6
7
24
10
14
null
null
punitrathore/haskell-first-principles
src/Folds.hs
bsd-3-clause
myOr :: [Bool] -> Bool myOr = foldr (||) False
46
myOr :: [Bool] -> Bool myOr = foldr (||) False
46
myOr = foldr (||) False
23
false
true
0
7
9
33
15
18
null
null
pernas/service-randombytes-haskell
src/Main.hs
unlicense
handleEx :: Monad m => Except -> ActionT Except m () handleEx (StringEx msg) = do status status400 json $ object [ ("error" .= msg)] -- Server code
156
handleEx :: Monad m => Except -> ActionT Except m () handleEx (StringEx msg) = do status status400 json $ object [ ("error" .= msg)] -- Server code
156
handleEx (StringEx msg) = do status status400 json $ object [ ("error" .= msg)] -- Server code
103
false
true
0
11
36
67
32
35
null
null
SimSaladin/hcalc
src/Hcalc.hs
bsd-3-clause
-- | Execute a transformation on each column mapCols :: Sheet -> (Int -> Col -> Col) -> Sheet mapCols (Sheet xs) f = Sheet (zipWith f [0..] xs)
143
mapCols :: Sheet -> (Int -> Col -> Col) -> Sheet mapCols (Sheet xs) f = Sheet (zipWith f [0..] xs)
98
mapCols (Sheet xs) f = Sheet (zipWith f [0..] xs)
49
true
true
0
9
28
58
30
28
null
null
frosch03/arrowVHDL
src/System/ArrowVHDL/Circuit/Show/DOT.hs
cc0-1.0
showEdge e = "nodeId" ++ show src_cid ++ ':': "op" ++ show src_pid ++ " -> " ++ "nodeId" ++ show snk_cid ++ ':': "ip" ++ show snk_pid where (Just src_cid, src_pid) = sourceInfo e (Just snk_cid, snk_pid) = sinkInfo e
243
showEdge e = "nodeId" ++ show src_cid ++ ':': "op" ++ show src_pid ++ " -> " ++ "nodeId" ++ show snk_cid ++ ':': "ip" ++ show snk_pid where (Just src_cid, src_pid) = sourceInfo e (Just snk_cid, snk_pid) = sinkInfo e
243
showEdge e = "nodeId" ++ show src_cid ++ ':': "op" ++ show src_pid ++ " -> " ++ "nodeId" ++ show snk_cid ++ ':': "ip" ++ show snk_pid where (Just src_cid, src_pid) = sourceInfo e (Just snk_cid, snk_pid) = sinkInfo e
243
false
false
5
9
68
100
47
53
null
null
CRogers/stack
src/Stack/Build/Execute.hs
bsd-3-clause
-- | Perform the actual plan executePlan :: M env m => EnvOverride -> BuildOpts -> BaseConfigOpts -> [LocalPackage] -> SourceMap -> Plan -> m () executePlan menv bopts baseConfigOpts locals sourceMap plan = do withSystemTempDirectory stackProgName $ \tmpdir -> do tmpdir' <- parseAbsDir tmpdir configLock <- newMVar () installLock <- newMVar () idMap <- liftIO $ newTVarIO Map.empty let setupHs = tmpdir' </> $(mkRelFile "Setup.hs") liftIO $ writeFile (toFilePath setupHs) "import Distribution.Simple\nmain = defaultMain" cabalPkgVer <- asks (envConfigCabalVersion . getEnvConfig) globalDB <- getGlobalDB menv executePlan' plan ExecuteEnv { eeEnvOverride = menv , eeBuildOpts = bopts -- Uncertain as to why we cannot run configures in parallel. This appears -- to be a Cabal library bug. Original issue: -- https://github.com/fpco/stack/issues/84. Ideally we'd be able to remove -- this. , eeConfigureLock = configLock , eeInstallLock = installLock , eeBaseConfigOpts = baseConfigOpts , eeGhcPkgIds = idMap , eeTempDir = tmpdir' , eeSetupHs = setupHs , eeCabalPkgVer = cabalPkgVer , eeTotalWanted = length $ filter lpWanted locals , eeWanted = wantedLocalPackages locals , eeLocals = locals , eeSourceMap = sourceMap , eeGlobalDB = globalDB } unless (Map.null $ planInstallExes plan) $ do snapBin <- (</> bindirSuffix) `liftM` installationRootDeps localBin <- (</> bindirSuffix) `liftM` installationRootLocal destDir <- asks $ configLocalBin . getConfig let destDir' = toFilePath destDir liftIO $ createDirectoryIfMissing True destDir' when (not $ any (FP.equalFilePath destDir') (envSearchPath menv)) $ $logWarn $ T.concat [ "Installation path " , T.pack destDir' , " not found in PATH environment variable" ] platform <- asks getPlatform let ext = case platform of Platform _ Windows -> ".exe" _ -> "" currExe <- liftIO getExecutablePath -- needed for windows, see below installed <- forM (Map.toList $ planInstallExes plan) $ \(name, loc) -> do let bindir = case loc of Snap -> snapBin Local -> localBin mfp <- resolveFileMaybe bindir $ T.unpack name ++ ext case mfp of Nothing -> do $logWarn $ T.concat [ "Couldn't find executable " , name , " in directory " , T.pack $ toFilePath bindir ] return Nothing Just file -> do let destFile = destDir' FP.</> T.unpack name ++ ext $logInfo $ T.concat [ "Copying from " , T.pack $ toFilePath file , " to " , T.pack destFile ] liftIO $ case platform of Platform _ Windows | FP.equalFilePath destFile currExe -> windowsRenameCopy (toFilePath file) destFile _ -> copyFile (toFilePath file) destFile return $ Just (destDir', [T.append name (T.pack ext)]) let destToInstalled = Map.fromListWith (++) (catMaybes installed) unless (Map.null destToInstalled) $ $logInfo "" forM_ (Map.toList destToInstalled) $ \(dest, executables) -> do $logInfo $ T.concat [ "Installed executables to " , T.pack dest , ":"] forM_ executables $ \exe -> $logInfo $ T.append "- " exe -- | Windows can't write over the current executable. Instead, we rename the -- current executable to something else and then do the copy.
4,324
executePlan :: M env m => EnvOverride -> BuildOpts -> BaseConfigOpts -> [LocalPackage] -> SourceMap -> Plan -> m () executePlan menv bopts baseConfigOpts locals sourceMap plan = do withSystemTempDirectory stackProgName $ \tmpdir -> do tmpdir' <- parseAbsDir tmpdir configLock <- newMVar () installLock <- newMVar () idMap <- liftIO $ newTVarIO Map.empty let setupHs = tmpdir' </> $(mkRelFile "Setup.hs") liftIO $ writeFile (toFilePath setupHs) "import Distribution.Simple\nmain = defaultMain" cabalPkgVer <- asks (envConfigCabalVersion . getEnvConfig) globalDB <- getGlobalDB menv executePlan' plan ExecuteEnv { eeEnvOverride = menv , eeBuildOpts = bopts -- Uncertain as to why we cannot run configures in parallel. This appears -- to be a Cabal library bug. Original issue: -- https://github.com/fpco/stack/issues/84. Ideally we'd be able to remove -- this. , eeConfigureLock = configLock , eeInstallLock = installLock , eeBaseConfigOpts = baseConfigOpts , eeGhcPkgIds = idMap , eeTempDir = tmpdir' , eeSetupHs = setupHs , eeCabalPkgVer = cabalPkgVer , eeTotalWanted = length $ filter lpWanted locals , eeWanted = wantedLocalPackages locals , eeLocals = locals , eeSourceMap = sourceMap , eeGlobalDB = globalDB } unless (Map.null $ planInstallExes plan) $ do snapBin <- (</> bindirSuffix) `liftM` installationRootDeps localBin <- (</> bindirSuffix) `liftM` installationRootLocal destDir <- asks $ configLocalBin . getConfig let destDir' = toFilePath destDir liftIO $ createDirectoryIfMissing True destDir' when (not $ any (FP.equalFilePath destDir') (envSearchPath menv)) $ $logWarn $ T.concat [ "Installation path " , T.pack destDir' , " not found in PATH environment variable" ] platform <- asks getPlatform let ext = case platform of Platform _ Windows -> ".exe" _ -> "" currExe <- liftIO getExecutablePath -- needed for windows, see below installed <- forM (Map.toList $ planInstallExes plan) $ \(name, loc) -> do let bindir = case loc of Snap -> snapBin Local -> localBin mfp <- resolveFileMaybe bindir $ T.unpack name ++ ext case mfp of Nothing -> do $logWarn $ T.concat [ "Couldn't find executable " , name , " in directory " , T.pack $ toFilePath bindir ] return Nothing Just file -> do let destFile = destDir' FP.</> T.unpack name ++ ext $logInfo $ T.concat [ "Copying from " , T.pack $ toFilePath file , " to " , T.pack destFile ] liftIO $ case platform of Platform _ Windows | FP.equalFilePath destFile currExe -> windowsRenameCopy (toFilePath file) destFile _ -> copyFile (toFilePath file) destFile return $ Just (destDir', [T.append name (T.pack ext)]) let destToInstalled = Map.fromListWith (++) (catMaybes installed) unless (Map.null destToInstalled) $ $logInfo "" forM_ (Map.toList destToInstalled) $ \(dest, executables) -> do $logInfo $ T.concat [ "Installed executables to " , T.pack dest , ":"] forM_ executables $ \exe -> $logInfo $ T.append "- " exe -- | Windows can't write over the current executable. Instead, we rename the -- current executable to something else and then do the copy.
4,295
executePlan menv bopts baseConfigOpts locals sourceMap plan = do withSystemTempDirectory stackProgName $ \tmpdir -> do tmpdir' <- parseAbsDir tmpdir configLock <- newMVar () installLock <- newMVar () idMap <- liftIO $ newTVarIO Map.empty let setupHs = tmpdir' </> $(mkRelFile "Setup.hs") liftIO $ writeFile (toFilePath setupHs) "import Distribution.Simple\nmain = defaultMain" cabalPkgVer <- asks (envConfigCabalVersion . getEnvConfig) globalDB <- getGlobalDB menv executePlan' plan ExecuteEnv { eeEnvOverride = menv , eeBuildOpts = bopts -- Uncertain as to why we cannot run configures in parallel. This appears -- to be a Cabal library bug. Original issue: -- https://github.com/fpco/stack/issues/84. Ideally we'd be able to remove -- this. , eeConfigureLock = configLock , eeInstallLock = installLock , eeBaseConfigOpts = baseConfigOpts , eeGhcPkgIds = idMap , eeTempDir = tmpdir' , eeSetupHs = setupHs , eeCabalPkgVer = cabalPkgVer , eeTotalWanted = length $ filter lpWanted locals , eeWanted = wantedLocalPackages locals , eeLocals = locals , eeSourceMap = sourceMap , eeGlobalDB = globalDB } unless (Map.null $ planInstallExes plan) $ do snapBin <- (</> bindirSuffix) `liftM` installationRootDeps localBin <- (</> bindirSuffix) `liftM` installationRootLocal destDir <- asks $ configLocalBin . getConfig let destDir' = toFilePath destDir liftIO $ createDirectoryIfMissing True destDir' when (not $ any (FP.equalFilePath destDir') (envSearchPath menv)) $ $logWarn $ T.concat [ "Installation path " , T.pack destDir' , " not found in PATH environment variable" ] platform <- asks getPlatform let ext = case platform of Platform _ Windows -> ".exe" _ -> "" currExe <- liftIO getExecutablePath -- needed for windows, see below installed <- forM (Map.toList $ planInstallExes plan) $ \(name, loc) -> do let bindir = case loc of Snap -> snapBin Local -> localBin mfp <- resolveFileMaybe bindir $ T.unpack name ++ ext case mfp of Nothing -> do $logWarn $ T.concat [ "Couldn't find executable " , name , " in directory " , T.pack $ toFilePath bindir ] return Nothing Just file -> do let destFile = destDir' FP.</> T.unpack name ++ ext $logInfo $ T.concat [ "Copying from " , T.pack $ toFilePath file , " to " , T.pack destFile ] liftIO $ case platform of Platform _ Windows | FP.equalFilePath destFile currExe -> windowsRenameCopy (toFilePath file) destFile _ -> copyFile (toFilePath file) destFile return $ Just (destDir', [T.append name (T.pack ext)]) let destToInstalled = Map.fromListWith (++) (catMaybes installed) unless (Map.null destToInstalled) $ $logInfo "" forM_ (Map.toList destToInstalled) $ \(dest, executables) -> do $logInfo $ T.concat [ "Installed executables to " , T.pack dest , ":"] forM_ executables $ \exe -> $logInfo $ T.append "- " exe -- | Windows can't write over the current executable. Instead, we rename the -- current executable to something else and then do the copy.
4,095
true
true
0
28
1,752
955
467
488
null
null
danr/hipspec
testsuite/prod/zeno_version/PropT22.hs
gpl-3.0
insert n (x:xs) = case n <= x of True -> n : x : xs False -> x : (insert n xs)
88
insert n (x:xs) = case n <= x of True -> n : x : xs False -> x : (insert n xs)
88
insert n (x:xs) = case n <= x of True -> n : x : xs False -> x : (insert n xs)
88
false
false
0
10
32
58
29
29
null
null
DanielSchuessler/hstri
Tikz/InteractiveLayout.hs
gpl-3.0
inputS3 = do c <- getChar' case c of 'a' -> return S3cba 'w' -> return S3acb 'd' -> return S3bac 'r' -> return S3cab 'f' -> return S3bca _ -> do beep inputS3
248
inputS3 = do c <- getChar' case c of 'a' -> return S3cba 'w' -> return S3acb 'd' -> return S3bac 'r' -> return S3cab 'f' -> return S3bca _ -> do beep inputS3
248
inputS3 = do c <- getChar' case c of 'a' -> return S3cba 'w' -> return S3acb 'd' -> return S3bac 'r' -> return S3cab 'f' -> return S3bca _ -> do beep inputS3
248
false
false
0
11
124
77
34
43
null
null
geophf/1HaskellADay
exercises/HAD/Y2018/M04/D16/Solution.hs
mit
insertSourceFiles :: Connection -> [SourceFile] -> IO [Index] insertSourceFiles conn = returning conn fileStmt
110
insertSourceFiles :: Connection -> [SourceFile] -> IO [Index] insertSourceFiles conn = returning conn fileStmt
110
insertSourceFiles conn = returning conn fileStmt
48
false
true
0
8
13
36
18
18
null
null
allanderek/ipclib
Language/Pepa/Probes/Syntax.hs
gpl-2.0
endsInReplicatorProbe (SPbit _ _) = True
43
endsInReplicatorProbe (SPbit _ _) = True
43
endsInReplicatorProbe (SPbit _ _) = True
43
false
false
0
6
8
18
8
10
null
null
acowley/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
isStringClassKey :: Unique isStringClassKey = mkPreludeClassUnique 33
76
isStringClassKey :: Unique isStringClassKey = mkPreludeClassUnique 33
76
isStringClassKey = mkPreludeClassUnique 33
49
false
true
0
5
13
14
7
7
null
null
benb/MetAl
src/AlnDist.hs
gpl-3.0
safeCompare :: (ListAlignment -> ListAlignment -> [[(Int,Int)]]) -> ListAlignment -> ListAlignment -> Either String [[(Int,Int)]] safeCompare dist aln1 aln2 = case incompatibilities aln1 aln2 of (Incompat (fatal,err):errs) -> Left err [] -> Right $ dist aln1 aln2
344
safeCompare :: (ListAlignment -> ListAlignment -> [[(Int,Int)]]) -> ListAlignment -> ListAlignment -> Either String [[(Int,Int)]] safeCompare dist aln1 aln2 = case incompatibilities aln1 aln2 of (Incompat (fatal,err):errs) -> Left err [] -> Right $ dist aln1 aln2
344
safeCompare dist aln1 aln2 = case incompatibilities aln1 aln2 of (Incompat (fatal,err):errs) -> Left err [] -> Right $ dist aln1 aln2
214
false
true
0
11
117
121
64
57
null
null
keera-studios/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qCast_QMessageBox :: Object a -> IO (QMessageBox ()) qCast_QMessageBox _qobj = return (objectCast _qobj)
106
qCast_QMessageBox :: Object a -> IO (QMessageBox ()) qCast_QMessageBox _qobj = return (objectCast _qobj)
106
qCast_QMessageBox _qobj = return (objectCast _qobj)
53
false
true
0
9
15
41
19
22
null
null