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
DavidAlphaFox/CacheDNS
src/CacheDNS/DNS/Lookup.hs
bsd-3-clause
---------------------------------------------------------------- -- | Look up all \'TXT\' records for the given hostname. The results -- are free-form 'ByteString's. -- -- Two common uses for \'TXT\' records are -- <http://en.wikipedia.org/wiki/Sender_Policy_Framework> and -- <http://en.wikipedia.org/wiki/DomainKeys_Identified_Mail>. As an -- example, we find the SPF record for \"mew.org\": -- -- >>> let hostname = Data.ByteString.Char8.pack "mew.org" -- >>> -- >>> rs <- makeResolvSeed defaultResolvConf -- >>> withResolver rs $ \resolver -> lookupTXT resolver hostname -- Right ["v=spf1 +mx -all"] -- lookupTXT :: Resolver -> Domain -> IO (Either DNSError [ByteString]) lookupTXT rlv dom = do erds <- DNS.lookup rlv dom TXT case erds of -- See lookupXviaMX for an explanation of this construct. Left err -> return (Left err) Right rds -> return $ mapM unTag rds where unTag :: RData -> Either DNSError ByteString unTag (RD_TXT x) = Right x unTag _ = Left UnexpectedRDATA ---------------------------------------------------------------- -- | Look up all \'PTR\' records for the given hostname. To perform a -- reverse lookup on an IP address, you must first reverse its -- octets and then append the suffix \".in-addr.arpa.\" -- -- We look up the PTR associated with the IP address -- 210.130.137.80, i.e., 80.137.130.210.in-addr.arpa: -- -- >>> let hostname = Data.ByteString.Char8.pack "164.2.232.202.in-addr.arpa" -- >>> -- >>> rs <- makeResolvSeed defaultResolvConf -- >>> withResolver rs $ \resolver -> lookupPTR resolver hostname -- Right ["www.iij.ad.jp."] -- -- The 'lookupRDNS' function is more suited to this particular task. --
1,717
lookupTXT :: Resolver -> Domain -> IO (Either DNSError [ByteString]) lookupTXT rlv dom = do erds <- DNS.lookup rlv dom TXT case erds of -- See lookupXviaMX for an explanation of this construct. Left err -> return (Left err) Right rds -> return $ mapM unTag rds where unTag :: RData -> Either DNSError ByteString unTag (RD_TXT x) = Right x unTag _ = Left UnexpectedRDATA ---------------------------------------------------------------- -- | Look up all \'PTR\' records for the given hostname. To perform a -- reverse lookup on an IP address, you must first reverse its -- octets and then append the suffix \".in-addr.arpa.\" -- -- We look up the PTR associated with the IP address -- 210.130.137.80, i.e., 80.137.130.210.in-addr.arpa: -- -- >>> let hostname = Data.ByteString.Char8.pack "164.2.232.202.in-addr.arpa" -- >>> -- >>> rs <- makeResolvSeed defaultResolvConf -- >>> withResolver rs $ \resolver -> lookupPTR resolver hostname -- Right ["www.iij.ad.jp."] -- -- The 'lookupRDNS' function is more suited to this particular task. --
1,089
lookupTXT rlv dom = do erds <- DNS.lookup rlv dom TXT case erds of -- See lookupXviaMX for an explanation of this construct. Left err -> return (Left err) Right rds -> return $ mapM unTag rds where unTag :: RData -> Either DNSError ByteString unTag (RD_TXT x) = Right x unTag _ = Left UnexpectedRDATA ---------------------------------------------------------------- -- | Look up all \'PTR\' records for the given hostname. To perform a -- reverse lookup on an IP address, you must first reverse its -- octets and then append the suffix \".in-addr.arpa.\" -- -- We look up the PTR associated with the IP address -- 210.130.137.80, i.e., 80.137.130.210.in-addr.arpa: -- -- >>> let hostname = Data.ByteString.Char8.pack "164.2.232.202.in-addr.arpa" -- >>> -- >>> rs <- makeResolvSeed defaultResolvConf -- >>> withResolver rs $ \resolver -> lookupPTR resolver hostname -- Right ["www.iij.ad.jp."] -- -- The 'lookupRDNS' function is more suited to this particular task. --
1,020
true
true
0
12
307
174
98
76
null
null
tjakway/ghcjvm
compiler/hsSyn/HsExpr.hs
bsd-3-clause
ppr_expr (HsArrForm op _ args) = hang (text "(|" <+> ppr_lexpr op) 4 (sep (map (pprCmdArg.unLoc) args) <+> text "|)")
128
ppr_expr (HsArrForm op _ args) = hang (text "(|" <+> ppr_lexpr op) 4 (sep (map (pprCmdArg.unLoc) args) <+> text "|)")
128
ppr_expr (HsArrForm op _ args) = hang (text "(|" <+> ppr_lexpr op) 4 (sep (map (pprCmdArg.unLoc) args) <+> text "|)")
128
false
false
0
11
30
68
31
37
null
null
LambdaHack/LambdaHack
engine-src/Game/LambdaHack/Server/MonadServer.hs
bsd-3-clause
serverPrint :: MonadServer m => Text -> m () serverPrint t = liftIO $ do T.hPutStr stdout $! t <> "\n" -- hPutStrLn not atomic enough hFlush stdout
152
serverPrint :: MonadServer m => Text -> m () serverPrint t = liftIO $ do T.hPutStr stdout $! t <> "\n" -- hPutStrLn not atomic enough hFlush stdout
152
serverPrint t = liftIO $ do T.hPutStr stdout $! t <> "\n" -- hPutStrLn not atomic enough hFlush stdout
107
false
true
0
12
32
62
27
35
null
null
zaxtax/hakaru
haskell/Language/Hakaru/Types/HClasses.hs
bsd-3-clause
hSemiring_Sing :: Sing a -> Maybe (HSemiring a) hSemiring_Sing SNat = Just HSemiring_Nat
89
hSemiring_Sing :: Sing a -> Maybe (HSemiring a) hSemiring_Sing SNat = Just HSemiring_Nat
89
hSemiring_Sing SNat = Just HSemiring_Nat
41
false
true
0
8
13
33
15
18
null
null
codecurve/FieldML-Haskell-01
src/FieldML/Utility01.hs
bsd-2-clause
codomain (Plus _ _) = Reals
27
codomain (Plus _ _) = Reals
27
codomain (Plus _ _) = Reals
27
false
false
0
6
5
18
8
10
null
null
michaelt/streaming-bytestring
Data/ByteString/Streaming/Char8.hs
bsd-3-clause
count :: Monad m => Char -> ByteString m r -> m (Of Int r) count c = R.count (c2w c)
84
count :: Monad m => Char -> ByteString m r -> m (Of Int r) count c = R.count (c2w c)
84
count c = R.count (c2w c)
25
false
true
0
10
20
56
26
30
null
null
ComputationWithBoundedResources/jat
src/Jat/PState/Fun.hs
bsd-3-clause
programLocation :: PState i a -> [(P.ClassId,P.MethodId,P.PC)] programLocation (PState _ frms _) = [(cn,mn,pc) | Frame _ _ cn mn pc <- frms]
141
programLocation :: PState i a -> [(P.ClassId,P.MethodId,P.PC)] programLocation (PState _ frms _) = [(cn,mn,pc) | Frame _ _ cn mn pc <- frms]
141
programLocation (PState _ frms _) = [(cn,mn,pc) | Frame _ _ cn mn pc <- frms]
78
false
true
0
8
23
82
44
38
null
null
peter-fogg/pardoc
src/Text/Pandoc/Readers/EPUB.hs
gpl-2.0
parseMeta :: MonadError String m => Element -> m Meta parseMeta content = do meta <- findElementE (dfName "metadata") content let dcspace (QName _ (Just "http://purl.org/dc/elements/1.1/") (Just "dc")) = True dcspace _ = False let dcs = filterChildrenName dcspace meta let r = foldr parseMetaItem nullMeta dcs return r -- http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-metadata-elem
414
parseMeta :: MonadError String m => Element -> m Meta parseMeta content = do meta <- findElementE (dfName "metadata") content let dcspace (QName _ (Just "http://purl.org/dc/elements/1.1/") (Just "dc")) = True dcspace _ = False let dcs = filterChildrenName dcspace meta let r = foldr parseMetaItem nullMeta dcs return r -- http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-metadata-elem
414
parseMeta content = do meta <- findElementE (dfName "metadata") content let dcspace (QName _ (Just "http://purl.org/dc/elements/1.1/") (Just "dc")) = True dcspace _ = False let dcs = filterChildrenName dcspace meta let r = foldr parseMetaItem nullMeta dcs return r -- http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-metadata-elem
360
false
true
0
14
67
127
58
69
null
null
Persi/shellcheck
ShellCheck/Parser.hs
gpl-3.0
prop_readForClause8 = isOk readForClause "for ((;;)) ; do echo $i\ndone"
72
prop_readForClause8 = isOk readForClause "for ((;;)) ; do echo $i\ndone"
72
prop_readForClause8 = isOk readForClause "for ((;;)) ; do echo $i\ndone"
72
false
false
0
5
9
11
5
6
null
null
chrisbanks/cpiwb
profileMC4.hs
gpl-3.0
f2 = Pos (0,infty) (ValLE (Conc (Def "S" ["s"])) (R 0.01))
58
f2 = Pos (0,infty) (ValLE (Conc (Def "S" ["s"])) (R 0.01))
58
f2 = Pos (0,infty) (ValLE (Conc (Def "S" ["s"])) (R 0.01))
58
false
false
1
12
10
51
25
26
null
null
sgillespie/lambda-calculus
src/Language/Lambda/Eval.hs
mit
etaConvert (App e1 e2) = App (etaConvert e1) (etaConvert e2)
61
etaConvert (App e1 e2) = App (etaConvert e1) (etaConvert e2)
61
etaConvert (App e1 e2) = App (etaConvert e1) (etaConvert e2)
61
false
false
0
6
10
36
16
20
null
null
moonKimura/vector-0.10.9.1
tests/Utilities.hs
bsd-3-clause
minIndex :: Ord a => [a] -> Int minIndex = fst . foldr1 imin . zip [0..] where imin (i,x) (j,y) | x <= y = (i,x) | otherwise = (j,y)
162
minIndex :: Ord a => [a] -> Int minIndex = fst . foldr1 imin . zip [0..] where imin (i,x) (j,y) | x <= y = (i,x) | otherwise = (j,y)
162
minIndex = fst . foldr1 imin . zip [0..] where imin (i,x) (j,y) | x <= y = (i,x) | otherwise = (j,y)
130
false
true
0
8
60
98
51
47
null
null
ehlemur/HLearn
src/HLearn/Data/LoadData.hs
bsd-3-clause
v1 = VS.fromList [1,2,3]
24
v1 = VS.fromList [1,2,3]
24
v1 = VS.fromList [1,2,3]
24
false
false
1
6
3
23
11
12
null
null
andrewthad/vinyl-vectors
src/Data/Vector/Vinyl/Default/NonEmpty/Tagged.hs
bsd-3-clause
-- | /O(1)/ Unsafely convert an immutable vector to a mutable one without -- copying. The immutable vector may not be used after this operation. unsafeThaw :: (PrimMonad m, G.Vector (Vector k) (Rec (TaggedFunctor Identity) rs)) => (Vector k) (Rec (TaggedFunctor Identity) rs) -> m (G.Mutable (Vector k) (PrimState m) (Rec (TaggedFunctor Identity) rs)) unsafeThaw = G.unsafeThaw
388
unsafeThaw :: (PrimMonad m, G.Vector (Vector k) (Rec (TaggedFunctor Identity) rs)) => (Vector k) (Rec (TaggedFunctor Identity) rs) -> m (G.Mutable (Vector k) (PrimState m) (Rec (TaggedFunctor Identity) rs)) unsafeThaw = G.unsafeThaw
243
unsafeThaw = G.unsafeThaw
25
true
true
0
14
67
128
63
65
null
null
alpmestan/continued-fractions
Math/ContinuedFraction.hs
bsd-3-clause
-- |Computes the real number corresponding to the given continuous fraction toDouble :: CF -> Double toDouble = V.foldr (\y x -> let z = x + 1 / (fromInteger y :: Double) in z `seq` z) 0 . unCF
193
toDouble :: CF -> Double toDouble = V.foldr (\y x -> let z = x + 1 / (fromInteger y :: Double) in z `seq` z) 0 . unCF
117
toDouble = V.foldr (\y x -> let z = x + 1 / (fromInteger y :: Double) in z `seq` z) 0 . unCF
92
true
true
0
15
39
71
38
33
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/filter_1.hs
mit
foldr :: (a -> b -> b) -> b -> (List a) -> b; foldr f z Nil = z
73
foldr :: (a -> b -> b) -> b -> (List a) -> b foldr f z Nil = z
72
foldr f z Nil = z
17
false
true
0
9
29
48
25
23
null
null
trskop/yx
src/YX/Type/EnvVarTemplate.hs
bsd-3-clause
toString :: IsString s => EnvVarTemplate -> s toString = IsString.fromString . show
83
toString :: IsString s => EnvVarTemplate -> s toString = IsString.fromString . show
83
toString = IsString.fromString . show
37
false
true
0
6
12
28
14
14
null
null
rayl/gedcom-tools
Main.hs
bsd-3-clause
digit :: GedParser Char digit = oneOf ['0'..'9']
48
digit :: GedParser Char digit = oneOf ['0'..'9']
48
digit = oneOf ['0'..'9']
24
false
true
0
6
7
28
12
16
null
null
sgillespie/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
staticPtrTyConKey :: Unique staticPtrTyConKey = mkPreludeTyConUnique 181
74
staticPtrTyConKey :: Unique staticPtrTyConKey = mkPreludeTyConUnique 181
74
staticPtrTyConKey = mkPreludeTyConUnique 181
45
false
true
0
5
8
14
7
7
null
null
green-haskell/ghc
compiler/utils/GraphOps.hs
bsd-3-clause
-- | Set the color of a certain node setColor :: Uniquable k => k -> color -> Graph k cls color -> Graph k cls color setColor u color = graphMapModify $ adjustUFM_C (\n -> n { nodeColor = Just color }) u
276
setColor :: Uniquable k => k -> color -> Graph k cls color -> Graph k cls color setColor u color = graphMapModify $ adjustUFM_C (\n -> n { nodeColor = Just color }) u
238
setColor u color = graphMapModify $ adjustUFM_C (\n -> n { nodeColor = Just color }) u
134
true
true
0
11
116
78
39
39
null
null
brendanhay/gogol
gogol-qpxexpress/gen/Network/Google/QPXExpress/Types/Product.hs
mpl-2.0
-- | Identifies this as a passenger count object, representing the number of -- passengers. Value: the fixed string qpxexpress#passengerCounts. pcKind :: Lens' PassengerCounts Text pcKind = lens _pcKind (\ s a -> s{_pcKind = a})
228
pcKind :: Lens' PassengerCounts Text pcKind = lens _pcKind (\ s a -> s{_pcKind = a})
84
pcKind = lens _pcKind (\ s a -> s{_pcKind = a})
47
true
true
0
9
35
41
23
18
null
null
esmolanka/haddock
haddock-api/src/Haddock/Utils.hs
bsd-2-clause
markup m (DocParagraph d) = markupParagraph m (markup m d)
69
markup m (DocParagraph d) = markupParagraph m (markup m d)
69
markup m (DocParagraph d) = markupParagraph m (markup m d)
69
false
false
0
7
20
30
14
16
null
null
rkoeninger/GameCom
src/lib/CPU.hs
mit
decode 0x08 = (php, impMode, 3)
31
decode 0x08 = (php, impMode, 3)
31
decode 0x08 = (php, impMode, 3)
31
false
false
0
5
5
18
10
8
null
null
Persi/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkUnpassedInFunctions5 = verifyNotTree checkUnpassedInFunctions "foo() { echo $1; }; foo 'lol'; foo"
108
prop_checkUnpassedInFunctions5 = verifyNotTree checkUnpassedInFunctions "foo() { echo $1; }; foo 'lol'; foo"
108
prop_checkUnpassedInFunctions5 = verifyNotTree checkUnpassedInFunctions "foo() { echo $1; }; foo 'lol'; foo"
108
false
false
0
5
11
11
5
6
null
null
hpacheco/HAAP
src/HAAP/IO.hs
mit
hiddenIOArgs :: IOArgs hiddenIOArgs = defaultIOArgs {ioHidden = True, ioSilent = True }
87
hiddenIOArgs :: IOArgs hiddenIOArgs = defaultIOArgs {ioHidden = True, ioSilent = True }
87
hiddenIOArgs = defaultIOArgs {ioHidden = True, ioSilent = True }
64
false
true
0
6
12
25
15
10
null
null
bgold-cosmos/Tidal
src/Sound/Tidal/Params.hs
gpl-3.0
button0Take :: String -> [Double] -> ControlPattern button0Take name xs = pStateListF "button0" name xs
103
button0Take :: String -> [Double] -> ControlPattern button0Take name xs = pStateListF "button0" name xs
103
button0Take name xs = pStateListF "button0" name xs
51
false
true
0
8
14
42
18
24
null
null
MagneticDuck/simpleirc
Network/SimpleIRC/Core.hs
bsd-3-clause
getFloodControlTimestamp :: MIrc -> IO UTCTime getFloodControlTimestamp mIrc = do s <- readMVar mIrc return $ sFloodControlTimestamp s -- |Updates the value of the flood control timestamp
193
getFloodControlTimestamp :: MIrc -> IO UTCTime getFloodControlTimestamp mIrc = do s <- readMVar mIrc return $ sFloodControlTimestamp s -- |Updates the value of the flood control timestamp
193
getFloodControlTimestamp mIrc = do s <- readMVar mIrc return $ sFloodControlTimestamp s -- |Updates the value of the flood control timestamp
146
false
true
0
8
32
42
19
23
null
null
runebak/wcc
Codec/Image/PNG.hs
bsd-3-clause
toPngChunk :: RawPNGChunk -> Either String PNGChunk toPngChunk raw = case chunkName of "IHDR" -> parseChunkData parseIhdr "PLTE" -> parseChunkData parsePlte "IEND" -> return IEND "IDAT" -> return $ IDAT (rawPngChunk_data raw) _ -> return $ UnknownChunk raw where parseChunkData a = case runP a () "" (rawPngChunk_data raw) of Left e -> fail $ "failed to parse chunk " ++ show chunkName ++ ", " ++ show e Right x -> return x chunkName = rawPngChunk_type raw
538
toPngChunk :: RawPNGChunk -> Either String PNGChunk toPngChunk raw = case chunkName of "IHDR" -> parseChunkData parseIhdr "PLTE" -> parseChunkData parsePlte "IEND" -> return IEND "IDAT" -> return $ IDAT (rawPngChunk_data raw) _ -> return $ UnknownChunk raw where parseChunkData a = case runP a () "" (rawPngChunk_data raw) of Left e -> fail $ "failed to parse chunk " ++ show chunkName ++ ", " ++ show e Right x -> return x chunkName = rawPngChunk_type raw
538
toPngChunk raw = case chunkName of "IHDR" -> parseChunkData parseIhdr "PLTE" -> parseChunkData parsePlte "IEND" -> return IEND "IDAT" -> return $ IDAT (rawPngChunk_data raw) _ -> return $ UnknownChunk raw where parseChunkData a = case runP a () "" (rawPngChunk_data raw) of Left e -> fail $ "failed to parse chunk " ++ show chunkName ++ ", " ++ show e Right x -> return x chunkName = rawPngChunk_type raw
486
false
true
0
11
159
169
78
91
null
null
noughtmare/yi
yi-core/src/Yi/UI/Common.hs
gpl-2.0
dummyUI :: UI e dummyUI = UI { main = return () , end = const (return ()) , suspend = return () , refresh = const (return ()) , userForceRefresh = return () , layout = return , reloadProject = const (return ()) }
284
dummyUI :: UI e dummyUI = UI { main = return () , end = const (return ()) , suspend = return () , refresh = const (return ()) , userForceRefresh = return () , layout = return , reloadProject = const (return ()) }
284
dummyUI = UI { main = return () , end = const (return ()) , suspend = return () , refresh = const (return ()) , userForceRefresh = return () , layout = return , reloadProject = const (return ()) }
268
false
true
0
11
116
115
59
56
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
mpl-2.0
-- | The ID of the security group. uigpGroupId :: Lens' UserIdGroupPair (Maybe Text) uigpGroupId = lens _uigpGroupId (\s a -> s { _uigpGroupId = a })
149
uigpGroupId :: Lens' UserIdGroupPair (Maybe Text) uigpGroupId = lens _uigpGroupId (\s a -> s { _uigpGroupId = a })
114
uigpGroupId = lens _uigpGroupId (\s a -> s { _uigpGroupId = a })
64
true
true
1
9
26
51
25
26
null
null
literate-unitb/literate-unitb
src/UnitB/Test.hs
mit
get_cmd_tr_po :: Monad m => Either [Error] RawMachine -> m (Either [Error] String) get_cmd_tr_po em = return (do m <- em let lbl = composite_label [as_label $ _name m, "TR/TR0/t@param"] pos = proof_obligation m po = lookupSequent lbl pos cmd = either id z3_code po return cmd)
367
get_cmd_tr_po :: Monad m => Either [Error] RawMachine -> m (Either [Error] String) get_cmd_tr_po em = return (do m <- em let lbl = composite_label [as_label $ _name m, "TR/TR0/t@param"] pos = proof_obligation m po = lookupSequent lbl pos cmd = either id z3_code po return cmd)
367
get_cmd_tr_po em = return (do m <- em let lbl = composite_label [as_label $ _name m, "TR/TR0/t@param"] pos = proof_obligation m po = lookupSequent lbl pos cmd = either id z3_code po return cmd)
254
false
true
0
15
137
125
59
66
null
null
tcrayford/hafka
Network/Kafka/Consumer/ByteReader.hs
bsd-3-clause
handleByteReader :: Handle -> ByteReader handleByteReader = B.hGet
66
handleByteReader :: Handle -> ByteReader handleByteReader = B.hGet
66
handleByteReader = B.hGet
25
false
true
0
7
7
24
10
14
null
null
Evan-Zhao/FastCanvas
src/Communication/Send.hs
bsd-3-clause
loopListening :: EnvS -> Async (Excepted Sync) -> IO (Excepted Sync) loopListening channel asyncR = do next <- readChan channel print next maybeR <- poll asyncR maybe this reshape maybeR where this = loopListening channel asyncR reshape = return . joinEither
284
loopListening :: EnvS -> Async (Excepted Sync) -> IO (Excepted Sync) loopListening channel asyncR = do next <- readChan channel print next maybeR <- poll asyncR maybe this reshape maybeR where this = loopListening channel asyncR reshape = return . joinEither
284
loopListening channel asyncR = do next <- readChan channel print next maybeR <- poll asyncR maybe this reshape maybeR where this = loopListening channel asyncR reshape = return . joinEither
215
false
true
0
9
66
100
45
55
null
null
geekingfrog/advent-of-code
src/Y2018/Day19.hs
bsd-3-clause
unOp op getS = binOp (\a b -> op a) getS getVal
47
unOp op getS = binOp (\a b -> op a) getS getVal
47
unOp op getS = binOp (\a b -> op a) getS getVal
47
false
false
0
8
11
31
15
16
null
null
wouwouwou/2017_module_8
src/haskell/PP-project-2017/CodeGen.hs
apache-2.0
codeGen (ASTGlobal varType astVar Nothing checkType@(functions, globals, variables,_)) threads = [ Load (ImmValue addr) regA -- Load memory address of global's lock , TestAndSet (IndAddr regA) -- Lock on ready bit , Receive regB -- , Branch regB (Rel 2) -- Retry if lock fails , Jump (Rel (-3)) -- , Load (ImmValue (addr + global_record_value)) regC -- Load memory address of global value , WriteInstr reg0 (IndAddr regC) -- Write value , WriteInstr reg0 (IndAddr regA) -- Unlock value ] where addr = fork_record_size + threads + (global_record_size * (globalIndex (getStr astVar) globals)) -- Same as function above, except that now an expression can be assigned to the variable.
972
codeGen (ASTGlobal varType astVar Nothing checkType@(functions, globals, variables,_)) threads = [ Load (ImmValue addr) regA -- Load memory address of global's lock , TestAndSet (IndAddr regA) -- Lock on ready bit , Receive regB -- , Branch regB (Rel 2) -- Retry if lock fails , Jump (Rel (-3)) -- , Load (ImmValue (addr + global_record_value)) regC -- Load memory address of global value , WriteInstr reg0 (IndAddr regC) -- Write value , WriteInstr reg0 (IndAddr regA) -- Unlock value ] where addr = fork_record_size + threads + (global_record_size * (globalIndex (getStr astVar) globals)) -- Same as function above, except that now an expression can be assigned to the variable.
972
codeGen (ASTGlobal varType astVar Nothing checkType@(functions, globals, variables,_)) threads = [ Load (ImmValue addr) regA -- Load memory address of global's lock , TestAndSet (IndAddr regA) -- Lock on ready bit , Receive regB -- , Branch regB (Rel 2) -- Retry if lock fails , Jump (Rel (-3)) -- , Load (ImmValue (addr + global_record_value)) regC -- Load memory address of global value , WriteInstr reg0 (IndAddr regC) -- Write value , WriteInstr reg0 (IndAddr regA) -- Unlock value ] where addr = fork_record_size + threads + (global_record_size * (globalIndex (getStr astVar) globals)) -- Same as function above, except that now an expression can be assigned to the variable.
972
false
false
1
12
401
202
106
96
null
null
shlevy/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
unknown3TyConKey = mkPreludeTyConUnique 132
66
unknown3TyConKey = mkPreludeTyConUnique 132
66
unknown3TyConKey = mkPreludeTyConUnique 132
66
false
false
0
5
26
9
4
5
null
null
yupferris/write-you-a-haskell
chapter7/poly/src/Main.hs
mit
hoistErr :: Show e => Either e a -> Repl a hoistErr (Right val) = return val
76
hoistErr :: Show e => Either e a -> Repl a hoistErr (Right val) = return val
76
hoistErr (Right val) = return val
33
false
true
0
10
16
46
20
26
null
null
brodyberg/LearnHaskell
CaesarCypher.hsproj/Transmitter.hs
mit
bin2int :: [Bit] -> Int bin2int = foldr (\x y -> x + 2*y) 0
59
bin2int :: [Bit] -> Int bin2int = foldr (\x y -> x + 2*y) 0
59
bin2int = foldr (\x y -> x + 2*y) 0
35
false
true
0
9
14
48
23
25
null
null
jfischoff/lagrangian
src/Numeric/AD/Lagrangian/Internal.hs
bsd-3-clause
-- | Build a 'Constraint' from a function and a constant (<=>) :: (forall a. (Floating a) => [a] -> a) -> (forall b. (Floating b) => b) -> Constraint f <=> c = Constraint (f, c)
189
(<=>) :: (forall a. (Floating a) => [a] -> a) -> (forall b. (Floating b) => b) -> Constraint f <=> c = Constraint (f, c)
132
f <=> c = Constraint (f, c)
27
true
true
0
11
48
82
45
37
null
null
urbanslug/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
-- getOperand: the operand is not required to remain valid across the -- computation of an arbitrary expression. getOperand :: CmmExpr -> NatM (Operand, InstrBlock) getOperand (CmmLit lit) = do use_sse2 <- sse2Enabled if (use_sse2 && isSuitableFloatingPointLit lit) then do let CmmFloat _ w = lit Amode addr code <- memConstant (widthInBytes w) lit return (OpAddr addr, code) else do is32Bit <- is32BitPlatform dflags <- getDynFlags if is32BitLit is32Bit lit && not (isFloatType (cmmLitType dflags lit)) then return (OpImm (litToImm lit), nilOL) else getOperand_generic (CmmLit lit)
628
getOperand :: CmmExpr -> NatM (Operand, InstrBlock) getOperand (CmmLit lit) = do use_sse2 <- sse2Enabled if (use_sse2 && isSuitableFloatingPointLit lit) then do let CmmFloat _ w = lit Amode addr code <- memConstant (widthInBytes w) lit return (OpAddr addr, code) else do is32Bit <- is32BitPlatform dflags <- getDynFlags if is32BitLit is32Bit lit && not (isFloatType (cmmLitType dflags lit)) then return (OpImm (litToImm lit), nilOL) else getOperand_generic (CmmLit lit)
514
getOperand (CmmLit lit) = do use_sse2 <- sse2Enabled if (use_sse2 && isSuitableFloatingPointLit lit) then do let CmmFloat _ w = lit Amode addr code <- memConstant (widthInBytes w) lit return (OpAddr addr, code) else do is32Bit <- is32BitPlatform dflags <- getDynFlags if is32BitLit is32Bit lit && not (isFloatType (cmmLitType dflags lit)) then return (OpImm (litToImm lit), nilOL) else getOperand_generic (CmmLit lit)
462
true
true
0
17
131
199
94
105
null
null
rzetterberg/orgmode-sql
test/Database/ExportSpec.hs
bsd-3-clause
countHeadings (h:hs) = 1 + (countHeadings (subHeadings h)) + (countHeadings hs)
79
countHeadings (h:hs) = 1 + (countHeadings (subHeadings h)) + (countHeadings hs)
79
countHeadings (h:hs) = 1 + (countHeadings (subHeadings h)) + (countHeadings hs)
79
false
false
0
10
10
42
21
21
null
null
cchalmers/geometry
src/Geometry/Parametric.hs
bsd-3-clause
-- | Compute the normal vector at the start of a segment or trail. normalAtStart :: (InSpace V2 n t, TangentEndValues t, Floating n) => t -> V2 n normalAtStart = normize . tangentAtStart
190
normalAtStart :: (InSpace V2 n t, TangentEndValues t, Floating n) => t -> V2 n normalAtStart = normize . tangentAtStart
123
normalAtStart = normize . tangentAtStart
40
true
true
0
7
37
52
26
26
null
null
gcampax/ghc
compiler/main/DynFlags.hs
bsd-3-clause
wayDesc WayEventLog = "RTS Event Logging"
41
wayDesc WayEventLog = "RTS Event Logging"
41
wayDesc WayEventLog = "RTS Event Logging"
41
false
false
0
4
5
10
4
6
null
null
5outh/Elm
src/AST/Variable.hs
bsd-3-clause
openListing :: Listing a openListing = Listing [] True
58
openListing :: Listing a openListing = Listing [] True
58
openListing = Listing [] True
33
false
true
0
6
12
21
10
11
null
null
santolucito/haste-compiler
libraries/haste-lib/src/Haste/Ajax.hs
bsd-3-clause
-- | Pass to 'ajaxRequest' instead of @[]@ when no parameters are needed, to -- avoid type ambiguity errors. noParams :: [((), ())] noParams = []
147
noParams :: [((), ())] noParams = []
36
noParams = []
13
true
true
0
9
27
35
18
17
null
null
wereHamster/mole
src/Data/Mole/Builder/Html.hs
mit
tagTransformers :: [Transformer] tagTransformers = [ Transformer ("link"==) "href" extractSingleAsset renderSingleAttribute , Transformer ("img"==) "src" extractSingleAsset renderSingleAttribute , Transformer ("source"==) "srcset" extractSingleAsset renderSingleAttribute , Transformer ("script"==) "src" extractSingleAsset renderSingleAttribute , Transformer ("a"==) "href" extractSingleAsset renderSingleAttribute , Transformer ("meta"==) "content" extractSingleAsset renderSingleAttribute , Transformer (const True) "style" extractStylesheetAssets renderStylesheetAssets ]
636
tagTransformers :: [Transformer] tagTransformers = [ Transformer ("link"==) "href" extractSingleAsset renderSingleAttribute , Transformer ("img"==) "src" extractSingleAsset renderSingleAttribute , Transformer ("source"==) "srcset" extractSingleAsset renderSingleAttribute , Transformer ("script"==) "src" extractSingleAsset renderSingleAttribute , Transformer ("a"==) "href" extractSingleAsset renderSingleAttribute , Transformer ("meta"==) "content" extractSingleAsset renderSingleAttribute , Transformer (const True) "style" extractStylesheetAssets renderStylesheetAssets ]
636
tagTransformers = [ Transformer ("link"==) "href" extractSingleAsset renderSingleAttribute , Transformer ("img"==) "src" extractSingleAsset renderSingleAttribute , Transformer ("source"==) "srcset" extractSingleAsset renderSingleAttribute , Transformer ("script"==) "src" extractSingleAsset renderSingleAttribute , Transformer ("a"==) "href" extractSingleAsset renderSingleAttribute , Transformer ("meta"==) "content" extractSingleAsset renderSingleAttribute , Transformer (const True) "style" extractStylesheetAssets renderStylesheetAssets ]
603
false
true
0
8
109
128
71
57
null
null
MgaMPKAy/language-sh
Language/Sh/Parser/Internal.hs
bsd-3-clause
mkHereDoc "<<-" (Just s) t = do addHereDoc t return $ s :<<- t
94
mkHereDoc "<<-" (Just s) t = do addHereDoc t return $ s :<<- t
94
mkHereDoc "<<-" (Just s) t = do addHereDoc t return $ s :<<- t
94
false
false
1
8
45
42
16
26
null
null
amutake/haskelltter
src/Haskelltter.hs
bsd-3-clause
n :: Maybe a n = Nothing
24
n :: Maybe a n = Nothing
24
n = Nothing
11
false
true
1
5
6
18
7
11
null
null
kylcarte/threepenny-extra
src/Graphics/UI/Threepenny/Widgets/DataTable.hs
bsd-3-clause
jsDataTable :: JSONRow a => [a] -> UI (JSInit,Element) jsDataTable as = do t <- UI.table #. "display" i <- identify t lt <- jsObjectT $ ffi "$(%1).DataTable(%2)" (selUID i) $ object [ "data" .= as , "columns" .= [ object [ "data" .= c ] | c <- cs ] ] return (lt,t) where cs = colNames as
352
jsDataTable :: JSONRow a => [a] -> UI (JSInit,Element) jsDataTable as = do t <- UI.table #. "display" i <- identify t lt <- jsObjectT $ ffi "$(%1).DataTable(%2)" (selUID i) $ object [ "data" .= as , "columns" .= [ object [ "data" .= c ] | c <- cs ] ] return (lt,t) where cs = colNames as
352
jsDataTable as = do t <- UI.table #. "display" i <- identify t lt <- jsObjectT $ ffi "$(%1).DataTable(%2)" (selUID i) $ object [ "data" .= as , "columns" .= [ object [ "data" .= c ] | c <- cs ] ] return (lt,t) where cs = colNames as
297
false
true
1
15
123
155
73
82
null
null
bergey/metastic
src/Export.hs
bsd-2-clause
writeTurtle :: RDF r => r -> IO () writeTurtle = hWriteTurtle stdin
67
writeTurtle :: RDF r => r -> IO () writeTurtle = hWriteTurtle stdin
67
writeTurtle = hWriteTurtle stdin
32
false
true
0
9
12
35
15
20
null
null
a-ford/notghc
LlvmCodeGen/Base.hs
bsd-3-clause
generateAliases :: LlvmM LlvmData generateAliases = do delayed <- fmap uniqSetToList $ getEnv envAliases defss <- flip mapM delayed $ \lbl -> do let var ty = LMGlobalVar lbl (LMPointer ty) External Nothing Nothing Global aliasLbl = lbl `appendFS` fsLit "$alias" aliasVar = LMGlobalVar aliasLbl i8Ptr Private Nothing Nothing Alias -- If we have a definition, set the alias value using a -- cost. Otherwise, declare it as an undefined external symbol. m_ty <- funLookup lbl case m_ty of Just ty -> return [LMGlobal aliasVar $ Just $ LMBitc (LMStaticPointer (var ty)) i8Ptr] Nothing -> return [LMGlobal (var i8) Nothing, LMGlobal aliasVar $ Just $ LMStaticPointer (var i8) ] -- Reset forward list modifyEnv $ \env -> env { envAliases = emptyUniqSet } return (concat defss, []) -- Note [Llvm Forward References] -- -- The issue here is that LLVM insists on being strongly typed at -- every corner, so the first time we mention something, we have to -- settle what type we assign to it. That makes things awkward, as Cmm -- will often reference things before their definition, and we have no -- idea what (LLVM) type it is going to be before that point. -- -- Our work-around is to define "aliases" of a standard type (i8 *) in -- these kind of situations, which we later tell LLVM to be either -- references to their actual local definitions (involving a cast) or -- an external reference. This obviously only works for pointers. -- ---------------------------------------------------------------------------- -- * Misc -- -- | Error function
1,665
generateAliases :: LlvmM LlvmData generateAliases = do delayed <- fmap uniqSetToList $ getEnv envAliases defss <- flip mapM delayed $ \lbl -> do let var ty = LMGlobalVar lbl (LMPointer ty) External Nothing Nothing Global aliasLbl = lbl `appendFS` fsLit "$alias" aliasVar = LMGlobalVar aliasLbl i8Ptr Private Nothing Nothing Alias -- If we have a definition, set the alias value using a -- cost. Otherwise, declare it as an undefined external symbol. m_ty <- funLookup lbl case m_ty of Just ty -> return [LMGlobal aliasVar $ Just $ LMBitc (LMStaticPointer (var ty)) i8Ptr] Nothing -> return [LMGlobal (var i8) Nothing, LMGlobal aliasVar $ Just $ LMStaticPointer (var i8) ] -- Reset forward list modifyEnv $ \env -> env { envAliases = emptyUniqSet } return (concat defss, []) -- Note [Llvm Forward References] -- -- The issue here is that LLVM insists on being strongly typed at -- every corner, so the first time we mention something, we have to -- settle what type we assign to it. That makes things awkward, as Cmm -- will often reference things before their definition, and we have no -- idea what (LLVM) type it is going to be before that point. -- -- Our work-around is to define "aliases" of a standard type (i8 *) in -- these kind of situations, which we later tell LLVM to be either -- references to their actual local definitions (involving a cast) or -- an external reference. This obviously only works for pointers. -- ---------------------------------------------------------------------------- -- * Misc -- -- | Error function
1,665
generateAliases = do delayed <- fmap uniqSetToList $ getEnv envAliases defss <- flip mapM delayed $ \lbl -> do let var ty = LMGlobalVar lbl (LMPointer ty) External Nothing Nothing Global aliasLbl = lbl `appendFS` fsLit "$alias" aliasVar = LMGlobalVar aliasLbl i8Ptr Private Nothing Nothing Alias -- If we have a definition, set the alias value using a -- cost. Otherwise, declare it as an undefined external symbol. m_ty <- funLookup lbl case m_ty of Just ty -> return [LMGlobal aliasVar $ Just $ LMBitc (LMStaticPointer (var ty)) i8Ptr] Nothing -> return [LMGlobal (var i8) Nothing, LMGlobal aliasVar $ Just $ LMStaticPointer (var i8) ] -- Reset forward list modifyEnv $ \env -> env { envAliases = emptyUniqSet } return (concat defss, []) -- Note [Llvm Forward References] -- -- The issue here is that LLVM insists on being strongly typed at -- every corner, so the first time we mention something, we have to -- settle what type we assign to it. That makes things awkward, as Cmm -- will often reference things before their definition, and we have no -- idea what (LLVM) type it is going to be before that point. -- -- Our work-around is to define "aliases" of a standard type (i8 *) in -- these kind of situations, which we later tell LLVM to be either -- references to their actual local definitions (involving a cast) or -- an external reference. This obviously only works for pointers. -- ---------------------------------------------------------------------------- -- * Misc -- -- | Error function
1,631
false
true
0
22
383
277
142
135
null
null
jstolarek/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprInstr g@(GSUB _ src1 src2 dst) | src1 == dst = pprG g (text "\t#GSUB-xxxcase1" $$ hcat [gtab, gpush src2 0, text " ; fsubrp %st(0),", greg src1 1]) | src2 == dst = pprG g (text "\t#GSUB-xxxcase2" $$ hcat [gtab, gpush src1 0, text " ; fsubp %st(0),", greg src2 1]) | otherwise = pprG g (hcat [gtab, gpush src1 0, text " ; fsub ", greg src2 1, text ",%st(0)", gsemi, gpop dst 1])
500
pprInstr g@(GSUB _ src1 src2 dst) | src1 == dst = pprG g (text "\t#GSUB-xxxcase1" $$ hcat [gtab, gpush src2 0, text " ; fsubrp %st(0),", greg src1 1]) | src2 == dst = pprG g (text "\t#GSUB-xxxcase2" $$ hcat [gtab, gpush src1 0, text " ; fsubp %st(0),", greg src2 1]) | otherwise = pprG g (hcat [gtab, gpush src1 0, text " ; fsub ", greg src2 1, text ",%st(0)", gsemi, gpop dst 1])
500
pprInstr g@(GSUB _ src1 src2 dst) | src1 == dst = pprG g (text "\t#GSUB-xxxcase1" $$ hcat [gtab, gpush src2 0, text " ; fsubrp %st(0),", greg src1 1]) | src2 == dst = pprG g (text "\t#GSUB-xxxcase2" $$ hcat [gtab, gpush src1 0, text " ; fsubp %st(0),", greg src2 1]) | otherwise = pprG g (hcat [gtab, gpush src1 0, text " ; fsub ", greg src2 1, text ",%st(0)", gsemi, gpop dst 1])
500
false
false
1
11
195
197
96
101
null
null
bendmorris/biophylo
Bio/Phylo/IO/Newick.hs
mit
process_tokens tokens = fst (new_clade tokens)
46
process_tokens tokens = fst (new_clade tokens)
46
process_tokens tokens = fst (new_clade tokens)
46
false
false
0
7
5
18
8
10
null
null
nkarag/haskell-CSVDB
src/Data/RTable.hs
bsd-3-clause
-- | createRTuple: Create an Rtuple from a list of column names and values createRtuple :: [(ColumnName, RDataType)] -- ^ input list of (columnname,value) pairs -> RTuple createRtuple l = HM.fromList l
217
createRtuple :: [(ColumnName, RDataType)] -- ^ input list of (columnname,value) pairs -> RTuple createRtuple l = HM.fromList l
139
createRtuple l = HM.fromList l
30
true
true
0
7
47
34
19
15
null
null
jwiegley/ghc-release
libraries/transformers/Control/Monad/Trans/Writer/Strict.hs
gpl-3.0
-- | @'listen' m@ is an action that executes the action @m@ and adds its -- output to the value of the computation. -- -- * @'runWriterT' ('listen' m) = 'liftM' (\\(a, w) -> ((a, w), w)) ('runWriterT' m)@ listen :: (Monoid w, Monad m) => WriterT w m a -> WriterT w m (a, w) listen m = WriterT $ do (a, w) <- runWriterT m return ((a, w), w) -- | @'listens' f m@ is an action that executes the action @m@ and adds -- the result of applying @f@ to the output to the value of the computation. -- -- * @'listens' f m = 'liftM' (id *** f) ('listen' m)@ -- -- * @'runWriterT' ('listens' f m) = 'liftM' (\\(a, w) -> ((a, f w), w)) ('runWriterT' m)@
649
listen :: (Monoid w, Monad m) => WriterT w m a -> WriterT w m (a, w) listen m = WriterT $ do (a, w) <- runWriterT m return ((a, w), w) -- | @'listens' f m@ is an action that executes the action @m@ and adds -- the result of applying @f@ to the output to the value of the computation. -- -- * @'listens' f m = 'liftM' (id *** f) ('listen' m)@ -- -- * @'runWriterT' ('listens' f m) = 'liftM' (\\(a, w) -> ((a, f w), w)) ('runWriterT' m)@
444
listen m = WriterT $ do (a, w) <- runWriterT m return ((a, w), w) -- | @'listens' f m@ is an action that executes the action @m@ and adds -- the result of applying @f@ to the output to the value of the computation. -- -- * @'listens' f m = 'liftM' (id *** f) ('listen' m)@ -- -- * @'runWriterT' ('listens' f m) = 'liftM' (\\(a, w) -> ((a, f w), w)) ('runWriterT' m)@
375
true
true
0
10
140
101
57
44
null
null
robx/puzzle-draw
src/Data/Compose.hs
mit
handle f ThermoSudoku = f R.thermosudoku D.thermosudoku
55
handle f ThermoSudoku = f R.thermosudoku D.thermosudoku
55
handle f ThermoSudoku = f R.thermosudoku D.thermosudoku
55
false
false
0
6
6
21
9
12
null
null
ryantrinkle/ghcjs
src/Gen2/Prim.hs
mit
genPrim _ _ CharNeOp [r] [x,y] = PrimInline [j| `r` = (`x` !== `y`) ? 1 : 0; |]
88
genPrim _ _ CharNeOp [r] [x,y] = PrimInline [j| `r` = (`x` !== `y`) ? 1 : 0; |]
88
genPrim _ _ CharNeOp [r] [x,y] = PrimInline [j| `r` = (`x` !== `y`) ? 1 : 0; |]
88
false
false
3
6
27
34
19
15
null
null
MedeaMelana/Zwaluw
Web/Zwaluw/TH.hs
bsd-3-clause
mkRouterName :: Name -> Name mkRouterName name = mkName ('r' : nameBase name)
77
mkRouterName :: Name -> Name mkRouterName name = mkName ('r' : nameBase name)
77
mkRouterName name = mkName ('r' : nameBase name)
48
false
true
0
8
12
31
15
16
null
null
fffej/sql-server-gen
src/Database/SqlServer/Create/DataType.hs
bsd-2-clause
renderDataType (VarBinary range _) = text "varbinary" <> maybe empty renderVarBinaryStorage range
99
renderDataType (VarBinary range _) = text "varbinary" <> maybe empty renderVarBinaryStorage range
99
renderDataType (VarBinary range _) = text "varbinary" <> maybe empty renderVarBinaryStorage range
99
false
false
0
7
13
31
14
17
null
null
xruzzz/codingame-haskell
PowerOfThor.hs
gpl-2.0
findDir :: Coor -> Coor -> DIR findDir thor light = let dx = x light - x thor dy = y light - y thor in DIR { xx = comRes dx, yy = comRes dy} where comRes x |x > 0 = 1 |x < 0 = (-1) | otherwise = 0
261
findDir :: Coor -> Coor -> DIR findDir thor light = let dx = x light - x thor dy = y light - y thor in DIR { xx = comRes dx, yy = comRes dy} where comRes x |x > 0 = 1 |x < 0 = (-1) | otherwise = 0
261
findDir thor light = let dx = x light - x thor dy = y light - y thor in DIR { xx = comRes dx, yy = comRes dy} where comRes x |x > 0 = 1 |x < 0 = (-1) | otherwise = 0
230
false
true
0
10
118
127
61
66
null
null
cservenka/ROOPLPPC
src/MacroExpander.hs
mit
getAddress :: Label -> MacroExpander Address getAddress l = asks addressTable >>= \at -> case lookup l at of (Just i) -> return i Nothing -> throwError $ "ICE: Unknown label " ++ l -- | Returns the size of a given class name
245
getAddress :: Label -> MacroExpander Address getAddress l = asks addressTable >>= \at -> case lookup l at of (Just i) -> return i Nothing -> throwError $ "ICE: Unknown label " ++ l -- | Returns the size of a given class name
245
getAddress l = asks addressTable >>= \at -> case lookup l at of (Just i) -> return i Nothing -> throwError $ "ICE: Unknown label " ++ l -- | Returns the size of a given class name
200
false
true
0
11
64
72
35
37
null
null
lupuionut/homedmanager
src/Auth.hs
bsd-3-clause
withAccessToken :: Maybe Config -> IO (Maybe ResponseTokens) withAccessToken Nothing = return Nothing
101
withAccessToken :: Maybe Config -> IO (Maybe ResponseTokens) withAccessToken Nothing = return Nothing
101
withAccessToken Nothing = return Nothing
40
false
true
0
8
12
33
15
18
null
null
ekmett/ghc
utils/genprimopcode/Main.hs
bsd-3-clause
gen_primop_vector_tycons :: Info -> String gen_primop_vector_tycons (Info _ entries) = unlines $ map mkVecTypes specs where specs = concatMap desugarVectorSpec (filter is_vector (filter is_primtype entries)) mkVecTypes :: Entry -> String mkVecTypes i = " , " ++ tycon_id where tycon_id = prefix i ++ "PrimTyCon"
359
gen_primop_vector_tycons :: Info -> String gen_primop_vector_tycons (Info _ entries) = unlines $ map mkVecTypes specs where specs = concatMap desugarVectorSpec (filter is_vector (filter is_primtype entries)) mkVecTypes :: Entry -> String mkVecTypes i = " , " ++ tycon_id where tycon_id = prefix i ++ "PrimTyCon"
359
gen_primop_vector_tycons (Info _ entries) = unlines $ map mkVecTypes specs where specs = concatMap desugarVectorSpec (filter is_vector (filter is_primtype entries)) mkVecTypes :: Entry -> String mkVecTypes i = " , " ++ tycon_id where tycon_id = prefix i ++ "PrimTyCon"
316
false
true
7
9
92
100
49
51
null
null
matt76k/ponder
Text/Ponder/Prim.hs
mit
andP :: Monad m => StateT s m a -> StateT s m () andP p = StateT $ \s -> (runStateT p s) >> return ((), s)
106
andP :: Monad m => StateT s m a -> StateT s m () andP p = StateT $ \s -> (runStateT p s) >> return ((), s)
106
andP p = StateT $ \s -> (runStateT p s) >> return ((), s)
57
false
true
0
10
27
77
37
40
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/AppStreamFleetVpcConfig.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appstream-fleet-vpcconfig.html#cfn-appstream-fleet-vpcconfig-subnetids asfvcSubnetIds :: Lens' AppStreamFleetVpcConfig (Maybe (ValList Text)) asfvcSubnetIds = lens _appStreamFleetVpcConfigSubnetIds (\s a -> s { _appStreamFleetVpcConfigSubnetIds = a })
333
asfvcSubnetIds :: Lens' AppStreamFleetVpcConfig (Maybe (ValList Text)) asfvcSubnetIds = lens _appStreamFleetVpcConfigSubnetIds (\s a -> s { _appStreamFleetVpcConfigSubnetIds = a })
180
asfvcSubnetIds = lens _appStreamFleetVpcConfigSubnetIds (\s a -> s { _appStreamFleetVpcConfigSubnetIds = a })
109
true
true
0
9
22
52
28
24
null
null
wochinge/CacheSimulator
src/BeladyCache.hs
bsd-3-clause
initFuture' :: [FileRequest] -> FilePrio -> BeladyCache -> BeladyCache initFuture' requests prio cache = fst $ foldl' alter (cache, prio) requests where alter (c, p) r@(_, fileId, _) = (c { future = snd $ H.alter (alter' r p) fileId $ future cache }, p - 1)
261
initFuture' :: [FileRequest] -> FilePrio -> BeladyCache -> BeladyCache initFuture' requests prio cache = fst $ foldl' alter (cache, prio) requests where alter (c, p) r@(_, fileId, _) = (c { future = snd $ H.alter (alter' r p) fileId $ future cache }, p - 1)
261
initFuture' requests prio cache = fst $ foldl' alter (cache, prio) requests where alter (c, p) r@(_, fileId, _) = (c { future = snd $ H.alter (alter' r p) fileId $ future cache }, p - 1)
190
false
true
0
12
50
124
67
57
null
null
urbanslug/ghc
libraries/base/Data/Typeable/Internal.hs
bsd-3-clause
typeOf7 :: forall t (a :: *) (b :: *) (c :: *) (d :: *) (e :: *) (f :: *) (g :: *). Typeable t => t a b c d e f g -> TypeRep typeOf7 _ = typeRep (Proxy :: Proxy t)
179
typeOf7 :: forall t (a :: *) (b :: *) (c :: *) (d :: *) (e :: *) (f :: *) (g :: *). Typeable t => t a b c d e f g -> TypeRep typeOf7 _ = typeRep (Proxy :: Proxy t)
179
typeOf7 _ = typeRep (Proxy :: Proxy t)
38
false
true
0
8
61
110
64
46
null
null
ohua-dev/ohua-core
core/src/Ohua/Feature/TailRec/Passes/ALang.hs
epl-1.0
findRecCall (Let a expr inExpr) algosInScope = do (iFound, iExpr) <- findRecCall inExpr algosInScope return (iFound, Let a expr iExpr)
142
findRecCall (Let a expr inExpr) algosInScope = do (iFound, iExpr) <- findRecCall inExpr algosInScope return (iFound, Let a expr iExpr)
142
findRecCall (Let a expr inExpr) algosInScope = do (iFound, iExpr) <- findRecCall inExpr algosInScope return (iFound, Let a expr iExpr)
142
false
false
0
9
27
58
28
30
null
null
GaloisInc/saw-script
heapster-saw/src/Verifier/SAW/Heapster/Widening.hs
bsd-3-clause
setVarNameM :: String -> ExprVar tp -> WideningM () setVarNameM base x = modify $ over wsPPInfo $ ppInfoAddExprName base x
122
setVarNameM :: String -> ExprVar tp -> WideningM () setVarNameM base x = modify $ over wsPPInfo $ ppInfoAddExprName base x
122
setVarNameM base x = modify $ over wsPPInfo $ ppInfoAddExprName base x
70
false
true
0
8
20
48
22
26
null
null
brendanhay/gogol
gogol-containeranalysis/gen/Network/Google/ContainerAnalysis/Types/Product.hs
mpl-2.0
-- | The base score is a function of the base metric scores. cvssBaseScore :: Lens' CVSSv3 (Maybe Double) cvssBaseScore = lens _cvssBaseScore (\ s a -> s{_cvssBaseScore = a}) . mapping _Coerce
206
cvssBaseScore :: Lens' CVSSv3 (Maybe Double) cvssBaseScore = lens _cvssBaseScore (\ s a -> s{_cvssBaseScore = a}) . mapping _Coerce
145
cvssBaseScore = lens _cvssBaseScore (\ s a -> s{_cvssBaseScore = a}) . mapping _Coerce
100
true
true
1
8
46
57
28
29
null
null
brendanhay/gogol
gogol-ml/gen/Network/Google/Resource/Ml/Projects/Jobs/Cancel.hs
mpl-2.0
-- | Required. The name of the job to cancel. pjcName :: Lens' ProjectsJobsCancel Text pjcName = lens _pjcName (\ s a -> s{_pjcName = a})
137
pjcName :: Lens' ProjectsJobsCancel Text pjcName = lens _pjcName (\ s a -> s{_pjcName = a})
91
pjcName = lens _pjcName (\ s a -> s{_pjcName = a})
50
true
true
1
9
25
43
22
21
null
null
ekohl/ganeti
htools/Ganeti/HTools/PeerMap.hs
gpl-2.0
accumArray :: (Elem -> Elem -> Elem) -- ^ function used to merge the elements -> [(Key, Elem)] -- ^ source data -> PeerMap -- ^ results accumArray _ [] = empty
206
accumArray :: (Elem -> Elem -> Elem) -- ^ function used to merge the elements -> [(Key, Elem)] -- ^ source data -> PeerMap accumArray _ [] = empty
181
accumArray _ [] = empty
24
true
true
0
8
78
49
28
21
null
null
benmos/pathtype
System/Path/IO.hs
bsd-3-clause
vectorOf :: Gen a -> Int -> Gen [a] vectorOf gen n = sequence [ gen | i <- [1..n] ]
83
vectorOf :: Gen a -> Int -> Gen [a] vectorOf gen n = sequence [ gen | i <- [1..n] ]
83
vectorOf gen n = sequence [ gen | i <- [1..n] ]
47
false
true
0
9
20
52
26
26
null
null
sdiehl/ghc
libraries/base/GHC/Int.hs
bsd-3-clause
neInt16 (I16# x) (I16# y) = isTrue# (x /=# y)
45
neInt16 (I16# x) (I16# y) = isTrue# (x /=# y)
45
neInt16 (I16# x) (I16# y) = isTrue# (x /=# y)
45
false
false
0
7
9
33
16
17
null
null
vasily-kirichenko/haskell-book
src/Monads.hs
bsd-3-clause
meh :: Monad m => [a] -> (a -> m b) -> m [b] meh [] _ = return []
65
meh :: Monad m => [a] -> (a -> m b) -> m [b] meh [] _ = return []
65
meh [] _ = return []
20
false
true
0
11
19
61
29
32
null
null
sdiehl/ghc
compiler/basicTypes/OccName.hs
bsd-3-clause
elemOccEnv x (A y) = elemUFM x y
38
elemOccEnv x (A y) = elemUFM x y
38
elemOccEnv x (A y) = elemUFM x y
38
false
false
0
7
13
22
10
12
null
null
ku-fpg/sunroof-compiler
Language/Sunroof/JS/String.hs
bsd-3-clause
jsEscapeString (c:cs) = case c of -- Backslash has to remain backslash in JS. '\\' -> '\\' : '\\' : jsEscapeString cs -- Special control sequences. '\0' -> jsUnicodeChar '\0' ++ jsEscapeString cs -- Ambigous with numbers '\a' -> jsUnicodeChar '\a' ++ jsEscapeString cs -- Non JS '\b' -> '\\' : 'b' : jsEscapeString cs '\f' -> '\\' : 'f' : jsEscapeString cs '\n' -> '\\' : 'n' : jsEscapeString cs '\r' -> '\\' : 'r' : jsEscapeString cs '\t' -> '\\' : 't' : jsEscapeString cs '\v' -> '\\' : 'v' : jsEscapeString cs '\"' -> '\\' : '\"' : jsEscapeString cs '\'' -> '\\' : '\'' : jsEscapeString cs -- Non-control ASCII characters can remain as they are. c' | not (isControl c') && isAscii c' -> c' : jsEscapeString cs -- All other non ASCII signs are escaped to unicode. c' -> jsUnicodeChar c' ++ jsEscapeString cs
844
jsEscapeString (c:cs) = case c of -- Backslash has to remain backslash in JS. '\\' -> '\\' : '\\' : jsEscapeString cs -- Special control sequences. '\0' -> jsUnicodeChar '\0' ++ jsEscapeString cs -- Ambigous with numbers '\a' -> jsUnicodeChar '\a' ++ jsEscapeString cs -- Non JS '\b' -> '\\' : 'b' : jsEscapeString cs '\f' -> '\\' : 'f' : jsEscapeString cs '\n' -> '\\' : 'n' : jsEscapeString cs '\r' -> '\\' : 'r' : jsEscapeString cs '\t' -> '\\' : 't' : jsEscapeString cs '\v' -> '\\' : 'v' : jsEscapeString cs '\"' -> '\\' : '\"' : jsEscapeString cs '\'' -> '\\' : '\'' : jsEscapeString cs -- Non-control ASCII characters can remain as they are. c' | not (isControl c') && isAscii c' -> c' : jsEscapeString cs -- All other non ASCII signs are escaped to unicode. c' -> jsUnicodeChar c' ++ jsEscapeString cs
844
jsEscapeString (c:cs) = case c of -- Backslash has to remain backslash in JS. '\\' -> '\\' : '\\' : jsEscapeString cs -- Special control sequences. '\0' -> jsUnicodeChar '\0' ++ jsEscapeString cs -- Ambigous with numbers '\a' -> jsUnicodeChar '\a' ++ jsEscapeString cs -- Non JS '\b' -> '\\' : 'b' : jsEscapeString cs '\f' -> '\\' : 'f' : jsEscapeString cs '\n' -> '\\' : 'n' : jsEscapeString cs '\r' -> '\\' : 'r' : jsEscapeString cs '\t' -> '\\' : 't' : jsEscapeString cs '\v' -> '\\' : 'v' : jsEscapeString cs '\"' -> '\\' : '\"' : jsEscapeString cs '\'' -> '\\' : '\'' : jsEscapeString cs -- Non-control ASCII characters can remain as they are. c' | not (isControl c') && isAscii c' -> c' : jsEscapeString cs -- All other non ASCII signs are escaped to unicode. c' -> jsUnicodeChar c' ++ jsEscapeString cs
844
false
false
0
14
184
263
124
139
null
null
annenkov/contracts
Coq/Extraction/contracts-haskell/src/Contracts/HOAS.hs
mit
(!=!) :: ExpHoas exp => exp R -> exp R -> exp B x !=! y = opE Equal [x, y]
74
(!=!) :: ExpHoas exp => exp R -> exp R -> exp B x !=! y = opE Equal [x, y]
74
x !=! y = opE Equal [x, y]
26
false
true
0
10
20
54
26
28
null
null
uuhan/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
process fn Universes = do i <- getIState let cs = idris_constraints i let cslist = S.toAscList cs -- iputStrLn $ showSep "\n" (map show cs) iputStrLn $ showSep "\n" (map show cslist) let n = length cslist iputStrLn $ "(" ++ show n ++ " constraints)" case ucheck cs of Error e -> iPrintError $ pshow i e OK _ -> iPrintResult "Universes OK"
594
process fn Universes = do i <- getIState let cs = idris_constraints i let cslist = S.toAscList cs -- iputStrLn $ showSep "\n" (map show cs) iputStrLn $ showSep "\n" (map show cslist) let n = length cslist iputStrLn $ "(" ++ show n ++ " constraints)" case ucheck cs of Error e -> iPrintError $ pshow i e OK _ -> iPrintResult "Universes OK"
594
process fn Universes = do i <- getIState let cs = idris_constraints i let cslist = S.toAscList cs -- iputStrLn $ showSep "\n" (map show cs) iputStrLn $ showSep "\n" (map show cslist) let n = length cslist iputStrLn $ "(" ++ show n ++ " constraints)" case ucheck cs of Error e -> iPrintError $ pshow i e OK _ -> iPrintResult "Universes OK"
594
false
false
0
11
320
135
59
76
null
null
facebook/fbthrift
thrift/lib/hs/Thrift/Transport/Framed.hs
apache-2.0
readFrame :: Transport t => FramedTransport t -> IO Int readFrame trans = do -- Read and decode the frame size. szBs <- tRead (wrappedTrans trans) 4 let sz = fromIntegral (B.decode szBs :: Int32) -- Read the frame and stuff it into the read buffer. bs <- tRead (wrappedTrans trans) sz fillBuf (readBuffer trans) bs -- Return the frame size so that the caller knows whether to expect -- something in the read buffer or not. return sz
452
readFrame :: Transport t => FramedTransport t -> IO Int readFrame trans = do -- Read and decode the frame size. szBs <- tRead (wrappedTrans trans) 4 let sz = fromIntegral (B.decode szBs :: Int32) -- Read the frame and stuff it into the read buffer. bs <- tRead (wrappedTrans trans) sz fillBuf (readBuffer trans) bs -- Return the frame size so that the caller knows whether to expect -- something in the read buffer or not. return sz
452
readFrame trans = do -- Read and decode the frame size. szBs <- tRead (wrappedTrans trans) 4 let sz = fromIntegral (B.decode szBs :: Int32) -- Read the frame and stuff it into the read buffer. bs <- tRead (wrappedTrans trans) sz fillBuf (readBuffer trans) bs -- Return the frame size so that the caller knows whether to expect -- something in the read buffer or not. return sz
396
false
true
0
13
98
114
53
61
null
null
TomMD/ghc
compiler/types/TyCon.hs
bsd-3-clause
-- | Kind constructors mkKindTyCon :: Name -> Kind -> TyCon mkKindTyCon name kind = mkPrimTyCon' name kind [] VoidRep True
124
mkKindTyCon :: Name -> Kind -> TyCon mkKindTyCon name kind = mkPrimTyCon' name kind [] VoidRep True
101
mkKindTyCon name kind = mkPrimTyCon' name kind [] VoidRep True
64
true
true
0
8
22
44
20
24
null
null
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/SSP/Assumptions.hs
bsd-2-clause
assumpWISE = cic "assumpWISE" waterSIntersect "Water-Intersects-Surface-Edge" assumpDom
90
assumpWISE = cic "assumpWISE" waterSIntersect "Water-Intersects-Surface-Edge" assumpDom
90
assumpWISE = cic "assumpWISE" waterSIntersect "Water-Intersects-Surface-Edge" assumpDom
90
false
false
1
5
9
22
7
15
null
null
urbanslug/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
compareIntegerName = varQual gHC_INTEGER_TYPE (fsLit "compareInteger") compareIntegerIdKey
96
compareIntegerName = varQual gHC_INTEGER_TYPE (fsLit "compareInteger") compareIntegerIdKey
96
compareIntegerName = varQual gHC_INTEGER_TYPE (fsLit "compareInteger") compareIntegerIdKey
96
false
false
0
7
12
19
9
10
null
null
VictorDenisov/jdi
src/Language/Java/Jdwp.hs
gpl-2.0
errorList = [ ( 10, "Passed thread is null, is not a valid thread or has exited.") , ( 11, "Thread group invalid.") , ( 12, "Invalid priority.") , ( 13, "If the specified thread has not been suspended by an event.") , ( 14, "Thread already suspended.") , ( 20, "The reference type has been unloaded or garbage collected.") , ( 21, "Invalid class") , ( 22, "Class has been loaded, but not yet prepared.") , ( 23, "Invalid method.") , ( 24, "Invalid location.") , ( 25, "Invalid field.") , ( 30, "Invalid jframeID.") , ( 31, "There are no more Java or JNI frames on the call stack.") , ( 32, "Information about the frame is not available.") , ( 33, "Operation can only be performed on current frame.") , ( 34, "The variable is not an appropriate type for the function used.") , ( 35, "Invalid slot.") , ( 40, "Item already set.") , ( 41, "Desired element not found.") , ( 50, "Invalid monitor.") , ( 51, "This thread doesn't own the monitor.") , ( 52, "The call has been interrupted before completion.") , ( 60, "The call has been interrupted before completion.") , ( 61, "A circularity has been detected while initializing a class.") , ( 62, "The verifier detected that a class file, though well formed, contained some sort of internal inconsistency or security problem.") , ( 63, "Adding methods has not been implemented.") , ( 64, "Schema change has not been implemented.") , ( 65, "The state of the thread has been modified, and is now inconsistent.") , ( 66, "A direct superclass is different for the new class version, or the set of directly implemented interfaces is different and canUnrestrictedlyRedefineClasses is false.") , ( 67, "The new class version does not declare a method declared in the old class version and canUnrestrictedlyRedefineClasses is false.") , ( 68, "A class file has a version number not supported by this VM.") , ( 69, "The class name defined in the new class file is different from the name in the old class object.") , ( 70, "The new class version has different modifiers and and canUnrestrictedlyRedefineClasses is false.") , ( 71, "A method in the new class version has different modifiers than its counterpart in the old class version and and canUnrestrictedlyRedefineClasses is false.") , ( 99, "The functionality is not implemented in this virtual machine.") , (100, "Invalid pointer.") , (101, "Desired information is not available.") , (102, "The specified event type id is not recognized.") , (103, "Illegal argument.") , (110, "The function needed to allocate memory and no more memory was available for allocation.") , (111, "Debugging has not been enabled in this virtual machine. JVMDI cannot be used.") , (112, "The virtual machine is not running.") , (113, "An unexpected internal error has occurred.") , (115, "The thread being used to call this function is not attached to the virtual machine. Calls must be made from attached threads.") , (500, "Invalid object type id or class tag.") , (502, "Previous invoke not complete.") , (503, "Index is invalid.") , (504, "The length is invalid.") , (506, "The string is invalid.") , (507, "The class loader is invalid.") , (508, "The array is invalid.") , (509, "Unable to load the transport.") , (510, "Unable to initialize the transport.") , (511, "Native method.") , (512, "The count is invalid.") ]
3,954
errorList = [ ( 10, "Passed thread is null, is not a valid thread or has exited.") , ( 11, "Thread group invalid.") , ( 12, "Invalid priority.") , ( 13, "If the specified thread has not been suspended by an event.") , ( 14, "Thread already suspended.") , ( 20, "The reference type has been unloaded or garbage collected.") , ( 21, "Invalid class") , ( 22, "Class has been loaded, but not yet prepared.") , ( 23, "Invalid method.") , ( 24, "Invalid location.") , ( 25, "Invalid field.") , ( 30, "Invalid jframeID.") , ( 31, "There are no more Java or JNI frames on the call stack.") , ( 32, "Information about the frame is not available.") , ( 33, "Operation can only be performed on current frame.") , ( 34, "The variable is not an appropriate type for the function used.") , ( 35, "Invalid slot.") , ( 40, "Item already set.") , ( 41, "Desired element not found.") , ( 50, "Invalid monitor.") , ( 51, "This thread doesn't own the monitor.") , ( 52, "The call has been interrupted before completion.") , ( 60, "The call has been interrupted before completion.") , ( 61, "A circularity has been detected while initializing a class.") , ( 62, "The verifier detected that a class file, though well formed, contained some sort of internal inconsistency or security problem.") , ( 63, "Adding methods has not been implemented.") , ( 64, "Schema change has not been implemented.") , ( 65, "The state of the thread has been modified, and is now inconsistent.") , ( 66, "A direct superclass is different for the new class version, or the set of directly implemented interfaces is different and canUnrestrictedlyRedefineClasses is false.") , ( 67, "The new class version does not declare a method declared in the old class version and canUnrestrictedlyRedefineClasses is false.") , ( 68, "A class file has a version number not supported by this VM.") , ( 69, "The class name defined in the new class file is different from the name in the old class object.") , ( 70, "The new class version has different modifiers and and canUnrestrictedlyRedefineClasses is false.") , ( 71, "A method in the new class version has different modifiers than its counterpart in the old class version and and canUnrestrictedlyRedefineClasses is false.") , ( 99, "The functionality is not implemented in this virtual machine.") , (100, "Invalid pointer.") , (101, "Desired information is not available.") , (102, "The specified event type id is not recognized.") , (103, "Illegal argument.") , (110, "The function needed to allocate memory and no more memory was available for allocation.") , (111, "Debugging has not been enabled in this virtual machine. JVMDI cannot be used.") , (112, "The virtual machine is not running.") , (113, "An unexpected internal error has occurred.") , (115, "The thread being used to call this function is not attached to the virtual machine. Calls must be made from attached threads.") , (500, "Invalid object type id or class tag.") , (502, "Previous invoke not complete.") , (503, "Index is invalid.") , (504, "The length is invalid.") , (506, "The string is invalid.") , (507, "The class loader is invalid.") , (508, "The array is invalid.") , (509, "Unable to load the transport.") , (510, "Unable to initialize the transport.") , (511, "Native method.") , (512, "The count is invalid.") ]
3,954
errorList = [ ( 10, "Passed thread is null, is not a valid thread or has exited.") , ( 11, "Thread group invalid.") , ( 12, "Invalid priority.") , ( 13, "If the specified thread has not been suspended by an event.") , ( 14, "Thread already suspended.") , ( 20, "The reference type has been unloaded or garbage collected.") , ( 21, "Invalid class") , ( 22, "Class has been loaded, but not yet prepared.") , ( 23, "Invalid method.") , ( 24, "Invalid location.") , ( 25, "Invalid field.") , ( 30, "Invalid jframeID.") , ( 31, "There are no more Java or JNI frames on the call stack.") , ( 32, "Information about the frame is not available.") , ( 33, "Operation can only be performed on current frame.") , ( 34, "The variable is not an appropriate type for the function used.") , ( 35, "Invalid slot.") , ( 40, "Item already set.") , ( 41, "Desired element not found.") , ( 50, "Invalid monitor.") , ( 51, "This thread doesn't own the monitor.") , ( 52, "The call has been interrupted before completion.") , ( 60, "The call has been interrupted before completion.") , ( 61, "A circularity has been detected while initializing a class.") , ( 62, "The verifier detected that a class file, though well formed, contained some sort of internal inconsistency or security problem.") , ( 63, "Adding methods has not been implemented.") , ( 64, "Schema change has not been implemented.") , ( 65, "The state of the thread has been modified, and is now inconsistent.") , ( 66, "A direct superclass is different for the new class version, or the set of directly implemented interfaces is different and canUnrestrictedlyRedefineClasses is false.") , ( 67, "The new class version does not declare a method declared in the old class version and canUnrestrictedlyRedefineClasses is false.") , ( 68, "A class file has a version number not supported by this VM.") , ( 69, "The class name defined in the new class file is different from the name in the old class object.") , ( 70, "The new class version has different modifiers and and canUnrestrictedlyRedefineClasses is false.") , ( 71, "A method in the new class version has different modifiers than its counterpart in the old class version and and canUnrestrictedlyRedefineClasses is false.") , ( 99, "The functionality is not implemented in this virtual machine.") , (100, "Invalid pointer.") , (101, "Desired information is not available.") , (102, "The specified event type id is not recognized.") , (103, "Illegal argument.") , (110, "The function needed to allocate memory and no more memory was available for allocation.") , (111, "Debugging has not been enabled in this virtual machine. JVMDI cannot be used.") , (112, "The virtual machine is not running.") , (113, "An unexpected internal error has occurred.") , (115, "The thread being used to call this function is not attached to the virtual machine. Calls must be made from attached threads.") , (500, "Invalid object type id or class tag.") , (502, "Previous invoke not complete.") , (503, "Index is invalid.") , (504, "The length is invalid.") , (506, "The string is invalid.") , (507, "The class loader is invalid.") , (508, "The array is invalid.") , (509, "Unable to load the transport.") , (510, "Unable to initialize the transport.") , (511, "Native method.") , (512, "The count is invalid.") ]
3,954
false
false
1
6
1,228
504
333
171
null
null
valderman/shellmate
shellmate/Control/Shell/File.hs
bsd-3-clause
-- | Lazily read a file. input :: FilePath -> Shell String input f = do e <- getEnv unsafeLiftIO $ readFile (absPath e f) -- | Lazily write a file.
152
input :: FilePath -> Shell String input f = do e <- getEnv unsafeLiftIO $ readFile (absPath e f) -- | Lazily write a file.
127
input f = do e <- getEnv unsafeLiftIO $ readFile (absPath e f) -- | Lazily write a file.
93
true
true
0
10
35
48
23
25
null
null
FranklinChen/project-euler-haskell
Test/Test12.hs
bsd-3-clause
prop_numDivisors_optimization (Positive n) (Positive t) = t `hasNumDivisorsGreaterThan` n == (numDivisors t > n)
114
prop_numDivisors_optimization (Positive n) (Positive t) = t `hasNumDivisorsGreaterThan` n == (numDivisors t > n)
114
prop_numDivisors_optimization (Positive n) (Positive t) = t `hasNumDivisorsGreaterThan` n == (numDivisors t > n)
114
false
false
0
9
15
47
23
24
null
null
askl56/Hastore
src/SimpleFunctions.hs
mit
(+++) :: [a] -> [a] -> [a] lst1 +++ lst2 = if null lst1 {- check emptyness -} then lst2 -- base case else (head lst1) : (tail lst1 +++ lst2)
145
(+++) :: [a] -> [a] -> [a] lst1 +++ lst2 = if null lst1 {- check emptyness -} then lst2 -- base case else (head lst1) : (tail lst1 +++ lst2)
145
lst1 +++ lst2 = if null lst1 {- check emptyness -} then lst2 -- base case else (head lst1) : (tail lst1 +++ lst2)
118
false
true
0
9
35
69
38
31
null
null
sakari/haskell-gherkin
Language/Gherkin/Pretty.hs
bsd-3-clause
prettyBackground :: Background -> Doc prettyBackground (Background steps) = text "Background:" $+$ (nest 4 $ vcat $ map prettyStep steps)
214
prettyBackground :: Background -> Doc prettyBackground (Background steps) = text "Background:" $+$ (nest 4 $ vcat $ map prettyStep steps)
214
prettyBackground (Background steps) = text "Background:" $+$ (nest 4 $ vcat $ map prettyStep steps)
176
false
true
0
9
96
50
24
26
null
null
rueshyna/gogol
gogol-logging/gen/Network/Google/Logging/Types/Product.hs
mpl-2.0
-- | The number of HTTP response bytes inserted into cache. Set only when a -- cache fill was attempted. httprCacheFillBytes :: Lens' HTTPRequest (Maybe Int64) httprCacheFillBytes = lens _httprCacheFillBytes (\ s a -> s{_httprCacheFillBytes = a}) . mapping _Coerce
278
httprCacheFillBytes :: Lens' HTTPRequest (Maybe Int64) httprCacheFillBytes = lens _httprCacheFillBytes (\ s a -> s{_httprCacheFillBytes = a}) . mapping _Coerce
173
httprCacheFillBytes = lens _httprCacheFillBytes (\ s a -> s{_httprCacheFillBytes = a}) . mapping _Coerce
118
true
true
0
10
53
56
29
27
null
null
beni55/fay
examples/D3TreeSample.hs
bsd-3-clause
displayNodes :: D3SvgCanvas -> D3LayoutTreeNodes -> Fay D3SvgNode displayNodes = ffi "%1.selectAll('g.node').data(%2)\ \.enter().append('svg:g')\ \.attr('transform', \ \function(d) { return 'translate(' + d.x + ',' + d.y + ')'; })"
384
displayNodes :: D3SvgCanvas -> D3LayoutTreeNodes -> Fay D3SvgNode displayNodes = ffi "%1.selectAll('g.node').data(%2)\ \.enter().append('svg:g')\ \.attr('transform', \ \function(d) { return 'translate(' + d.x + ',' + d.y + ')'; })"
384
displayNodes = ffi "%1.selectAll('g.node').data(%2)\ \.enter().append('svg:g')\ \.attr('transform', \ \function(d) { return 'translate(' + d.x + ',' + d.y + ')'; })"
318
false
true
0
7
180
25
12
13
null
null
brownsys/nettle-openflow
src/Nettle/OpenFlow/MessagesBinary.hs
bsd-3-clause
flowModSizeInBytes' :: [Action] -> Int flowModSizeInBytes' actions = headerSize + matchSize + 20 + sum (map actionSizeInBytes actions)
139
flowModSizeInBytes' :: [Action] -> Int flowModSizeInBytes' actions = headerSize + matchSize + 20 + sum (map actionSizeInBytes actions)
139
flowModSizeInBytes' actions = headerSize + matchSize + 20 + sum (map actionSizeInBytes actions)
100
false
true
0
8
22
44
22
22
null
null
gridaphobe/ghc
compiler/stgSyn/StgLint.hs
bsd-3-clause
_mkCaseAltMsg :: [StgAlt] -> MsgDoc _mkCaseAltMsg _alts = ($$) (text "In some case alternatives, type of alternatives not all same:") (Outputable.empty)
166
_mkCaseAltMsg :: [StgAlt] -> MsgDoc _mkCaseAltMsg _alts = ($$) (text "In some case alternatives, type of alternatives not all same:") (Outputable.empty)
166
_mkCaseAltMsg _alts = ($$) (text "In some case alternatives, type of alternatives not all same:") (Outputable.empty)
130
false
true
0
7
34
46
22
24
null
null
cjlarose/advent-2016
src/BathroomSecurity.hs
bsd-3-clause
normalGrid :: ButtonGrid normalGrid = (Button (1, 1), buttonOnNormalGrid, labelOnNormalGrid)
92
normalGrid :: ButtonGrid normalGrid = (Button (1, 1), buttonOnNormalGrid, labelOnNormalGrid)
92
normalGrid = (Button (1, 1), buttonOnNormalGrid, labelOnNormalGrid)
67
false
true
0
7
9
29
17
12
null
null
chreekat/stack
src/Stack/Constants.hs
bsd-3-clause
-- -- | Hoogle database file. -- hoogleDatabaseFile :: Path Abs Dir -> Path Abs File -- hoogleDatabaseFile docLoc = -- docLoc </> -- $(mkRelFile "default.hoo") -- -- | Extension for hoogle databases. -- hoogleDbExtension :: String -- hoogleDbExtension = "hoo" -- -- | Extension of haddock files -- haddockExtension :: String -- haddockExtension = "haddock" -- | User documentation directory. userDocsDir :: Config -> Path Abs Dir userDocsDir config = configStackRoot config </> $(mkRelDir "doc/")
503
userDocsDir :: Config -> Path Abs Dir userDocsDir config = configStackRoot config </> $(mkRelDir "doc/")
104
userDocsDir config = configStackRoot config </> $(mkRelDir "doc/")
66
true
true
2
7
82
54
30
24
null
null
lostbean/sledge
src/File/ANGReader.hs
gpl-3.0
phasesParse :: Parser [ANGphase] phasesParse = many1 (skipCommentLine >> phaseParse) <?> "Couldn't parser not a sinlge phase information"
137
phasesParse :: Parser [ANGphase] phasesParse = many1 (skipCommentLine >> phaseParse) <?> "Couldn't parser not a sinlge phase information"
137
phasesParse = many1 (skipCommentLine >> phaseParse) <?> "Couldn't parser not a sinlge phase information"
104
false
true
0
8
17
31
16
15
null
null
brendanhay/gogol
gogol-deploymentmanager/gen/Network/Google/DeploymentManager/Types/Product.hs
mpl-2.0
-- | [Output Only] A warning data value corresponding to the key. rwidiValue :: Lens' ResourceWarningsItemDataItem (Maybe Text) rwidiValue = lens _rwidiValue (\ s a -> s{_rwidiValue = a})
189
rwidiValue :: Lens' ResourceWarningsItemDataItem (Maybe Text) rwidiValue = lens _rwidiValue (\ s a -> s{_rwidiValue = a})
123
rwidiValue = lens _rwidiValue (\ s a -> s{_rwidiValue = a})
61
true
true
0
9
30
48
25
23
null
null
QuickChick/Luck
luck/src/Core/Optimizations.hs
mit
unvar x = error $ show ("Unvaring", x)
38
unvar x = error $ show ("Unvaring", x)
38
unvar x = error $ show ("Unvaring", x)
38
false
false
1
7
7
25
11
14
null
null
angerman/data-bitcode-edsl
src/EDSL/Monad/Internal.hs
bsd-3-clause
askFuncs :: (HasCallStack, Monad m) => BodyBuilderT m Funcs askFuncs = getsCtx funcs
84
askFuncs :: (HasCallStack, Monad m) => BodyBuilderT m Funcs askFuncs = getsCtx funcs
84
askFuncs = getsCtx funcs
24
false
true
0
6
12
32
16
16
null
null
jlouis/combinatorrent
src/Process/ChokeMgr.hs
bsd-2-clause
addPeer :: PeerChannel -> InfoHash -> ThreadId -> ChokeMgrProcess () addPeer ch ih t = do chn <- gets chain pt <- liftIO $ getStdRandom (\gen -> randomR (0, length chn - 1) gen) let (front, back) = splitAt pt chn modify (\db -> db { chain = (front ++ initPeer : back) }) where initPeer = Peer t ih ch
319
addPeer :: PeerChannel -> InfoHash -> ThreadId -> ChokeMgrProcess () addPeer ch ih t = do chn <- gets chain pt <- liftIO $ getStdRandom (\gen -> randomR (0, length chn - 1) gen) let (front, back) = splitAt pt chn modify (\db -> db { chain = (front ++ initPeer : back) }) where initPeer = Peer t ih ch
319
addPeer ch ih t = do chn <- gets chain pt <- liftIO $ getStdRandom (\gen -> randomR (0, length chn - 1) gen) let (front, back) = splitAt pt chn modify (\db -> db { chain = (front ++ initPeer : back) }) where initPeer = Peer t ih ch
250
false
true
0
15
79
154
76
78
null
null
higgsd/euler
hs/45.hs
bsd-2-clause
findTriple n = findTriple0 (drop n hexagonal) pentagonal triangular
67
findTriple n = findTriple0 (drop n hexagonal) pentagonal triangular
67
findTriple n = findTriple0 (drop n hexagonal) pentagonal triangular
67
false
false
0
7
8
24
11
13
null
null