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
unknownloner/calccomp
FORTH/Stdlib.hs
mit
wasm "SWAP" = rtni [asm|pop hl \ ex (sp),hl \ push hl|]
55
wasm "SWAP" = rtni [asm|pop hl \ ex (sp),hl \ push hl|]
55
wasm "SWAP" = rtni [asm|pop hl \ ex (sp),hl \ push hl|]
55
false
false
0
5
11
17
9
8
null
null
input-output-hk/pos-haskell-prototype
util/src/Pos/Util/Wlog/Compatibility.hs
mit
logMessage :: WithLogger m => Severity -> Text -> m () logMessage severity msg = do name <- askLoggerName dispatchMessage name severity msg
147
logMessage :: WithLogger m => Severity -> Text -> m () logMessage severity msg = do name <- askLoggerName dispatchMessage name severity msg
147
logMessage severity msg = do name <- askLoggerName dispatchMessage name severity msg
92
false
true
0
9
30
53
24
29
null
null
kayuri/HNC
Test/TestFixtures.hs
lgpl-3.0
runFB = runF >=> runB firstLabel where firstLabel = runSimpleUniqueMonad freshLabel
84
runFB = runF >=> runB firstLabel where firstLabel = runSimpleUniqueMonad freshLabel
84
runFB = runF >=> runB firstLabel where firstLabel = runSimpleUniqueMonad freshLabel
84
false
false
4
5
11
33
12
21
null
null
HIPERFIT/futhark
src/Language/Futhark/Interpreter.hs
isc
eval env (Negate e _) = do ev <- eval env e ValuePrim <$> case ev of ValuePrim (SignedValue (Int8Value v)) -> return $ SignedValue $ Int8Value (- v) ValuePrim (SignedValue (Int16Value v)) -> return $ SignedValue $ Int16Value (- v) ValuePrim (SignedValue (Int32Value v)) -> return $ SignedValue $ Int32Value (- v) ValuePrim (SignedValue (Int64Value v)) -> return $ SignedValue $ Int64Value (- v) ValuePrim (UnsignedValue (Int8Value v)) -> return $ UnsignedValue $ Int8Value (- v) ValuePrim (UnsignedValue (Int16Value v)) -> return $ UnsignedValue $ Int16Value (- v) ValuePrim (UnsignedValue (Int32Value v)) -> return $ UnsignedValue $ Int32Value (- v) ValuePrim (UnsignedValue (Int64Value v)) -> return $ UnsignedValue $ Int64Value (- v) ValuePrim (FloatValue (Float16Value v)) -> return $ FloatValue $ Float16Value (- v) ValuePrim (FloatValue (Float32Value v)) -> return $ FloatValue $ Float32Value (- v) ValuePrim (FloatValue (Float64Value v)) -> return $ FloatValue $ Float64Value (- v) _ -> error $ "Cannot negate " ++ pretty ev
1,083
eval env (Negate e _) = do ev <- eval env e ValuePrim <$> case ev of ValuePrim (SignedValue (Int8Value v)) -> return $ SignedValue $ Int8Value (- v) ValuePrim (SignedValue (Int16Value v)) -> return $ SignedValue $ Int16Value (- v) ValuePrim (SignedValue (Int32Value v)) -> return $ SignedValue $ Int32Value (- v) ValuePrim (SignedValue (Int64Value v)) -> return $ SignedValue $ Int64Value (- v) ValuePrim (UnsignedValue (Int8Value v)) -> return $ UnsignedValue $ Int8Value (- v) ValuePrim (UnsignedValue (Int16Value v)) -> return $ UnsignedValue $ Int16Value (- v) ValuePrim (UnsignedValue (Int32Value v)) -> return $ UnsignedValue $ Int32Value (- v) ValuePrim (UnsignedValue (Int64Value v)) -> return $ UnsignedValue $ Int64Value (- v) ValuePrim (FloatValue (Float16Value v)) -> return $ FloatValue $ Float16Value (- v) ValuePrim (FloatValue (Float32Value v)) -> return $ FloatValue $ Float32Value (- v) ValuePrim (FloatValue (Float64Value v)) -> return $ FloatValue $ Float64Value (- v) _ -> error $ "Cannot negate " ++ pretty ev
1,083
eval env (Negate e _) = do ev <- eval env e ValuePrim <$> case ev of ValuePrim (SignedValue (Int8Value v)) -> return $ SignedValue $ Int8Value (- v) ValuePrim (SignedValue (Int16Value v)) -> return $ SignedValue $ Int16Value (- v) ValuePrim (SignedValue (Int32Value v)) -> return $ SignedValue $ Int32Value (- v) ValuePrim (SignedValue (Int64Value v)) -> return $ SignedValue $ Int64Value (- v) ValuePrim (UnsignedValue (Int8Value v)) -> return $ UnsignedValue $ Int8Value (- v) ValuePrim (UnsignedValue (Int16Value v)) -> return $ UnsignedValue $ Int16Value (- v) ValuePrim (UnsignedValue (Int32Value v)) -> return $ UnsignedValue $ Int32Value (- v) ValuePrim (UnsignedValue (Int64Value v)) -> return $ UnsignedValue $ Int64Value (- v) ValuePrim (FloatValue (Float16Value v)) -> return $ FloatValue $ Float16Value (- v) ValuePrim (FloatValue (Float32Value v)) -> return $ FloatValue $ Float32Value (- v) ValuePrim (FloatValue (Float64Value v)) -> return $ FloatValue $ Float64Value (- v) _ -> error $ "Cannot negate " ++ pretty ev
1,083
false
false
0
15
210
466
225
241
null
null
uuhan/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reflectTTQuotePattern unq (TType exp) = do ue <- getNameFrom (sMN 0 "uexp") claim ue (Var (sNS (sUN "TTUExp") ["Reflection", "Language"])) movelast ue fill $ reflCall "TType" [Var ue] solve
219
reflectTTQuotePattern unq (TType exp) = do ue <- getNameFrom (sMN 0 "uexp") claim ue (Var (sNS (sUN "TTUExp") ["Reflection", "Language"])) movelast ue fill $ reflCall "TType" [Var ue] solve
219
reflectTTQuotePattern unq (TType exp) = do ue <- getNameFrom (sMN 0 "uexp") claim ue (Var (sNS (sUN "TTUExp") ["Reflection", "Language"])) movelast ue fill $ reflCall "TType" [Var ue] solve
219
false
false
0
13
58
96
44
52
null
null
mmisamore/probabilities
src/Examples.hs
bsd-3-clause
toNumeric :: Rational -> Numeric toNumeric = Numeric
52
toNumeric :: Rational -> Numeric toNumeric = Numeric
52
toNumeric = Numeric
19
false
true
0
5
7
15
8
7
null
null
dysinger/amazonka
amazonka-directconnect/gen/Network/AWS/DirectConnect/ConfirmConnection.hs
mpl-2.0
ccr1ConnectionState :: Lens' ConfirmConnectionResponse (Maybe ConnectionState) ccr1ConnectionState = lens _ccr1ConnectionState (\s a -> s { _ccr1ConnectionState = a })
171
ccr1ConnectionState :: Lens' ConfirmConnectionResponse (Maybe ConnectionState) ccr1ConnectionState = lens _ccr1ConnectionState (\s a -> s { _ccr1ConnectionState = a })
171
ccr1ConnectionState = lens _ccr1ConnectionState (\s a -> s { _ccr1ConnectionState = a })
92
false
true
1
9
22
51
24
27
null
null
robeverest/accelerate
Data/Array/Accelerate/Analysis/Match.hs
bsd-3-clause
hashPrimFun :: PrimFun f -> Int hashPrimFun (PrimAdd _) = hash "PrimAdd"
88
hashPrimFun :: PrimFun f -> Int hashPrimFun (PrimAdd _) = hash "PrimAdd"
88
hashPrimFun (PrimAdd _) = hash "PrimAdd"
56
false
true
0
6
27
34
15
19
null
null
lukexi/ghc-7.8-arm64
compiler/cmm/CmmExpr.hs
bsd-3-clause
globalRegType dflags (VanillaReg _ VNonGcPtr) = bWord dflags
60
globalRegType dflags (VanillaReg _ VNonGcPtr) = bWord dflags
60
globalRegType dflags (VanillaReg _ VNonGcPtr) = bWord dflags
60
false
false
0
7
7
22
10
12
null
null
tjakway/ghcjvm
compiler/cmm/CLabel.hs
bsd-3-clause
-- | Whether label is a non-haskell label (defined in C code) isForeignLabel :: CLabel -> Bool isForeignLabel (ForeignLabel _ _ _ _) = True
139
isForeignLabel :: CLabel -> Bool isForeignLabel (ForeignLabel _ _ _ _) = True
77
isForeignLabel (ForeignLabel _ _ _ _) = True
44
true
true
0
7
24
31
16
15
null
null
sherwoodwang/wxHaskell
wx/src/Graphics/UI/WX/Frame.hs
lgpl-2.1
- | Create an MDI parent frame with a custom style. mdiParentFrameEx :: Window a -> Style -> [Prop (MDIParentFrame ())] -> IO (MDIParentFrame ()) mdiParentFrameEx parent stl props = feed2 props stl $ initialFrame $ \id rect txt -> \props stl -> do f <- mdiParentFrameCreate parent id txt rect stl let initProps = (if (containsProperty visible props) then [] else [visible := True]) ++ (if (containsProperty bgcolor props) then [] else [bgcolor := colorSystem Color3DFace]) set f initProps set f props return f -- | Create a MDI child frame.
652
mdiParentFrameEx :: Window a -> Style -> [Prop (MDIParentFrame ())] -> IO (MDIParentFrame ()) mdiParentFrameEx parent stl props = feed2 props stl $ initialFrame $ \id rect txt -> \props stl -> do f <- mdiParentFrameCreate parent id txt rect stl let initProps = (if (containsProperty visible props) then [] else [visible := True]) ++ (if (containsProperty bgcolor props) then [] else [bgcolor := colorSystem Color3DFace]) set f initProps set f props return f -- | Create a MDI child frame.
599
mdiParentFrameEx parent stl props = feed2 props stl $ initialFrame $ \id rect txt -> \props stl -> do f <- mdiParentFrameCreate parent id txt rect stl let initProps = (if (containsProperty visible props) then [] else [visible := True]) ++ (if (containsProperty bgcolor props) then [] else [bgcolor := colorSystem Color3DFace]) set f initProps set f props return f -- | Create a MDI child frame.
505
true
true
2
18
203
215
111
104
null
null
ti1024/hacq
src/Control/Monad/Quantum/Adder.hs
bsd-3-clause
comparator2 :: MonadQuantum w m => Bit w -> Bit w -> Bit w -> [Bit w] -> [Bit w] -> m (Bit w) comparator2 a b (BitConst c) x' y' = comparator1 a b c x' y'
158
comparator2 :: MonadQuantum w m => Bit w -> Bit w -> Bit w -> [Bit w] -> [Bit w] -> m (Bit w) comparator2 a b (BitConst c) x' y' = comparator1 a b c x' y'
158
comparator2 a b (BitConst c) x' y' = comparator1 a b c x' y'
64
false
true
0
14
41
107
47
60
null
null
rodrigosetti/json-archetype
src/JSON/Archetype.hs
mit
string :: ArchetypeParser JSONValidator string = liftM jsonString stringLiteral where jsonString s = try $ do s' <- stringLiteral unless (s' =~ wrapRe s) (unexpected (show s') <?> show s) -- | Parses an archetype array, handling the quantity qualifiers
291
string :: ArchetypeParser JSONValidator string = liftM jsonString stringLiteral where jsonString s = try $ do s' <- stringLiteral unless (s' =~ wrapRe s) (unexpected (show s') <?> show s) -- | Parses an archetype array, handling the quantity qualifiers
291
string = liftM jsonString stringLiteral where jsonString s = try $ do s' <- stringLiteral unless (s' =~ wrapRe s) (unexpected (show s') <?> show s) -- | Parses an archetype array, handling the quantity qualifiers
251
false
true
1
14
78
83
37
46
null
null
mcschroeder/ghc
compiler/prelude/THNames.hs
bsd-3-clause
funLikeDataConKey = mkPreludeDataConUnique 104
46
funLikeDataConKey = mkPreludeDataConUnique 104
46
funLikeDataConKey = mkPreludeDataConUnique 104
46
false
false
0
5
3
9
4
5
null
null
aurapm/aura
aura/lib/Aura/Settings/External.hs
gpl-3.0
defaultAuraConf :: FilePath defaultAuraConf = "/etc/aura.conf"
62
defaultAuraConf :: FilePath defaultAuraConf = "/etc/aura.conf"
62
defaultAuraConf = "/etc/aura.conf"
34
false
true
0
4
5
11
6
5
null
null
ihc/futhark
src/Futhark/Optimise/MemoryBlockMerging/MemoryAliases.hs
isc
lookInPatElem _ = return ()
27
lookInPatElem _ = return ()
27
lookInPatElem _ = return ()
27
false
false
0
5
4
15
6
9
null
null
Lainepress/hledger
hledger/Hledger/Cli/Convert.hs
gpl-3.0
test_parser = [ "convert rules parsing: empty file" ~: do -- let assertMixedAmountParse parseresult mixedamount = -- (either (const "parse error") showMixedAmountDebug parseresult) ~?= (showMixedAmountDebug mixedamount) assertParseEqual (parseCsvRules "unknown" "") nullrules ,"convert rules parsing: accountrule" ~: do assertParseEqual (parseWithCtx nullrules accountrule "A\na\n") -- leading blank line required ([("A",Nothing)], "a") ,"convert rules parsing: trailing comments" ~: do assertParse (parseWithCtx nullrules csvrulesfile "A\na\n# \n#\n") ,"convert rules parsing: trailing blank lines" ~: do assertParse (parseWithCtx nullrules csvrulesfile "A\na\n\n \n") -- not supported -- ,"convert rules parsing: no final newline" ~: do -- assertParse (parseWithCtx nullrules csvrulesfile "A\na") -- assertParse (parseWithCtx nullrules csvrulesfile "A\na\n# \n#") -- assertParse (parseWithCtx nullrules csvrulesfile "A\na\n\n ") -- (nullrules{ -- -- dateField=Maybe FieldPosition, -- -- statusField=Maybe FieldPosition, -- -- codeField=Maybe FieldPosition, -- -- descriptionField=Maybe FieldPosition, -- -- amountField=Maybe FieldPosition, -- -- currencyField=Maybe FieldPosition, -- -- baseCurrency=Maybe String, -- -- baseAccount=AccountName, -- accountRules=[ -- ([("A",Nothing)], "a") -- ] -- }) ]
1,650
test_parser = [ "convert rules parsing: empty file" ~: do -- let assertMixedAmountParse parseresult mixedamount = -- (either (const "parse error") showMixedAmountDebug parseresult) ~?= (showMixedAmountDebug mixedamount) assertParseEqual (parseCsvRules "unknown" "") nullrules ,"convert rules parsing: accountrule" ~: do assertParseEqual (parseWithCtx nullrules accountrule "A\na\n") -- leading blank line required ([("A",Nothing)], "a") ,"convert rules parsing: trailing comments" ~: do assertParse (parseWithCtx nullrules csvrulesfile "A\na\n# \n#\n") ,"convert rules parsing: trailing blank lines" ~: do assertParse (parseWithCtx nullrules csvrulesfile "A\na\n\n \n") -- not supported -- ,"convert rules parsing: no final newline" ~: do -- assertParse (parseWithCtx nullrules csvrulesfile "A\na") -- assertParse (parseWithCtx nullrules csvrulesfile "A\na\n# \n#") -- assertParse (parseWithCtx nullrules csvrulesfile "A\na\n\n ") -- (nullrules{ -- -- dateField=Maybe FieldPosition, -- -- statusField=Maybe FieldPosition, -- -- codeField=Maybe FieldPosition, -- -- descriptionField=Maybe FieldPosition, -- -- amountField=Maybe FieldPosition, -- -- currencyField=Maybe FieldPosition, -- -- baseCurrency=Maybe String, -- -- baseAccount=AccountName, -- accountRules=[ -- ([("A",Nothing)], "a") -- ] -- }) ]
1,650
test_parser = [ "convert rules parsing: empty file" ~: do -- let assertMixedAmountParse parseresult mixedamount = -- (either (const "parse error") showMixedAmountDebug parseresult) ~?= (showMixedAmountDebug mixedamount) assertParseEqual (parseCsvRules "unknown" "") nullrules ,"convert rules parsing: accountrule" ~: do assertParseEqual (parseWithCtx nullrules accountrule "A\na\n") -- leading blank line required ([("A",Nothing)], "a") ,"convert rules parsing: trailing comments" ~: do assertParse (parseWithCtx nullrules csvrulesfile "A\na\n# \n#\n") ,"convert rules parsing: trailing blank lines" ~: do assertParse (parseWithCtx nullrules csvrulesfile "A\na\n\n \n") -- not supported -- ,"convert rules parsing: no final newline" ~: do -- assertParse (parseWithCtx nullrules csvrulesfile "A\na") -- assertParse (parseWithCtx nullrules csvrulesfile "A\na\n# \n#") -- assertParse (parseWithCtx nullrules csvrulesfile "A\na\n\n ") -- (nullrules{ -- -- dateField=Maybe FieldPosition, -- -- statusField=Maybe FieldPosition, -- -- codeField=Maybe FieldPosition, -- -- descriptionField=Maybe FieldPosition, -- -- amountField=Maybe FieldPosition, -- -- currencyField=Maybe FieldPosition, -- -- baseCurrency=Maybe String, -- -- baseAccount=AccountName, -- accountRules=[ -- ([("A",Nothing)], "a") -- ] -- }) ]
1,650
false
false
0
12
497
136
79
57
null
null
rlpowell/hblog
lib/HBlog/HBlog.hs
mit
-- Pull a file's time out of the list getGitTimeUTC :: Identifier -> [GitTimes] -> (GitTimes -> UTCTime) -> UTCTime getGitTimeUTC ident times typeF = -- The identifier for the things compiled with the "recents" -- version has the identifierVersion "recents", but we don't care -- about that since the only reason that exists is to avoid loops, -- so we strip it here for our lookup. let fixedIdent = ident { identifierVersion = Nothing } timeList = filter (\x -> fixedIdent == (gtid x)) times in if length timeList /= 1 then -- It's not obvious to me how this could occur even in theory; I'd expect it to error out during getGitTimes error $ "getGitTimeUTC: Couldn't find the time for " ++ (show fixedIdent) ++ " in GitTimes list " ++ (show times) else typeF $ head timeList
816
getGitTimeUTC :: Identifier -> [GitTimes] -> (GitTimes -> UTCTime) -> UTCTime getGitTimeUTC ident times typeF = -- The identifier for the things compiled with the "recents" -- version has the identifierVersion "recents", but we don't care -- about that since the only reason that exists is to avoid loops, -- so we strip it here for our lookup. let fixedIdent = ident { identifierVersion = Nothing } timeList = filter (\x -> fixedIdent == (gtid x)) times in if length timeList /= 1 then -- It's not obvious to me how this could occur even in theory; I'd expect it to error out during getGitTimes error $ "getGitTimeUTC: Couldn't find the time for " ++ (show fixedIdent) ++ " in GitTimes list " ++ (show times) else typeF $ head timeList
778
getGitTimeUTC ident times typeF = -- The identifier for the things compiled with the "recents" -- version has the identifierVersion "recents", but we don't care -- about that since the only reason that exists is to avoid loops, -- so we strip it here for our lookup. let fixedIdent = ident { identifierVersion = Nothing } timeList = filter (\x -> fixedIdent == (gtid x)) times in if length timeList /= 1 then -- It's not obvious to me how this could occur even in theory; I'd expect it to error out during getGitTimes error $ "getGitTimeUTC: Couldn't find the time for " ++ (show fixedIdent) ++ " in GitTimes list " ++ (show times) else typeF $ head timeList
700
true
true
0
14
181
143
77
66
null
null
brendanhay/gogol
gogol-servicebroker/gen/Network/Google/ServiceBroker/Types/Product.hs
mpl-2.0
-- | A subset of \`TestPermissionsRequest.permissions\` that the caller is -- allowed. givtiprPermissions :: Lens' GoogleIAMV1__TestIAMPermissionsResponse [Text] givtiprPermissions = lens _givtiprPermissions (\ s a -> s{_givtiprPermissions = a}) . _Default . _Coerce
286
givtiprPermissions :: Lens' GoogleIAMV1__TestIAMPermissionsResponse [Text] givtiprPermissions = lens _givtiprPermissions (\ s a -> s{_givtiprPermissions = a}) . _Default . _Coerce
199
givtiprPermissions = lens _givtiprPermissions (\ s a -> s{_givtiprPermissions = a}) . _Default . _Coerce
124
true
true
2
8
51
58
29
29
null
null
realli/chatqy
src/Qy/User.hs
mit
getAlgorithm :: Algorithm getAlgorithm = HS256
46
getAlgorithm :: Algorithm getAlgorithm = HS256
46
getAlgorithm = HS256
20
false
true
0
6
5
18
7
11
null
null
daoo/include-graph
src/IncludeGraph.hs
bsd-3-clause
includeCPP :: Parser Text includeCPP = string "#include" *> skipSpace *> (system <|> local) where system = char '<' *> takeWhile1 (/='>') <* char '>' local = char '"' *> takeWhile1 (/='"') <* char '"'
211
includeCPP :: Parser Text includeCPP = string "#include" *> skipSpace *> (system <|> local) where system = char '<' *> takeWhile1 (/='>') <* char '>' local = char '"' *> takeWhile1 (/='"') <* char '"'
211
includeCPP = string "#include" *> skipSpace *> (system <|> local) where system = char '<' *> takeWhile1 (/='>') <* char '>' local = char '"' *> takeWhile1 (/='"') <* char '"'
185
false
true
0
8
45
87
43
44
null
null
Erdwolf/autotool-bonn
src/Syntax/Transformer.hs
gpl-2.0
findCycles :: Eq a => [(a,a)] -> [[a]] findCycles graph = cycles Nothing allVertices [] where cycles Nothing not_visited@(v:_) [] = cycles (Just v) not_visited [] cycles Nothing [] [] = [] cycles (Just v) not_visited prefix = -- trace ("\nVertex: " ++ show v ++ "\nPrefix = " ++ show prefix ++ "\n") $ let nexts = [ n | (t,n) <- graph, t == v, n `elem` not_visited ] prefix' = prefix ++ [v] verticesInCycles = [ n | (t,n) <- graph, t == v, n `elem` prefix' ] not_visited' = not_visited \\ [v] in nub $ map (testcycle prefix') verticesInCycles ++ if null nexts then cycles Nothing not_visited' [] else concat [ cycles (Just n) not_visited' prefix' | n <- nexts ] where testcycle (x:xs) n | x == n = nub $ x:xs testcycle (_:xs) n = testcycle xs n testcycle [] n = [] allVertices = nub $ graph >>= \(a,b) -> [a,b]
1,076
findCycles :: Eq a => [(a,a)] -> [[a]] findCycles graph = cycles Nothing allVertices [] where cycles Nothing not_visited@(v:_) [] = cycles (Just v) not_visited [] cycles Nothing [] [] = [] cycles (Just v) not_visited prefix = -- trace ("\nVertex: " ++ show v ++ "\nPrefix = " ++ show prefix ++ "\n") $ let nexts = [ n | (t,n) <- graph, t == v, n `elem` not_visited ] prefix' = prefix ++ [v] verticesInCycles = [ n | (t,n) <- graph, t == v, n `elem` prefix' ] not_visited' = not_visited \\ [v] in nub $ map (testcycle prefix') verticesInCycles ++ if null nexts then cycles Nothing not_visited' [] else concat [ cycles (Just n) not_visited' prefix' | n <- nexts ] where testcycle (x:xs) n | x == n = nub $ x:xs testcycle (_:xs) n = testcycle xs n testcycle [] n = [] allVertices = nub $ graph >>= \(a,b) -> [a,b]
1,076
findCycles graph = cycles Nothing allVertices [] where cycles Nothing not_visited@(v:_) [] = cycles (Just v) not_visited [] cycles Nothing [] [] = [] cycles (Just v) not_visited prefix = -- trace ("\nVertex: " ++ show v ++ "\nPrefix = " ++ show prefix ++ "\n") $ let nexts = [ n | (t,n) <- graph, t == v, n `elem` not_visited ] prefix' = prefix ++ [v] verticesInCycles = [ n | (t,n) <- graph, t == v, n `elem` prefix' ] not_visited' = not_visited \\ [v] in nub $ map (testcycle prefix') verticesInCycles ++ if null nexts then cycles Nothing not_visited' [] else concat [ cycles (Just n) not_visited' prefix' | n <- nexts ] where testcycle (x:xs) n | x == n = nub $ x:xs testcycle (_:xs) n = testcycle xs n testcycle [] n = [] allVertices = nub $ graph >>= \(a,b) -> [a,b]
1,037
false
true
7
12
423
427
215
212
null
null
blanu/arbre-go
bin/print.hs
gpl-2.0
printProgramWithViews :: Views -> IO() printProgramWithViews views = do prog <- loadProgram "test.json" case prog of Just lp -> do printProg views lp Nothing -> do return()
196
printProgramWithViews :: Views -> IO() printProgramWithViews views = do prog <- loadProgram "test.json" case prog of Just lp -> do printProg views lp Nothing -> do return()
196
printProgramWithViews views = do prog <- loadProgram "test.json" case prog of Just lp -> do printProg views lp Nothing -> do return()
157
false
true
0
13
50
72
31
41
null
null
heyLu/tracing-js
Trace.hs
mit
traceExpr e@(CallExpr p name args) | not (ignoreCall name) = traceValue p (pp e) $ CallExpr p name $ map traceExpr args
119
traceExpr e@(CallExpr p name args) | not (ignoreCall name) = traceValue p (pp e) $ CallExpr p name $ map traceExpr args
119
traceExpr e@(CallExpr p name args) | not (ignoreCall name) = traceValue p (pp e) $ CallExpr p name $ map traceExpr args
119
false
false
0
10
21
66
30
36
null
null
oldmanmike/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
eqClass_RDR, numClass_RDR, ordClass_RDR, enumClass_RDR, monadClass_RDR :: RdrName eqClass_RDR = nameRdrName eqClassName
135
eqClass_RDR, numClass_RDR, ordClass_RDR, enumClass_RDR, monadClass_RDR :: RdrName eqClass_RDR = nameRdrName eqClassName
135
eqClass_RDR = nameRdrName eqClassName
49
false
true
0
5
26
22
15
7
null
null
juanedi/cap-typechecking
haskell/test/TestUtil.hs
gpl-3.0
{- Equality matchers -} (~~) :: Type -> Type -> Assertion (~~) t1 t2 = (@?) (typeEq t1 t2) $ (show t1) ++ " should be considered equal to " ++ (show t2)
153
(~~) :: Type -> Type -> Assertion (~~) t1 t2 = (@?) (typeEq t1 t2) $ (show t1) ++ " should be considered equal to " ++ (show t2)
128
(~~) t1 t2 = (@?) (typeEq t1 t2) $ (show t1) ++ " should be considered equal to " ++ (show t2)
94
true
true
0
9
33
72
37
35
null
null
cwbriones/mal-hs
src/MalVal.hs
mit
prettyPrint (Func _) = "#<builtin-function>"
44
prettyPrint (Func _) = "#<builtin-function>"
44
prettyPrint (Func _) = "#<builtin-function>"
44
false
false
0
6
4
16
7
9
null
null
bhickey/cloudyfs
cloudyfs.hs
agpl-3.0
cloudyOpenDirectory :: State -> FilePath -> IO Errno cloudyOpenDirectory stateRef path = do case mapMaybe (\ x -> x path) fileSpecifications of (fp, DirectoryFile):[] -> do st <- readIORef stateRef case mkdir st fp of Just f -> do writeIORef stateRef f return $ eOK Nothing -> return $ eOK _ -> return $ eEXIST
368
cloudyOpenDirectory :: State -> FilePath -> IO Errno cloudyOpenDirectory stateRef path = do case mapMaybe (\ x -> x path) fileSpecifications of (fp, DirectoryFile):[] -> do st <- readIORef stateRef case mkdir st fp of Just f -> do writeIORef stateRef f return $ eOK Nothing -> return $ eOK _ -> return $ eEXIST
368
cloudyOpenDirectory stateRef path = do case mapMaybe (\ x -> x path) fileSpecifications of (fp, DirectoryFile):[] -> do st <- readIORef stateRef case mkdir st fp of Just f -> do writeIORef stateRef f return $ eOK Nothing -> return $ eOK _ -> return $ eEXIST
315
false
true
0
17
112
135
63
72
null
null
jwaldmann/rx
src/FiniteMap.hs
gpl-3.0
minusFM = Data.Map.difference
29
minusFM = Data.Map.difference
29
minusFM = Data.Map.difference
29
false
false
1
6
2
13
5
8
null
null
mcmaniac/bindrop
src/HTML/Upload.hs
apache-2.0
upload :: Maybe User -> FileUpload -> Html upload u f = baseHtml (Just "file info") $ do H.head $ do H.title "File Information" mkBody f where mkBody file = do let filePath = file ^. fpath let fileName = file ^. fname let fileTime = file ^. uploadTime let privacy = file ^. public let infoLink = "bindrop.de/f/" ++ file ^. sfname H.body $ do H.header $ mainHeader mainMenu u H.div ! A.id "file-info" $ do H.h2 "Upload successful" H.p (H.toHtml $ fileName) H.p (H.toHtml $ formatTime defaultTimeLocale "%H:%M - %a %Y.%m.%d" fileTime) H.p (H.toHtml $ "Link: " ++ infoLink)
781
upload :: Maybe User -> FileUpload -> Html upload u f = baseHtml (Just "file info") $ do H.head $ do H.title "File Information" mkBody f where mkBody file = do let filePath = file ^. fpath let fileName = file ^. fname let fileTime = file ^. uploadTime let privacy = file ^. public let infoLink = "bindrop.de/f/" ++ file ^. sfname H.body $ do H.header $ mainHeader mainMenu u H.div ! A.id "file-info" $ do H.h2 "Upload successful" H.p (H.toHtml $ fileName) H.p (H.toHtml $ formatTime defaultTimeLocale "%H:%M - %a %Y.%m.%d" fileTime) H.p (H.toHtml $ "Link: " ++ infoLink)
781
upload u f = baseHtml (Just "file info") $ do H.head $ do H.title "File Information" mkBody f where mkBody file = do let filePath = file ^. fpath let fileName = file ^. fname let fileTime = file ^. uploadTime let privacy = file ^. public let infoLink = "bindrop.de/f/" ++ file ^. sfname H.body $ do H.header $ mainHeader mainMenu u H.div ! A.id "file-info" $ do H.h2 "Upload successful" H.p (H.toHtml $ fileName) H.p (H.toHtml $ formatTime defaultTimeLocale "%H:%M - %a %Y.%m.%d" fileTime) H.p (H.toHtml $ "Link: " ++ infoLink)
738
false
true
1
18
311
264
116
148
null
null
chrisbloecker/Beekeeper
src/Beekeeper.hs
bsd-3-clause
help :: IO () help = do putStrLn "Usage:" putStrLn "" putStrLn "'queen' host port" putStrLn " to start a queen on host using port" putStrLn "" putStrLn "'drone' host port queenHost queenPort" putStrLn " to start a drone on host using port" putStrLn "" putStrLn "'client host port problem" putStrLn " to start a client on host using port, requestion to solve Problem"
389
help :: IO () help = do putStrLn "Usage:" putStrLn "" putStrLn "'queen' host port" putStrLn " to start a queen on host using port" putStrLn "" putStrLn "'drone' host port queenHost queenPort" putStrLn " to start a drone on host using port" putStrLn "" putStrLn "'client host port problem" putStrLn " to start a client on host using port, requestion to solve Problem"
389
help = do putStrLn "Usage:" putStrLn "" putStrLn "'queen' host port" putStrLn " to start a queen on host using port" putStrLn "" putStrLn "'drone' host port queenHost queenPort" putStrLn " to start a drone on host using port" putStrLn "" putStrLn "'client host port problem" putStrLn " to start a client on host using port, requestion to solve Problem"
375
false
true
0
7
86
76
28
48
null
null
M42/mikrokosmos
source/Stlc/Block.hs
gpl-3.0
-- | Draws a logical inference in a text block deductionBlock :: Block -> String -> [Block] -> Block deductionBlock inference label blocks = stackBlocks label top inference where top = if not (null blocks) then foldr1 (\x y -> x <> Block [" "] <> y) blocks else Block [""] -- | Draws a box around a text block
338
deductionBlock :: Block -> String -> [Block] -> Block deductionBlock inference label blocks = stackBlocks label top inference where top = if not (null blocks) then foldr1 (\x y -> x <> Block [" "] <> y) blocks else Block [""] -- | Draws a box around a text block
291
deductionBlock inference label blocks = stackBlocks label top inference where top = if not (null blocks) then foldr1 (\x y -> x <> Block [" "] <> y) blocks else Block [""] -- | Draws a box around a text block
237
true
true
0
12
88
102
53
49
null
null
vincenthz/hs-foundation
foundation/benchs/compare-libs/Parser.hs
bsd-3-clause
foundationParserStr :: F.Parser F.String F.String foundationParserStr = do F.string "Foundation" F.element ',' >> F.element ' ' F.take 12
149
foundationParserStr :: F.Parser F.String F.String foundationParserStr = do F.string "Foundation" F.element ',' >> F.element ' ' F.take 12
149
foundationParserStr = do F.string "Foundation" F.element ',' >> F.element ' ' F.take 12
99
false
true
0
9
29
55
24
31
null
null
chris-kahn/polymorphcms
src/Utils.hs
bsd-3-clause
transformFst f (x:xs) = f x : xs
32
transformFst f (x:xs) = f x : xs
32
transformFst f (x:xs) = f x : xs
32
false
false
0
7
7
25
12
13
null
null
brendanhay/gogol
gogol-run/gen/Network/Google/Run/Types/Product.hs
mpl-2.0
-- | The standard List next-page token. llrNextPageToken :: Lens' ListLocationsResponse (Maybe Text) llrNextPageToken = lens _llrNextPageToken (\ s a -> s{_llrNextPageToken = a})
186
llrNextPageToken :: Lens' ListLocationsResponse (Maybe Text) llrNextPageToken = lens _llrNextPageToken (\ s a -> s{_llrNextPageToken = a})
146
llrNextPageToken = lens _llrNextPageToken (\ s a -> s{_llrNextPageToken = a})
85
true
true
0
9
31
48
25
23
null
null
zaxtax/hakaru
haskell/Tests/RoundTrip.hs
bsd-3-clause
testCauchy :: (ABT Term abt) => abt '[] ('HMeasure 'HReal) testCauchy = cauchy (real_ 5) (prob_ 3)
98
testCauchy :: (ABT Term abt) => abt '[] ('HMeasure 'HReal) testCauchy = cauchy (real_ 5) (prob_ 3)
98
testCauchy = cauchy (real_ 5) (prob_ 3)
39
false
true
0
10
16
65
30
35
null
null
locaweb/leela
src/warpdrive/src/Leela/Data/TimeSeries.hs
apache-2.0
castToDouble (Int32 v) = Just $ fromIntegral v
47
castToDouble (Int32 v) = Just $ fromIntegral v
47
castToDouble (Int32 v) = Just $ fromIntegral v
47
false
false
0
7
8
22
10
12
null
null
shlevy/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
true_RDR = nameRdrName trueDataConName
45
true_RDR = nameRdrName trueDataConName
45
true_RDR = nameRdrName trueDataConName
45
false
false
0
5
10
9
4
5
null
null
hamishmack/haskell-gi-base
src/Data/GI/Base/ManagedPtr.hs
lgpl-2.1
unsafeCastTo :: forall o o'. (GObject o, GObject o') => (ForeignPtr o' -> o') -> o -> IO o' unsafeCastTo constructor obj = withManagedPtr obj $ \objPtr -> do GType t <- gobjectType (undefined :: o') if c_check_object_type objPtr t /= 1 then do srcType <- gobjectType obj >>= gtypeName destType <- gobjectType (undefined :: o') >>= gtypeName error $ "unsafeCastTo :: invalid conversion from " ++ srcType ++ " to " ++ destType ++ " requested." else newObject constructor objPtr -- Reference counting for constructors
579
unsafeCastTo :: forall o o'. (GObject o, GObject o') => (ForeignPtr o' -> o') -> o -> IO o' unsafeCastTo constructor obj = withManagedPtr obj $ \objPtr -> do GType t <- gobjectType (undefined :: o') if c_check_object_type objPtr t /= 1 then do srcType <- gobjectType obj >>= gtypeName destType <- gobjectType (undefined :: o') >>= gtypeName error $ "unsafeCastTo :: invalid conversion from " ++ srcType ++ " to " ++ destType ++ " requested." else newObject constructor objPtr -- Reference counting for constructors
579
unsafeCastTo constructor obj = withManagedPtr obj $ \objPtr -> do GType t <- gobjectType (undefined :: o') if c_check_object_type objPtr t /= 1 then do srcType <- gobjectType obj >>= gtypeName destType <- gobjectType (undefined :: o') >>= gtypeName error $ "unsafeCastTo :: invalid conversion from " ++ srcType ++ " to " ++ destType ++ " requested." else newObject constructor objPtr -- Reference counting for constructors
471
false
true
2
16
150
178
86
92
null
null
jdubrule/bond
compiler/src/Language/Bond/Lexer.hs
mit
float :: Parser Double float = L.signed sc float'
49
float :: Parser Double float = L.signed sc float'
49
float = L.signed sc float'
26
false
true
0
6
8
21
10
11
null
null
chreekat/yesod
yesod-core/Yesod/Content.hs
bsd-2-clause
typeAtom :: ContentType typeAtom = "application/atom+xml"
57
typeAtom :: ContentType typeAtom = "application/atom+xml"
57
typeAtom = "application/atom+xml"
33
false
true
0
6
5
18
7
11
null
null
brendanhay/gogol
gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs
mpl-2.0
-- | Description for the deal terms. (buyer-readonly) mdInventoryDescription :: Lens' MarketplaceDeal (Maybe Text) mdInventoryDescription = lens _mdInventoryDescription (\ s a -> s{_mdInventoryDescription = a})
218
mdInventoryDescription :: Lens' MarketplaceDeal (Maybe Text) mdInventoryDescription = lens _mdInventoryDescription (\ s a -> s{_mdInventoryDescription = a})
164
mdInventoryDescription = lens _mdInventoryDescription (\ s a -> s{_mdInventoryDescription = a})
103
true
true
1
9
32
51
25
26
null
null
cjdev/test-fixture
src/Control/Monad/TestFixture.hs
bsd-3-clause
{-| Like 'unTestFixture', but instead of returning the result of the computation, 'logTestFixture' returns the value written from the writer monad. Useful for testing impure functions called exclusively for side-effects that do not depend on complex prior state. -} logTestFixture :: TestFixture fixture log () a -> fixture (TestFixture fixture log ()) -> [log] logTestFixture stack env = runIdentity (logTestFixtureT stack env)
436
logTestFixture :: TestFixture fixture log () a -> fixture (TestFixture fixture log ()) -> [log] logTestFixture stack env = runIdentity (logTestFixtureT stack env)
162
logTestFixture stack env = runIdentity (logTestFixtureT stack env)
66
true
true
0
10
69
65
32
33
null
null
hemio-ev/libghc-acme
test/TestIntegration.hs
lgpl-3.0
newUnsafeTestManager :: IO Manager newUnsafeTestManager = newManager (mkManagerSettings (TLSSettingsSimple True False False) Nothing) {managerResponseTimeout = responseTimeoutMicro 3000000}
201
newUnsafeTestManager :: IO Manager newUnsafeTestManager = newManager (mkManagerSettings (TLSSettingsSimple True False False) Nothing) {managerResponseTimeout = responseTimeoutMicro 3000000}
201
newUnsafeTestManager = newManager (mkManagerSettings (TLSSettingsSimple True False False) Nothing) {managerResponseTimeout = responseTimeoutMicro 3000000}
166
false
true
0
10
28
46
23
23
null
null
GaloisInc/pads-haskell
Examples/Binary.hs
bsd-3-clause
{- on a little endian machine -} int32_result :: (Int32, Base_md) = unsafePerformIO $ parseFileWith Native.int32_parseM binary_input_file
137
int32_result :: (Int32, Base_md) = unsafePerformIO $ parseFileWith Native.int32_parseM binary_input_file
104
int32_result :: (Int32, Base_md) = unsafePerformIO $ parseFileWith Native.int32_parseM binary_input_file
104
true
false
1
7
16
30
15
15
null
null
danidiaz/foldl-transduce-pipes
src/Pipes/Transduce/Internal.hs
bsd-3-clause
mapperFoldable :: Foldable f => (a -> f b) -- ^ -> Transducer Continuous a e b -- ^ mapperFoldable f = F (Data.Foldable.toList . f)
145
mapperFoldable :: Foldable f => (a -> f b) -- ^ -> Transducer Continuous a e b mapperFoldable f = F (Data.Foldable.toList . f)
140
mapperFoldable f = F (Data.Foldable.toList . f)
47
true
true
0
10
39
63
31
32
null
null
airtial/hellolisp.scala
src/Language/Parser.hs
mit
string :: Parser Expression string = String . pack <$> Token.stringLiteral lexer
80
string :: Parser Expression string = String . pack <$> Token.stringLiteral lexer
80
string = String . pack <$> Token.stringLiteral lexer
52
false
true
1
7
11
30
13
17
null
null
seereason/cabal
cabal-install/Distribution/Client/InstallPlan.hs
bsd-3-clause
completed :: InstalledPackageId -> BuildSuccess -> InstallPlan -> InstallPlan completed pkgid buildResult plan = assert (invariant plan') plan' where plan' = plan { -- NB: installation can change the IPID, so better -- record it in the fake mapping... planFakeMap = insert_fake_mapping buildResult $ planFakeMap plan, planIndex = PackageIndex.insert installed . PackageIndex.deleteInstalledPackageId pkgid $ planIndex plan } -- ...but be sure to use the *old* IPID for the lookup for the -- preexisting record installed = Installed (lookupProcessingPackage plan pkgid) buildResult insert_fake_mapping (BuildOk _ _ (Just ipi)) = Map.insert pkgid (installedPackageId ipi) insert_fake_mapping _ = id -- | Marks a package in the graph as having failed. It also marks all the -- packages that depended on it as having failed. -- -- * The package must exist in the graph and be in the processing -- state. --
1,127
completed :: InstalledPackageId -> BuildSuccess -> InstallPlan -> InstallPlan completed pkgid buildResult plan = assert (invariant plan') plan' where plan' = plan { -- NB: installation can change the IPID, so better -- record it in the fake mapping... planFakeMap = insert_fake_mapping buildResult $ planFakeMap plan, planIndex = PackageIndex.insert installed . PackageIndex.deleteInstalledPackageId pkgid $ planIndex plan } -- ...but be sure to use the *old* IPID for the lookup for the -- preexisting record installed = Installed (lookupProcessingPackage plan pkgid) buildResult insert_fake_mapping (BuildOk _ _ (Just ipi)) = Map.insert pkgid (installedPackageId ipi) insert_fake_mapping _ = id -- | Marks a package in the graph as having failed. It also marks all the -- packages that depended on it as having failed. -- -- * The package must exist in the graph and be in the processing -- state. --
1,127
completed pkgid buildResult plan = assert (invariant plan') plan' where plan' = plan { -- NB: installation can change the IPID, so better -- record it in the fake mapping... planFakeMap = insert_fake_mapping buildResult $ planFakeMap plan, planIndex = PackageIndex.insert installed . PackageIndex.deleteInstalledPackageId pkgid $ planIndex plan } -- ...but be sure to use the *old* IPID for the lookup for the -- preexisting record installed = Installed (lookupProcessingPackage plan pkgid) buildResult insert_fake_mapping (BuildOk _ _ (Just ipi)) = Map.insert pkgid (installedPackageId ipi) insert_fake_mapping _ = id -- | Marks a package in the graph as having failed. It also marks all the -- packages that depended on it as having failed. -- -- * The package must exist in the graph and be in the processing -- state. --
1,029
false
true
0
10
363
167
87
80
null
null
evolutics/haskell-formatter
src/library/Language/Haskell/Formatter/Process/CodeOrdering.hs
gpl-3.0
replaceImportDeclarations :: ([Syntax.ImportDecl a] -> [Syntax.ImportDecl a]) -> Source.Module a -> Source.Module a replaceImportDeclarations function (Syntax.Module a h p importDeclarations d) = Syntax.Module a h p importDeclarations' d where importDeclarations' = function importDeclarations
351
replaceImportDeclarations :: ([Syntax.ImportDecl a] -> [Syntax.ImportDecl a]) -> Source.Module a -> Source.Module a replaceImportDeclarations function (Syntax.Module a h p importDeclarations d) = Syntax.Module a h p importDeclarations' d where importDeclarations' = function importDeclarations
351
replaceImportDeclarations function (Syntax.Module a h p importDeclarations d) = Syntax.Module a h p importDeclarations' d where importDeclarations' = function importDeclarations
181
false
true
0
10
90
97
47
50
null
null
nickbart1980/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
acute 'n' = "ń"
15
acute 'n' = "ń"
15
acute 'n' = "ń"
15
false
false
0
5
3
9
4
5
null
null
ksaveljev/hake-2
src/Constants.hs
bsd-3-clause
-- entity_state_t->effects -- Effects are things handled on the client side (lights, particles, frame animations) -- that happen constantly on the given entity. -- An entity that has effects will be sent to the client -- even if it has a zero index model. efRotate = 0x00000001 :: Int
290
efRotate = 0x00000001 :: Int
34
efRotate = 0x00000001 :: Int
34
true
false
0
4
54
14
10
4
null
null
apyrgio/snf-ganeti
src/Ganeti/Logging.hs
bsd-2-clause
-- | Log at info level. logInfo :: String -> IO () logInfo = infoM rootLoggerName
81
logInfo :: String -> IO () logInfo = infoM rootLoggerName
57
logInfo = infoM rootLoggerName
30
true
true
0
7
15
24
12
12
null
null
ian-ross/cabal
cabal-install/Distribution/Client/Setup.hs
bsd-3-clause
parseDependencyOrPackageId :: Parse.ReadP r Dependency parseDependencyOrPackageId = parse Parse.+++ liftM pkgidToDependency parse where pkgidToDependency :: PackageIdentifier -> Dependency pkgidToDependency p = case packageVersion p of Version [] _ -> Dependency (packageName p) anyVersion version -> Dependency (packageName p) (thisVersion version)
376
parseDependencyOrPackageId :: Parse.ReadP r Dependency parseDependencyOrPackageId = parse Parse.+++ liftM pkgidToDependency parse where pkgidToDependency :: PackageIdentifier -> Dependency pkgidToDependency p = case packageVersion p of Version [] _ -> Dependency (packageName p) anyVersion version -> Dependency (packageName p) (thisVersion version)
376
parseDependencyOrPackageId = parse Parse.+++ liftM pkgidToDependency parse where pkgidToDependency :: PackageIdentifier -> Dependency pkgidToDependency p = case packageVersion p of Version [] _ -> Dependency (packageName p) anyVersion version -> Dependency (packageName p) (thisVersion version)
321
false
true
3
7
66
101
49
52
null
null
mariolameiras/Natercio-Sequence
Main.hs
gpl-2.0
nat 0 = 0
9
nat 0 = 0
9
nat 0 = 0
9
false
false
1
5
3
13
4
9
null
null
leshchevds/ganeti
src/Ganeti/MaintD/MemoryState.hs
bsd-2-clause
rmEvacuated :: IORef MemoryState -> String -> IO () rmEvacuated memstate name = do runModifyRpc $ rmMaintdEvacuated name atomicModifyWithLens_ memstate msEvacuatedL $ filter (/= name) -- | Get the list of incidents fo the authoritative copy and update the -- in-memory state.
280
rmEvacuated :: IORef MemoryState -> String -> IO () rmEvacuated memstate name = do runModifyRpc $ rmMaintdEvacuated name atomicModifyWithLens_ memstate msEvacuatedL $ filter (/= name) -- | Get the list of incidents fo the authoritative copy and update the -- in-memory state.
280
rmEvacuated memstate name = do runModifyRpc $ rmMaintdEvacuated name atomicModifyWithLens_ memstate msEvacuatedL $ filter (/= name) -- | Get the list of incidents fo the authoritative copy and update the -- in-memory state.
228
false
true
0
10
46
68
31
37
null
null
srijs/haskell-lambda-term-zipper
src/Data/Lambda/Term/Zipper.hs
mit
left loc = loc
14
left loc = loc
14
left loc = loc
14
false
false
1
5
3
13
4
9
null
null
clample/lamdabtc
backend/src/BitcoinCore/Keys.hs
bsd-3-clause
serializePrivateKey :: PrivateKey -> ByteString serializePrivateKey = BL.toStrict . Put.runPut . Put.putByteString . unrollWithPad BE 32 . fromIntegral . private_d
175
serializePrivateKey :: PrivateKey -> ByteString serializePrivateKey = BL.toStrict . Put.runPut . Put.putByteString . unrollWithPad BE 32 . fromIntegral . private_d
175
serializePrivateKey = BL.toStrict . Put.runPut . Put.putByteString . unrollWithPad BE 32 . fromIntegral . private_d
127
false
true
5
5
31
52
23
29
null
null
m-alvarez/jhc
src/FrontEnd/Tc/Type.hs
mit
followTaus :: MonadIO m => Type -> m Type followTaus tv@(TMetaVar mv@MetaVar {metaRef = r }) | not (isBoxyMetaVar mv) = liftIO $ do rt <- readIORef r case rt of Nothing -> return tv Just t -> do t' <- followTaus t writeIORef r (Just t') return t'
306
followTaus :: MonadIO m => Type -> m Type followTaus tv@(TMetaVar mv@MetaVar {metaRef = r }) | not (isBoxyMetaVar mv) = liftIO $ do rt <- readIORef r case rt of Nothing -> return tv Just t -> do t' <- followTaus t writeIORef r (Just t') return t'
306
followTaus tv@(TMetaVar mv@MetaVar {metaRef = r }) | not (isBoxyMetaVar mv) = liftIO $ do rt <- readIORef r case rt of Nothing -> return tv Just t -> do t' <- followTaus t writeIORef r (Just t') return t'
264
false
true
0
16
108
133
60
73
null
null
bgwines/project-euler
src/solved/problem78.hs
bsd-3-clause
generalized_pents :: [Integer] generalized_pents = map pent alternatings
72
generalized_pents :: [Integer] generalized_pents = map pent alternatings
72
generalized_pents = map pent alternatings
41
false
true
0
5
7
19
10
9
null
null
mbakke/ganeti
src/Ganeti/Parsers.hs
bsd-2-clause
-- | A parser recognizing a number preceeded by spaces. numberP :: Parser Int numberP = skipSpaces *> A.decimal
111
numberP :: Parser Int numberP = skipSpaces *> A.decimal
55
numberP = skipSpaces *> A.decimal
33
true
true
2
6
18
29
13
16
null
null
iblumenfeld/saw-core
src/Verifier/SAW/Prelude/Constants.hs
bsd-3-clause
preludeFloatIdent :: Ident preludeFloatIdent = mkIdent preludeModuleName "Float"
81
preludeFloatIdent :: Ident preludeFloatIdent = mkIdent preludeModuleName "Float"
81
preludeFloatIdent = mkIdent preludeModuleName "Float"
54
false
true
0
6
8
22
9
13
null
null
rahulmutt/ghcvm
compiler/Eta/SimplStg/UnariseStg.hs
bsd-3-clause
unariseExpr us rho (StgCase e case_lives alts_lives bndr srt alt_ty alts) = StgCase (unariseExpr us1 rho e) (unariseLives rho case_lives) (unariseLives rho alts_lives) bndr (unariseSRT rho srt) alt_ty' alts' where (us1, us2) = splitUniqSupply us (alt_ty', alts') = unariseAlts us2 rho alt_ty bndr (repType (idType bndr)) alts
360
unariseExpr us rho (StgCase e case_lives alts_lives bndr srt alt_ty alts) = StgCase (unariseExpr us1 rho e) (unariseLives rho case_lives) (unariseLives rho alts_lives) bndr (unariseSRT rho srt) alt_ty' alts' where (us1, us2) = splitUniqSupply us (alt_ty', alts') = unariseAlts us2 rho alt_ty bndr (repType (idType bndr)) alts
360
unariseExpr us rho (StgCase e case_lives alts_lives bndr srt alt_ty alts) = StgCase (unariseExpr us1 rho e) (unariseLives rho case_lives) (unariseLives rho alts_lives) bndr (unariseSRT rho srt) alt_ty' alts' where (us1, us2) = splitUniqSupply us (alt_ty', alts') = unariseAlts us2 rho alt_ty bndr (repType (idType bndr)) alts
360
false
false
0
9
81
142
67
75
null
null
brendanhay/gogol
gogol-vision/gen/Network/Google/Vision/Types/Product.hs
mpl-2.0
-- | The bounding polygon for the crop region. The coordinates of the -- bounding box are in the original image\'s scale. gcvvch1BoundingPoly :: Lens' GoogleCloudVisionV1p3beta1CropHint (Maybe GoogleCloudVisionV1p3beta1BoundingPoly) gcvvch1BoundingPoly = lens _gcvvch1BoundingPoly (\ s a -> s{_gcvvch1BoundingPoly = a})
327
gcvvch1BoundingPoly :: Lens' GoogleCloudVisionV1p3beta1CropHint (Maybe GoogleCloudVisionV1p3beta1BoundingPoly) gcvvch1BoundingPoly = lens _gcvvch1BoundingPoly (\ s a -> s{_gcvvch1BoundingPoly = a})
205
gcvvch1BoundingPoly = lens _gcvvch1BoundingPoly (\ s a -> s{_gcvvch1BoundingPoly = a})
94
true
true
1
9
46
52
26
26
null
null
prt2121/haskell-practice
cis194-s13/src/HigherOrder04.hs
apache-2.0
treeHeight (Node depth _ _ _) = depth
37
treeHeight (Node depth _ _ _) = depth
37
treeHeight (Node depth _ _ _) = depth
37
false
false
0
7
7
21
10
11
null
null
GaloisInc/halvm-ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprLit i (RationalL rat) = parensIf (i > noPrec) $ integer (numerator rat) <+> char '/' <+> integer (denominator rat)
174
pprLit i (RationalL rat) = parensIf (i > noPrec) $ integer (numerator rat) <+> char '/' <+> integer (denominator rat)
174
pprLit i (RationalL rat) = parensIf (i > noPrec) $ integer (numerator rat) <+> char '/' <+> integer (denominator rat)
174
false
false
0
10
76
62
28
34
null
null
elieux/ghc
compiler/main/DynFlags.hs
bsd-3-clause
defaultFlushErr :: FlushErr defaultFlushErr = FlushErr $ hFlush stderr
70
defaultFlushErr :: FlushErr defaultFlushErr = FlushErr $ hFlush stderr
70
defaultFlushErr = FlushErr $ hFlush stderr
42
false
true
0
6
8
18
9
9
null
null
badp/ganeti
src/Ganeti/Monitoring/Server.hs
gpl-2.0
errorReport :: Snap () errorReport = do modifyResponse $ setResponseStatus 404 "Not found" writeBS "Unable to produce a report for the requested resource"
158
errorReport :: Snap () errorReport = do modifyResponse $ setResponseStatus 404 "Not found" writeBS "Unable to produce a report for the requested resource"
158
errorReport = do modifyResponse $ setResponseStatus 404 "Not found" writeBS "Unable to produce a report for the requested resource"
135
false
true
0
8
26
34
15
19
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/ExtensionPredicates.hs
bsd-3-clause
-- | Is the <https://www.opengl.org/registry/specs/NV/sample_locations.txt NV_sample_locations> extension supported? glGetNVSampleLocations :: MonadIO m => m Bool glGetNVSampleLocations = getExtensions >>= (return . member "GL_NV_sample_locations")
248
glGetNVSampleLocations :: MonadIO m => m Bool glGetNVSampleLocations = getExtensions >>= (return . member "GL_NV_sample_locations")
131
glGetNVSampleLocations = getExtensions >>= (return . member "GL_NV_sample_locations")
85
true
true
0
8
22
36
18
18
null
null
keithodulaigh/Hets
CspCASL/CspCASL_Keywords.hs
gpl-2.0
doubleSemis :: String doubleSemis = ";;"
40
doubleSemis :: String doubleSemis = ";;"
40
doubleSemis = ";;"
18
false
true
0
4
5
11
6
5
null
null
tphyahoo/haskoin
haskoin-core/Network/Haskoin/Crypto/ExtendedKeys.hs
unlicense
hardSubKey :: XPrvKey -- ^ Extended Parent private key -> KeyIndex -- ^ Child derivation index -> XPrvKey -- ^ Extended child private key hardSubKey xkey child | child >= 0 && child < 0x80000000 = XPrvKey (xPrvDepth xkey + 1) (xPrvFP xkey) i c k | otherwise = error "Invalid child derivation index" where i = setBit child 31 msg = BS.append (bsPadPrvKey $ xPrvKey xkey) (encode' i) (a, c) = split512 $ hmac512 (encode' $ xPrvChain xkey) msg k = fromMaybe err $ tweakPrvKeyC (xPrvKey xkey) a err = throw $ DerivationException "Invalid hardSubKey derivation" -- | Returns True if the extended private key was derived through a hard -- derivation.
723
hardSubKey :: XPrvKey -- ^ Extended Parent private key -> KeyIndex -- ^ Child derivation index -> XPrvKey hardSubKey xkey child | child >= 0 && child < 0x80000000 = XPrvKey (xPrvDepth xkey + 1) (xPrvFP xkey) i c k | otherwise = error "Invalid child derivation index" where i = setBit child 31 msg = BS.append (bsPadPrvKey $ xPrvKey xkey) (encode' i) (a, c) = split512 $ hmac512 (encode' $ xPrvChain xkey) msg k = fromMaybe err $ tweakPrvKeyC (xPrvKey xkey) a err = throw $ DerivationException "Invalid hardSubKey derivation" -- | Returns True if the extended private key was derived through a hard -- derivation.
690
hardSubKey xkey child | child >= 0 && child < 0x80000000 = XPrvKey (xPrvDepth xkey + 1) (xPrvFP xkey) i c k | otherwise = error "Invalid child derivation index" where i = setBit child 31 msg = BS.append (bsPadPrvKey $ xPrvKey xkey) (encode' i) (a, c) = split512 $ hmac512 (encode' $ xPrvChain xkey) msg k = fromMaybe err $ tweakPrvKeyC (xPrvKey xkey) a err = throw $ DerivationException "Invalid hardSubKey derivation" -- | Returns True if the extended private key was derived through a hard -- derivation.
561
true
true
4
10
191
204
97
107
null
null
avh4/elm-format
elm-format-lib/src/Parse/Module.hs
bsd-3-clause
topLevel :: IParser a -> IParser [TopLevelStructure a] topLevel entry = (++) <$> option [] (((\x -> [x]) <$> Decl.topLevelStructure entry)) <*> (concat <$> many (freshDef entry))
186
topLevel :: IParser a -> IParser [TopLevelStructure a] topLevel entry = (++) <$> option [] (((\x -> [x]) <$> Decl.topLevelStructure entry)) <*> (concat <$> many (freshDef entry))
186
topLevel entry = (++) <$> option [] (((\x -> [x]) <$> Decl.topLevelStructure entry)) <*> (concat <$> many (freshDef entry))
131
false
true
3
12
34
93
48
45
null
null
Peaker/keyvaluehash
src/Database/KeyValueHash.hs
bsd-3-clause
mkHashFunc :: String -> (Key -> Word64) -> HashFunction mkHashFunc name f = HashFunction { hfName = name , hfHash = cap . f }
131
mkHashFunc :: String -> (Key -> Word64) -> HashFunction mkHashFunc name f = HashFunction { hfName = name , hfHash = cap . f }
131
mkHashFunc name f = HashFunction { hfName = name , hfHash = cap . f }
75
false
true
0
9
30
58
29
29
null
null
UCSD-PL/RefScript
src/Language/Rsc/Environment.hs
bsd-3-clause
safeEnvFindTy :: (CheckingEnvironment r t, IsLocated l, Symbolic x, Monad m) => l -> t r -> x -> m (RType r) -------------------------------------------------------------------------------- safeEnvFindTy l γ x | Just t <- chkEnvFindTy x γ = return t | otherwise = die $ bugEnvFindTy (srcPos l) (F.symbol x)
340
safeEnvFindTy :: (CheckingEnvironment r t, IsLocated l, Symbolic x, Monad m) => l -> t r -> x -> m (RType r) safeEnvFindTy l γ x | Just t <- chkEnvFindTy x γ = return t | otherwise = die $ bugEnvFindTy (srcPos l) (F.symbol x)
259
safeEnvFindTy l γ x | Just t <- chkEnvFindTy x γ = return t | otherwise = die $ bugEnvFindTy (srcPos l) (F.symbol x)
136
true
true
0
11
80
130
60
70
null
null
mainland/nikola
examples/mandelbrot/Mandelbrot/RepaV3.hs
bsd-3-clause
magnitude :: Complex -> R magnitude (x,y) = x*x + y*y
53
magnitude :: Complex -> R magnitude (x,y) = x*x + y*y
53
magnitude (x,y) = x*x + y*y
27
false
true
4
8
10
47
20
27
null
null
narurien/ganeti-ceph
test/hs/Test/Ganeti/TestCommon.hs
gpl-2.0
-- | Run Python with an expression, returning the exit code, standard -- output and error. runPython :: String -> String -> IO (ExitCode, String, String) runPython expr stdin = do py_binary <- pythonCmd readProcessWithExitCode py_binary ["-c", expr] stdin -- | Check python exit code, and fail via HUnit assertions if -- non-zero. Otherwise, return the standard output.
374
runPython :: String -> String -> IO (ExitCode, String, String) runPython expr stdin = do py_binary <- pythonCmd readProcessWithExitCode py_binary ["-c", expr] stdin -- | Check python exit code, and fail via HUnit assertions if -- non-zero. Otherwise, return the standard output.
283
runPython expr stdin = do py_binary <- pythonCmd readProcessWithExitCode py_binary ["-c", expr] stdin -- | Check python exit code, and fail via HUnit assertions if -- non-zero. Otherwise, return the standard output.
220
true
true
0
8
62
63
34
29
null
null
kRITZCREEK/psc-ide
src/PureScript/Ide.hs
mit
caseSplit :: (PscIde m, MonadLogger m, MonadError PscIdeError m) => Text -> Int -> Int -> CS.WildcardAnnotations -> Text -> m Success caseSplit l b e csa t = do patterns <- CS.makePattern l b e csa <$> CS.caseSplit t pure (MultilineTextResult patterns)
258
caseSplit :: (PscIde m, MonadLogger m, MonadError PscIdeError m) => Text -> Int -> Int -> CS.WildcardAnnotations -> Text -> m Success caseSplit l b e csa t = do patterns <- CS.makePattern l b e csa <$> CS.caseSplit t pure (MultilineTextResult patterns)
258
caseSplit l b e csa t = do patterns <- CS.makePattern l b e csa <$> CS.caseSplit t pure (MultilineTextResult patterns)
122
false
true
0
12
48
114
53
61
null
null
ComputationWithBoundedResources/tct-trs
src/Tct/Trs/Processor/Matrix/NaturalMI.hs
bsd-3-clause
gThreeConstraints :: Int -> (Int -> Int -> Int -> Int -> Int -> Int -> SMT.Formula w) -> I.Interpretation fun (MI.LinearInterpretation a (SMT.IExpr w)) -> SMT.SmtSolverSt w (SMT.Formula w) gThreeConstraints dim gthree mi = return $ SMT.bigAnd [ f i j k x y z | i <- toD, j <- toD, k <- toD, x <- toD, y <- toD, z <- toD ] where toD = [1..dim] f i j k x y z = (gthree i j k x y z) .<=> SMT.bigOr (map (SMT.bigOr . map (g i j k x y z) . Map.elems . MI.coefficients) $ Map.elems $ I.interpretations mi) g i j k x y z m = (EncM.mEntry i x m .>= one) .&& (EncM.mEntry j y m .>= one) .&& (EncM.mEntry k z m .>= one)
670
gThreeConstraints :: Int -> (Int -> Int -> Int -> Int -> Int -> Int -> SMT.Formula w) -> I.Interpretation fun (MI.LinearInterpretation a (SMT.IExpr w)) -> SMT.SmtSolverSt w (SMT.Formula w) gThreeConstraints dim gthree mi = return $ SMT.bigAnd [ f i j k x y z | i <- toD, j <- toD, k <- toD, x <- toD, y <- toD, z <- toD ] where toD = [1..dim] f i j k x y z = (gthree i j k x y z) .<=> SMT.bigOr (map (SMT.bigOr . map (g i j k x y z) . Map.elems . MI.coefficients) $ Map.elems $ I.interpretations mi) g i j k x y z m = (EncM.mEntry i x m .>= one) .&& (EncM.mEntry j y m .>= one) .&& (EncM.mEntry k z m .>= one)
670
gThreeConstraints dim gthree mi = return $ SMT.bigAnd [ f i j k x y z | i <- toD, j <- toD, k <- toD, x <- toD, y <- toD, z <- toD ] where toD = [1..dim] f i j k x y z = (gthree i j k x y z) .<=> SMT.bigOr (map (SMT.bigOr . map (g i j k x y z) . Map.elems . MI.coefficients) $ Map.elems $ I.interpretations mi) g i j k x y z m = (EncM.mEntry i x m .>= one) .&& (EncM.mEntry j y m .>= one) .&& (EncM.mEntry k z m .>= one)
442
false
true
0
17
196
370
182
188
null
null
tingtun/jmacro
Language/Javascript/JMacro/TypeCheck.hs
bsd-3-clause
prettyType :: JType -> TMonad String prettyType x = do xt <- resolveType x names <- freeVarsWithNames xt let replaceNames (JTFree ref) = JTFree $ fixRef ref replaceNames (JTForall refs t) = JTForall (map fixRef refs) $ replaceNames t replaceNames v = composOp1 replaceNames v fixRef (_,ref) = (M.lookup ref names, ref) prettyConstraints ref = map go <$> lookupConstraintsList (Nothing, ref) where myName = case M.lookup ref names of Just n -> n Nothing -> "t_"++show ref go (Sub t) = myName ++ " <: " ++ (show $ jsToDoc $ replaceNames t) go (Super t) = (show $ jsToDoc $ replaceNames t) ++ " <: " ++ myName constraintStrings <- nub . concat <$> mapM prettyConstraints (M.keys names) let constraintStr | null constraintStrings = "" | otherwise = "(" ++ intercalate ", " constraintStrings ++ ") => " return $ constraintStr ++ (show . jsToDoc $ replaceNames xt)
1,011
prettyType :: JType -> TMonad String prettyType x = do xt <- resolveType x names <- freeVarsWithNames xt let replaceNames (JTFree ref) = JTFree $ fixRef ref replaceNames (JTForall refs t) = JTForall (map fixRef refs) $ replaceNames t replaceNames v = composOp1 replaceNames v fixRef (_,ref) = (M.lookup ref names, ref) prettyConstraints ref = map go <$> lookupConstraintsList (Nothing, ref) where myName = case M.lookup ref names of Just n -> n Nothing -> "t_"++show ref go (Sub t) = myName ++ " <: " ++ (show $ jsToDoc $ replaceNames t) go (Super t) = (show $ jsToDoc $ replaceNames t) ++ " <: " ++ myName constraintStrings <- nub . concat <$> mapM prettyConstraints (M.keys names) let constraintStr | null constraintStrings = "" | otherwise = "(" ++ intercalate ", " constraintStrings ++ ") => " return $ constraintStr ++ (show . jsToDoc $ replaceNames xt)
1,011
prettyType x = do xt <- resolveType x names <- freeVarsWithNames xt let replaceNames (JTFree ref) = JTFree $ fixRef ref replaceNames (JTForall refs t) = JTForall (map fixRef refs) $ replaceNames t replaceNames v = composOp1 replaceNames v fixRef (_,ref) = (M.lookup ref names, ref) prettyConstraints ref = map go <$> lookupConstraintsList (Nothing, ref) where myName = case M.lookup ref names of Just n -> n Nothing -> "t_"++show ref go (Sub t) = myName ++ " <: " ++ (show $ jsToDoc $ replaceNames t) go (Super t) = (show $ jsToDoc $ replaceNames t) ++ " <: " ++ myName constraintStrings <- nub . concat <$> mapM prettyConstraints (M.keys names) let constraintStr | null constraintStrings = "" | otherwise = "(" ++ intercalate ", " constraintStrings ++ ") => " return $ constraintStr ++ (show . jsToDoc $ replaceNames xt)
974
false
true
0
16
301
374
176
198
null
null
jamesdabbs/pi-base-2
src/Config.hs
bsd-3-clause
putConf :: Config -> IO Config putConf c = do mc <- readIORef confRef case mc of Nothing -> return () Just old -> case getEnv old of Production -> error "Refusing to overwrite global Config cache" _ -> putStrLn "*** WARNING: overwriting global Config cache" writeIORef confRef $ Just c return c -- This assumes that `putConf` has been called previously (as it is on app boot)
414
putConf :: Config -> IO Config putConf c = do mc <- readIORef confRef case mc of Nothing -> return () Just old -> case getEnv old of Production -> error "Refusing to overwrite global Config cache" _ -> putStrLn "*** WARNING: overwriting global Config cache" writeIORef confRef $ Just c return c -- This assumes that `putConf` has been called previously (as it is on app boot)
414
putConf c = do mc <- readIORef confRef case mc of Nothing -> return () Just old -> case getEnv old of Production -> error "Refusing to overwrite global Config cache" _ -> putStrLn "*** WARNING: overwriting global Config cache" writeIORef confRef $ Just c return c -- This assumes that `putConf` has been called previously (as it is on app boot)
383
false
true
0
13
106
103
45
58
null
null
ggreif/clash-compiler
clash-lib/src/CLaSH/Driver/TopWrapper.hs
bsd-2-clause
-- | Generate output port mappings mkOutput :: [Identifier] -> (Identifier,HWType) -> Int -> ( [Identifier] , ( [(Identifier,HWType)] , ( [Declaration] , Identifier ) ) ) mkOutput nms (i,hwty) cnt = case hwty of Vector sz hwty' -> let (nms',(ports',(decls',ids))) = second ( (concat *** (first concat . unzip)) . unzip ) $ mapAccumL (\nm c -> mkOutput nm (iName,hwty') c) nms [0..(sz-1)] netdecl = NetDecl iName hwty assigns = zipWith (\id_ n -> Assignment id_ (Identifier iName (Just (Indexed (hwty,10,n))))) ids [0..] in (nms',(ports',(netdecl:assigns ++ decls',iName))) Product _ hwtys -> let (nms',(ports',(decls',ids))) = second ( (concat *** (first concat . unzip)) . unzip ) $ mapAccumL (\nm (inp,c) -> mkOutput nm inp c) nms (zip (map (iName,) hwtys) [0..]) netdecl = NetDecl iName hwty assigns = zipWith (\id_ n -> Assignment id_ (Identifier iName (Just (Indexed (hwty,0,n))))) ids [0..] in (nms',(ports',(netdecl:assigns ++ decls',iName))) _ -> case nms of [] -> (nms,([(iName,hwty)],([],iName))) (n:nms') -> (nms',([(n,hwty)],([],n))) where iName = append i (pack ("_" ++ show cnt)) -- | Create clock generators
1,745
mkOutput :: [Identifier] -> (Identifier,HWType) -> Int -> ( [Identifier] , ( [(Identifier,HWType)] , ( [Declaration] , Identifier ) ) ) mkOutput nms (i,hwty) cnt = case hwty of Vector sz hwty' -> let (nms',(ports',(decls',ids))) = second ( (concat *** (first concat . unzip)) . unzip ) $ mapAccumL (\nm c -> mkOutput nm (iName,hwty') c) nms [0..(sz-1)] netdecl = NetDecl iName hwty assigns = zipWith (\id_ n -> Assignment id_ (Identifier iName (Just (Indexed (hwty,10,n))))) ids [0..] in (nms',(ports',(netdecl:assigns ++ decls',iName))) Product _ hwtys -> let (nms',(ports',(decls',ids))) = second ( (concat *** (first concat . unzip)) . unzip ) $ mapAccumL (\nm (inp,c) -> mkOutput nm inp c) nms (zip (map (iName,) hwtys) [0..]) netdecl = NetDecl iName hwty assigns = zipWith (\id_ n -> Assignment id_ (Identifier iName (Just (Indexed (hwty,0,n))))) ids [0..] in (nms',(ports',(netdecl:assigns ++ decls',iName))) _ -> case nms of [] -> (nms,([(iName,hwty)],([],iName))) (n:nms') -> (nms',([(n,hwty)],([],n))) where iName = append i (pack ("_" ++ show cnt)) -- | Create clock generators
1,710
mkOutput nms (i,hwty) cnt = case hwty of Vector sz hwty' -> let (nms',(ports',(decls',ids))) = second ( (concat *** (first concat . unzip)) . unzip ) $ mapAccumL (\nm c -> mkOutput nm (iName,hwty') c) nms [0..(sz-1)] netdecl = NetDecl iName hwty assigns = zipWith (\id_ n -> Assignment id_ (Identifier iName (Just (Indexed (hwty,10,n))))) ids [0..] in (nms',(ports',(netdecl:assigns ++ decls',iName))) Product _ hwtys -> let (nms',(ports',(decls',ids))) = second ( (concat *** (first concat . unzip)) . unzip ) $ mapAccumL (\nm (inp,c) -> mkOutput nm inp c) nms (zip (map (iName,) hwtys) [0..]) netdecl = NetDecl iName hwty assigns = zipWith (\id_ n -> Assignment id_ (Identifier iName (Just (Indexed (hwty,0,n))))) ids [0..] in (nms',(ports',(netdecl:assigns ++ decls',iName))) _ -> case nms of [] -> (nms,([(iName,hwty)],([],iName))) (n:nms') -> (nms',([(n,hwty)],([],n))) where iName = append i (pack ("_" ++ show cnt)) -- | Create clock generators
1,463
true
true
0
22
793
631
353
278
null
null
csrhodes/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
inlineCommands :: M.Map String (LP Inlines) inlineCommands = M.fromList $ [ ("emph", extractSpaces emph <$> tok) , ("textit", extractSpaces emph <$> tok) , ("textsl", extractSpaces emph <$> tok) , ("textsc", extractSpaces smallcaps <$> tok) , ("sout", extractSpaces strikeout <$> tok) , ("textsuperscript", extractSpaces superscript <$> tok) , ("textsubscript", extractSpaces subscript <$> tok) , ("textbackslash", lit "\\") , ("backslash", lit "\\") , ("slash", lit "/") , ("textbf", extractSpaces strong <$> tok) , ("textnormal", extractSpaces (spanWith ("",["nodecor"],[])) <$> tok) , ("ldots", lit "…") , ("dots", lit "…") , ("mdots", lit "…") , ("sim", lit "~") , ("label", unlessParseRaw >> (inBrackets <$> tok)) , ("ref", unlessParseRaw >> (inBrackets <$> tok)) , ("noindent", unlessParseRaw >> return mempty) , ("textgreek", tok) , ("sep", lit ",") , ("cref", unlessParseRaw >> (inBrackets <$> tok)) -- from cleveref.sty , ("(", mathInline $ manyTill anyChar (try $ string "\\)")) , ("[", mathDisplay $ manyTill anyChar (try $ string "\\]")) , ("ensuremath", mathInline braced) , ("texorpdfstring", (\_ x -> x) <$> tok <*> tok) , ("P", lit "¶") , ("S", lit "§") , ("$", lit "$") , ("%", lit "%") , ("&", lit "&") , ("#", lit "#") , ("_", lit "_") , ("{", lit "{") , ("}", lit "}") -- old TeX commands , ("em", extractSpaces emph <$> inlines) , ("it", extractSpaces emph <$> inlines) , ("sl", extractSpaces emph <$> inlines) , ("bf", extractSpaces strong <$> inlines) , ("rm", inlines) , ("itshape", extractSpaces emph <$> inlines) , ("slshape", extractSpaces emph <$> inlines) , ("scshape", extractSpaces smallcaps <$> inlines) , ("bfseries", extractSpaces strong <$> inlines) , ("/", pure mempty) -- italic correction , ("aa", lit "å") , ("AA", lit "Å") , ("ss", lit "ß") , ("o", lit "ø") , ("O", lit "Ø") , ("L", lit "Ł") , ("l", lit "ł") , ("ae", lit "æ") , ("AE", lit "Æ") , ("oe", lit "œ") , ("OE", lit "Œ") , ("pounds", lit "£") , ("euro", lit "€") , ("copyright", lit "©") , ("textasciicircum", lit "^") , ("textasciitilde", lit "~") , ("`", option (str "`") $ try $ tok >>= accent grave) , ("'", option (str "'") $ try $ tok >>= accent acute) , ("^", option (str "^") $ try $ tok >>= accent circ) , ("~", option (str "~") $ try $ tok >>= accent tilde) , ("\"", option (str "\"") $ try $ tok >>= accent umlaut) , (".", option (str ".") $ try $ tok >>= accent dot) , ("=", option (str "=") $ try $ tok >>= accent macron) , ("c", option (str "c") $ try $ tok >>= accent cedilla) , ("v", option (str "v") $ try $ tok >>= accent hacek) , ("u", option (str "u") $ try $ tok >>= accent breve) , ("i", lit "i") , ("\\", linebreak <$ (optional (bracketed inline) *> spaces')) , (",", pure mempty) , ("@", pure mempty) , (" ", lit "\160") , ("ps", pure $ str "PS." <> space) , ("TeX", lit "TeX") , ("LaTeX", lit "LaTeX") , ("bar", lit "|") , ("textless", lit "<") , ("textgreater", lit ">") , ("thanks", (note . mconcat) <$> (char '{' *> manyTill block (char '}'))) , ("footnote", (note . mconcat) <$> (char '{' *> manyTill block (char '}'))) , ("verb", doverb) , ("lstinline", skipopts *> doverb) , ("Verb", doverb) , ("texttt", (code . stringify . toList) <$> tok) , ("url", (unescapeURL <$> braced) >>= \url -> pure (link url "" (str url))) , ("href", (unescapeURL <$> braced <* optional sp) >>= \url -> tok >>= \lab -> pure (link url "" lab)) , ("includegraphics", skipopts *> (unescapeURL <$> braced) >>= mkImage) , ("enquote", enquote) , ("cite", citation "cite" AuthorInText False) , ("citep", citation "citep" NormalCitation False) , ("citep*", citation "citep*" NormalCitation False) , ("citeal", citation "citeal" NormalCitation False) , ("citealp", citation "citealp" NormalCitation False) , ("citealp*", citation "citealp*" NormalCitation False) , ("autocite", citation "autocite" NormalCitation False) , ("smartcite", citation "smartcite" NormalCitation False) , ("footcite", inNote <$> citation "footcite" NormalCitation False) , ("parencite", citation "parencite" NormalCitation False) , ("supercite", citation "supercite" NormalCitation False) , ("footcitetext", inNote <$> citation "footcitetext" NormalCitation False) , ("citeyearpar", citation "citeyearpar" SuppressAuthor False) , ("citeyear", citation "citeyear" SuppressAuthor False) , ("autocite*", citation "autocite*" SuppressAuthor False) , ("cite*", citation "cite*" SuppressAuthor False) , ("parencite*", citation "parencite*" SuppressAuthor False) , ("textcite", citation "textcite" AuthorInText False) , ("citet", citation "citet" AuthorInText False) , ("citet*", citation "citet*" AuthorInText False) , ("citealt", citation "citealt" AuthorInText False) , ("citealt*", citation "citealt*" AuthorInText False) , ("textcites", citation "textcites" AuthorInText True) , ("cites", citation "cites" NormalCitation True) , ("autocites", citation "autocites" NormalCitation True) , ("footcites", inNote <$> citation "footcites" NormalCitation True) , ("parencites", citation "parencites" NormalCitation True) , ("supercites", citation "supercites" NormalCitation True) , ("footcitetexts", inNote <$> citation "footcitetexts" NormalCitation True) , ("Autocite", citation "Autocite" NormalCitation False) , ("Smartcite", citation "Smartcite" NormalCitation False) , ("Footcite", citation "Footcite" NormalCitation False) , ("Parencite", citation "Parencite" NormalCitation False) , ("Supercite", citation "Supercite" NormalCitation False) , ("Footcitetext", inNote <$> citation "Footcitetext" NormalCitation False) , ("Citeyearpar", citation "Citeyearpar" SuppressAuthor False) , ("Citeyear", citation "Citeyear" SuppressAuthor False) , ("Autocite*", citation "Autocite*" SuppressAuthor False) , ("Cite*", citation "Cite*" SuppressAuthor False) , ("Parencite*", citation "Parencite*" SuppressAuthor False) , ("Textcite", citation "Textcite" AuthorInText False) , ("Textcites", citation "Textcites" AuthorInText True) , ("Cites", citation "Cites" NormalCitation True) , ("Autocites", citation "Autocites" NormalCitation True) , ("Footcites", citation "Footcites" NormalCitation True) , ("Parencites", citation "Parencites" NormalCitation True) , ("Supercites", citation "Supercites" NormalCitation True) , ("Footcitetexts", inNote <$> citation "Footcitetexts" NormalCitation True) , ("citetext", complexNatbibCitation NormalCitation) , ("citeauthor", (try (tok *> optional sp *> controlSeq "citetext") *> complexNatbibCitation AuthorInText) <|> citation "citeauthor" AuthorInText False) , ("nocite", mempty <$ (citation "nocite" NormalCitation False >>= addMeta "nocite")) ] ++ map ignoreInlines -- these commands will be ignored unless --parse-raw is specified, -- in which case they will appear as raw latex blocks: [ "index" ]
7,095
inlineCommands :: M.Map String (LP Inlines) inlineCommands = M.fromList $ [ ("emph", extractSpaces emph <$> tok) , ("textit", extractSpaces emph <$> tok) , ("textsl", extractSpaces emph <$> tok) , ("textsc", extractSpaces smallcaps <$> tok) , ("sout", extractSpaces strikeout <$> tok) , ("textsuperscript", extractSpaces superscript <$> tok) , ("textsubscript", extractSpaces subscript <$> tok) , ("textbackslash", lit "\\") , ("backslash", lit "\\") , ("slash", lit "/") , ("textbf", extractSpaces strong <$> tok) , ("textnormal", extractSpaces (spanWith ("",["nodecor"],[])) <$> tok) , ("ldots", lit "…") , ("dots", lit "…") , ("mdots", lit "…") , ("sim", lit "~") , ("label", unlessParseRaw >> (inBrackets <$> tok)) , ("ref", unlessParseRaw >> (inBrackets <$> tok)) , ("noindent", unlessParseRaw >> return mempty) , ("textgreek", tok) , ("sep", lit ",") , ("cref", unlessParseRaw >> (inBrackets <$> tok)) -- from cleveref.sty , ("(", mathInline $ manyTill anyChar (try $ string "\\)")) , ("[", mathDisplay $ manyTill anyChar (try $ string "\\]")) , ("ensuremath", mathInline braced) , ("texorpdfstring", (\_ x -> x) <$> tok <*> tok) , ("P", lit "¶") , ("S", lit "§") , ("$", lit "$") , ("%", lit "%") , ("&", lit "&") , ("#", lit "#") , ("_", lit "_") , ("{", lit "{") , ("}", lit "}") -- old TeX commands , ("em", extractSpaces emph <$> inlines) , ("it", extractSpaces emph <$> inlines) , ("sl", extractSpaces emph <$> inlines) , ("bf", extractSpaces strong <$> inlines) , ("rm", inlines) , ("itshape", extractSpaces emph <$> inlines) , ("slshape", extractSpaces emph <$> inlines) , ("scshape", extractSpaces smallcaps <$> inlines) , ("bfseries", extractSpaces strong <$> inlines) , ("/", pure mempty) -- italic correction , ("aa", lit "å") , ("AA", lit "Å") , ("ss", lit "ß") , ("o", lit "ø") , ("O", lit "Ø") , ("L", lit "Ł") , ("l", lit "ł") , ("ae", lit "æ") , ("AE", lit "Æ") , ("oe", lit "œ") , ("OE", lit "Œ") , ("pounds", lit "£") , ("euro", lit "€") , ("copyright", lit "©") , ("textasciicircum", lit "^") , ("textasciitilde", lit "~") , ("`", option (str "`") $ try $ tok >>= accent grave) , ("'", option (str "'") $ try $ tok >>= accent acute) , ("^", option (str "^") $ try $ tok >>= accent circ) , ("~", option (str "~") $ try $ tok >>= accent tilde) , ("\"", option (str "\"") $ try $ tok >>= accent umlaut) , (".", option (str ".") $ try $ tok >>= accent dot) , ("=", option (str "=") $ try $ tok >>= accent macron) , ("c", option (str "c") $ try $ tok >>= accent cedilla) , ("v", option (str "v") $ try $ tok >>= accent hacek) , ("u", option (str "u") $ try $ tok >>= accent breve) , ("i", lit "i") , ("\\", linebreak <$ (optional (bracketed inline) *> spaces')) , (",", pure mempty) , ("@", pure mempty) , (" ", lit "\160") , ("ps", pure $ str "PS." <> space) , ("TeX", lit "TeX") , ("LaTeX", lit "LaTeX") , ("bar", lit "|") , ("textless", lit "<") , ("textgreater", lit ">") , ("thanks", (note . mconcat) <$> (char '{' *> manyTill block (char '}'))) , ("footnote", (note . mconcat) <$> (char '{' *> manyTill block (char '}'))) , ("verb", doverb) , ("lstinline", skipopts *> doverb) , ("Verb", doverb) , ("texttt", (code . stringify . toList) <$> tok) , ("url", (unescapeURL <$> braced) >>= \url -> pure (link url "" (str url))) , ("href", (unescapeURL <$> braced <* optional sp) >>= \url -> tok >>= \lab -> pure (link url "" lab)) , ("includegraphics", skipopts *> (unescapeURL <$> braced) >>= mkImage) , ("enquote", enquote) , ("cite", citation "cite" AuthorInText False) , ("citep", citation "citep" NormalCitation False) , ("citep*", citation "citep*" NormalCitation False) , ("citeal", citation "citeal" NormalCitation False) , ("citealp", citation "citealp" NormalCitation False) , ("citealp*", citation "citealp*" NormalCitation False) , ("autocite", citation "autocite" NormalCitation False) , ("smartcite", citation "smartcite" NormalCitation False) , ("footcite", inNote <$> citation "footcite" NormalCitation False) , ("parencite", citation "parencite" NormalCitation False) , ("supercite", citation "supercite" NormalCitation False) , ("footcitetext", inNote <$> citation "footcitetext" NormalCitation False) , ("citeyearpar", citation "citeyearpar" SuppressAuthor False) , ("citeyear", citation "citeyear" SuppressAuthor False) , ("autocite*", citation "autocite*" SuppressAuthor False) , ("cite*", citation "cite*" SuppressAuthor False) , ("parencite*", citation "parencite*" SuppressAuthor False) , ("textcite", citation "textcite" AuthorInText False) , ("citet", citation "citet" AuthorInText False) , ("citet*", citation "citet*" AuthorInText False) , ("citealt", citation "citealt" AuthorInText False) , ("citealt*", citation "citealt*" AuthorInText False) , ("textcites", citation "textcites" AuthorInText True) , ("cites", citation "cites" NormalCitation True) , ("autocites", citation "autocites" NormalCitation True) , ("footcites", inNote <$> citation "footcites" NormalCitation True) , ("parencites", citation "parencites" NormalCitation True) , ("supercites", citation "supercites" NormalCitation True) , ("footcitetexts", inNote <$> citation "footcitetexts" NormalCitation True) , ("Autocite", citation "Autocite" NormalCitation False) , ("Smartcite", citation "Smartcite" NormalCitation False) , ("Footcite", citation "Footcite" NormalCitation False) , ("Parencite", citation "Parencite" NormalCitation False) , ("Supercite", citation "Supercite" NormalCitation False) , ("Footcitetext", inNote <$> citation "Footcitetext" NormalCitation False) , ("Citeyearpar", citation "Citeyearpar" SuppressAuthor False) , ("Citeyear", citation "Citeyear" SuppressAuthor False) , ("Autocite*", citation "Autocite*" SuppressAuthor False) , ("Cite*", citation "Cite*" SuppressAuthor False) , ("Parencite*", citation "Parencite*" SuppressAuthor False) , ("Textcite", citation "Textcite" AuthorInText False) , ("Textcites", citation "Textcites" AuthorInText True) , ("Cites", citation "Cites" NormalCitation True) , ("Autocites", citation "Autocites" NormalCitation True) , ("Footcites", citation "Footcites" NormalCitation True) , ("Parencites", citation "Parencites" NormalCitation True) , ("Supercites", citation "Supercites" NormalCitation True) , ("Footcitetexts", inNote <$> citation "Footcitetexts" NormalCitation True) , ("citetext", complexNatbibCitation NormalCitation) , ("citeauthor", (try (tok *> optional sp *> controlSeq "citetext") *> complexNatbibCitation AuthorInText) <|> citation "citeauthor" AuthorInText False) , ("nocite", mempty <$ (citation "nocite" NormalCitation False >>= addMeta "nocite")) ] ++ map ignoreInlines -- these commands will be ignored unless --parse-raw is specified, -- in which case they will appear as raw latex blocks: [ "index" ]
7,095
inlineCommands = M.fromList $ [ ("emph", extractSpaces emph <$> tok) , ("textit", extractSpaces emph <$> tok) , ("textsl", extractSpaces emph <$> tok) , ("textsc", extractSpaces smallcaps <$> tok) , ("sout", extractSpaces strikeout <$> tok) , ("textsuperscript", extractSpaces superscript <$> tok) , ("textsubscript", extractSpaces subscript <$> tok) , ("textbackslash", lit "\\") , ("backslash", lit "\\") , ("slash", lit "/") , ("textbf", extractSpaces strong <$> tok) , ("textnormal", extractSpaces (spanWith ("",["nodecor"],[])) <$> tok) , ("ldots", lit "…") , ("dots", lit "…") , ("mdots", lit "…") , ("sim", lit "~") , ("label", unlessParseRaw >> (inBrackets <$> tok)) , ("ref", unlessParseRaw >> (inBrackets <$> tok)) , ("noindent", unlessParseRaw >> return mempty) , ("textgreek", tok) , ("sep", lit ",") , ("cref", unlessParseRaw >> (inBrackets <$> tok)) -- from cleveref.sty , ("(", mathInline $ manyTill anyChar (try $ string "\\)")) , ("[", mathDisplay $ manyTill anyChar (try $ string "\\]")) , ("ensuremath", mathInline braced) , ("texorpdfstring", (\_ x -> x) <$> tok <*> tok) , ("P", lit "¶") , ("S", lit "§") , ("$", lit "$") , ("%", lit "%") , ("&", lit "&") , ("#", lit "#") , ("_", lit "_") , ("{", lit "{") , ("}", lit "}") -- old TeX commands , ("em", extractSpaces emph <$> inlines) , ("it", extractSpaces emph <$> inlines) , ("sl", extractSpaces emph <$> inlines) , ("bf", extractSpaces strong <$> inlines) , ("rm", inlines) , ("itshape", extractSpaces emph <$> inlines) , ("slshape", extractSpaces emph <$> inlines) , ("scshape", extractSpaces smallcaps <$> inlines) , ("bfseries", extractSpaces strong <$> inlines) , ("/", pure mempty) -- italic correction , ("aa", lit "å") , ("AA", lit "Å") , ("ss", lit "ß") , ("o", lit "ø") , ("O", lit "Ø") , ("L", lit "Ł") , ("l", lit "ł") , ("ae", lit "æ") , ("AE", lit "Æ") , ("oe", lit "œ") , ("OE", lit "Œ") , ("pounds", lit "£") , ("euro", lit "€") , ("copyright", lit "©") , ("textasciicircum", lit "^") , ("textasciitilde", lit "~") , ("`", option (str "`") $ try $ tok >>= accent grave) , ("'", option (str "'") $ try $ tok >>= accent acute) , ("^", option (str "^") $ try $ tok >>= accent circ) , ("~", option (str "~") $ try $ tok >>= accent tilde) , ("\"", option (str "\"") $ try $ tok >>= accent umlaut) , (".", option (str ".") $ try $ tok >>= accent dot) , ("=", option (str "=") $ try $ tok >>= accent macron) , ("c", option (str "c") $ try $ tok >>= accent cedilla) , ("v", option (str "v") $ try $ tok >>= accent hacek) , ("u", option (str "u") $ try $ tok >>= accent breve) , ("i", lit "i") , ("\\", linebreak <$ (optional (bracketed inline) *> spaces')) , (",", pure mempty) , ("@", pure mempty) , (" ", lit "\160") , ("ps", pure $ str "PS." <> space) , ("TeX", lit "TeX") , ("LaTeX", lit "LaTeX") , ("bar", lit "|") , ("textless", lit "<") , ("textgreater", lit ">") , ("thanks", (note . mconcat) <$> (char '{' *> manyTill block (char '}'))) , ("footnote", (note . mconcat) <$> (char '{' *> manyTill block (char '}'))) , ("verb", doverb) , ("lstinline", skipopts *> doverb) , ("Verb", doverb) , ("texttt", (code . stringify . toList) <$> tok) , ("url", (unescapeURL <$> braced) >>= \url -> pure (link url "" (str url))) , ("href", (unescapeURL <$> braced <* optional sp) >>= \url -> tok >>= \lab -> pure (link url "" lab)) , ("includegraphics", skipopts *> (unescapeURL <$> braced) >>= mkImage) , ("enquote", enquote) , ("cite", citation "cite" AuthorInText False) , ("citep", citation "citep" NormalCitation False) , ("citep*", citation "citep*" NormalCitation False) , ("citeal", citation "citeal" NormalCitation False) , ("citealp", citation "citealp" NormalCitation False) , ("citealp*", citation "citealp*" NormalCitation False) , ("autocite", citation "autocite" NormalCitation False) , ("smartcite", citation "smartcite" NormalCitation False) , ("footcite", inNote <$> citation "footcite" NormalCitation False) , ("parencite", citation "parencite" NormalCitation False) , ("supercite", citation "supercite" NormalCitation False) , ("footcitetext", inNote <$> citation "footcitetext" NormalCitation False) , ("citeyearpar", citation "citeyearpar" SuppressAuthor False) , ("citeyear", citation "citeyear" SuppressAuthor False) , ("autocite*", citation "autocite*" SuppressAuthor False) , ("cite*", citation "cite*" SuppressAuthor False) , ("parencite*", citation "parencite*" SuppressAuthor False) , ("textcite", citation "textcite" AuthorInText False) , ("citet", citation "citet" AuthorInText False) , ("citet*", citation "citet*" AuthorInText False) , ("citealt", citation "citealt" AuthorInText False) , ("citealt*", citation "citealt*" AuthorInText False) , ("textcites", citation "textcites" AuthorInText True) , ("cites", citation "cites" NormalCitation True) , ("autocites", citation "autocites" NormalCitation True) , ("footcites", inNote <$> citation "footcites" NormalCitation True) , ("parencites", citation "parencites" NormalCitation True) , ("supercites", citation "supercites" NormalCitation True) , ("footcitetexts", inNote <$> citation "footcitetexts" NormalCitation True) , ("Autocite", citation "Autocite" NormalCitation False) , ("Smartcite", citation "Smartcite" NormalCitation False) , ("Footcite", citation "Footcite" NormalCitation False) , ("Parencite", citation "Parencite" NormalCitation False) , ("Supercite", citation "Supercite" NormalCitation False) , ("Footcitetext", inNote <$> citation "Footcitetext" NormalCitation False) , ("Citeyearpar", citation "Citeyearpar" SuppressAuthor False) , ("Citeyear", citation "Citeyear" SuppressAuthor False) , ("Autocite*", citation "Autocite*" SuppressAuthor False) , ("Cite*", citation "Cite*" SuppressAuthor False) , ("Parencite*", citation "Parencite*" SuppressAuthor False) , ("Textcite", citation "Textcite" AuthorInText False) , ("Textcites", citation "Textcites" AuthorInText True) , ("Cites", citation "Cites" NormalCitation True) , ("Autocites", citation "Autocites" NormalCitation True) , ("Footcites", citation "Footcites" NormalCitation True) , ("Parencites", citation "Parencites" NormalCitation True) , ("Supercites", citation "Supercites" NormalCitation True) , ("Footcitetexts", inNote <$> citation "Footcitetexts" NormalCitation True) , ("citetext", complexNatbibCitation NormalCitation) , ("citeauthor", (try (tok *> optional sp *> controlSeq "citetext") *> complexNatbibCitation AuthorInText) <|> citation "citeauthor" AuthorInText False) , ("nocite", mempty <$ (citation "nocite" NormalCitation False >>= addMeta "nocite")) ] ++ map ignoreInlines -- these commands will be ignored unless --parse-raw is specified, -- in which case they will appear as raw latex blocks: [ "index" ]
7,051
false
true
6
14
1,341
2,585
1,442
1,143
null
null
et4te/zero
server/src/Zero/Authentication/Server.hs
bsd-3-clause
------------------------------------------------------------------------------ authenticationServer :: SessionId -> Connection -> Server AuthenticationAPI authenticationServer sid conn = authStart sid conn :<|> authFinish sid conn :<|> sessionNew sid conn :<|> sessionKeys sid conn :<|> sessionDestroy sid conn
326
authenticationServer :: SessionId -> Connection -> Server AuthenticationAPI authenticationServer sid conn = authStart sid conn :<|> authFinish sid conn :<|> sessionNew sid conn :<|> sessionKeys sid conn :<|> sessionDestroy sid conn
246
authenticationServer sid conn = authStart sid conn :<|> authFinish sid conn :<|> sessionNew sid conn :<|> sessionKeys sid conn :<|> sessionDestroy sid conn
170
true
true
12
8
47
91
41
50
null
null
gridaphobe/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
-- | Like 'tcSplitForAllTys', but splits off only named binders. tcSplitNamedPiTys :: Type -> ([TyBinder], Type) tcSplitNamedPiTys = splitNamedPiTys
148
tcSplitNamedPiTys :: Type -> ([TyBinder], Type) tcSplitNamedPiTys = splitNamedPiTys
83
tcSplitNamedPiTys = splitNamedPiTys
35
true
true
0
7
18
25
15
10
null
null
fmapfmapfmap/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/RegisterInstance.hs
mpl-2.0
-- | The response status code. rirsResponseStatus :: Lens' RegisterInstanceResponse Int rirsResponseStatus = lens _rirsResponseStatus (\ s a -> s{_rirsResponseStatus = a})
171
rirsResponseStatus :: Lens' RegisterInstanceResponse Int rirsResponseStatus = lens _rirsResponseStatus (\ s a -> s{_rirsResponseStatus = a})
140
rirsResponseStatus = lens _rirsResponseStatus (\ s a -> s{_rirsResponseStatus = a})
83
true
true
0
9
21
40
22
18
null
null
uduki/hsQt
Qtc/Enums/Gui/QItemSelectionModel.hs
bsd-2-clause
fSelectCurrent :: SelectionFlags fSelectCurrent = ifSelectionFlags $ 18
73
fSelectCurrent :: SelectionFlags fSelectCurrent = ifSelectionFlags $ 18
73
fSelectCurrent = ifSelectionFlags $ 18
40
false
true
0
6
9
18
8
10
null
null
li-zhirui/EoplLangs
src/CallByReference/Evaluator.hs
bsd-3-clause
tryFindOp :: (Eq a, Show a) => a -> [(a, b)] -> StatedTry b tryFindOp op = tryFind ("Unknown operator: " `mappend` show op) op
126
tryFindOp :: (Eq a, Show a) => a -> [(a, b)] -> StatedTry b tryFindOp op = tryFind ("Unknown operator: " `mappend` show op) op
126
tryFindOp op = tryFind ("Unknown operator: " `mappend` show op) op
66
false
true
0
10
24
71
36
35
null
null
tadeuzagallo/verve-lang
src/Reassoc/Reassoc.hs
mit
comparePrec :: String -> String -> Reassoc Prec comparePrec l r = do (lAssoc, lPrec) <- getOpInfo l (rAssoc, rPrec) <- getOpInfo r case (compare lPrec rPrec, lAssoc, rAssoc) of (LT, _, _) -> return PRight (GT, _, _) -> return PLeft (EQ, AssocLeft, AssocLeft) -> return PLeft (EQ, AssocRight, AssocRight) -> return PRight (EQ, _, _) -> throwError $ PrecedenceError l r
393
comparePrec :: String -> String -> Reassoc Prec comparePrec l r = do (lAssoc, lPrec) <- getOpInfo l (rAssoc, rPrec) <- getOpInfo r case (compare lPrec rPrec, lAssoc, rAssoc) of (LT, _, _) -> return PRight (GT, _, _) -> return PLeft (EQ, AssocLeft, AssocLeft) -> return PLeft (EQ, AssocRight, AssocRight) -> return PRight (EQ, _, _) -> throwError $ PrecedenceError l r
393
comparePrec l r = do (lAssoc, lPrec) <- getOpInfo l (rAssoc, rPrec) <- getOpInfo r case (compare lPrec rPrec, lAssoc, rAssoc) of (LT, _, _) -> return PRight (GT, _, _) -> return PLeft (EQ, AssocLeft, AssocLeft) -> return PLeft (EQ, AssocRight, AssocRight) -> return PRight (EQ, _, _) -> throwError $ PrecedenceError l r
345
false
true
0
12
88
181
94
87
null
null
andorp/bead
test/Test/Unit/Persistence.hs
bsd-3-clause
test_initialize_persistence = testCase "Initialize NoSQLDir persistence layer" $ do init <- createPersistInit defaultConfig setUp <- isSetUp init assertBool "Persistence was set up" (not setUp) initPersist init setUp <- isSetUp init assertBool "Settin up persistence was failed" setUp
296
test_initialize_persistence = testCase "Initialize NoSQLDir persistence layer" $ do init <- createPersistInit defaultConfig setUp <- isSetUp init assertBool "Persistence was set up" (not setUp) initPersist init setUp <- isSetUp init assertBool "Settin up persistence was failed" setUp
296
test_initialize_persistence = testCase "Initialize NoSQLDir persistence layer" $ do init <- createPersistInit defaultConfig setUp <- isSetUp init assertBool "Persistence was set up" (not setUp) initPersist init setUp <- isSetUp init assertBool "Settin up persistence was failed" setUp
296
false
false
1
11
48
75
29
46
null
null
Fuuzetsu/osz-loader
src/Game/Osu/OszLoader/OsuParser/TimingPoint.hs
gpl-3.0
millisecondsPerBeatP ∷ Parser Double millisecondsPerBeatP = signed double
73
millisecondsPerBeatP ∷ Parser Double millisecondsPerBeatP = signed double
73
millisecondsPerBeatP = signed double
36
false
true
0
6
7
23
9
14
null
null
antonpetkoff/reinvent-the-wheel
primitive-recursion/prf.hs
gpl-3.0
eval (R f g) (y:xs) = eval g ((eval (R f g) (y-1:xs)):y-1:xs)
61
eval (R f g) (y:xs) = eval g ((eval (R f g) (y-1:xs)):y-1:xs)
61
eval (R f g) (y:xs) = eval g ((eval (R f g) (y-1:xs)):y-1:xs)
61
false
false
1
14
12
75
37
38
null
null
spechub/Hets
HasCASL/Subst.hs
gpl-2.0
redList :: (a -> ReductionResult a) -> [a] -> ReductionResult [a] redList _ [] = NotReduced []
94
redList :: (a -> ReductionResult a) -> [a] -> ReductionResult [a] redList _ [] = NotReduced []
94
redList _ [] = NotReduced []
28
false
true
0
9
16
55
26
29
null
null
daleooo/barrelfish
tools/mackerel/Attr.hs
mit
attr_is_writeonly RWO = False
29
attr_is_writeonly RWO = False
29
attr_is_writeonly RWO = False
29
false
false
0
5
3
9
4
5
null
null
amccausl/RDF4H
testsuite/tests/Text/RDF/RDF4H/XmlParser_Test.hs
bsd-3-clause
test_parseXmlRDF_example18 = testParse "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\ \<rdf:Seq rdf:about=\"http://example.org/favourite-fruit\">\ \<rdf:li rdf:resource=\"http://example.org/banana\"/>\ \<rdf:li rdf:resource=\"http://example.org/apple\"/>\ \<rdf:li rdf:resource=\"http://example.org/pear\"/>\ \</rdf:Seq>\ \</rdf:RDF>" ( mkRdf [ Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:type") ((unode . s2b) "rdf:Seq") , Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:_1") ((unode . s2b) "http://example.org/banana") , Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:_2") ((unode . s2b) "http://example.org/apple") , Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:_3") ((unode . s2b) "http://example.org/pear") ] Nothing ( PrefixMappings (Map.fromList [ (s2b "rdf", s2b "http://www.w3.org/1999/02/22-rdf-syntax-ns#") ]) ) )
1,275
test_parseXmlRDF_example18 = testParse "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\ \<rdf:Seq rdf:about=\"http://example.org/favourite-fruit\">\ \<rdf:li rdf:resource=\"http://example.org/banana\"/>\ \<rdf:li rdf:resource=\"http://example.org/apple\"/>\ \<rdf:li rdf:resource=\"http://example.org/pear\"/>\ \</rdf:Seq>\ \</rdf:RDF>" ( mkRdf [ Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:type") ((unode . s2b) "rdf:Seq") , Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:_1") ((unode . s2b) "http://example.org/banana") , Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:_2") ((unode . s2b) "http://example.org/apple") , Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:_3") ((unode . s2b) "http://example.org/pear") ] Nothing ( PrefixMappings (Map.fromList [ (s2b "rdf", s2b "http://www.w3.org/1999/02/22-rdf-syntax-ns#") ]) ) )
1,275
test_parseXmlRDF_example18 = testParse "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\ \<rdf:Seq rdf:about=\"http://example.org/favourite-fruit\">\ \<rdf:li rdf:resource=\"http://example.org/banana\"/>\ \<rdf:li rdf:resource=\"http://example.org/apple\"/>\ \<rdf:li rdf:resource=\"http://example.org/pear\"/>\ \</rdf:Seq>\ \</rdf:RDF>" ( mkRdf [ Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:type") ((unode . s2b) "rdf:Seq") , Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:_1") ((unode . s2b) "http://example.org/banana") , Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:_2") ((unode . s2b) "http://example.org/apple") , Triple ((unode . s2b) "http://example.org/favourite-fruit") ((unode . s2b) "rdf:_3") ((unode . s2b) "http://example.org/pear") ] Nothing ( PrefixMappings (Map.fromList [ (s2b "rdf", s2b "http://www.w3.org/1999/02/22-rdf-syntax-ns#") ]) ) )
1,275
false
false
0
14
377
246
129
117
null
null
flipstone/orville
orville-postgresql/src/Database/Orville/PostgreSQL/Plan/Many.hs
mit
{-| 'elems' returns all the values that correspond the keys of the 'Many'. The values will be returned in the same order that the keys were present at the time of creation, though if you truly care about this it's probably better to use 'lookup' to make that correspondence explicit. -} elems :: Many k a -> [a] elems (Many ks keyToValue) = Either.rights $ keyToValue <$> ks
384
elems :: Many k a -> [a] elems (Many ks keyToValue) = Either.rights $ keyToValue <$> ks
89
elems (Many ks keyToValue) = Either.rights $ keyToValue <$> ks
64
true
true
4
9
77
53
24
29
null
null
AlexanderPankiv/ghc
compiler/stgSyn/CoreToStg.hs
bsd-3-clause
stgArity :: Id -> HowBound -> Arity stgArity _ (LetBound _ arity) = arity
73
stgArity :: Id -> HowBound -> Arity stgArity _ (LetBound _ arity) = arity
73
stgArity _ (LetBound _ arity) = arity
37
false
true
0
10
13
38
17
21
null
null
gorkinovich/Haskell
Problems/Problem0010a.hs
mit
squareRoot :: (Integral a) => a -> a squareRoot x = truncate $ sqrt $ fromIntegral x
84
squareRoot :: (Integral a) => a -> a squareRoot x = truncate $ sqrt $ fromIntegral x
84
squareRoot x = truncate $ sqrt $ fromIntegral x
47
false
true
4
8
16
45
20
25
null
null
brendanhay/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/CourseWorkMaterials/Patch.hs
mpl-2.0
-- | Identifier of the course work material. ccwmpId :: Lens' CoursesCourseWorkMaterialsPatch Text ccwmpId = lens _ccwmpId (\ s a -> s{_ccwmpId = a})
149
ccwmpId :: Lens' CoursesCourseWorkMaterialsPatch Text ccwmpId = lens _ccwmpId (\ s a -> s{_ccwmpId = a})
104
ccwmpId = lens _ccwmpId (\ s a -> s{_ccwmpId = a})
50
true
true
0
9
23
40
22
18
null
null
rueshyna/gogol
gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/Services/Get.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). asgUploadProtocol :: Lens' AppsServicesGet (Maybe Text) asgUploadProtocol = lens _asgUploadProtocol (\ s a -> s{_asgUploadProtocol = a})
206
asgUploadProtocol :: Lens' AppsServicesGet (Maybe Text) asgUploadProtocol = lens _asgUploadProtocol (\ s a -> s{_asgUploadProtocol = a})
144
asgUploadProtocol = lens _asgUploadProtocol (\ s a -> s{_asgUploadProtocol = a})
88
true
true
0
9
33
48
25
23
null
null
limaner2002/EPC-tools
scheduler-ui/src/Scheduler.hs
bsd-3-clause
getNotFinished :: JobQueue a -> Maybe (Job a, JobQueue a) getNotFinished = getFirstJobNot (\j -> isFinished j || isCancelled j) update where update job = case job ^. jobStatus == Queued of True -> Just (jobStatus .~ Running $ job) False -> Nothing
265
getNotFinished :: JobQueue a -> Maybe (Job a, JobQueue a) getNotFinished = getFirstJobNot (\j -> isFinished j || isCancelled j) update where update job = case job ^. jobStatus == Queued of True -> Just (jobStatus .~ Running $ job) False -> Nothing
265
getNotFinished = getFirstJobNot (\j -> isFinished j || isCancelled j) update where update job = case job ^. jobStatus == Queued of True -> Just (jobStatus .~ Running $ job) False -> Nothing
207
false
true
0
11
60
105
51
54
null
null
sdiehl/ghc
compiler/coreSyn/CoreTidy.hs
bsd-3-clause
tidyExpr env (Coercion co) = Coercion (tidyCo env co)
53
tidyExpr env (Coercion co) = Coercion (tidyCo env co)
53
tidyExpr env (Coercion co) = Coercion (tidyCo env co)
53
false
false
0
7
8
28
13
15
null
null