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
vladimir-ipatov/ganeti
src/Ganeti/Constants.hs
gpl-2.0
-- * VTypes vtypeBool :: VType vtypeBool = VTypeBool
53
vtypeBool :: VType vtypeBool = VTypeBool
40
vtypeBool = VTypeBool
21
true
true
0
6
9
19
8
11
null
null
BartAdv/clientsession
src/Web/ClientSession.hs
bsd-2-clause
-- | Construct a new 16-byte IV using our CPRNG. Forks another -- thread to reseed the CPRNG should its usage count reach a -- hardcoded threshold. aesRNG :: IO IV aesRNG = do (bs, count) <- I.atomicModifyIORef aesRef $ \(ASt rng count) -> #if MIN_VERSION_cprng_aes(0, 5, 0) let (bs', rng') = cprgGenerate 16 rng #elif MIN_VERSION_cprng_aes(0, 3, 2) let (bs', rng') = genRandomBytes 16 rng #else let (bs', rng') = genRandomBytes rng 16 #endif in (ASt rng' (succ count), (bs', count)) when (count == threshold) $ void $ forkIO aesReseed return $! unsafeMkIV bs where void f = f >> return () -- | How many IVs should be generated before reseeding the CPRNG. -- This number depends basically on how paranoid you are. We -- think 100.000 is a good compromise: larger numbers give only a -- small performance advantage, while it still is a small number -- since we only generate 1.5 MiB of random data between reseeds.
971
aesRNG :: IO IV aesRNG = do (bs, count) <- I.atomicModifyIORef aesRef $ \(ASt rng count) -> #if MIN_VERSION_cprng_aes(0, 5, 0) let (bs', rng') = cprgGenerate 16 rng #elif MIN_VERSION_cprng_aes(0, 3, 2) let (bs', rng') = genRandomBytes 16 rng #else let (bs', rng') = genRandomBytes rng 16 #endif in (ASt rng' (succ count), (bs', count)) when (count == threshold) $ void $ forkIO aesReseed return $! unsafeMkIV bs where void f = f >> return () -- | How many IVs should be generated before reseeding the CPRNG. -- This number depends basically on how paranoid you are. We -- think 100.000 is a good compromise: larger numbers give only a -- small performance advantage, while it still is a small number -- since we only generate 1.5 MiB of random data between reseeds.
822
aesRNG = do (bs, count) <- I.atomicModifyIORef aesRef $ \(ASt rng count) -> #if MIN_VERSION_cprng_aes(0, 5, 0) let (bs', rng') = cprgGenerate 16 rng #elif MIN_VERSION_cprng_aes(0, 3, 2) let (bs', rng') = genRandomBytes 16 rng #else let (bs', rng') = genRandomBytes rng 16 #endif in (ASt rng' (succ count), (bs', count)) when (count == threshold) $ void $ forkIO aesReseed return $! unsafeMkIV bs where void f = f >> return () -- | How many IVs should be generated before reseeding the CPRNG. -- This number depends basically on how paranoid you are. We -- think 100.000 is a good compromise: larger numbers give only a -- small performance advantage, while it still is a small number -- since we only generate 1.5 MiB of random data between reseeds.
806
true
true
3
15
218
169
85
84
null
null
mightymoose/liquidhaskell
benchmarks/base-4.5.1.0/Debug/Trace.hs
bsd-3-clause
traceEventIO msg = GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s -> case traceEvent# p s of s' -> (# s', () #) #else traceEventIO msg = (return $! length msg) >> return () #endif -- | like 'trace', but additionally prints a call stack if one is -- available. -- -- In the current GHC implementation, the call stack is only -- availble if the program was compiled with @-prof@; otherwise -- 'traceStack' behaves exactly like 'trace'. Entries in the call -- stack correspond to @SCC@ annotations, so it is a good idea to use -- @-fprof-auto@ or @-fprof-auto-calls@ to add SCC annotations automatically. --
620
traceEventIO msg = GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s -> case traceEvent# p s of s' -> (# s', () #) #else traceEventIO msg = (return $! length msg) >> return () #endif -- | like 'trace', but additionally prints a call stack if one is -- available. -- -- In the current GHC implementation, the call stack is only -- availble if the program was compiled with @-prof@; otherwise -- 'traceStack' behaves exactly like 'trace'. Entries in the call -- stack correspond to @SCC@ annotations, so it is a good idea to use -- @-fprof-auto@ or @-fprof-auto-calls@ to add SCC annotations automatically. --
620
traceEventIO msg = GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s -> case traceEvent# p s of s' -> (# s', () #) #else traceEventIO msg = (return $! length msg) >> return () #endif -- | like 'trace', but additionally prints a call stack if one is -- available. -- -- In the current GHC implementation, the call stack is only -- availble if the program was compiled with @-prof@; otherwise -- 'traceStack' behaves exactly like 'trace'. Entries in the call -- stack correspond to @SCC@ annotations, so it is a good idea to use -- @-fprof-auto@ or @-fprof-auto-calls@ to add SCC annotations automatically. --
620
false
false
0
13
115
74
43
31
null
null
sukwon0709/mysql
tests/ParserTest.hs
bsd-3-clause
ts4 :: TestTree ts4 = testCase "Expression3" $ (parse parseExpr "" (Lex.alexScanTokens $ "NOT(1 <= CourseID and CourseID <= 10) or Points < 6")) @?= Right (Syn.EOr (Syn.ENot (Syn.BooleanPrimary (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.SEList [Syn.EAnd (Syn.BooleanPrimary (Syn.BPLTE (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.Lit (Syn.NLit "1"))))) (Syn.BitExpr (Syn.SimpleExpr (Syn.Ident (Syn.SimpleIdent "CourseID")))))) (Syn.BooleanPrimary (Syn.BPLTE (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.Ident (Syn.SimpleIdent "CourseID"))))) (Syn.BitExpr (Syn.SimpleExpr (Syn.Lit (Syn.NLit "10")))))) ])))))) (Syn.BooleanPrimary (Syn.BPLT (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.Ident (Syn.SimpleIdent "Points"))))) (Syn.BitExpr (Syn.SimpleExpr (Syn.Lit (Syn.NLit "6")))))))
1,155
ts4 :: TestTree ts4 = testCase "Expression3" $ (parse parseExpr "" (Lex.alexScanTokens $ "NOT(1 <= CourseID and CourseID <= 10) or Points < 6")) @?= Right (Syn.EOr (Syn.ENot (Syn.BooleanPrimary (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.SEList [Syn.EAnd (Syn.BooleanPrimary (Syn.BPLTE (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.Lit (Syn.NLit "1"))))) (Syn.BitExpr (Syn.SimpleExpr (Syn.Ident (Syn.SimpleIdent "CourseID")))))) (Syn.BooleanPrimary (Syn.BPLTE (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.Ident (Syn.SimpleIdent "CourseID"))))) (Syn.BitExpr (Syn.SimpleExpr (Syn.Lit (Syn.NLit "10")))))) ])))))) (Syn.BooleanPrimary (Syn.BPLT (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.Ident (Syn.SimpleIdent "Points"))))) (Syn.BitExpr (Syn.SimpleExpr (Syn.Lit (Syn.NLit "6")))))))
1,155
ts4 = testCase "Expression3" $ (parse parseExpr "" (Lex.alexScanTokens $ "NOT(1 <= CourseID and CourseID <= 10) or Points < 6")) @?= Right (Syn.EOr (Syn.ENot (Syn.BooleanPrimary (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.SEList [Syn.EAnd (Syn.BooleanPrimary (Syn.BPLTE (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.Lit (Syn.NLit "1"))))) (Syn.BitExpr (Syn.SimpleExpr (Syn.Ident (Syn.SimpleIdent "CourseID")))))) (Syn.BooleanPrimary (Syn.BPLTE (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.Ident (Syn.SimpleIdent "CourseID"))))) (Syn.BitExpr (Syn.SimpleExpr (Syn.Lit (Syn.NLit "10")))))) ])))))) (Syn.BooleanPrimary (Syn.BPLT (Syn.Predicate (Syn.BitExpr (Syn.SimpleExpr (Syn.Ident (Syn.SimpleIdent "Points"))))) (Syn.BitExpr (Syn.SimpleExpr (Syn.Lit (Syn.NLit "6")))))))
1,139
false
true
2
35
431
392
194
198
null
null
GaloisInc/halvm-ghc
compiler/basicTypes/RdrName.hs
bsd-3-clause
lookupLocalRdrOcc :: LocalRdrEnv -> OccName -> Maybe Name lookupLocalRdrOcc (LRE { lre_env = env }) occ = lookupOccEnv env occ
126
lookupLocalRdrOcc :: LocalRdrEnv -> OccName -> Maybe Name lookupLocalRdrOcc (LRE { lre_env = env }) occ = lookupOccEnv env occ
126
lookupLocalRdrOcc (LRE { lre_env = env }) occ = lookupOccEnv env occ
68
false
true
0
9
19
44
22
22
null
null
erikd/fastpack
bench/bench.hs
bsd-2-clause
main :: IO () main = do sanityCheck putStrLn "\nPassed sanity test.\n" C.defaultMain benchmarks -------------------------------------------------------------------------------- -- The benchmarks.
209
main :: IO () main = do sanityCheck putStrLn "\nPassed sanity test.\n" C.defaultMain benchmarks -------------------------------------------------------------------------------- -- The benchmarks.
209
main = do sanityCheck putStrLn "\nPassed sanity test.\n" C.defaultMain benchmarks -------------------------------------------------------------------------------- -- The benchmarks.
195
false
true
0
9
31
41
17
24
null
null
olorin/amazonka
amazonka/src/Network/AWS.hs
mpl-2.0
-- | Retrieve the user data. Returns 'Nothing' if no user data is assigned -- to the instance. userdata :: MonadAWS m => m (Maybe ByteString) userdata = liftAWS AWST.userdata
174
userdata :: MonadAWS m => m (Maybe ByteString) userdata = liftAWS AWST.userdata
79
userdata = liftAWS AWST.userdata
32
true
true
0
8
29
34
17
17
null
null
shnarazk/mios
src/SAT/Mios/Util/BoolExp.hs
gpl-3.0
-- | an alias of 'conjunctionOf' (-&&&-) :: [BoolForm] -> BoolForm (-&&&-) = conjunctionOf
90
(-&&&-) :: [BoolForm] -> BoolForm (-&&&-) = conjunctionOf
57
(-&&&-) = conjunctionOf
23
true
true
0
6
13
23
15
8
null
null
blanu/arbre-go
Arbre/Compile.hs
gpl-2.0
compileInlineBody :: Expression -> String compileInlineBody body = "{ " ++ "return " ++ compileExpression body ++ " }"
118
compileInlineBody :: Expression -> String compileInlineBody body = "{ " ++ "return " ++ compileExpression body ++ " }"
118
compileInlineBody body = "{ " ++ "return " ++ compileExpression body ++ " }"
76
false
true
4
7
18
41
17
24
null
null
alexvong1995/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
isBlockCommand :: String -> Bool isBlockCommand s = s `M.member` blockCommands
78
isBlockCommand :: String -> Bool isBlockCommand s = s `M.member` blockCommands
78
isBlockCommand s = s `M.member` blockCommands
45
false
true
0
5
10
26
14
12
null
null
arekfu/irt
src/G4Release.hs
bsd-3-clause
releaseFile :: FilePath -> (String -> IO String) -> FilePath -> IO () releaseFile destinationDir transform file = do -- putStrLn ("Processing " ++ file) code <- readFile file code' <- transform code let fileName = takeFileName file targetFileName = destinationDir </> fileName writeFile targetFileName code'
322
releaseFile :: FilePath -> (String -> IO String) -> FilePath -> IO () releaseFile destinationDir transform file = do -- putStrLn ("Processing " ++ file) code <- readFile file code' <- transform code let fileName = takeFileName file targetFileName = destinationDir </> fileName writeFile targetFileName code'
322
releaseFile destinationDir transform file = do -- putStrLn ("Processing " ++ file) code <- readFile file code' <- transform code let fileName = takeFileName file targetFileName = destinationDir </> fileName writeFile targetFileName code'
252
false
true
0
10
60
95
44
51
null
null
iu-parfunc/haskell-hpx
mockups/StaticRep.hs
bsd-3-clause
fromSerial :: SerialRep -> StaticTypeRep fromSerial (SR (con, args)) = STR $ mkTyConApp (fromTyConRep con) (map (unSTR . fromSerial) args)
185
fromSerial :: SerialRep -> StaticTypeRep fromSerial (SR (con, args)) = STR $ mkTyConApp (fromTyConRep con) (map (unSTR . fromSerial) args)
185
fromSerial (SR (con, args)) = STR $ mkTyConApp (fromTyConRep con) (map (unSTR . fromSerial) args)
144
false
true
0
10
66
60
31
29
null
null
stevezhee/shootout
src/CEval.hs
bsd-3-clause
ppSwitchC :: Doc -> [Doc] -> Doc -> Doc ppSwitchC x ys z = ppBlockC (text "switch" <> parens x) $ map ppCaseC (zip [0..] ys) ++ [ ppDefaultC z ]
146
ppSwitchC :: Doc -> [Doc] -> Doc -> Doc ppSwitchC x ys z = ppBlockC (text "switch" <> parens x) $ map ppCaseC (zip [0..] ys) ++ [ ppDefaultC z ]
146
ppSwitchC x ys z = ppBlockC (text "switch" <> parens x) $ map ppCaseC (zip [0..] ys) ++ [ ppDefaultC z ]
106
false
true
0
10
32
79
39
40
null
null
dmp1ce/Haskell-Programming-Exercises
Chapter 22/Short Exercise: Warming Up.hs
unlicense
composed :: [Char] -> [Char] composed = cap . rev
49
composed :: [Char] -> [Char] composed = cap . rev
49
composed = cap . rev
20
false
true
0
6
9
25
14
11
null
null
thomie/vector
Data/Vector/Primitive.hs
bsd-3-clause
fromList = G.fromList
21
fromList = G.fromList
21
fromList = G.fromList
21
false
false
0
5
2
8
4
4
null
null
brendanhay/amazonka-limited
src/Network/AWS/Headers.hs
mpl-2.0
hAMZAuth :: ByteString -> Header hAMZAuth = ("X-Amzn-Authorization",)
69
hAMZAuth :: ByteString -> Header hAMZAuth = ("X-Amzn-Authorization",)
69
hAMZAuth = ("X-Amzn-Authorization",)
36
false
true
0
7
7
26
12
14
null
null
FunctionalThinking/ninety-nine
src/MultiwayTree.hs
mit
tree2 = Node 'a' [Node 'b' []]
30
tree2 = Node 'a' [Node 'b' []]
30
tree2 = Node 'a' [Node 'b' []]
30
false
false
0
8
6
21
10
11
null
null
kcharter/erl
Erl/EntitySet.hs
bsd-2-clause
intersection :: EntitySet -> EntitySet -> EntitySet intersection = lift2 DS.intersection
88
intersection :: EntitySet -> EntitySet -> EntitySet intersection = lift2 DS.intersection
88
intersection = lift2 DS.intersection
36
false
true
0
6
10
24
12
12
null
null
mjhopkins/alerta-client
src/Alerta.hs
bsd-3-clause
deleteHeartbeat = raise2 deleteHeartbeat'
41
deleteHeartbeat = raise2 deleteHeartbeat'
41
deleteHeartbeat = raise2 deleteHeartbeat'
41
false
false
0
5
3
9
4
5
null
null
nikita-volkov/hasql-th
library/Hasql/TH/Extraction/ChildExprList.hs
mit
joinQual = \case UsingJoinQual _ -> [] OnJoinQual a -> aExpr a -- *
72
joinQual = \case UsingJoinQual _ -> [] OnJoinQual a -> aExpr a -- *
72
joinQual = \case UsingJoinQual _ -> [] OnJoinQual a -> aExpr a -- *
72
false
false
1
9
18
36
15
21
null
null
sizur/haskell-i18n
Text/I18n.hs
bsd-3-clause
withLocale :: Locale -- ^ Locale to use -> I18n a -- ^ Internationalized expression -> I18n a -- ^ New internationalized expression. -- Note: while this expression is localy localized already, it is to be a -- part of another internationalized expression. -- Therefore the final type is internationalized. withLocale loc expression = do (_, l10n, ctxt) <- ask local (const (loc, l10n, ctxt)) expression
463
withLocale :: Locale -- ^ Locale to use -> I18n a -- ^ Internationalized expression -> I18n a withLocale loc expression = do (_, l10n, ctxt) <- ask local (const (loc, l10n, ctxt)) expression
236
withLocale loc expression = do (_, l10n, ctxt) <- ask local (const (loc, l10n, ctxt)) expression
114
true
true
0
11
126
80
42
38
null
null
brownplt/ovid
src/Data/InductiveGraph/ListImpl.hs
bsd-2-clause
foldVerticesM f acc (InductiveGraph a ix to from subgraph) = do acc' <- f (a,ix,to,from) acc foldVerticesM f acc' subgraph -- |'f' must define an equivalence relation. The resultant graph has one node in each equivalence class. Which node is -- chosen is not defined. 'f' is applied O(|V|^2) times.
304
foldVerticesM f acc (InductiveGraph a ix to from subgraph) = do acc' <- f (a,ix,to,from) acc foldVerticesM f acc' subgraph -- |'f' must define an equivalence relation. The resultant graph has one node in each equivalence class. Which node is -- chosen is not defined. 'f' is applied O(|V|^2) times.
304
foldVerticesM f acc (InductiveGraph a ix to from subgraph) = do acc' <- f (a,ix,to,from) acc foldVerticesM f acc' subgraph -- |'f' must define an equivalence relation. The resultant graph has one node in each equivalence class. Which node is -- chosen is not defined. 'f' is applied O(|V|^2) times.
304
false
false
0
9
55
63
32
31
null
null
bergmark/haskell-opaleye
opaleye-sqlite/src/Opaleye/SQLite/Internal/Table.hs
bsd-3-clause
runWriter :: Writer columns columns' -> columns -> [(HPQ.PrimExpr, String)] runWriter (Writer (PM.PackMap f)) columns = outColumns where (outColumns, ()) = f extract (I.Identity columns) extract (pes, s) = ([(I.runIdentity pes, s)], ()) -- This works more generally for any "zippable", that is an -- Applicative that satisfies -- -- x == (,) <$> fmap fst x <*> fmap snd x -- -- However, I'm unaware of a typeclass for this.
437
runWriter :: Writer columns columns' -> columns -> [(HPQ.PrimExpr, String)] runWriter (Writer (PM.PackMap f)) columns = outColumns where (outColumns, ()) = f extract (I.Identity columns) extract (pes, s) = ([(I.runIdentity pes, s)], ()) -- This works more generally for any "zippable", that is an -- Applicative that satisfies -- -- x == (,) <$> fmap fst x <*> fmap snd x -- -- However, I'm unaware of a typeclass for this.
437
runWriter (Writer (PM.PackMap f)) columns = outColumns where (outColumns, ()) = f extract (I.Identity columns) extract (pes, s) = ([(I.runIdentity pes, s)], ()) -- This works more generally for any "zippable", that is an -- Applicative that satisfies -- -- x == (,) <$> fmap fst x <*> fmap snd x -- -- However, I'm unaware of a typeclass for this.
361
false
true
0
10
84
126
70
56
null
null
elginer/Delve
src/Phases.hs
gpl-3.0
-- | Compile embedded haskell files -- Open the given files -- Parse each file into an sexpression -- Join the sexpressions -- Compile the code into a haskell file -- Write the haskell file to a temporary file -- Compile it with the virtual machine to create a virtual machine executable embedded :: String -> [ FilePath ] -> IO ExitCode embedded ghc_opts files = do fs <- C.mapM read_s files let sexp = parse_file_sexps files fs mname = "VirtualMachineExtension" VarApp vuniq vcore = compile $ NonVarApp 0 $ from_sexp sexp Resolved lcore syms = compile $ Unresolved vcore [ ] EmbedModule euniq m ec = compile $ EmbeddedHaskell vuniq mname lcore VMAST vmuniq haskell = compile $ EmbedCore euniq m ec tmp = mname L.++ ".hs" delve_interface = "edvm.dui" catch ( Prelude.writeFile tmp $ prettyPrint haskell ) ( const $ error $ "Error while writing temporary file '" L.++ tmp L.++ "'" ) ghc <- system $ "ghc --make edvm " L.++ ghc_opts -- This has a bit of duplication with the build system -- if this ever gets cabalized, that should sort the problem case ghc of ExitSuccess -> do -- The vm was created X.onException ( Z.writeFile delve_interface $ to_dui syms vmuniq ) ( error $ "Error while writing Delve Interface file '" L.++ delve_interface L.++ "'" ) _ -> return ( ) putStrLn "\nBuild complete. It's a good idea to move 'edvm.dui' (the VM interface file for the compiler ) into /etc/delve/, so the compiler can find it while compiling things. Otherwise, it will have to be in your PWD every time you want to compile!" return ghc -- Read a file, trigger error on failure
1,777
embedded :: String -> [ FilePath ] -> IO ExitCode embedded ghc_opts files = do fs <- C.mapM read_s files let sexp = parse_file_sexps files fs mname = "VirtualMachineExtension" VarApp vuniq vcore = compile $ NonVarApp 0 $ from_sexp sexp Resolved lcore syms = compile $ Unresolved vcore [ ] EmbedModule euniq m ec = compile $ EmbeddedHaskell vuniq mname lcore VMAST vmuniq haskell = compile $ EmbedCore euniq m ec tmp = mname L.++ ".hs" delve_interface = "edvm.dui" catch ( Prelude.writeFile tmp $ prettyPrint haskell ) ( const $ error $ "Error while writing temporary file '" L.++ tmp L.++ "'" ) ghc <- system $ "ghc --make edvm " L.++ ghc_opts -- This has a bit of duplication with the build system -- if this ever gets cabalized, that should sort the problem case ghc of ExitSuccess -> do -- The vm was created X.onException ( Z.writeFile delve_interface $ to_dui syms vmuniq ) ( error $ "Error while writing Delve Interface file '" L.++ delve_interface L.++ "'" ) _ -> return ( ) putStrLn "\nBuild complete. It's a good idea to move 'edvm.dui' (the VM interface file for the compiler ) into /etc/delve/, so the compiler can find it while compiling things. Otherwise, it will have to be in your PWD every time you want to compile!" return ghc -- Read a file, trigger error on failure
1,488
embedded ghc_opts files = do fs <- C.mapM read_s files let sexp = parse_file_sexps files fs mname = "VirtualMachineExtension" VarApp vuniq vcore = compile $ NonVarApp 0 $ from_sexp sexp Resolved lcore syms = compile $ Unresolved vcore [ ] EmbedModule euniq m ec = compile $ EmbeddedHaskell vuniq mname lcore VMAST vmuniq haskell = compile $ EmbedCore euniq m ec tmp = mname L.++ ".hs" delve_interface = "edvm.dui" catch ( Prelude.writeFile tmp $ prettyPrint haskell ) ( const $ error $ "Error while writing temporary file '" L.++ tmp L.++ "'" ) ghc <- system $ "ghc --make edvm " L.++ ghc_opts -- This has a bit of duplication with the build system -- if this ever gets cabalized, that should sort the problem case ghc of ExitSuccess -> do -- The vm was created X.onException ( Z.writeFile delve_interface $ to_dui syms vmuniq ) ( error $ "Error while writing Delve Interface file '" L.++ delve_interface L.++ "'" ) _ -> return ( ) putStrLn "\nBuild complete. It's a good idea to move 'edvm.dui' (the VM interface file for the compiler ) into /etc/delve/, so the compiler can find it while compiling things. Otherwise, it will have to be in your PWD every time you want to compile!" return ghc -- Read a file, trigger error on failure
1,438
true
true
0
16
485
327
158
169
null
null
facebookincubator/duckling
Duckling/Distance/EN/Corpus.hs
bsd-3-clause
allExamples :: [Example] allExamples = concat [ examples (simple Kilometre 3) [ "3 kilometers" , "3 km" , "3km" , "3k" , "3.0 km" ] , examples (simple Mile 8) [ "8 miles" , "eight mile" , "8 mi" ] , examples (simple M 9) [ "9m" ] , examples (simple Centimetre 2) [ "2cm" , "2 centimeters" ] , examples (simple Inch 5) [ "5 in" , "5''" , "five inches" , "5\"" ] , examples (simple Metre 1.87) [ "1.87 meters" ] -- Composite values: , examples (simple Inch 94) [ "7 feet and 10 inches" , "7 feet, 10 inches" , "7 feet 10 inches" ] , examples (simple Metre 2001) [ "2 km and 1 meter" , "2 kilometer, 1 metre" , "2 kilometer 1 metre" ] , examples (simple Inch 166) [ "2 yards 7 ft 10 inches" , "2 yds, 7 feet and 10 inches" , "2 yards, 7 feet, 10 in" ] , examples (simple Foot 13) [ "2 yards and 7 feet" , "2 yards, 7 feet" , "2 yd 7'" ] , examples (simple Centimetre 1000806) [ "10 kms 8 metres 6 cm" , "10 kms, 8 meters, 6 cm" , "10 kms, 8 meters and 6 centimeters" -- , "10 kms, 8 meters, and 6 cm" -- Oxford comma not supported ] , examples (simple Metre 1.3048) [ "1 meter and 1 foot" ] , examples (simple Kilometre 2.609344) [ "1 kilometer and 1 mile" ] , examples (simple M 3) -- The original, ambiguous "m" unit is preserved [ "3m" ] , examples (simple Centimetre 305) -- The ambiguous "m" unit is inferred as "meteres" [ "3m and 5cm" ] , examples (simple Foot 5281) -- The ambiguous "m" unit is inferred as "miles" [ "1m and 1ft" ] -- Ranges: , examples (between Kilometre (3, 5)) [ "between 3 and 5 kilometers" , "from 3km to 5km" , "around 3-5 kilometers" , "about 3km-5km" , "3-5 kilometers" ] , examples (under Mile 3.5) [ "under 3.5 miles" , "less than 3.5mi" , "lower than three point five miles" ] , examples (above Inch 5) [ "more than five inches" , "at least 5''" , "over 5\"" , "above 5 in" ] , examples (between Millimetre (5, 6)) [ "between 5 and six millimeters" , "between 5 and six millimetres" , "5-6 mm" ] ]
2,950
allExamples :: [Example] allExamples = concat [ examples (simple Kilometre 3) [ "3 kilometers" , "3 km" , "3km" , "3k" , "3.0 km" ] , examples (simple Mile 8) [ "8 miles" , "eight mile" , "8 mi" ] , examples (simple M 9) [ "9m" ] , examples (simple Centimetre 2) [ "2cm" , "2 centimeters" ] , examples (simple Inch 5) [ "5 in" , "5''" , "five inches" , "5\"" ] , examples (simple Metre 1.87) [ "1.87 meters" ] -- Composite values: , examples (simple Inch 94) [ "7 feet and 10 inches" , "7 feet, 10 inches" , "7 feet 10 inches" ] , examples (simple Metre 2001) [ "2 km and 1 meter" , "2 kilometer, 1 metre" , "2 kilometer 1 metre" ] , examples (simple Inch 166) [ "2 yards 7 ft 10 inches" , "2 yds, 7 feet and 10 inches" , "2 yards, 7 feet, 10 in" ] , examples (simple Foot 13) [ "2 yards and 7 feet" , "2 yards, 7 feet" , "2 yd 7'" ] , examples (simple Centimetre 1000806) [ "10 kms 8 metres 6 cm" , "10 kms, 8 meters, 6 cm" , "10 kms, 8 meters and 6 centimeters" -- , "10 kms, 8 meters, and 6 cm" -- Oxford comma not supported ] , examples (simple Metre 1.3048) [ "1 meter and 1 foot" ] , examples (simple Kilometre 2.609344) [ "1 kilometer and 1 mile" ] , examples (simple M 3) -- The original, ambiguous "m" unit is preserved [ "3m" ] , examples (simple Centimetre 305) -- The ambiguous "m" unit is inferred as "meteres" [ "3m and 5cm" ] , examples (simple Foot 5281) -- The ambiguous "m" unit is inferred as "miles" [ "1m and 1ft" ] -- Ranges: , examples (between Kilometre (3, 5)) [ "between 3 and 5 kilometers" , "from 3km to 5km" , "around 3-5 kilometers" , "about 3km-5km" , "3-5 kilometers" ] , examples (under Mile 3.5) [ "under 3.5 miles" , "less than 3.5mi" , "lower than three point five miles" ] , examples (above Inch 5) [ "more than five inches" , "at least 5''" , "over 5\"" , "above 5 in" ] , examples (between Millimetre (5, 6)) [ "between 5 and six millimeters" , "between 5 and six millimetres" , "5-6 mm" ] ]
2,950
allExamples = concat [ examples (simple Kilometre 3) [ "3 kilometers" , "3 km" , "3km" , "3k" , "3.0 km" ] , examples (simple Mile 8) [ "8 miles" , "eight mile" , "8 mi" ] , examples (simple M 9) [ "9m" ] , examples (simple Centimetre 2) [ "2cm" , "2 centimeters" ] , examples (simple Inch 5) [ "5 in" , "5''" , "five inches" , "5\"" ] , examples (simple Metre 1.87) [ "1.87 meters" ] -- Composite values: , examples (simple Inch 94) [ "7 feet and 10 inches" , "7 feet, 10 inches" , "7 feet 10 inches" ] , examples (simple Metre 2001) [ "2 km and 1 meter" , "2 kilometer, 1 metre" , "2 kilometer 1 metre" ] , examples (simple Inch 166) [ "2 yards 7 ft 10 inches" , "2 yds, 7 feet and 10 inches" , "2 yards, 7 feet, 10 in" ] , examples (simple Foot 13) [ "2 yards and 7 feet" , "2 yards, 7 feet" , "2 yd 7'" ] , examples (simple Centimetre 1000806) [ "10 kms 8 metres 6 cm" , "10 kms, 8 meters, 6 cm" , "10 kms, 8 meters and 6 centimeters" -- , "10 kms, 8 meters, and 6 cm" -- Oxford comma not supported ] , examples (simple Metre 1.3048) [ "1 meter and 1 foot" ] , examples (simple Kilometre 2.609344) [ "1 kilometer and 1 mile" ] , examples (simple M 3) -- The original, ambiguous "m" unit is preserved [ "3m" ] , examples (simple Centimetre 305) -- The ambiguous "m" unit is inferred as "meteres" [ "3m and 5cm" ] , examples (simple Foot 5281) -- The ambiguous "m" unit is inferred as "miles" [ "1m and 1ft" ] -- Ranges: , examples (between Kilometre (3, 5)) [ "between 3 and 5 kilometers" , "from 3km to 5km" , "around 3-5 kilometers" , "about 3km-5km" , "3-5 kilometers" ] , examples (under Mile 3.5) [ "under 3.5 miles" , "less than 3.5mi" , "lower than three point five miles" ] , examples (above Inch 5) [ "more than five inches" , "at least 5''" , "over 5\"" , "above 5 in" ] , examples (between Millimetre (5, 6)) [ "between 5 and six millimeters" , "between 5 and six millimetres" , "5-6 mm" ] ]
2,925
false
true
0
10
1,415
515
286
229
null
null
edwtjo/irc-colors
src/main/Data/Text/IRC/Color.hs
bsd-3-clause
black = MkColor "1"
19
black = MkColor "1"
19
black = MkColor "1"
19
false
false
0
5
3
9
4
5
null
null
holmisen/glbrix
src/ModelRender.hs
gpl-3.0
renderAxis :: GLdouble -> IO () renderAxis s = GL.renderPrimitive GL.Lines $ do GL.color (Color3 1 0 0 :: Color3 GLfloat) GL.vertex $ vertex3f 0 0 0 GL.vertex $ vertex3f s 0 0 GL.color (Color3 0 1 0 :: Color3 GLfloat) GL.vertex $ vertex3f 0 0 0 GL.vertex $ vertex3f 0 s 0 GL.color (Color3 0 0 1 :: Color3 GLfloat) GL.vertex $ vertex3f 0 0 0 GL.vertex $ vertex3f 0 0 s
407
renderAxis :: GLdouble -> IO () renderAxis s = GL.renderPrimitive GL.Lines $ do GL.color (Color3 1 0 0 :: Color3 GLfloat) GL.vertex $ vertex3f 0 0 0 GL.vertex $ vertex3f s 0 0 GL.color (Color3 0 1 0 :: Color3 GLfloat) GL.vertex $ vertex3f 0 0 0 GL.vertex $ vertex3f 0 s 0 GL.color (Color3 0 0 1 :: Color3 GLfloat) GL.vertex $ vertex3f 0 0 0 GL.vertex $ vertex3f 0 0 s
407
renderAxis s = GL.renderPrimitive GL.Lines $ do GL.color (Color3 1 0 0 :: Color3 GLfloat) GL.vertex $ vertex3f 0 0 0 GL.vertex $ vertex3f s 0 0 GL.color (Color3 0 1 0 :: Color3 GLfloat) GL.vertex $ vertex3f 0 0 0 GL.vertex $ vertex3f 0 s 0 GL.color (Color3 0 0 1 :: Color3 GLfloat) GL.vertex $ vertex3f 0 0 0 GL.vertex $ vertex3f 0 0 s
375
false
true
0
10
112
202
91
111
null
null
jmitchell/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
bcc i (MKCON l loc tag []) | tag < 256 = indent i ++ creg l ++ " = NULL_CON(" ++ show tag ++ ");\n"
103
bcc i (MKCON l loc tag []) | tag < 256 = indent i ++ creg l ++ " = NULL_CON(" ++ show tag ++ ");\n"
103
bcc i (MKCON l loc tag []) | tag < 256 = indent i ++ creg l ++ " = NULL_CON(" ++ show tag ++ ");\n"
103
false
false
0
10
29
60
27
33
null
null
brendanhay/gogol
gogol-cloudidentity/gen/Network/Google/Resource/CloudIdentity/Devices/DeviceUsers/ClientStates/Patch.hs
mpl-2.0
-- | Optional. Comma-separated list of fully qualified names of fields to be -- updated. If not specified, all updatable fields in ClientState are -- updated. dducspUpdateMask :: Lens' DevicesDeviceUsersClientStatesPatch (Maybe GFieldMask) dducspUpdateMask = lens _dducspUpdateMask (\ s a -> s{_dducspUpdateMask = a})
325
dducspUpdateMask :: Lens' DevicesDeviceUsersClientStatesPatch (Maybe GFieldMask) dducspUpdateMask = lens _dducspUpdateMask (\ s a -> s{_dducspUpdateMask = a})
166
dducspUpdateMask = lens _dducspUpdateMask (\ s a -> s{_dducspUpdateMask = a})
85
true
true
0
9
50
50
27
23
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F19.hs
bsd-3-clause
ptr_glPathParameterfNV :: FunPtr (GLuint -> GLenum -> GLfloat -> IO ()) ptr_glPathParameterfNV = unsafePerformIO $ getCommand "glPathParameterfNV"
146
ptr_glPathParameterfNV :: FunPtr (GLuint -> GLenum -> GLfloat -> IO ()) ptr_glPathParameterfNV = unsafePerformIO $ getCommand "glPathParameterfNV"
146
ptr_glPathParameterfNV = unsafePerformIO $ getCommand "glPathParameterfNV"
74
false
true
1
11
16
44
20
24
null
null
brendanhay/gogol
gogol-plus-domains/gen/Network/Google/PlusDomains/Types/Product.hs
mpl-2.0
-- | The original actor\'s name, which is suitable for display. aoaDisplayName :: Lens' ActivityObjectActor (Maybe Text) aoaDisplayName = lens _aoaDisplayName (\ s a -> s{_aoaDisplayName = a})
200
aoaDisplayName :: Lens' ActivityObjectActor (Maybe Text) aoaDisplayName = lens _aoaDisplayName (\ s a -> s{_aoaDisplayName = a})
136
aoaDisplayName = lens _aoaDisplayName (\ s a -> s{_aoaDisplayName = a})
79
true
true
0
9
35
48
25
23
null
null
jozefg/hasquito
src/Language/Hasquito/Closure.hs
mit
liftLam :: Exp -> WriterT [Def] CompilerM Exp liftLam (Num i) = return $ Num i
78
liftLam :: Exp -> WriterT [Def] CompilerM Exp liftLam (Num i) = return $ Num i
78
liftLam (Num i) = return $ Num i
32
false
true
2
9
15
47
21
26
null
null
jvilar/hrows
lib/Model/Expression/Parser.hs
gpl-2.0
parse :: Parser a -> Text -> Either Text a parse p = evalState (runExceptT p) . tokenize
88
parse :: Parser a -> Text -> Either Text a parse p = evalState (runExceptT p) . tokenize
88
parse p = evalState (runExceptT p) . tokenize
45
false
true
0
8
17
48
21
27
null
null
andyarvanitis/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
forgetEnv env (TType i) = RType
31
forgetEnv env (TType i) = RType
31
forgetEnv env (TType i) = RType
31
false
false
0
6
5
19
8
11
null
null
gcampax/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
hsExprNeedsParens (HsBracket {}) = False
45
hsExprNeedsParens (HsBracket {}) = False
45
hsExprNeedsParens (HsBracket {}) = False
45
false
false
0
7
9
16
8
8
null
null
ganeti/ganeti
test/hs/Test/Ganeti/JQScheduler.hs
bsd-2-clause
case_jobFiltering :: Assertion case_jobFiltering = do clusterName <- mkNonEmpty "cluster1" jid1 <- makeJobId 1 jid2 <- makeJobId 2 jid3 <- makeJobId 3 jid4 <- makeJobId 4 unsetPrio <- mkNonNegative 1234 uuid1 <- fmap UTF8.fromString newUUID let j1 = nullJobWithStat QueuedJob { qjId = jid1 , qjOps = [ QueuedOpCode { qoInput = ValidOpCode MetaOpCode { metaParams = CommonOpParams { opDryRun = Nothing , opDebugLevel = Nothing , opPriority = OpPrioHigh , opDepends = Just [] , opComment = Nothing , opReason = [("source1", "reason1", 1234)]} , metaOpCode = OpClusterRename { opName = clusterName } } , qoStatus = OP_STATUS_QUEUED , qoResult = JSNull , qoLog = [] , qoPriority = -1 , qoStartTimestamp = Nothing , qoExecTimestamp = Nothing , qoEndTimestamp = Nothing } ] , qjReceivedTimestamp = Nothing , qjStartTimestamp = Nothing , qjEndTimestamp = Nothing , qjLivelock = Nothing , qjProcessId = Nothing } j2 = j1 & jJobL . qjIdL .~ jid2 j3 = j1 & jJobL . qjIdL .~ jid3 j4 = j1 & jJobL . qjIdL .~ jid4 fr1 = FilterRule { frWatermark = jid1 , frPriority = unsetPrio , frPredicates = [FPJobId (EQFilter "id" (NumericValue 1))] , frAction = Reject , frReasonTrail = [] , frUuid = uuid1 } -- Gives the rule a new UUID. rule fr = do uuid <- fmap UTF8.fromString newUUID return fr{ frUuid = uuid } -- Helper to create filter chains: assigns the filters in the list -- increasing priorities, so that filters listed first are processed -- first. chain :: [FilterRule] -> Set FilterRule chain frs | any ((/= unsetPrio) . frPriority) frs = error "Filter was passed to `chain` that already had a priority." | otherwise = Set.fromList [ fr{ frPriority = prio } | (fr, Just prio) <- zip frs (map mkNonNegative [1..]) ] fr2 <- rule fr1{ frAction = Accept } fr3 <- rule fr1{ frAction = Pause } fr4 <- rule fr1{ frPredicates = [FPJobId (GTFilter "id" (QuotedString "watermark"))] } fr5 <- rule fr1{ frPredicates = [] } fr6 <- rule fr5{ frAction = Continue } fr7 <- rule fr6{ frAction = RateLimit 2 } fr8 <- rule fr4{ frAction = Continue, frWatermark = jid1 } fr9 <- rule fr8{ frAction = RateLimit 2 } assertEqual "j1 should be rejected (by fr1)" [] (jobFiltering (Queue [j1] [] []) (chain [fr1]) [j1]) assertEqual "j1 should be rejected (by fr1, it has priority)" [] (jobFiltering (Queue [j1] [] []) (chain [fr1, fr2]) [j1]) assertEqual "j1 should be accepted (by fr2, it has priority)" [j1] (jobFiltering (Queue [j1] [] []) (chain [fr2, fr1]) [j1]) assertEqual "j1 should be paused (by fr3)" [] (jobFiltering (Queue [j1] [] []) (chain [fr3]) [j1]) assertEqual "j2 should be rejected (over watermark1)" [j1] (jobFiltering (Queue [j1, j2] [] []) (chain [fr4]) [j1, j2]) assertEqual "all jobs should be rejected (since no predicates)" [] (jobFiltering (Queue [j1, j2] [] []) (chain [fr5]) [j1, j2]) assertEqual "j3 should be rate-limited" [j1, j2] (jobFiltering (Queue [j1, j2, j3] [] []) (chain [fr6, fr7]) [j1, j2, j3]) assertEqual "j4 should be rate-limited" -- j1 doesn't apply to fr8/fr9 (since they match only watermark > jid1) -- so j1 gets scheduled [j1, j2, j3] (jobFiltering (Queue [j1, j2, j3, j4] [] []) (chain [fr8, fr9]) [j1, j2, j3, j4]) -- | Tests the specified properties of `jobFiltering`, as defined in -- `doc/design-optables.rst`.
4,242
case_jobFiltering :: Assertion case_jobFiltering = do clusterName <- mkNonEmpty "cluster1" jid1 <- makeJobId 1 jid2 <- makeJobId 2 jid3 <- makeJobId 3 jid4 <- makeJobId 4 unsetPrio <- mkNonNegative 1234 uuid1 <- fmap UTF8.fromString newUUID let j1 = nullJobWithStat QueuedJob { qjId = jid1 , qjOps = [ QueuedOpCode { qoInput = ValidOpCode MetaOpCode { metaParams = CommonOpParams { opDryRun = Nothing , opDebugLevel = Nothing , opPriority = OpPrioHigh , opDepends = Just [] , opComment = Nothing , opReason = [("source1", "reason1", 1234)]} , metaOpCode = OpClusterRename { opName = clusterName } } , qoStatus = OP_STATUS_QUEUED , qoResult = JSNull , qoLog = [] , qoPriority = -1 , qoStartTimestamp = Nothing , qoExecTimestamp = Nothing , qoEndTimestamp = Nothing } ] , qjReceivedTimestamp = Nothing , qjStartTimestamp = Nothing , qjEndTimestamp = Nothing , qjLivelock = Nothing , qjProcessId = Nothing } j2 = j1 & jJobL . qjIdL .~ jid2 j3 = j1 & jJobL . qjIdL .~ jid3 j4 = j1 & jJobL . qjIdL .~ jid4 fr1 = FilterRule { frWatermark = jid1 , frPriority = unsetPrio , frPredicates = [FPJobId (EQFilter "id" (NumericValue 1))] , frAction = Reject , frReasonTrail = [] , frUuid = uuid1 } -- Gives the rule a new UUID. rule fr = do uuid <- fmap UTF8.fromString newUUID return fr{ frUuid = uuid } -- Helper to create filter chains: assigns the filters in the list -- increasing priorities, so that filters listed first are processed -- first. chain :: [FilterRule] -> Set FilterRule chain frs | any ((/= unsetPrio) . frPriority) frs = error "Filter was passed to `chain` that already had a priority." | otherwise = Set.fromList [ fr{ frPriority = prio } | (fr, Just prio) <- zip frs (map mkNonNegative [1..]) ] fr2 <- rule fr1{ frAction = Accept } fr3 <- rule fr1{ frAction = Pause } fr4 <- rule fr1{ frPredicates = [FPJobId (GTFilter "id" (QuotedString "watermark"))] } fr5 <- rule fr1{ frPredicates = [] } fr6 <- rule fr5{ frAction = Continue } fr7 <- rule fr6{ frAction = RateLimit 2 } fr8 <- rule fr4{ frAction = Continue, frWatermark = jid1 } fr9 <- rule fr8{ frAction = RateLimit 2 } assertEqual "j1 should be rejected (by fr1)" [] (jobFiltering (Queue [j1] [] []) (chain [fr1]) [j1]) assertEqual "j1 should be rejected (by fr1, it has priority)" [] (jobFiltering (Queue [j1] [] []) (chain [fr1, fr2]) [j1]) assertEqual "j1 should be accepted (by fr2, it has priority)" [j1] (jobFiltering (Queue [j1] [] []) (chain [fr2, fr1]) [j1]) assertEqual "j1 should be paused (by fr3)" [] (jobFiltering (Queue [j1] [] []) (chain [fr3]) [j1]) assertEqual "j2 should be rejected (over watermark1)" [j1] (jobFiltering (Queue [j1, j2] [] []) (chain [fr4]) [j1, j2]) assertEqual "all jobs should be rejected (since no predicates)" [] (jobFiltering (Queue [j1, j2] [] []) (chain [fr5]) [j1, j2]) assertEqual "j3 should be rate-limited" [j1, j2] (jobFiltering (Queue [j1, j2, j3] [] []) (chain [fr6, fr7]) [j1, j2, j3]) assertEqual "j4 should be rate-limited" -- j1 doesn't apply to fr8/fr9 (since they match only watermark > jid1) -- so j1 gets scheduled [j1, j2, j3] (jobFiltering (Queue [j1, j2, j3, j4] [] []) (chain [fr8, fr9]) [j1, j2, j3, j4]) -- | Tests the specified properties of `jobFiltering`, as defined in -- `doc/design-optables.rst`.
4,242
case_jobFiltering = do clusterName <- mkNonEmpty "cluster1" jid1 <- makeJobId 1 jid2 <- makeJobId 2 jid3 <- makeJobId 3 jid4 <- makeJobId 4 unsetPrio <- mkNonNegative 1234 uuid1 <- fmap UTF8.fromString newUUID let j1 = nullJobWithStat QueuedJob { qjId = jid1 , qjOps = [ QueuedOpCode { qoInput = ValidOpCode MetaOpCode { metaParams = CommonOpParams { opDryRun = Nothing , opDebugLevel = Nothing , opPriority = OpPrioHigh , opDepends = Just [] , opComment = Nothing , opReason = [("source1", "reason1", 1234)]} , metaOpCode = OpClusterRename { opName = clusterName } } , qoStatus = OP_STATUS_QUEUED , qoResult = JSNull , qoLog = [] , qoPriority = -1 , qoStartTimestamp = Nothing , qoExecTimestamp = Nothing , qoEndTimestamp = Nothing } ] , qjReceivedTimestamp = Nothing , qjStartTimestamp = Nothing , qjEndTimestamp = Nothing , qjLivelock = Nothing , qjProcessId = Nothing } j2 = j1 & jJobL . qjIdL .~ jid2 j3 = j1 & jJobL . qjIdL .~ jid3 j4 = j1 & jJobL . qjIdL .~ jid4 fr1 = FilterRule { frWatermark = jid1 , frPriority = unsetPrio , frPredicates = [FPJobId (EQFilter "id" (NumericValue 1))] , frAction = Reject , frReasonTrail = [] , frUuid = uuid1 } -- Gives the rule a new UUID. rule fr = do uuid <- fmap UTF8.fromString newUUID return fr{ frUuid = uuid } -- Helper to create filter chains: assigns the filters in the list -- increasing priorities, so that filters listed first are processed -- first. chain :: [FilterRule] -> Set FilterRule chain frs | any ((/= unsetPrio) . frPriority) frs = error "Filter was passed to `chain` that already had a priority." | otherwise = Set.fromList [ fr{ frPriority = prio } | (fr, Just prio) <- zip frs (map mkNonNegative [1..]) ] fr2 <- rule fr1{ frAction = Accept } fr3 <- rule fr1{ frAction = Pause } fr4 <- rule fr1{ frPredicates = [FPJobId (GTFilter "id" (QuotedString "watermark"))] } fr5 <- rule fr1{ frPredicates = [] } fr6 <- rule fr5{ frAction = Continue } fr7 <- rule fr6{ frAction = RateLimit 2 } fr8 <- rule fr4{ frAction = Continue, frWatermark = jid1 } fr9 <- rule fr8{ frAction = RateLimit 2 } assertEqual "j1 should be rejected (by fr1)" [] (jobFiltering (Queue [j1] [] []) (chain [fr1]) [j1]) assertEqual "j1 should be rejected (by fr1, it has priority)" [] (jobFiltering (Queue [j1] [] []) (chain [fr1, fr2]) [j1]) assertEqual "j1 should be accepted (by fr2, it has priority)" [j1] (jobFiltering (Queue [j1] [] []) (chain [fr2, fr1]) [j1]) assertEqual "j1 should be paused (by fr3)" [] (jobFiltering (Queue [j1] [] []) (chain [fr3]) [j1]) assertEqual "j2 should be rejected (over watermark1)" [j1] (jobFiltering (Queue [j1, j2] [] []) (chain [fr4]) [j1, j2]) assertEqual "all jobs should be rejected (since no predicates)" [] (jobFiltering (Queue [j1, j2] [] []) (chain [fr5]) [j1, j2]) assertEqual "j3 should be rate-limited" [j1, j2] (jobFiltering (Queue [j1, j2, j3] [] []) (chain [fr6, fr7]) [j1, j2, j3]) assertEqual "j4 should be rate-limited" -- j1 doesn't apply to fr8/fr9 (since they match only watermark > jid1) -- so j1 gets scheduled [j1, j2, j3] (jobFiltering (Queue [j1, j2, j3, j4] [] []) (chain [fr8, fr9]) [j1, j2, j3, j4]) -- | Tests the specified properties of `jobFiltering`, as defined in -- `doc/design-optables.rst`.
4,211
false
true
0
22
1,565
1,197
645
552
null
null
BartMassey/extensible-printf
Text/Printf/Extensible.hs
bsd-3-clause
getSpecs :: Bool -> Bool -> Maybe FormatSign -> Bool -> String -> [UPrintf] -> (FieldFormat, String, [UPrintf]) getSpecs _ z s a ('-' : cs0) us = getSpecs True z s a cs0 us
181
getSpecs :: Bool -> Bool -> Maybe FormatSign -> Bool -> String -> [UPrintf] -> (FieldFormat, String, [UPrintf]) getSpecs _ z s a ('-' : cs0) us = getSpecs True z s a cs0 us
181
getSpecs _ z s a ('-' : cs0) us = getSpecs True z s a cs0 us
60
false
true
0
14
43
93
46
47
null
null
mainland/dph
icebox/examples/barnesHut/BarnesHutPar.hs
bsd-3-clause
calcAccel ((centroids, segd) :trees) particles = closeAccel where closeAccel = splitApplyU particlesClose ((calcAccel trees) . sndU ) calcFarAccel (zipU (flattenSU $ replicateCU (lengthU particles) centroids) (flattenSU $ replicateSUP (lengthsToUSegd $ replicateUP (lengthU particles) (lengthU centroids)) particles)) particlesClose (((x1 :*: y1):*: _) :*: ((x2 :*: y2) :*: _)) = (x1-x2)^2 + (y1-y2)^2 < eClose
649
calcAccel ((centroids, segd) :trees) particles = closeAccel where closeAccel = splitApplyU particlesClose ((calcAccel trees) . sndU ) calcFarAccel (zipU (flattenSU $ replicateCU (lengthU particles) centroids) (flattenSU $ replicateSUP (lengthsToUSegd $ replicateUP (lengthU particles) (lengthU centroids)) particles)) particlesClose (((x1 :*: y1):*: _) :*: ((x2 :*: y2) :*: _)) = (x1-x2)^2 + (y1-y2)^2 < eClose
649
calcAccel ((centroids, segd) :trees) particles = closeAccel where closeAccel = splitApplyU particlesClose ((calcAccel trees) . sndU ) calcFarAccel (zipU (flattenSU $ replicateCU (lengthU particles) centroids) (flattenSU $ replicateSUP (lengthsToUSegd $ replicateUP (lengthU particles) (lengthU centroids)) particles)) particlesClose (((x1 :*: y1):*: _) :*: ((x2 :*: y2) :*: _)) = (x1-x2)^2 + (y1-y2)^2 < eClose
649
false
false
0
15
291
189
99
90
null
null
YueLiPicasso/unification
GenerateFOTE.hs
gpl-3.0
sizedTerm :: Int -> Gen Term sizedTerm n = do fname <- randomName 'f' vname <- randomName 'v' args <- sizedListOf sizedTerm (n - 1) let i = length args elements ([Constant fname, Variable vname] ++ if n < 2 then [] else [Function fname i args]) -- Given a size s, generates a list where the sizes of the elements sum to <= s
373
sizedTerm :: Int -> Gen Term sizedTerm n = do fname <- randomName 'f' vname <- randomName 'v' args <- sizedListOf sizedTerm (n - 1) let i = length args elements ([Constant fname, Variable vname] ++ if n < 2 then [] else [Function fname i args]) -- Given a size s, generates a list where the sizes of the elements sum to <= s
373
sizedTerm n = do fname <- randomName 'f' vname <- randomName 'v' args <- sizedListOf sizedTerm (n - 1) let i = length args elements ([Constant fname, Variable vname] ++ if n < 2 then [] else [Function fname i args]) -- Given a size s, generates a list where the sizes of the elements sum to <= s
344
false
true
0
12
113
122
58
64
null
null
propella/prolog
Prolog.hs
mit
nextLine (x:xs) = (x:ys, zs) where (ys, zs) = nextLine xs ---- Testing ---- -- | Test function -- -- >>> solveString "p:-q. q:-r. r." "?-p." -- > [[]] -- >>> solveString' "p(X):-q(X).q(a)." "?-p(X)." -- > ["X=X_1,X_1=a"]
226
nextLine (x:xs) = (x:ys, zs) where (ys, zs) = nextLine xs ---- Testing ---- -- | Test function -- -- >>> solveString "p:-q. q:-r. r." "?-p." -- > [[]] -- >>> solveString' "p(X):-q(X).q(a)." "?-p(X)." -- > ["X=X_1,X_1=a"]
226
nextLine (x:xs) = (x:ys, zs) where (ys, zs) = nextLine xs ---- Testing ---- -- | Test function -- -- >>> solveString "p:-q. q:-r. r." "?-p." -- > [[]] -- >>> solveString' "p(X):-q(X).q(a)." "?-p(X)." -- > ["X=X_1,X_1=a"]
226
false
false
0
7
42
50
30
20
null
null
corajr/shmonad
src/Control/Monad/Shmonad/Conditional.hs
bsd-2-clause
elseFi :: (Boolean b, CondCommand c) => c -> PartialCond b c -> Cond b c elseFi = flip ElseFi
93
elseFi :: (Boolean b, CondCommand c) => c -> PartialCond b c -> Cond b c elseFi = flip ElseFi
93
elseFi = flip ElseFi
20
false
true
0
9
19
53
24
29
null
null
stschiff/rarecoal-tools
src-groupFreqSum/groupFreqSum.hs
gpl-3.0
getGroupDefinitions :: Either [GroupInput] FilePath -> IO [(Text, [Text])] getGroupDefinitions groupInput = do groups <- case groupInput of Left directGroupInputs -> return [(n, s') | GroupInput n s' <- directGroupInputs] Right fp' -> parseGroupsFromFile fp' when (null groups) $ error "need at least one group definition to proceed" err . unsafeTextToLine $ format ("Using the following group definitions:"%w) groups return groups
463
getGroupDefinitions :: Either [GroupInput] FilePath -> IO [(Text, [Text])] getGroupDefinitions groupInput = do groups <- case groupInput of Left directGroupInputs -> return [(n, s') | GroupInput n s' <- directGroupInputs] Right fp' -> parseGroupsFromFile fp' when (null groups) $ error "need at least one group definition to proceed" err . unsafeTextToLine $ format ("Using the following group definitions:"%w) groups return groups
463
getGroupDefinitions groupInput = do groups <- case groupInput of Left directGroupInputs -> return [(n, s') | GroupInput n s' <- directGroupInputs] Right fp' -> parseGroupsFromFile fp' when (null groups) $ error "need at least one group definition to proceed" err . unsafeTextToLine $ format ("Using the following group definitions:"%w) groups return groups
388
false
true
0
15
92
146
70
76
null
null
brendanhay/gogol
gogol-drive/gen/Network/Google/Drive/Types/Product.hs
mpl-2.0
-- | The total usage across all services. asqUsage :: Lens' AboutStorageQuota (Maybe Int64) asqUsage = lens _asqUsage (\ s a -> s{_asqUsage = a}) . mapping _Coerce
171
asqUsage :: Lens' AboutStorageQuota (Maybe Int64) asqUsage = lens _asqUsage (\ s a -> s{_asqUsage = a}) . mapping _Coerce
129
asqUsage = lens _asqUsage (\ s a -> s{_asqUsage = a}) . mapping _Coerce
79
true
true
0
10
35
55
28
27
null
null
ellej/mire
test/Mire/Test/Autocomplete.hs
bsd-3-clause
addWordTest :: Assertion addWordTest = assertEqual "" (Just "sometest") (acNewText <$> tryAutocomplete (addAutocomplete simpleDb "sometest") "some" 4)
156
addWordTest :: Assertion addWordTest = assertEqual "" (Just "sometest") (acNewText <$> tryAutocomplete (addAutocomplete simpleDb "sometest") "some" 4)
156
addWordTest = assertEqual "" (Just "sometest") (acNewText <$> tryAutocomplete (addAutocomplete simpleDb "sometest") "some" 4)
131
false
true
0
9
22
48
23
25
null
null
fmapfmapfmap/amazonka
amazonka-rds/gen/Network/AWS/RDS/DescribeOptionGroups.hs
mpl-2.0
-- | The name of the option group to describe. Cannot be supplied together -- with EngineName or MajorEngineVersion. dogOptionGroupName :: Lens' DescribeOptionGroups (Maybe Text) dogOptionGroupName = lens _dogOptionGroupName (\ s a -> s{_dogOptionGroupName = a})
262
dogOptionGroupName :: Lens' DescribeOptionGroups (Maybe Text) dogOptionGroupName = lens _dogOptionGroupName (\ s a -> s{_dogOptionGroupName = a})
145
dogOptionGroupName = lens _dogOptionGroupName (\ s a -> s{_dogOptionGroupName = a})
83
true
true
0
9
35
47
26
21
null
null
hvr/lens
src/Control/Lens/Plated.hs
bsd-3-clause
-- | Given a 'Fold' that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself. -- -- @ -- 'universeOf' :: 'Fold' a a -> a -> [a] -- @ universeOf :: Getting [a] a a -> a -> [a] universeOf l = go where go a = a : foldMapOf l go a
288
universeOf :: Getting [a] a a -> a -> [a] universeOf l = go where go a = a : foldMapOf l go a
96
universeOf l = go where go a = a : foldMapOf l go a
54
true
true
0
8
64
61
33
28
null
null
sdiehl/ghc
compiler/GHC/Stg/Lift/Analysis.hs
bsd-3-clause
-- Note [When to lift] -- ~~~~~~~~~~~~~~~~~~~ -- $when -- The analysis proceeds in two steps: -- -- 1. It tags the syntax tree with analysis information in the form of -- 'BinderInfo' at each binder and 'Skeleton's at each let-binding -- by 'tagSkeletonTopBind' and friends. -- 2. The resulting syntax tree is treated by the "GHC.Stg.Lift" -- module, calling out to 'goodToLift' to decide if a binding is worthwhile -- to lift. -- 'goodToLift' consults argument occurrence information in 'BinderInfo' -- and estimates 'closureGrowth', for which it needs the 'Skeleton'. -- -- So the annotations from 'tagSkeletonTopBind' ultimately fuel 'goodToLift', -- which employs a number of heuristics to identify and exclude lambda lifting -- opportunities deemed non-beneficial: -- -- [Top-level bindings] can't be lifted. -- [Thunks] and data constructors shouldn't be lifted in order not to destroy -- sharing. -- [Argument occurrences] #arg_occs# of binders prohibit them to be lifted. -- Doing the lift would re-introduce the very allocation at call sites that -- we tried to get rid off in the first place. We capture analysis -- information in 'BinderInfo'. Note that we also consider a nullary -- application as argument occurrence, because it would turn into an n-ary -- partial application created by a generic apply function. This occurs in -- CPS-heavy code like the CS benchmark. -- [Join points] should not be lifted, simply because there's no reduction in -- allocation to be had. -- [Abstracting over join points] destroys join points, because they end up as -- arguments to the lifted function. -- [Abstracting over known local functions] turns a known call into an unknown -- call (e.g. some @stg_ap_*@), which is generally slower. Can be turned off -- with @-fstg-lift-lams-known@. -- [Calling convention] Don't lift when the resulting function would have a -- higher arity than available argument registers for the calling convention. -- Can be influenced with @-fstg-lift-(non)rec-args(-any)@. -- [Closure growth] introduced when former free variables have to be available -- at call sites may actually lead to an increase in overall allocations -- resulting from a lift. Estimating closure growth is described in -- "GHC.Stg.Lift.Analysis#clogro" and is what most of this module is ultimately -- concerned with. -- -- There's a <https://gitlab.haskell.org/ghc/ghc/wikis/late-lam-lift wiki page> with -- some more background and history. -- Note [Estimating closure growth] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- $clogro -- We estimate closure growth by abstracting the syntax tree into a 'Skeleton', -- capturing only syntactic details relevant to 'closureGrowth', such as -- -- * 'ClosureSk', representing closure allocation. -- * 'RhsSk', representing a RHS of a binding and how many times it's called -- by an appropriate 'DmdShell'. -- * 'AltSk', 'BothSk' and 'NilSk' for choice, sequence and empty element. -- -- This abstraction is mostly so that the main analysis function 'closureGrowth' -- can stay simple and focused. Also, skeletons tend to be much smaller than -- the syntax tree they abstract, so it makes sense to construct them once and -- and operate on them instead of the actual syntax tree. -- -- A more detailed treatment of computing closure growth, including examples, -- can be found in the paper referenced from the -- <https://gitlab.haskell.org/ghc/ghc/wikis/late-lam-lift wiki page>. llTrace :: String -> SDoc -> a -> a llTrace _ _ c = c
3,575
llTrace :: String -> SDoc -> a -> a llTrace _ _ c = c
53
llTrace _ _ c = c
17
true
true
0
9
642
101
81
20
null
null
olsner/ghc
compiler/iface/IfaceType.hs
bsd-3-clause
ppr_co ctxt_prec (IfaceUnivCo IfaceUnsafeCoerceProv r ty1 ty2) = maybeParen ctxt_prec TyConPrec $ text "UnsafeCo" <+> ppr r <+> pprParendIfaceType ty1 <+> pprParendIfaceType ty2
187
ppr_co ctxt_prec (IfaceUnivCo IfaceUnsafeCoerceProv r ty1 ty2) = maybeParen ctxt_prec TyConPrec $ text "UnsafeCo" <+> ppr r <+> pprParendIfaceType ty1 <+> pprParendIfaceType ty2
187
ppr_co ctxt_prec (IfaceUnivCo IfaceUnsafeCoerceProv r ty1 ty2) = maybeParen ctxt_prec TyConPrec $ text "UnsafeCo" <+> ppr r <+> pprParendIfaceType ty1 <+> pprParendIfaceType ty2
187
false
false
0
9
32
57
25
32
null
null
ktvoelker/helium
src/He/RefGraph.hs
gpl-3.0
addRef :: (Ord a) => a -> a -> RefGraph a -> RefGraph a addRef from to = (nodeLens from %~ (S.insert to <$>)) . addDef from
123
addRef :: (Ord a) => a -> a -> RefGraph a -> RefGraph a addRef from to = (nodeLens from %~ (S.insert to <$>)) . addDef from
123
addRef from to = (nodeLens from %~ (S.insert to <$>)) . addDef from
67
false
true
0
10
26
69
34
35
null
null
typedvar/hLand
hcore/NParser.hs
mit
pExpr2 = pThen assembleOp pExpr3 pExpr2c
40
pExpr2 = pThen assembleOp pExpr3 pExpr2c
40
pExpr2 = pThen assembleOp pExpr3 pExpr2c
40
false
false
0
5
5
13
6
7
null
null
danr/hipspec
tfp1/tests/SomePrelude.hs
gpl-3.0
takeWhile :: (a -> Bool) -> [a] -> [a] takeWhile p [] = []
82
takeWhile :: (a -> Bool) -> [a] -> [a] takeWhile p [] = []
82
takeWhile p [] = []
29
false
true
0
7
37
41
22
19
null
null
carlohamalainen/ghc-mod
Language/Haskell/GhcMod/Types.hs
bsd-3-clause
-- | A default 'Options'. defaultOptions :: Options defaultOptions = Options { outputStyle = PlainStyle , hlintOpts = [] , ghcOpts = [] , operators = False , detailed = False , qualified = False , lineSeparator = LineSeparator "\0" }
276
defaultOptions :: Options defaultOptions = Options { outputStyle = PlainStyle , hlintOpts = [] , ghcOpts = [] , operators = False , detailed = False , qualified = False , lineSeparator = LineSeparator "\0" }
250
defaultOptions = Options { outputStyle = PlainStyle , hlintOpts = [] , ghcOpts = [] , operators = False , detailed = False , qualified = False , lineSeparator = LineSeparator "\0" }
224
true
true
0
7
83
63
39
24
null
null
d0/dotfiles
.xmonad/xmonad.hs
gpl-3.0
-- Whether focus follows the mouse pointer myFocusFollowsMouse :: Bool myFocusFollowsMouse = True
97
myFocusFollowsMouse :: Bool myFocusFollowsMouse = True
54
myFocusFollowsMouse = True
26
true
true
0
6
12
19
8
11
null
null
mcmaniac/ghc
compiler/cmm/CmmType.hs
bsd-3-clause
widthInLog W16 = 1
19
widthInLog W16 = 1
19
widthInLog W16 = 1
19
false
false
1
5
4
13
4
9
null
null
slcz/gomoku
src/Ai.hs
apache-2.0
aiMove :: Float -> StateT AiState IO Pos aiMove epsilon = do AiState dimension@(dx,dy) win (black, white) slot scans featuremap parameters first _ _ <- get if (not first) || (not $ null black) then do rdm <- if epsilon >= 0.000001 then liftIO $ randomRIO (0, floor (1 / epsilon) :: Int) else return 0 if rdm == 1 then do size <- liftIO $ randomRIO (0, length slot - 1) return (setToList slot !! size) else do let ext = extractFeatures featuremap scans white win bestMoves <- return $ evaluate ext parameters black dimension slot randCandidate <- liftIO $ randomRIO (0, length bestMoves - 1) return $ fst $ fromJust $ index bestMoves randCandidate else return (dx `div` 2, dy `div` 2)
927
aiMove :: Float -> StateT AiState IO Pos aiMove epsilon = do AiState dimension@(dx,dy) win (black, white) slot scans featuremap parameters first _ _ <- get if (not first) || (not $ null black) then do rdm <- if epsilon >= 0.000001 then liftIO $ randomRIO (0, floor (1 / epsilon) :: Int) else return 0 if rdm == 1 then do size <- liftIO $ randomRIO (0, length slot - 1) return (setToList slot !! size) else do let ext = extractFeatures featuremap scans white win bestMoves <- return $ evaluate ext parameters black dimension slot randCandidate <- liftIO $ randomRIO (0, length bestMoves - 1) return $ fst $ fromJust $ index bestMoves randCandidate else return (dx `div` 2, dy `div` 2)
927
aiMove epsilon = do AiState dimension@(dx,dy) win (black, white) slot scans featuremap parameters first _ _ <- get if (not first) || (not $ null black) then do rdm <- if epsilon >= 0.000001 then liftIO $ randomRIO (0, floor (1 / epsilon) :: Int) else return 0 if rdm == 1 then do size <- liftIO $ randomRIO (0, length slot - 1) return (setToList slot !! size) else do let ext = extractFeatures featuremap scans white win bestMoves <- return $ evaluate ext parameters black dimension slot randCandidate <- liftIO $ randomRIO (0, length bestMoves - 1) return $ fst $ fromJust $ index bestMoves randCandidate else return (dx `div` 2, dy `div` 2)
886
false
true
0
19
367
318
158
160
null
null
facebookincubator/duckling
Duckling/Rules/ES.hs
bsd-3-clause
langRules (Seal RegexMatch) = []
32
langRules (Seal RegexMatch) = []
32
langRules (Seal RegexMatch) = []
32
false
false
0
6
4
18
8
10
null
null
draperlaboratory/specgen
src/Language/CSPM/SpecGen/UML2CSP.hs
bsd-3-clause
eventExp :: Event -> Id -> Exp eventExp ev i | isNamed ev = EId i -- i is Id for named Event | otherwise = EDot (EId $ Fixed "Completed") [EId i]
193
eventExp :: Event -> Id -> Exp eventExp ev i | isNamed ev = EId i -- i is Id for named Event | otherwise = EDot (EId $ Fixed "Completed") [EId i]
193
eventExp ev i | isNamed ev = EId i -- i is Id for named Event | otherwise = EDot (EId $ Fixed "Completed") [EId i]
162
false
true
0
9
80
67
31
36
null
null
Saulzar/reflex
src/Reflex/Patch/DMapWithMove.hs
bsd-3-clause
swapDMapKey :: GCompare k => k a -> k a -> PatchDMapWithMove k v swapDMapKey src dst = case src `geq` dst of Nothing -> PatchDMapWithMove $ DMap.fromList [ dst :=> NodeInfo (From_Move src) (ComposeMaybe $ Just src) , src :=> NodeInfo (From_Move dst) (ComposeMaybe $ Just dst) ] Just _ -> mempty -- |Make a @'PatchDMapWithMove' k v@ which has the effect of deleting a key in the mapping, equivalent to 'DMap.delete'.
432
swapDMapKey :: GCompare k => k a -> k a -> PatchDMapWithMove k v swapDMapKey src dst = case src `geq` dst of Nothing -> PatchDMapWithMove $ DMap.fromList [ dst :=> NodeInfo (From_Move src) (ComposeMaybe $ Just src) , src :=> NodeInfo (From_Move dst) (ComposeMaybe $ Just dst) ] Just _ -> mempty -- |Make a @'PatchDMapWithMove' k v@ which has the effect of deleting a key in the mapping, equivalent to 'DMap.delete'.
432
swapDMapKey src dst = case src `geq` dst of Nothing -> PatchDMapWithMove $ DMap.fromList [ dst :=> NodeInfo (From_Move src) (ComposeMaybe $ Just src) , src :=> NodeInfo (From_Move dst) (ComposeMaybe $ Just dst) ] Just _ -> mempty -- |Make a @'PatchDMapWithMove' k v@ which has the effect of deleting a key in the mapping, equivalent to 'DMap.delete'.
367
false
true
0
15
89
133
65
68
null
null
olorin/amazonka
amazonka-autoscaling/test/Test/AWS/Gen/AutoScaling.hs
mpl-2.0
testCreateAutoScalingGroup :: CreateAutoScalingGroup -> TestTree testCreateAutoScalingGroup = req "CreateAutoScalingGroup" "fixture/CreateAutoScalingGroup.yaml"
168
testCreateAutoScalingGroup :: CreateAutoScalingGroup -> TestTree testCreateAutoScalingGroup = req "CreateAutoScalingGroup" "fixture/CreateAutoScalingGroup.yaml"
168
testCreateAutoScalingGroup = req "CreateAutoScalingGroup" "fixture/CreateAutoScalingGroup.yaml"
103
false
true
0
5
17
21
10
11
null
null
rubilnikas/haskell2
src/Resolver/MoveResolver.hs
bsd-3-clause
getEmptyBoard:: [Move] getEmptyBoard = [Move x y Nothing 0 | x <- [0 .. 2], y <- [0 .. 2]]
90
getEmptyBoard:: [Move] getEmptyBoard = [Move x y Nothing 0 | x <- [0 .. 2], y <- [0 .. 2]]
90
getEmptyBoard = [Move x y Nothing 0 | x <- [0 .. 2], y <- [0 .. 2]]
67
false
true
0
8
19
54
30
24
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x1F60' = "\x03C9\x0313"
39
decomposeChar '\x1F60' = "\x03C9\x0313"
39
decomposeChar '\x1F60' = "\x03C9\x0313"
39
false
false
0
5
3
9
4
5
null
null
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/RegionBackendServices/List.hs
mpl-2.0
-- | Opt-in for partial success behavior which provides partial results in -- case of failure. The default value is false. rbslReturnPartialSuccess :: Lens' RegionBackendServicesList (Maybe Bool) rbslReturnPartialSuccess = lens _rbslReturnPartialSuccess (\ s a -> s{_rbslReturnPartialSuccess = a})
305
rbslReturnPartialSuccess :: Lens' RegionBackendServicesList (Maybe Bool) rbslReturnPartialSuccess = lens _rbslReturnPartialSuccess (\ s a -> s{_rbslReturnPartialSuccess = a})
182
rbslReturnPartialSuccess = lens _rbslReturnPartialSuccess (\ s a -> s{_rbslReturnPartialSuccess = a})
109
true
true
0
9
45
49
26
23
null
null
tidalcycles/Tidal
src/Sound/Tidal/UI.hs
gpl-3.0
{- | The 'spread' function allows you to take a pattern transformation which takes a parameter, such as `slow`, and provide several parameters which are switched between. In other words it 'spreads' a function across several values. Taking a simple high hat loop as an example: @ d1 $ sound "ho ho:2 ho:3 hc" @ We can slow it down by different amounts, such as by a half: @ d1 $ slow 2 $ sound "ho ho:2 ho:3 hc" @ Or by four thirds (i.e. speeding it up by a third; `4%3` means four over three): @ d1 $ slow (4%3) $ sound "ho ho:2 ho:3 hc" @ But if we use `spread`, we can make a pattern which alternates between the two speeds: @ d1 $ spread slow [2,4%3] $ sound "ho ho:2 ho:3 hc" @ Note that if you pass ($) as the function to spread values over, you can put functions as the list of values. For example: @ d1 $ spread ($) [density 2, rev, slow 2, striate 3, (# speed "0.8")] $ sound "[bd*2 [~ bd]] [sn future]*2 cp jvbass*4" @ Above, the pattern will have these transforms applied to it, one at a time, per cycle: * cycle 1: `density 2` - pattern will increase in speed * cycle 2: `rev` - pattern will be reversed * cycle 3: `slow 2` - pattern will decrease in speed * cycle 4: `striate 3` - pattern will be granualized * cycle 5: `(# speed "0.8")` - pattern samples will be played back more slowly After `(# speed "0.8")`, the transforms will repeat and start at `density 2` again. -} spread :: (a -> t -> Pattern b) -> [a] -> t -> Pattern b spread f xs p = slowcat $ map (`f` p) xs
1,502
spread :: (a -> t -> Pattern b) -> [a] -> t -> Pattern b spread f xs p = slowcat $ map (`f` p) xs
97
spread f xs p = slowcat $ map (`f` p) xs
40
true
true
0
9
315
70
36
34
null
null
np/boolexpr
Data/BoolExpr.hs
bsd-3-clause
-- | Reduce a boolean expression in conjunctive normal form to a single -- boolean. reduceCNF :: CNF Bool -> Bool reduceCNF = runEvalId . fromCNF
145
reduceCNF :: CNF Bool -> Bool reduceCNF = runEvalId . fromCNF
61
reduceCNF = runEvalId . fromCNF
31
true
true
1
7
25
32
14
18
null
null
crclark/functional-pearls
src/Weave/Section4.hs
bsd-3-clause
topNaive :: DumbLang -> Loc DumbLang topNaive t = r where r = At t (weaveNaive r t) r r r --Can this be made without relying on Eq?
132
topNaive :: DumbLang -> Loc DumbLang topNaive t = r where r = At t (weaveNaive r t) r r r --Can this be made without relying on Eq?
132
topNaive t = r where r = At t (weaveNaive r t) r r r --Can this be made without relying on Eq?
95
false
true
0
9
29
48
24
24
null
null
Rotaerk/iircc
src/common/Network/IIRCC.hs
bsd-3-clause
encodeSessionEventData :: SessionEvent -> Encoding encodeSessionEventData = \case Connecting :=> Identity v -> encode v Connected :=> Identity v -> encode v FailedToConnect :=> Identity v -> encode v --FromChannel :=> Identity v -> encode v ReceivedUninterpretedMessage :=> Identity v -> encode v SessionUnableTo :=> Identity v -> encode v SentQuit :=> Identity v -> encode v EndedConnection :=> Identity v -> encode v LostConnection :=> Identity v -> encode v EndedSession :=> Identity v -> encode v
520
encodeSessionEventData :: SessionEvent -> Encoding encodeSessionEventData = \case Connecting :=> Identity v -> encode v Connected :=> Identity v -> encode v FailedToConnect :=> Identity v -> encode v --FromChannel :=> Identity v -> encode v ReceivedUninterpretedMessage :=> Identity v -> encode v SessionUnableTo :=> Identity v -> encode v SentQuit :=> Identity v -> encode v EndedConnection :=> Identity v -> encode v LostConnection :=> Identity v -> encode v EndedSession :=> Identity v -> encode v
520
encodeSessionEventData = \case Connecting :=> Identity v -> encode v Connected :=> Identity v -> encode v FailedToConnect :=> Identity v -> encode v --FromChannel :=> Identity v -> encode v ReceivedUninterpretedMessage :=> Identity v -> encode v SessionUnableTo :=> Identity v -> encode v SentQuit :=> Identity v -> encode v EndedConnection :=> Identity v -> encode v LostConnection :=> Identity v -> encode v EndedSession :=> Identity v -> encode v
469
false
true
10
7
97
146
73
73
null
null
siddhanathan/jianpu
change.hs
gpl-3.0
main = do putStrLn $ "Run successful"
39
main = do putStrLn $ "Run successful"
39
main = do putStrLn $ "Run successful"
39
false
false
0
7
8
13
6
7
null
null
markuspf/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v LSystemInfo [x] = v ++ "idris_systemInfo(vm, " ++ creg x ++ ")"
70
doOp v LSystemInfo [x] = v ++ "idris_systemInfo(vm, " ++ creg x ++ ")"
70
doOp v LSystemInfo [x] = v ++ "idris_systemInfo(vm, " ++ creg x ++ ")"
70
false
false
0
7
13
34
15
19
null
null
sdiehl/ghc
libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
bsd-3-clause
sourceNoUnpack = pure SourceNoUnpack
42
sourceNoUnpack = pure SourceNoUnpack
42
sourceNoUnpack = pure SourceNoUnpack
42
false
false
0
5
9
9
4
5
null
null
ahri/bombastic-hs
src/Bombastic.hs
bsd-3-clause
charToTile ' ' = Just EmptyTile
31
charToTile ' ' = Just EmptyTile
31
charToTile ' ' = Just EmptyTile
31
false
false
0
5
5
12
5
7
null
null
Kyly/liquidhaskell
tests/test.hs
bsd-3-clause
knownToFail CVC4 = [ "tests/pos/linspace.hs", "tests/pos/RealProps.hs", "tests/pos/RealProps1.hs", "tests/pos/initarray.hs" , "tests/pos/maps.hs", "tests/pos/maps1.hs", "tests/neg/maps.hs" , "tests/pos/Product.hs" ]
253
knownToFail CVC4 = [ "tests/pos/linspace.hs", "tests/pos/RealProps.hs", "tests/pos/RealProps1.hs", "tests/pos/initarray.hs" , "tests/pos/maps.hs", "tests/pos/maps1.hs", "tests/neg/maps.hs" , "tests/pos/Product.hs" ]
253
knownToFail CVC4 = [ "tests/pos/linspace.hs", "tests/pos/RealProps.hs", "tests/pos/RealProps1.hs", "tests/pos/initarray.hs" , "tests/pos/maps.hs", "tests/pos/maps1.hs", "tests/neg/maps.hs" , "tests/pos/Product.hs" ]
253
false
false
1
5
52
36
20
16
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x0178' = "\x0059\x0308"
39
decomposeChar '\x0178' = "\x0059\x0308"
39
decomposeChar '\x0178' = "\x0059\x0308"
39
false
false
0
5
3
9
4
5
null
null
loadimpact/http2-test
hs-src/Rede/Research/ResearchWorker.hs
bsd-3-clause
spawnHarServer :: FilePath -> Chan ResolveCenter -> Chan FinishRequest -> IO () spawnHarServer mimic_dir resolve_center_chan finish_request_chan = do let mimic_config_dir = configDir mimic_dir port <- getMimicPort infoM "ResearchWorker.SpawnHarServer" $ ".. Mimic port: " ++ (show port) iface <- getInterfaceName mimic_config_dir infoM "ResearchWorker.SpawnHarServer" $ ".. Mimic using interface: " ++ (show iface) finish_request_mvar <- newEmptyMVar let watcher = do r <- readChan finish_request_chan infoM "ResearchWorker.SpawnHarServer" $ " .. Finishing mimic service " putMVar finish_request_mvar r watcher forkIO watcher let serveWork = do resolve_center <- readChan resolve_center_chan infoM "ResearchWorker.SpawnHarServer" $ printf ".. START for resolve center %s" (resolve_center ^. rcName) let har_filename = unpack $ resolve_center ^. rcName priv_key_filename = privKeyFilename mimic_dir har_filename cert_filename = certificateFilename mimic_dir har_filename host_list = resolve_center ^. allSeenHosts infoM "ResearchWorker.SpawnHarServer" $ ".. .. about to create comprhensive certificate for " ++ har_filename getComprehensiveCertificate mimic_dir har_filename host_list infoM "ResearchWorker.SpawnHarServer" $ ".. .. .. Chosen cert. at file: " ++ (show cert_filename) infoM "ResearchWorker.SpawnHarServer" $ ".. .. .. .. with private key: " ++ (show priv_key_filename) infoM "ResearchWorker.SpawnHarServer" $ ".. Starting mimic server" let http2worker = harCoherentWorker resolve_center tlsServeWithALPNAndFinishOnRequest cert_filename priv_key_filename iface [ -- ("h2-14", wrapSession veryBasic) ("h2-14", http2Attendant http2worker) -- TODO: Let the user select HTTP/1.1 from time to time... ] port finish_request_mvar -- infoM "ResearchWorker.SpawnHarServer" $ printf ".. FINISH for resolve center %s" (resolve_center ^. rcName) serveWork serveWork
2,321
spawnHarServer :: FilePath -> Chan ResolveCenter -> Chan FinishRequest -> IO () spawnHarServer mimic_dir resolve_center_chan finish_request_chan = do let mimic_config_dir = configDir mimic_dir port <- getMimicPort infoM "ResearchWorker.SpawnHarServer" $ ".. Mimic port: " ++ (show port) iface <- getInterfaceName mimic_config_dir infoM "ResearchWorker.SpawnHarServer" $ ".. Mimic using interface: " ++ (show iface) finish_request_mvar <- newEmptyMVar let watcher = do r <- readChan finish_request_chan infoM "ResearchWorker.SpawnHarServer" $ " .. Finishing mimic service " putMVar finish_request_mvar r watcher forkIO watcher let serveWork = do resolve_center <- readChan resolve_center_chan infoM "ResearchWorker.SpawnHarServer" $ printf ".. START for resolve center %s" (resolve_center ^. rcName) let har_filename = unpack $ resolve_center ^. rcName priv_key_filename = privKeyFilename mimic_dir har_filename cert_filename = certificateFilename mimic_dir har_filename host_list = resolve_center ^. allSeenHosts infoM "ResearchWorker.SpawnHarServer" $ ".. .. about to create comprhensive certificate for " ++ har_filename getComprehensiveCertificate mimic_dir har_filename host_list infoM "ResearchWorker.SpawnHarServer" $ ".. .. .. Chosen cert. at file: " ++ (show cert_filename) infoM "ResearchWorker.SpawnHarServer" $ ".. .. .. .. with private key: " ++ (show priv_key_filename) infoM "ResearchWorker.SpawnHarServer" $ ".. Starting mimic server" let http2worker = harCoherentWorker resolve_center tlsServeWithALPNAndFinishOnRequest cert_filename priv_key_filename iface [ -- ("h2-14", wrapSession veryBasic) ("h2-14", http2Attendant http2worker) -- TODO: Let the user select HTTP/1.1 from time to time... ] port finish_request_mvar -- infoM "ResearchWorker.SpawnHarServer" $ printf ".. FINISH for resolve center %s" (resolve_center ^. rcName) serveWork serveWork
2,321
spawnHarServer mimic_dir resolve_center_chan finish_request_chan = do let mimic_config_dir = configDir mimic_dir port <- getMimicPort infoM "ResearchWorker.SpawnHarServer" $ ".. Mimic port: " ++ (show port) iface <- getInterfaceName mimic_config_dir infoM "ResearchWorker.SpawnHarServer" $ ".. Mimic using interface: " ++ (show iface) finish_request_mvar <- newEmptyMVar let watcher = do r <- readChan finish_request_chan infoM "ResearchWorker.SpawnHarServer" $ " .. Finishing mimic service " putMVar finish_request_mvar r watcher forkIO watcher let serveWork = do resolve_center <- readChan resolve_center_chan infoM "ResearchWorker.SpawnHarServer" $ printf ".. START for resolve center %s" (resolve_center ^. rcName) let har_filename = unpack $ resolve_center ^. rcName priv_key_filename = privKeyFilename mimic_dir har_filename cert_filename = certificateFilename mimic_dir har_filename host_list = resolve_center ^. allSeenHosts infoM "ResearchWorker.SpawnHarServer" $ ".. .. about to create comprhensive certificate for " ++ har_filename getComprehensiveCertificate mimic_dir har_filename host_list infoM "ResearchWorker.SpawnHarServer" $ ".. .. .. Chosen cert. at file: " ++ (show cert_filename) infoM "ResearchWorker.SpawnHarServer" $ ".. .. .. .. with private key: " ++ (show priv_key_filename) infoM "ResearchWorker.SpawnHarServer" $ ".. Starting mimic server" let http2worker = harCoherentWorker resolve_center tlsServeWithALPNAndFinishOnRequest cert_filename priv_key_filename iface [ -- ("h2-14", wrapSession veryBasic) ("h2-14", http2Attendant http2worker) -- TODO: Let the user select HTTP/1.1 from time to time... ] port finish_request_mvar -- infoM "ResearchWorker.SpawnHarServer" $ printf ".. FINISH for resolve center %s" (resolve_center ^. rcName) serveWork serveWork
2,240
false
true
0
16
675
395
177
218
null
null
green-haskell/ghc
libraries/base/Data/OldList.hs
bsd-3-clause
genericSplitAt _ [] = ([],[])
34
genericSplitAt _ [] = ([],[])
34
genericSplitAt _ [] = ([],[])
34
false
false
0
6
9
23
12
11
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/utils/Bag.hs
bsd-3-clause
partitionBag :: (a -> Bool) -> Bag a -> (Bag a {- Satisfy predictate -}, Bag a {- Don't -}) partitionBag _ EmptyBag = (EmptyBag, EmptyBag)
182
partitionBag :: (a -> Bool) -> Bag a -> (Bag a {- Satisfy predictate -}, Bag a {- Don't -}) partitionBag _ EmptyBag = (EmptyBag, EmptyBag)
182
partitionBag _ EmptyBag = (EmptyBag, EmptyBag)
49
false
true
0
10
69
60
30
30
null
null
JacquesCarette/literate-scientific-software
code/drasil-code/Language/Drasil/Code/ExternalLibrary.hs
bsd-2-clause
implementation :: String -> [MethodInfo] -> ClassInfo implementation = Implements
81
implementation :: String -> [MethodInfo] -> ClassInfo implementation = Implements
81
implementation = Implements
27
false
true
0
7
9
22
12
10
null
null
rueshyna/gogol
gogol-games/gen/Network/Google/Games/Types/Product.hs
mpl-2.0
-- | The numerical value for this player score. psScore :: Lens' PlayerScore (Maybe Int64) psScore = lens _psScore (\ s a -> s{_psScore = a}) . mapping _Coerce
167
psScore :: Lens' PlayerScore (Maybe Int64) psScore = lens _psScore (\ s a -> s{_psScore = a}) . mapping _Coerce
119
psScore = lens _psScore (\ s a -> s{_psScore = a}) . mapping _Coerce
76
true
true
0
10
36
55
28
27
null
null
tcoenraad/functioneel-programmeren
2012/opg2c.hs
mit
toNF :: ExprA -> ExprA toNF (OpA Add (OpA Add expr1 expr2) (expr3)) = OpA Add (toNF expr1) (OpA Add (toNF expr2) (toNF expr3))
126
toNF :: ExprA -> ExprA toNF (OpA Add (OpA Add expr1 expr2) (expr3)) = OpA Add (toNF expr1) (OpA Add (toNF expr2) (toNF expr3))
126
toNF (OpA Add (OpA Add expr1 expr2) (expr3)) = OpA Add (toNF expr1) (OpA Add (toNF expr2) (toNF expr3))
103
false
true
0
9
23
80
39
41
null
null
akru/haste-compiler
libraries/haste-lib/src/Haste/DOM.hs
bsd-3-clause
-- | Get a property of an element. getProp :: (IsElem e, MonadIO m) => e -> PropID -> m String getProp e prop = J.getProp e (toJSStr prop) >>= return . fromJSStr
161
getProp :: (IsElem e, MonadIO m) => e -> PropID -> m String getProp e prop = J.getProp e (toJSStr prop) >>= return . fromJSStr
126
getProp e prop = J.getProp e (toJSStr prop) >>= return . fromJSStr
66
true
true
2
9
32
71
34
37
null
null
kmilner/tamarin-prover
lib/term/src/Term/Builtin/Convenience.hs
gpl-3.0
p4 = pubTerm "p4"
18
p4 = pubTerm "p4"
18
p4 = pubTerm "p4"
18
false
false
1
5
4
12
4
8
null
null
tphyahoo/haskoin
haskoin-wallet/Network/Haskoin/Wallet/Server/Handler.hs
unlicense
postTxsR :: ( MonadLogger m, MonadBaseControl IO m, MonadBase IO m , MonadIO m, MonadThrow m, MonadResource m ) => KeyRingName -> AccountName -> TxAction -> Handler m (Maybe Value) postTxsR keyRingName name action = do (keyRing, accE@(Entity ai acc), height) <- runDB $ do (keyRing, accE) <- getAccount keyRingName name (_, height) <- getBestBlock return (keyRing, accE, height) (txRes, newAddrs) <- case action of CreateTx rs fee minconf rcptFee sign -> do $(logInfo) $ format $ unlines [ "PostTxsR CreateTx" , " KeyRing name: " ++ unpack keyRingName , " Account name: " ++ unpack name , " Recipients : " ++ show (map (first addrToBase58) rs) , " Fee : " ++ show fee , " Minconf : " ++ show minconf , " Rcpt. Fee : " ++ show rcptFee , " Sign : " ++ show sign ] runDB $ createTx keyRing accE rs fee minconf rcptFee sign ImportTx tx -> do $(logInfo) $ format $ unlines [ "PostTxsR ImportTx" , " KeyRing name: " ++ unpack keyRingName , " Account name: " ++ unpack name , " Txid : " ++ cs (txHashToHex (txHash tx)) ] runDB $ do (res, newAddrs) <- importTx tx ai case filter ((== ai) . keyRingTxAccount) res of (txRes:_) -> return (txRes, newAddrs) _ -> liftIO . throwIO $ WalletException "Could not import the transaction" SignTx txid -> do $(logInfo) $ format $ unlines [ "PostTxsR SignTx" , " KeyRing name: " ++ unpack keyRingName , " Account name: " ++ unpack name , " Txid : " ++ cs (txHashToHex txid) ] runDB $ do (res, newAddrs) <- signKeyRingTx keyRing accE txid case filter ((== ai) . keyRingTxAccount) res of (txRes:_) -> return (txRes, newAddrs) _ -> liftIO . throwIO $ WalletException "Could not import the transaction" whenOnline $ do -- Update the bloom filter unless (null newAddrs) updateNodeFilter -- If the transaction is pending, broadcast it to the network when (keyRingTxConfidence txRes == TxPending) $ runNode $ broadcastTxs [keyRingTxHash txRes] return $ Just $ toJSON JsonWithAccount { withAccountKeyRing = toJsonKeyRing keyRing Nothing Nothing , withAccountAccount = toJsonAccount acc , withAccountData = toJsonTx txRes (Just height) }
2,851
postTxsR :: ( MonadLogger m, MonadBaseControl IO m, MonadBase IO m , MonadIO m, MonadThrow m, MonadResource m ) => KeyRingName -> AccountName -> TxAction -> Handler m (Maybe Value) postTxsR keyRingName name action = do (keyRing, accE@(Entity ai acc), height) <- runDB $ do (keyRing, accE) <- getAccount keyRingName name (_, height) <- getBestBlock return (keyRing, accE, height) (txRes, newAddrs) <- case action of CreateTx rs fee minconf rcptFee sign -> do $(logInfo) $ format $ unlines [ "PostTxsR CreateTx" , " KeyRing name: " ++ unpack keyRingName , " Account name: " ++ unpack name , " Recipients : " ++ show (map (first addrToBase58) rs) , " Fee : " ++ show fee , " Minconf : " ++ show minconf , " Rcpt. Fee : " ++ show rcptFee , " Sign : " ++ show sign ] runDB $ createTx keyRing accE rs fee minconf rcptFee sign ImportTx tx -> do $(logInfo) $ format $ unlines [ "PostTxsR ImportTx" , " KeyRing name: " ++ unpack keyRingName , " Account name: " ++ unpack name , " Txid : " ++ cs (txHashToHex (txHash tx)) ] runDB $ do (res, newAddrs) <- importTx tx ai case filter ((== ai) . keyRingTxAccount) res of (txRes:_) -> return (txRes, newAddrs) _ -> liftIO . throwIO $ WalletException "Could not import the transaction" SignTx txid -> do $(logInfo) $ format $ unlines [ "PostTxsR SignTx" , " KeyRing name: " ++ unpack keyRingName , " Account name: " ++ unpack name , " Txid : " ++ cs (txHashToHex txid) ] runDB $ do (res, newAddrs) <- signKeyRingTx keyRing accE txid case filter ((== ai) . keyRingTxAccount) res of (txRes:_) -> return (txRes, newAddrs) _ -> liftIO . throwIO $ WalletException "Could not import the transaction" whenOnline $ do -- Update the bloom filter unless (null newAddrs) updateNodeFilter -- If the transaction is pending, broadcast it to the network when (keyRingTxConfidence txRes == TxPending) $ runNode $ broadcastTxs [keyRingTxHash txRes] return $ Just $ toJSON JsonWithAccount { withAccountKeyRing = toJsonKeyRing keyRing Nothing Nothing , withAccountAccount = toJsonAccount acc , withAccountData = toJsonTx txRes (Just height) }
2,851
postTxsR keyRingName name action = do (keyRing, accE@(Entity ai acc), height) <- runDB $ do (keyRing, accE) <- getAccount keyRingName name (_, height) <- getBestBlock return (keyRing, accE, height) (txRes, newAddrs) <- case action of CreateTx rs fee minconf rcptFee sign -> do $(logInfo) $ format $ unlines [ "PostTxsR CreateTx" , " KeyRing name: " ++ unpack keyRingName , " Account name: " ++ unpack name , " Recipients : " ++ show (map (first addrToBase58) rs) , " Fee : " ++ show fee , " Minconf : " ++ show minconf , " Rcpt. Fee : " ++ show rcptFee , " Sign : " ++ show sign ] runDB $ createTx keyRing accE rs fee minconf rcptFee sign ImportTx tx -> do $(logInfo) $ format $ unlines [ "PostTxsR ImportTx" , " KeyRing name: " ++ unpack keyRingName , " Account name: " ++ unpack name , " Txid : " ++ cs (txHashToHex (txHash tx)) ] runDB $ do (res, newAddrs) <- importTx tx ai case filter ((== ai) . keyRingTxAccount) res of (txRes:_) -> return (txRes, newAddrs) _ -> liftIO . throwIO $ WalletException "Could not import the transaction" SignTx txid -> do $(logInfo) $ format $ unlines [ "PostTxsR SignTx" , " KeyRing name: " ++ unpack keyRingName , " Account name: " ++ unpack name , " Txid : " ++ cs (txHashToHex txid) ] runDB $ do (res, newAddrs) <- signKeyRingTx keyRing accE txid case filter ((== ai) . keyRingTxAccount) res of (txRes:_) -> return (txRes, newAddrs) _ -> liftIO . throwIO $ WalletException "Could not import the transaction" whenOnline $ do -- Update the bloom filter unless (null newAddrs) updateNodeFilter -- If the transaction is pending, broadcast it to the network when (keyRingTxConfidence txRes == TxPending) $ runNode $ broadcastTxs [keyRingTxHash txRes] return $ Just $ toJSON JsonWithAccount { withAccountKeyRing = toJsonKeyRing keyRing Nothing Nothing , withAccountAccount = toJsonAccount acc , withAccountData = toJsonTx txRes (Just height) }
2,637
false
true
0
22
1,151
752
373
379
null
null
urbanslug/ghc
testsuite/tests/indexed-types/should_compile/T9090.hs
bsd-3-clause
-- g x = g x -- checks f' :: Eq b => (forall a. Eq a => f a -> Bool) -> f b -> Bool f' = f
91
f' :: Eq b => (forall a. Eq a => f a -> Bool) -> f b -> Bool f' = f
67
f' = f
6
true
true
0
11
30
53
27
26
null
null
kmate/raw-feldspar
examples/Concurrent.hs
bsd-3-clause
pairChan :: Run () pairChan = do c :: Chan Closeable (Data Int32, Data Word8) <- newCloseableChan 10 writer <- fork $ do printf "Writer started\n" writeChan c (1337,42) printf "Writer ended\n" reader <- fork $ do printf "Reader started\n" (a,b) <- readChan c printf "Received: (%d, %d)\n" a b waitThread reader waitThread writer closeChan c
412
pairChan :: Run () pairChan = do c :: Chan Closeable (Data Int32, Data Word8) <- newCloseableChan 10 writer <- fork $ do printf "Writer started\n" writeChan c (1337,42) printf "Writer ended\n" reader <- fork $ do printf "Reader started\n" (a,b) <- readChan c printf "Received: (%d, %d)\n" a b waitThread reader waitThread writer closeChan c
412
pairChan = do c :: Chan Closeable (Data Int32, Data Word8) <- newCloseableChan 10 writer <- fork $ do printf "Writer started\n" writeChan c (1337,42) printf "Writer ended\n" reader <- fork $ do printf "Reader started\n" (a,b) <- readChan c printf "Received: (%d, %d)\n" a b waitThread reader waitThread writer closeChan c
393
false
true
0
12
127
145
63
82
null
null
tjakway/ghcjvm
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
ppr_dec _ (InstanceD o ctxt i ds) = text "instance" <+> maybe empty ppr_overlap o <+> pprCxt ctxt <+> ppr i $$ where_clause ds
168
ppr_dec _ (InstanceD o ctxt i ds) = text "instance" <+> maybe empty ppr_overlap o <+> pprCxt ctxt <+> ppr i $$ where_clause ds
168
ppr_dec _ (InstanceD o ctxt i ds) = text "instance" <+> maybe empty ppr_overlap o <+> pprCxt ctxt <+> ppr i $$ where_clause ds
168
false
false
0
9
65
58
26
32
null
null
kawamuray/ganeti
src/Ganeti/Query/Instance.hs
gpl-2.0
-- * Live fields functionality -- | List of node live fields. instanceLiveFieldsDefs :: [(FieldName, FieldTitle, FieldType, String, FieldDoc)] instanceLiveFieldsDefs = [ ("oper_ram", "Memory", QFTUnit, "oper_ram", "Actual memory usage as seen by hypervisor") , ("oper_vcpus", "VCPUs", QFTNumber, "oper_vcpus", "Actual number of VCPUs as seen by hypervisor") ]
376
instanceLiveFieldsDefs :: [(FieldName, FieldTitle, FieldType, String, FieldDoc)] instanceLiveFieldsDefs = [ ("oper_ram", "Memory", QFTUnit, "oper_ram", "Actual memory usage as seen by hypervisor") , ("oper_vcpus", "VCPUs", QFTNumber, "oper_vcpus", "Actual number of VCPUs as seen by hypervisor") ]
313
instanceLiveFieldsDefs = [ ("oper_ram", "Memory", QFTUnit, "oper_ram", "Actual memory usage as seen by hypervisor") , ("oper_vcpus", "VCPUs", QFTNumber, "oper_vcpus", "Actual number of VCPUs as seen by hypervisor") ]
232
true
true
0
6
63
67
44
23
null
null
tcsavage/hsaglgui
src/AGLGUI.hs
mit
quit :: IO () quit = do callbacks <- Map.elems <$> readIORef callbackMap mapM freeCallback callbacks aglguiQuit
123
quit :: IO () quit = do callbacks <- Map.elems <$> readIORef callbackMap mapM freeCallback callbacks aglguiQuit
123
quit = do callbacks <- Map.elems <$> readIORef callbackMap mapM freeCallback callbacks aglguiQuit
109
false
true
0
9
28
43
19
24
null
null
energyflowanalysis/efa-2.1
attic/src/EFA2/Solver/Horn.hs
bsd-3-clause
leftMarked vs (lhs :-> _) = S.null $ S.difference (getAtoms lhs) vs
67
leftMarked vs (lhs :-> _) = S.null $ S.difference (getAtoms lhs) vs
67
leftMarked vs (lhs :-> _) = S.null $ S.difference (getAtoms lhs) vs
67
false
false
0
8
11
39
18
21
null
null
parapluu/encore
src/ir/AST/Util.hs
bsd-3-clause
putChildren _ e@(Return {}) = error "'putChildren l Return' expects l to have 1 element"
88
putChildren _ e@(Return {}) = error "'putChildren l Return' expects l to have 1 element"
88
putChildren _ e@(Return {}) = error "'putChildren l Return' expects l to have 1 element"
88
false
false
0
8
14
27
13
14
null
null
lukexi/ghc-7.8-arm64
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp _ [] SetByteArrayOp [ba,off,len,c] = doSetByteArrayOp ba off len c
86
emitPrimOp _ [] SetByteArrayOp [ba,off,len,c] = doSetByteArrayOp ba off len c
86
emitPrimOp _ [] SetByteArrayOp [ba,off,len,c] = doSetByteArrayOp ba off len c
86
false
false
1
5
19
46
20
26
null
null
mariefarrell/Hets
Common/MathLink.hs
gpl-2.0
verbMsgMLLn :: Int -> String -> ML () verbMsgMLLn lvl msg = do hdl <- getHandle v <- asks mverbosity liftIO $ verbMsgLn hdl v lvl msg
139
verbMsgMLLn :: Int -> String -> ML () verbMsgMLLn lvl msg = do hdl <- getHandle v <- asks mverbosity liftIO $ verbMsgLn hdl v lvl msg
139
verbMsgMLLn lvl msg = do hdl <- getHandle v <- asks mverbosity liftIO $ verbMsgLn hdl v lvl msg
101
false
true
0
8
32
62
28
34
null
null
LukeHoersten/io-streams
test/System/IO/Streams/Tests/Combinators.hs
bsd-3-clause
testZipWith :: Test testZipWith = testCase "combinators/zipWith" $ do let l1 = [1 .. 10 :: Int] let l2 = [2 .. 10 :: Int] (join $ S.zipWith (+) <$> fromList l1 <*> fromList l2) >>= toList >>= assertEqual "zipWith1" (Prelude.zipWith (+) l1 l2) (join $ S.zipWith (+) <$> fromList l2 <*> fromList l1) >>= toList >>= assertEqual "zipWith1" (Prelude.zipWith (+) l2 l1) is1 <- fromList l1 is2 <- fromList l2 isZip <- S.zipWith (+) is1 is2 _ <- toList isZip read is1 >>= assertEqual "remainder" (Just 10) ------------------------------------------------------------------------------
641
testZipWith :: Test testZipWith = testCase "combinators/zipWith" $ do let l1 = [1 .. 10 :: Int] let l2 = [2 .. 10 :: Int] (join $ S.zipWith (+) <$> fromList l1 <*> fromList l2) >>= toList >>= assertEqual "zipWith1" (Prelude.zipWith (+) l1 l2) (join $ S.zipWith (+) <$> fromList l2 <*> fromList l1) >>= toList >>= assertEqual "zipWith1" (Prelude.zipWith (+) l2 l1) is1 <- fromList l1 is2 <- fromList l2 isZip <- S.zipWith (+) is1 is2 _ <- toList isZip read is1 >>= assertEqual "remainder" (Just 10) ------------------------------------------------------------------------------
641
testZipWith = testCase "combinators/zipWith" $ do let l1 = [1 .. 10 :: Int] let l2 = [2 .. 10 :: Int] (join $ S.zipWith (+) <$> fromList l1 <*> fromList l2) >>= toList >>= assertEqual "zipWith1" (Prelude.zipWith (+) l1 l2) (join $ S.zipWith (+) <$> fromList l2 <*> fromList l1) >>= toList >>= assertEqual "zipWith1" (Prelude.zipWith (+) l2 l1) is1 <- fromList l1 is2 <- fromList l2 isZip <- S.zipWith (+) is1 is2 _ <- toList isZip read is1 >>= assertEqual "remainder" (Just 10) ------------------------------------------------------------------------------
621
false
true
0
16
153
247
119
128
null
null
DougBurke/swish
tests/N3FormatterTest.hs
lgpl-2.1
noError, errorText :: String noError = ""
43
noError, errorText :: String noError = ""
43
noError = ""
14
false
true
0
4
8
13
8
5
null
null
karshan/language-java
Language/Java/Parser.hs
bsd-3-clause
---------------------------------------------------------------------------- -- Names name :: P Name name = do pos <- getPosition a <- seplist1 ident period return $ Name a
185
name :: P Name name = do pos <- getPosition a <- seplist1 ident period return $ Name a
98
name = do pos <- getPosition a <- seplist1 ident period return $ Name a
83
true
true
1
9
34
49
21
28
null
null
dawedawe/kripkeweb
src/DB.hs
bsd-3-clause
-- |Insert OneToN into the link table. insertAccessRel :: Connection -> OneToN -> IO () insertAccessRel c otn = do let otolst = oToN2OneToOnes otn let otolln = fromIntegral (Prelude.length otolst) rs <- executeMany c "INSERT INTO links (source, target) VALUES (?,?)" otolst putStrLn ("insertOneToN " ++ show rs) when (rs /= otolln) $ error ("insertAccessRel: inserted only " ++ show rs ++ " out of " ++ show otolln) -- |List of targets the given source links to.
498
insertAccessRel :: Connection -> OneToN -> IO () insertAccessRel c otn = do let otolst = oToN2OneToOnes otn let otolln = fromIntegral (Prelude.length otolst) rs <- executeMany c "INSERT INTO links (source, target) VALUES (?,?)" otolst putStrLn ("insertOneToN " ++ show rs) when (rs /= otolln) $ error ("insertAccessRel: inserted only " ++ show rs ++ " out of " ++ show otolln) -- |List of targets the given source links to.
458
insertAccessRel c otn = do let otolst = oToN2OneToOnes otn let otolln = fromIntegral (Prelude.length otolst) rs <- executeMany c "INSERT INTO links (source, target) VALUES (?,?)" otolst putStrLn ("insertOneToN " ++ show rs) when (rs /= otolln) $ error ("insertAccessRel: inserted only " ++ show rs ++ " out of " ++ show otolln) -- |List of targets the given source links to.
409
true
true
0
13
114
134
62
72
null
null
Prinhotels/goog-closure
src/Options.hs
mit
cCONFIG_PATH = "../application/configs/closure.ini"
51
cCONFIG_PATH = "../application/configs/closure.ini"
51
cCONFIG_PATH = "../application/configs/closure.ini"
51
false
false
0
4
2
6
3
3
null
null
nbrunt/JSHOP
src/CompUtils.hs
mit
peSimpCalc :: (PrimaryExpr -> JSCC()) -- ^ genPrimExpr function -> Maybe PrimaryExpr -- ^ First operand -> Maybe PrimaryExpr -- ^ Second operand -> Char -- ^ Operator -> JSCC (Maybe PrimaryExpr) peSimpCalc gen (Just (ExpLiteral a)) (Just (ExpLiteral b)) op = do pop -- operator pop -- first operand let (x, mbY) = simpCalcLit a b op if litLength x > origLength then do genLiteral a emit [op] genLiteral b return Nothing else if isJust mbY then do genLiteral x emit [op] genLiteral $ fromJust mbY return Nothing else return $ Just (ExpLiteral x) where origLength = litLength a + litLength b + 1 -- The 1 is the op litLength :: Literal -> Int litLength (LNull) = 4 -- null litLength (LBool _) = 2 -- !0 or !1 litLength (LInt x) = length $ show x litLength (LFloat x) = length $ dropPrefix $ show $ roundIfInt x litLength (LStr s) = length s
1,074
peSimpCalc :: (PrimaryExpr -> JSCC()) -- ^ genPrimExpr function -> Maybe PrimaryExpr -- ^ First operand -> Maybe PrimaryExpr -- ^ Second operand -> Char -- ^ Operator -> JSCC (Maybe PrimaryExpr) peSimpCalc gen (Just (ExpLiteral a)) (Just (ExpLiteral b)) op = do pop -- operator pop -- first operand let (x, mbY) = simpCalcLit a b op if litLength x > origLength then do genLiteral a emit [op] genLiteral b return Nothing else if isJust mbY then do genLiteral x emit [op] genLiteral $ fromJust mbY return Nothing else return $ Just (ExpLiteral x) where origLength = litLength a + litLength b + 1 -- The 1 is the op litLength :: Literal -> Int litLength (LNull) = 4 -- null litLength (LBool _) = 2 -- !0 or !1 litLength (LInt x) = length $ show x litLength (LFloat x) = length $ dropPrefix $ show $ roundIfInt x litLength (LStr s) = length s
1,074
peSimpCalc gen (Just (ExpLiteral a)) (Just (ExpLiteral b)) op = do pop -- operator pop -- first operand let (x, mbY) = simpCalcLit a b op if litLength x > origLength then do genLiteral a emit [op] genLiteral b return Nothing else if isJust mbY then do genLiteral x emit [op] genLiteral $ fromJust mbY return Nothing else return $ Just (ExpLiteral x) where origLength = litLength a + litLength b + 1 -- The 1 is the op litLength :: Literal -> Int litLength (LNull) = 4 -- null litLength (LBool _) = 2 -- !0 or !1 litLength (LInt x) = length $ show x litLength (LFloat x) = length $ dropPrefix $ show $ roundIfInt x litLength (LStr s) = length s
804
false
true
0
12
392
347
167
180
null
null
olorin/amazonka
amazonka-rds/gen/Network/AWS/RDS/Types/Product.hs
mpl-2.0
-- | Contains the identifier of the source DB instance if this DB instance is -- a Read Replica. diReadReplicaSourceDBInstanceIdentifier :: Lens' DBInstance (Maybe Text) diReadReplicaSourceDBInstanceIdentifier = lens _diReadReplicaSourceDBInstanceIdentifier (\ s a -> s{_diReadReplicaSourceDBInstanceIdentifier = a})
316
diReadReplicaSourceDBInstanceIdentifier :: Lens' DBInstance (Maybe Text) diReadReplicaSourceDBInstanceIdentifier = lens _diReadReplicaSourceDBInstanceIdentifier (\ s a -> s{_diReadReplicaSourceDBInstanceIdentifier = a})
219
diReadReplicaSourceDBInstanceIdentifier = lens _diReadReplicaSourceDBInstanceIdentifier (\ s a -> s{_diReadReplicaSourceDBInstanceIdentifier = a})
146
true
true
0
9
35
47
26
21
null
null
steve-chavez/postgrest
src/PostgREST/Middleware.hs
mit
unquoted (JSON.Bool b) = show b
31
unquoted (JSON.Bool b) = show b
31
unquoted (JSON.Bool b) = show b
31
false
false
0
7
5
21
9
12
null
null
ian-andrich/HaskellPengines
src/Types.hs
bsd-3-clause
{- Used in pengineCreate function -} createHeader :: HeaderBase -> HeaderBase createHeader h = h {accept = "application/json"}
126
createHeader :: HeaderBase -> HeaderBase createHeader h = h {accept = "application/json"}
89
createHeader h = h {accept = "application/json"}
48
true
true
0
6
17
27
15
12
null
null
mightymoose/liquidhaskell
tests/pos/GhcSort2.hs
bsd-3-clause
merge_pairs [xs] = [xs]
23
merge_pairs [xs] = [xs]
23
merge_pairs [xs] = [xs]
23
false
false
0
6
3
15
8
7
null
null