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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxwxwwxxx/ghc | compiler/main/DynFlags.hs | bsd-3-clause | isObjectTarget HscAsm = True | 30 | isObjectTarget HscAsm = True | 30 | isObjectTarget HscAsm = True | 30 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
TomMD/ghc | compiler/main/ErrUtils.hs | bsd-3-clause | isValid (NotValid {}) = False | 29 | isValid (NotValid {}) = False | 29 | isValid (NotValid {}) = False | 29 | false | false | 0 | 6 | 4 | 17 | 8 | 9 | null | null |
meimisaki/Yampa | src/FRP/Yampa/Vector2.hs | bsd-3-clause | vector2Theta :: RealFloat a => Vector2 a -> a
vector2Theta (Vector2 x y) = atan2 y x | 84 | vector2Theta :: RealFloat a => Vector2 a -> a
vector2Theta (Vector2 x y) = atan2 y x | 84 | vector2Theta (Vector2 x y) = atan2 y x | 38 | false | true | 0 | 7 | 16 | 45 | 20 | 25 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | alignType :: [String]
-> Int
-> Alignment
alignType [] _ = AlignDefault | 91 | alignType :: [String]
-> Int
-> Alignment
alignType [] _ = AlignDefault | 91 | alignType [] _ = AlignDefault | 29 | false | true | 0 | 6 | 31 | 29 | 15 | 14 | null | null |
FranklinChen/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LURem ITNative) [l, r] = v ++ "UINTOP(%," ++ creg l ++ ", " ++ creg r ++ ")" | 84 | doOp v (LURem ITNative) [l, r] = v ++ "UINTOP(%," ++ creg l ++ ", " ++ creg r ++ ")" | 84 | doOp v (LURem ITNative) [l, r] = v ++ "UINTOP(%," ++ creg l ++ ", " ++ creg r ++ ")" | 84 | false | false | 0 | 9 | 20 | 54 | 25 | 29 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |'HashSet.unions'
hs_unions = HashSet.unions | 47 | hs_unions = HashSet.unions | 26 | hs_unions = HashSet.unions | 26 | true | false | 0 | 5 | 4 | 9 | 5 | 4 | null | null |
haskell-works/conduit-succinct-json | src/Data/Conduit/Succinct/Json.hs | bsd-3-clause | ifM :: Monad m => m Bool -> m a -> m a -> m a
ifM p a b = do
t <- p
if t then a else b | 90 | ifM :: Monad m => m Bool -> m a -> m a -> m a
ifM p a b = do
t <- p
if t then a else b | 90 | ifM p a b = do
t <- p
if t then a else b | 44 | false | true | 0 | 9 | 34 | 72 | 32 | 40 | null | null |
mightymoose/liquidhaskell | src/Language/Haskell/Liquid/CoreToLogic.hs | bsd-3-clause | makeApp :: Expr -> LogicMap -> Located Symbol-> [Expr] -> Expr
makeApp _ _ f [e] | val f == symbol ("GHC.Num.negate" :: String)
= ENeg e | 138 | makeApp :: Expr -> LogicMap -> Located Symbol-> [Expr] -> Expr
makeApp _ _ f [e] | val f == symbol ("GHC.Num.negate" :: String)
= ENeg e | 138 | makeApp _ _ f [e] | val f == symbol ("GHC.Num.negate" :: String)
= ENeg e | 75 | false | true | 0 | 11 | 28 | 76 | 35 | 41 | null | null |
markus1189/lambda-feed | src/LambdaFeed/Widgets.hs | gpl-3.0 | getListItems :: Widget (List a b) -> IO [a]
getListItems w = do
size <- getListSize w
map fst . catMaybes <$> for [0..size-1] (getListItem w) | 145 | getListItems :: Widget (List a b) -> IO [a]
getListItems w = do
size <- getListSize w
map fst . catMaybes <$> for [0..size-1] (getListItem w) | 145 | getListItems w = do
size <- getListSize w
map fst . catMaybes <$> for [0..size-1] (getListItem w) | 101 | false | true | 0 | 11 | 29 | 84 | 38 | 46 | null | null |
kadena-io/pact | src/Pact/Native.hs | bsd-3-clause | listStringA :: Type n
listStringA = mkTyVar "a" [TyList (mkTyVar "l" []),TyPrim TyString] | 89 | listStringA :: Type n
listStringA = mkTyVar "a" [TyList (mkTyVar "l" []),TyPrim TyString] | 89 | listStringA = mkTyVar "a" [TyList (mkTyVar "l" []),TyPrim TyString] | 67 | false | true | 0 | 10 | 12 | 41 | 20 | 21 | null | null |
tenshiPure/Porker-Hand-Check | src/Checker.hs | bsd-3-clause | isRoyalStraightFlush hand = isStraightFlush hand && head (getNums hand) == 10 | 77 | isRoyalStraightFlush hand = isStraightFlush hand && head (getNums hand) == 10 | 77 | isRoyalStraightFlush hand = isStraightFlush hand && head (getNums hand) == 10 | 77 | false | false | 0 | 9 | 10 | 29 | 13 | 16 | null | null |
ghc-android/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | ctEvFlavour :: CtEvidence -> CtFlavour
ctEvFlavour (CtWanted {}) = Wanted | 74 | ctEvFlavour :: CtEvidence -> CtFlavour
ctEvFlavour (CtWanted {}) = Wanted | 74 | ctEvFlavour (CtWanted {}) = Wanted | 35 | false | true | 1 | 8 | 10 | 30 | 14 | 16 | null | null |
jwiegley/ghc-release | compiler/llvmGen/Llvm/PpLlvm.hs | gpl-3.0 | -- | Print out an LLVM block.
-- It must be part of a function definition.
ppLlvmBlock :: LlvmBlock -> SDoc
ppLlvmBlock (LlvmBlock blockId stmts) =
let isLabel (MkLabel _) = True
isLabel _ = False
(block, rest) = break isLabel stmts
ppRest = case rest of
MkLabel id:xs -> ppLlvmBlock (LlvmBlock id xs)
_ -> empty
in ppLlvmBlockLabel blockId
$+$ (vcat $ map ppLlvmStatement block)
$+$ newLine
$+$ ppRest | 501 | ppLlvmBlock :: LlvmBlock -> SDoc
ppLlvmBlock (LlvmBlock blockId stmts) =
let isLabel (MkLabel _) = True
isLabel _ = False
(block, rest) = break isLabel stmts
ppRest = case rest of
MkLabel id:xs -> ppLlvmBlock (LlvmBlock id xs)
_ -> empty
in ppLlvmBlockLabel blockId
$+$ (vcat $ map ppLlvmStatement block)
$+$ newLine
$+$ ppRest | 426 | ppLlvmBlock (LlvmBlock blockId stmts) =
let isLabel (MkLabel _) = True
isLabel _ = False
(block, rest) = break isLabel stmts
ppRest = case rest of
MkLabel id:xs -> ppLlvmBlock (LlvmBlock id xs)
_ -> empty
in ppLlvmBlockLabel blockId
$+$ (vcat $ map ppLlvmStatement block)
$+$ newLine
$+$ ppRest | 393 | true | true | 0 | 14 | 168 | 139 | 69 | 70 | null | null |
tinco/nanc | Nanc/IR/Expression/Binary.hs | mit | iOpToPred False CGrOp = I.UGT | 29 | iOpToPred False CGrOp = I.UGT | 29 | iOpToPred False CGrOp = I.UGT | 29 | false | false | 0 | 5 | 4 | 13 | 6 | 7 | null | null |
Pnom/haskell-ast-pretty | Test/examples/Attributes.hs | mit | usedByGraphs LayerSep{} = True | 40 | usedByGraphs LayerSep{} = True | 40 | usedByGraphs LayerSep{} = True | 40 | false | false | 0 | 6 | 13 | 13 | 6 | 7 | null | null |
coolhacks/scripts-hacks | examples/shellcheck-master/ShellCheck/Parser.hs | mit | readBraced = try braceExpansion
where
braceExpansion =
T_BraceExpansion `withParser` do
char '{'
elements <- bracedElement `sepBy1` char ','
guard $
case elements of
(_:_:_) -> True
[t] -> ".." `isInfixOf` onlyLiteralString t
[] -> False
char '}'
return elements
bracedElement =
T_NormalWord `withParser` do
many $ choice [
braceExpansion,
readDollarExpression,
readSingleQuoted,
readDoubleQuoted,
braceLiteral
]
braceLiteral =
T_Literal `withParser` readGenericLiteral1 (oneOf "{}\"$'," <|> whitespace) | 785 | readBraced = try braceExpansion
where
braceExpansion =
T_BraceExpansion `withParser` do
char '{'
elements <- bracedElement `sepBy1` char ','
guard $
case elements of
(_:_:_) -> True
[t] -> ".." `isInfixOf` onlyLiteralString t
[] -> False
char '}'
return elements
bracedElement =
T_NormalWord `withParser` do
many $ choice [
braceExpansion,
readDollarExpression,
readSingleQuoted,
readDoubleQuoted,
braceLiteral
]
braceLiteral =
T_Literal `withParser` readGenericLiteral1 (oneOf "{}\"$'," <|> whitespace) | 785 | readBraced = try braceExpansion
where
braceExpansion =
T_BraceExpansion `withParser` do
char '{'
elements <- bracedElement `sepBy1` char ','
guard $
case elements of
(_:_:_) -> True
[t] -> ".." `isInfixOf` onlyLiteralString t
[] -> False
char '}'
return elements
bracedElement =
T_NormalWord `withParser` do
many $ choice [
braceExpansion,
readDollarExpression,
readSingleQuoted,
readDoubleQuoted,
braceLiteral
]
braceLiteral =
T_Literal `withParser` readGenericLiteral1 (oneOf "{}\"$'," <|> whitespace) | 785 | false | false | 2 | 17 | 344 | 175 | 88 | 87 | null | null |
frontrowed/sendgrid | src/Network/API/SendGrid/Core.hs | mit | baseSendGridUrl :: Text
baseSendGridUrl = "https://api.sendgrid.com/api/" | 73 | baseSendGridUrl :: Text
baseSendGridUrl = "https://api.sendgrid.com/api/" | 73 | baseSendGridUrl = "https://api.sendgrid.com/api/" | 49 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
brendanhay/gogol | gogol-qpxexpress/gen/Network/Google/QPXExpress/Types/Product.hs | mpl-2.0 | -- | The slices that make up the itinerary of this trip. A slice represents a
-- traveler\'s intent, the portion of a low-fare search corresponding to a
-- traveler\'s request to get between two points. One-way journeys are
-- generally expressed using one slice, round-trips using two. An example
-- of a one slice trip with three segments might be BOS-SYD, SYD-LAX,
-- LAX-BOS if the traveler only stopped in SYD and LAX just long enough to
-- change planes.
torSlice :: Lens' TripOptionsRequest [SliceInput]
torSlice
= lens _torSlice (\ s a -> s{_torSlice = a}) .
_Default
. _Coerce | 599 | torSlice :: Lens' TripOptionsRequest [SliceInput]
torSlice
= lens _torSlice (\ s a -> s{_torSlice = a}) .
_Default
. _Coerce | 138 | torSlice
= lens _torSlice (\ s a -> s{_torSlice = a}) .
_Default
. _Coerce | 88 | true | true | 0 | 11 | 114 | 59 | 34 | 25 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/drop_1.hs | mit | primMinusInt (Pos x) (Pos y) = primMinusNat x y | 47 | primMinusInt (Pos x) (Pos y) = primMinusNat x y | 47 | primMinusInt (Pos x) (Pos y) = primMinusNat x y | 47 | false | false | 0 | 6 | 8 | 30 | 13 | 17 | null | null |
alanbuxton/planck-chauffeur | src/View.hs | bsd-3-clause | explanatoryText :: Html
explanatoryText = do
p $ do
toMarkup $ "The chart above shows how well (or badly) you do at getting the best possible " ++
"answer to a particular question, depending on the network of people you ask. A higher " ++
"Knowledge Score on the Y axis means a better answer. Or, at least, what you "
em "think"
" is a better answer."
p $ toMarkup $ "Suppose you need the answer to a question. It could be anything, for example " ++
"'Why is the sky blue?' or 'When were tiles first used on houses?' Now suppose that the only " ++
"way to get the answer is to ask people that you know to help you."
p $ toMarkup $ "You ask the first person you know. She gives you what she thinks is the answer. " ++
"She might be confident or not, depending on how well she thinks she knows the subject. " ++
"You then ask the next person you know and see if you get a better answer, until you get all " ++
"they way through your network. The X axis shows how your knowledge of the subject changes " ++
"as you ask more and more people."
p $ do
"If the only colour you can see is "
strong "green"
" then, great, you got the best answer."
p $ do
"The "
strong "blue"
toMarkup $ " area shows where your network got it wrong. At some point along the line you mixed up someone's " ++
"Planck Knowledge with his Chauffeur Knowledge. You gave ths person's opinion too much weight. " ++
"While you may "
em "think"
toMarkup $ " that you got the best answer, in fact you may well have got a worse answer than what you already had. " ++
"Either way you have a problem because what you "
em "think"
" you know is much more than what you "
em "really"
" know. The "
strong "black"
toMarkup $ " area shows the best answer that you could have got from your network, if only you had managed to " ++
"find the person with the best Planck Knowledge."
p "Notice how the blue and black parts always increase. It's just the green - what you really know - that jumps around." | 2,101 | explanatoryText :: Html
explanatoryText = do
p $ do
toMarkup $ "The chart above shows how well (or badly) you do at getting the best possible " ++
"answer to a particular question, depending on the network of people you ask. A higher " ++
"Knowledge Score on the Y axis means a better answer. Or, at least, what you "
em "think"
" is a better answer."
p $ toMarkup $ "Suppose you need the answer to a question. It could be anything, for example " ++
"'Why is the sky blue?' or 'When were tiles first used on houses?' Now suppose that the only " ++
"way to get the answer is to ask people that you know to help you."
p $ toMarkup $ "You ask the first person you know. She gives you what she thinks is the answer. " ++
"She might be confident or not, depending on how well she thinks she knows the subject. " ++
"You then ask the next person you know and see if you get a better answer, until you get all " ++
"they way through your network. The X axis shows how your knowledge of the subject changes " ++
"as you ask more and more people."
p $ do
"If the only colour you can see is "
strong "green"
" then, great, you got the best answer."
p $ do
"The "
strong "blue"
toMarkup $ " area shows where your network got it wrong. At some point along the line you mixed up someone's " ++
"Planck Knowledge with his Chauffeur Knowledge. You gave ths person's opinion too much weight. " ++
"While you may "
em "think"
toMarkup $ " that you got the best answer, in fact you may well have got a worse answer than what you already had. " ++
"Either way you have a problem because what you "
em "think"
" you know is much more than what you "
em "really"
" know. The "
strong "black"
toMarkup $ " area shows the best answer that you could have got from your network, if only you had managed to " ++
"find the person with the best Planck Knowledge."
p "Notice how the blue and black parts always increase. It's just the green - what you really know - that jumps around." | 2,101 | explanatoryText = do
p $ do
toMarkup $ "The chart above shows how well (or badly) you do at getting the best possible " ++
"answer to a particular question, depending on the network of people you ask. A higher " ++
"Knowledge Score on the Y axis means a better answer. Or, at least, what you "
em "think"
" is a better answer."
p $ toMarkup $ "Suppose you need the answer to a question. It could be anything, for example " ++
"'Why is the sky blue?' or 'When were tiles first used on houses?' Now suppose that the only " ++
"way to get the answer is to ask people that you know to help you."
p $ toMarkup $ "You ask the first person you know. She gives you what she thinks is the answer. " ++
"She might be confident or not, depending on how well she thinks she knows the subject. " ++
"You then ask the next person you know and see if you get a better answer, until you get all " ++
"they way through your network. The X axis shows how your knowledge of the subject changes " ++
"as you ask more and more people."
p $ do
"If the only colour you can see is "
strong "green"
" then, great, you got the best answer."
p $ do
"The "
strong "blue"
toMarkup $ " area shows where your network got it wrong. At some point along the line you mixed up someone's " ++
"Planck Knowledge with his Chauffeur Knowledge. You gave ths person's opinion too much weight. " ++
"While you may "
em "think"
toMarkup $ " that you got the best answer, in fact you may well have got a worse answer than what you already had. " ++
"Either way you have a problem because what you "
em "think"
" you know is much more than what you "
em "really"
" know. The "
strong "black"
toMarkup $ " area shows the best answer that you could have got from your network, if only you had managed to " ++
"find the person with the best Planck Knowledge."
p "Notice how the blue and black parts always increase. It's just the green - what you really know - that jumps around." | 2,077 | false | true | 0 | 13 | 539 | 203 | 84 | 119 | null | null |
rueshyna/gogol | gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/Students/List.hs | mpl-2.0 | -- | Identifier of the course. This identifier can be either the
-- Classroom-assigned identifier or an alias.
cslCourseId :: Lens' CoursesStudentsList Text
cslCourseId
= lens _cslCourseId (\ s a -> s{_cslCourseId = a}) | 221 | cslCourseId :: Lens' CoursesStudentsList Text
cslCourseId
= lens _cslCourseId (\ s a -> s{_cslCourseId = a}) | 110 | cslCourseId
= lens _cslCourseId (\ s a -> s{_cslCourseId = a}) | 64 | true | true | 1 | 9 | 35 | 47 | 23 | 24 | null | null |
osa1/chsc | Utilities.hs | bsd-3-clause | angles, coangles, bananas :: Doc -> Doc
angles d = Pretty.char '<' <> d <> Pretty.char '>' | 90 | angles, coangles, bananas :: Doc -> Doc
angles d = Pretty.char '<' <> d <> Pretty.char '>' | 90 | angles d = Pretty.char '<' <> d <> Pretty.char '>' | 50 | false | true | 4 | 7 | 16 | 53 | 22 | 31 | null | null |
olive/antiqua-prime | src/Antiqua/Graphics/TileRenderer.hs | mit | getArr (TR _ arr) = arr | 23 | getArr (TR _ arr) = arr | 23 | getArr (TR _ arr) = arr | 23 | false | false | 0 | 6 | 5 | 18 | 8 | 10 | null | null |
TomMD/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | breakpointCondIdKey = mkPreludeMiscIdUnique 111 | 57 | breakpointCondIdKey = mkPreludeMiscIdUnique 111 | 57 | breakpointCondIdKey = mkPreludeMiscIdUnique 111 | 57 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
Teaspot-Studio/genmus | src/Data/SymReg/Misc.hs | bsd-3-clause | calcChildren :: AST -> Int
calcChildren ast = case ast of
Const _ -> 0
Variable _ -> 0
Function _ args -> L.foldl' (\s a -> s + calcChildren a) 1 args | 162 | calcChildren :: AST -> Int
calcChildren ast = case ast of
Const _ -> 0
Variable _ -> 0
Function _ args -> L.foldl' (\s a -> s + calcChildren a) 1 args | 162 | calcChildren ast = case ast of
Const _ -> 0
Variable _ -> 0
Function _ args -> L.foldl' (\s a -> s + calcChildren a) 1 args | 135 | false | true | 0 | 12 | 44 | 77 | 37 | 40 | null | null |
tych0/xcffib | generator/Data/XCB/Python/PyHelpers.hs | apache-2.0 | mkIncr :: String -> Expr () -> Statement ()
mkIncr name expr = AugmentedAssign (mkName name) (PlusAssign ()) expr () | 116 | mkIncr :: String -> Expr () -> Statement ()
mkIncr name expr = AugmentedAssign (mkName name) (PlusAssign ()) expr () | 116 | mkIncr name expr = AugmentedAssign (mkName name) (PlusAssign ()) expr () | 72 | false | true | 0 | 9 | 19 | 63 | 29 | 34 | null | null |
tonyfloatersu/solution-haskell-craft-of-FP | Chapter_9_my_note.hs | mit | rev :: [a] -> [a]
rev xs = shunt xs [] | 41 | rev :: [a] -> [a]
rev xs = shunt xs [] | 41 | rev xs = shunt xs [] | 23 | false | true | 0 | 8 | 13 | 38 | 17 | 21 | null | null |
KaliszAd/programmierung2012 | aufgabe12_21.hs | gpl-2.0 | -- b)
-- `insertone (2,'x') (Node (5,'c') (Node (1,'a') Nil (Node (3,'b') Nil
-- Nil)) (Node (9,'d') Nil Nil))`
insertone :: (Int,a) -> Tree a -> Tree a
insertone d Nil = Node d Nil Nil | 187 | insertone :: (Int,a) -> Tree a -> Tree a
insertone d Nil = Node d Nil Nil | 73 | insertone d Nil = Node d Nil Nil | 32 | true | true | 0 | 7 | 37 | 46 | 24 | 22 | null | null |
dnaq/crypto-sodium | src/Crypto/Sodium/Stream/Internal.hs | mit | mkStream :: CInt -> CInt -> StreamFn -> XorFn -> StreamCipher s
mkStream c_keyBytes c_nonceBytes c_stream c_streamXor =
StreamCipher {..}
where
keyBytes = fromIntegral c_keyBytes
nonceBytes = fromIntegral c_nonceBytes
randomKey = Key <$> randomSecret keyBytes
mkKey = mkSecureHelper keyBytes Key
unKey = _unKey
mkNonce = mkHelper nonceBytes Nonce
unNonce = _unNonce
stream (Key k) (Nonce n) i =
B.unsafeCreate i $ \pc ->
B.unsafeUseAsCString n $ \pn ->
withSecureMem k $
void . c_stream pc (fromIntegral i) pn
streamXor (Key k) (Nonce n) m =
B.unsafeCreate mLen $ \pc ->
B.unsafeUseAsCString m $ \pm ->
B.unsafeUseAsCString n $ \pn ->
withSecureMem k $
void . c_streamXor pc pm (fromIntegral mLen) pn
where mLen = B.length m | 924 | mkStream :: CInt -> CInt -> StreamFn -> XorFn -> StreamCipher s
mkStream c_keyBytes c_nonceBytes c_stream c_streamXor =
StreamCipher {..}
where
keyBytes = fromIntegral c_keyBytes
nonceBytes = fromIntegral c_nonceBytes
randomKey = Key <$> randomSecret keyBytes
mkKey = mkSecureHelper keyBytes Key
unKey = _unKey
mkNonce = mkHelper nonceBytes Nonce
unNonce = _unNonce
stream (Key k) (Nonce n) i =
B.unsafeCreate i $ \pc ->
B.unsafeUseAsCString n $ \pn ->
withSecureMem k $
void . c_stream pc (fromIntegral i) pn
streamXor (Key k) (Nonce n) m =
B.unsafeCreate mLen $ \pc ->
B.unsafeUseAsCString m $ \pm ->
B.unsafeUseAsCString n $ \pn ->
withSecureMem k $
void . c_streamXor pc pm (fromIntegral mLen) pn
where mLen = B.length m | 924 | mkStream c_keyBytes c_nonceBytes c_stream c_streamXor =
StreamCipher {..}
where
keyBytes = fromIntegral c_keyBytes
nonceBytes = fromIntegral c_nonceBytes
randomKey = Key <$> randomSecret keyBytes
mkKey = mkSecureHelper keyBytes Key
unKey = _unKey
mkNonce = mkHelper nonceBytes Nonce
unNonce = _unNonce
stream (Key k) (Nonce n) i =
B.unsafeCreate i $ \pc ->
B.unsafeUseAsCString n $ \pn ->
withSecureMem k $
void . c_stream pc (fromIntegral i) pn
streamXor (Key k) (Nonce n) m =
B.unsafeCreate mLen $ \pc ->
B.unsafeUseAsCString m $ \pm ->
B.unsafeUseAsCString n $ \pn ->
withSecureMem k $
void . c_streamXor pc pm (fromIntegral mLen) pn
where mLen = B.length m | 860 | false | true | 8 | 18 | 315 | 286 | 141 | 145 | null | null |
tsahyt/clingo-haskell | src/Clingo/Configuration.hs | mit | keyStateVar :: Configuration s -> CKey -> StateVar Text
keyStateVar c k = makeStateVar getV setV
where getV = configurationValueGet c k
setV = configurationValueSet c k | 182 | keyStateVar :: Configuration s -> CKey -> StateVar Text
keyStateVar c k = makeStateVar getV setV
where getV = configurationValueGet c k
setV = configurationValueSet c k | 182 | keyStateVar c k = makeStateVar getV setV
where getV = configurationValueGet c k
setV = configurationValueSet c k | 126 | false | true | 1 | 8 | 40 | 64 | 28 | 36 | null | null |
green-haskell/ghc | libraries/base/Data/OldList.hs | bsd-3-clause | -- | 'delete' @x@ removes the first occurrence of @x@ from its list argument.
-- For example,
--
-- > delete 'a' "banana" == "bnana"
--
-- It is a special case of 'deleteBy', which allows the programmer to
-- supply their own equality test.
delete :: (Eq a) => a -> [a] -> [a]
delete = deleteBy (==) | 335 | delete :: (Eq a) => a -> [a] -> [a]
delete = deleteBy (==) | 93 | delete = deleteBy (==) | 40 | true | true | 0 | 8 | 94 | 46 | 29 | 17 | null | null |
eugenkiss/loopgotowhile | tests/Language/LoopGotoWhile/Goto/Transform/Tests.hs | bsd-3-clause | parseWhile :: String -> WhileAS.Stat
parseWhile code = case While.parse code of
Left err -> error err
Right ast -> ast | 127 | parseWhile :: String -> WhileAS.Stat
parseWhile code = case While.parse code of
Left err -> error err
Right ast -> ast | 127 | parseWhile code = case While.parse code of
Left err -> error err
Right ast -> ast | 90 | false | true | 0 | 8 | 29 | 50 | 23 | 27 | null | null |
NCrashed/hjass | src/library/Language/Jass/Codegen/Statement.hs | mit | genLLVMStatement (ExitWhenStatement _ cond) = do
(condName, condInstr) <- genLLVMExpression cond
retName <- getLoopReturn
afterBlock <- generateName "block_exitwhen_after"
appendCurrentBlock condInstr
finishCurrentBlock $ CondBr (LocalReference i1 condName) retName afterBlock []
pushNewBlock afterBlock | 315 | genLLVMStatement (ExitWhenStatement _ cond) = do
(condName, condInstr) <- genLLVMExpression cond
retName <- getLoopReturn
afterBlock <- generateName "block_exitwhen_after"
appendCurrentBlock condInstr
finishCurrentBlock $ CondBr (LocalReference i1 condName) retName afterBlock []
pushNewBlock afterBlock | 315 | genLLVMStatement (ExitWhenStatement _ cond) = do
(condName, condInstr) <- genLLVMExpression cond
retName <- getLoopReturn
afterBlock <- generateName "block_exitwhen_after"
appendCurrentBlock condInstr
finishCurrentBlock $ CondBr (LocalReference i1 condName) retName afterBlock []
pushNewBlock afterBlock | 315 | false | false | 0 | 10 | 42 | 88 | 39 | 49 | null | null |
jparyani/capnproto-boostpython | compiler/src/BoostPythonGenerator.hs | bsd-2-clause | cxxTypeString (BuiltinType BuiltinFloat64) = "double" | 53 | cxxTypeString (BuiltinType BuiltinFloat64) = "double" | 53 | cxxTypeString (BuiltinType BuiltinFloat64) = "double" | 53 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
markflorisson/hpack | testrepo/bytestring-0.10.2.0/tests/builder/Data/ByteString/Builder/Prim/TestUtils.hs | bsd-3-clause | -- | /For testing use only./ Evaluate a 'BoundedPrim' on a given value.
evalB :: BoundedPrim a -> a -> [Word8]
evalB be x = S.unpack $ unsafePerformIO $
S.createAndTrim (I.sizeBound be) $ \op -> do
op' <- I.runB be x op
return (op' `minusPtr` op)
-- | /For testing use only./ Show the result of a 'FixedPrim' of a given
-- value as a 'String' by interpreting the resulting bytes as Unicode
-- codepoints. | 425 | evalB :: BoundedPrim a -> a -> [Word8]
evalB be x = S.unpack $ unsafePerformIO $
S.createAndTrim (I.sizeBound be) $ \op -> do
op' <- I.runB be x op
return (op' `minusPtr` op)
-- | /For testing use only./ Show the result of a 'FixedPrim' of a given
-- value as a 'String' by interpreting the resulting bytes as Unicode
-- codepoints. | 353 | evalB be x = S.unpack $ unsafePerformIO $
S.createAndTrim (I.sizeBound be) $ \op -> do
op' <- I.runB be x op
return (op' `minusPtr` op)
-- | /For testing use only./ Show the result of a 'FixedPrim' of a given
-- value as a 'String' by interpreting the resulting bytes as Unicode
-- codepoints. | 314 | true | true | 0 | 12 | 95 | 102 | 51 | 51 | null | null |
woufrous/hoton | src/Hoton/Scenes/Forward1D.hs | mit | rayleighAtmos2Box' :: [Box Box1D] -> Maybe (Box Box1D)
rayleighAtmos2Box' [] = Nothing | 86 | rayleighAtmos2Box' :: [Box Box1D] -> Maybe (Box Box1D)
rayleighAtmos2Box' [] = Nothing | 86 | rayleighAtmos2Box' [] = Nothing | 31 | false | true | 0 | 9 | 11 | 40 | 18 | 22 | null | null |
GaloisInc/halvm-ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprSkolInfo ArrowSkol = text "an arrow form" | 52 | pprSkolInfo ArrowSkol = text "an arrow form" | 52 | pprSkolInfo ArrowSkol = text "an arrow form" | 52 | false | false | 1 | 5 | 14 | 15 | 5 | 10 | null | null |
brendanhay/gogol | gogol-jobs/gen/Network/Google/Resource/Jobs/Projects/Jobs/Delete.hs | mpl-2.0 | -- | Required. The resource name of the job to be deleted. The format is
-- \"projects\/{project_id}\/jobs\/{job_id}\", for example,
-- \"projects\/api-test-project\/jobs\/1234\".
pjdName :: Lens' ProjectsJobsDelete Text
pjdName = lens _pjdName (\ s a -> s{_pjdName = a}) | 271 | pjdName :: Lens' ProjectsJobsDelete Text
pjdName = lens _pjdName (\ s a -> s{_pjdName = a}) | 91 | pjdName = lens _pjdName (\ s a -> s{_pjdName = a}) | 50 | true | true | 0 | 9 | 36 | 42 | 24 | 18 | null | null |
glutamate/blaze-bootstrap | Text/Blaze/Html/Utils.hs | mit | styleSheetLink src= H.link ! A.rel "stylesheet" ! A.href src ! A.type_ "text/css" | 81 | styleSheetLink src= H.link ! A.rel "stylesheet" ! A.href src ! A.type_ "text/css" | 81 | styleSheetLink src= H.link ! A.rel "stylesheet" ! A.href src ! A.type_ "text/css" | 81 | false | false | 0 | 9 | 11 | 38 | 17 | 21 | null | null |
s9gf4ult/hdbi-tests | Database/HDBI/Tests.hs | bsd-3-clause | createTables :: (Connection con) => TestFieldTypes -> con -> IO ()
createTables tf con = do
mapM_ shortRC
[("decimals", tfDecimal)
,("integers", tfInteger)
,("doubles", tfDouble)
,("texts", tfText)
,("blobs", tfBlob)
,("bools", tfBool)
,("bitfields", tfBitField)
,("uuids", tfUUID)
,("utctimes", tfUTCTime)
,("localdates", tfLocalDate)
,("localtimeofdays", tfLocalTimeOfDay)
,("localtimes", tfLocalTime)
]
recreateTable "intdecs" [tfInteger tf, tfDecimal tf]
recreateTable "intublobs" [tfInteger tf, tfUUID tf, tfBlob tf]
recreateTable "table1" [tfInteger tf, tfInteger tf, tfInteger tf]
where
recreateTable tname fnames = do
run con ("DROP TABLE IF EXISTS " <> tname) ()
run con ("CREATE TABLE " <> tname <> " (" <> vals <> ")") ()
where
vals = Query $ TL.pack $ intercalate ", "
$ map (\(col :: Int, fname) -> "val" ++ show col ++ " " ++ (TL.unpack $ unQuery fname))
$ zip [1..] fnames
shortRC (tname, func) = recreateTable tname [func tf] | 1,067 | createTables :: (Connection con) => TestFieldTypes -> con -> IO ()
createTables tf con = do
mapM_ shortRC
[("decimals", tfDecimal)
,("integers", tfInteger)
,("doubles", tfDouble)
,("texts", tfText)
,("blobs", tfBlob)
,("bools", tfBool)
,("bitfields", tfBitField)
,("uuids", tfUUID)
,("utctimes", tfUTCTime)
,("localdates", tfLocalDate)
,("localtimeofdays", tfLocalTimeOfDay)
,("localtimes", tfLocalTime)
]
recreateTable "intdecs" [tfInteger tf, tfDecimal tf]
recreateTable "intublobs" [tfInteger tf, tfUUID tf, tfBlob tf]
recreateTable "table1" [tfInteger tf, tfInteger tf, tfInteger tf]
where
recreateTable tname fnames = do
run con ("DROP TABLE IF EXISTS " <> tname) ()
run con ("CREATE TABLE " <> tname <> " (" <> vals <> ")") ()
where
vals = Query $ TL.pack $ intercalate ", "
$ map (\(col :: Int, fname) -> "val" ++ show col ++ " " ++ (TL.unpack $ unQuery fname))
$ zip [1..] fnames
shortRC (tname, func) = recreateTable tname [func tf] | 1,067 | createTables tf con = do
mapM_ shortRC
[("decimals", tfDecimal)
,("integers", tfInteger)
,("doubles", tfDouble)
,("texts", tfText)
,("blobs", tfBlob)
,("bools", tfBool)
,("bitfields", tfBitField)
,("uuids", tfUUID)
,("utctimes", tfUTCTime)
,("localdates", tfLocalDate)
,("localtimeofdays", tfLocalTimeOfDay)
,("localtimes", tfLocalTime)
]
recreateTable "intdecs" [tfInteger tf, tfDecimal tf]
recreateTable "intublobs" [tfInteger tf, tfUUID tf, tfBlob tf]
recreateTable "table1" [tfInteger tf, tfInteger tf, tfInteger tf]
where
recreateTable tname fnames = do
run con ("DROP TABLE IF EXISTS " <> tname) ()
run con ("CREATE TABLE " <> tname <> " (" <> vals <> ")") ()
where
vals = Query $ TL.pack $ intercalate ", "
$ map (\(col :: Int, fname) -> "val" ++ show col ++ " " ++ (TL.unpack $ unQuery fname))
$ zip [1..] fnames
shortRC (tname, func) = recreateTable tname [func tf] | 1,000 | false | true | 0 | 15 | 262 | 398 | 213 | 185 | null | null |
spechub/Hets | TPTP/StaticAnalysis.hs | gpl-2.0 | signOfVariable :: Variable -> Sign
signOfVariable _ = emptySign | 63 | signOfVariable :: Variable -> Sign
signOfVariable _ = emptySign | 63 | signOfVariable _ = emptySign | 28 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
brendanhay/gogol | gogol-datastore/gen/Network/Google/Resource/Datastore/Projects/Operations/Cancel.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pocUploadProtocol :: Lens' ProjectsOperationsCancel (Maybe Text)
pocUploadProtocol
= lens _pocUploadProtocol
(\ s a -> s{_pocUploadProtocol = a}) | 215 | pocUploadProtocol :: Lens' ProjectsOperationsCancel (Maybe Text)
pocUploadProtocol
= lens _pocUploadProtocol
(\ s a -> s{_pocUploadProtocol = a}) | 153 | pocUploadProtocol
= lens _pocUploadProtocol
(\ s a -> s{_pocUploadProtocol = a}) | 88 | true | true | 1 | 9 | 33 | 52 | 25 | 27 | null | null |
ezyang/ghc | testsuite/tests/typecheck/should_run/T1735_Help/Basics.hs | bsd-3-clause | -- | Gets the fixity of a constructor
constrFixity :: Constr -> Fixity
constrFixity = confixity | 95 | constrFixity :: Constr -> Fixity
constrFixity = confixity | 57 | constrFixity = confixity | 24 | true | true | 0 | 7 | 15 | 23 | 10 | 13 | null | null |
anton-k/language-css | src/Language/Css/Build/Idents.hs | bsd-3-clause | -- | outline-style
outlineStyle :: Idents a => a
outlineStyle = ident "outline-style" | 85 | outlineStyle :: Idents a => a
outlineStyle = ident "outline-style" | 66 | outlineStyle = ident "outline-style" | 36 | true | true | 0 | 6 | 12 | 22 | 11 | 11 | null | null |
SKA-ScienceDataProcessor/RC | MS4/dna-programs/Kernel.hs | apache-2.0 | -- The supported discrete fourier transformation kernels
dftKernels :: [(String, IO DFTKernel)]
dftKernels = let noHints _ = [] in
[ ("dummy", return $ DFTKernel (\_ -> return ()) (return ())
Dummy.dft Dummy.dfti
noHints noHints)
, ("cufft", do
plans <- newIORef (error "DFT kernel called without dftPrepare!")
return $ DFTKernel (GPU_FFT.dftPrepare plans)
(GPU_FFT.dftClean plans)
(GPU_FFT.dftKernel plans)
(GPU_FFT.dftIKernel plans)
GPU_FFT.dftKernelHints
GPU_FFT.dftIKernelHints
)
, ("fftw3", do
plans <- newIORef (error "DFT kernel called without dftPrepare!")
return $ DFTKernel (CPU_FFT.dftPrepare plans)
(CPU_FFT.dftClean plans)
(CPU_FFT.dftKernel plans)
(CPU_FFT.dftIKernel plans)
noHints
noHints)
] | 1,057 | dftKernels :: [(String, IO DFTKernel)]
dftKernels = let noHints _ = [] in
[ ("dummy", return $ DFTKernel (\_ -> return ()) (return ())
Dummy.dft Dummy.dfti
noHints noHints)
, ("cufft", do
plans <- newIORef (error "DFT kernel called without dftPrepare!")
return $ DFTKernel (GPU_FFT.dftPrepare plans)
(GPU_FFT.dftClean plans)
(GPU_FFT.dftKernel plans)
(GPU_FFT.dftIKernel plans)
GPU_FFT.dftKernelHints
GPU_FFT.dftIKernelHints
)
, ("fftw3", do
plans <- newIORef (error "DFT kernel called without dftPrepare!")
return $ DFTKernel (CPU_FFT.dftPrepare plans)
(CPU_FFT.dftClean plans)
(CPU_FFT.dftKernel plans)
(CPU_FFT.dftIKernel plans)
noHints
noHints)
] | 1,000 | dftKernels = let noHints _ = [] in
[ ("dummy", return $ DFTKernel (\_ -> return ()) (return ())
Dummy.dft Dummy.dfti
noHints noHints)
, ("cufft", do
plans <- newIORef (error "DFT kernel called without dftPrepare!")
return $ DFTKernel (GPU_FFT.dftPrepare plans)
(GPU_FFT.dftClean plans)
(GPU_FFT.dftKernel plans)
(GPU_FFT.dftIKernel plans)
GPU_FFT.dftKernelHints
GPU_FFT.dftIKernelHints
)
, ("fftw3", do
plans <- newIORef (error "DFT kernel called without dftPrepare!")
return $ DFTKernel (CPU_FFT.dftPrepare plans)
(CPU_FFT.dftClean plans)
(CPU_FFT.dftKernel plans)
(CPU_FFT.dftIKernel plans)
noHints
noHints)
] | 961 | true | true | 2 | 16 | 436 | 256 | 126 | 130 | null | null |
meh/crepuscolo | src/Crepuscolo/Highlight.hs | gpl-3.0 | extend h s =
h s | 20 | extend h s =
h s | 20 | extend h s =
h s | 20 | false | false | 0 | 5 | 9 | 14 | 6 | 8 | null | null |
C-Elegans/linear | Core.hs | mit | exprType (Op op l r) = exprType l | 33 | exprType (Op op l r) = exprType l | 33 | exprType (Op op l r) = exprType l | 33 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2018/M11/D22/Solution.hs | mit | ft n x = 1 / 4 ** x + ft (pred n) (succ x) | 42 | ft n x = 1 / 4 ** x + ft (pred n) (succ x) | 42 | ft n x = 1 / 4 ** x + ft (pred n) (succ x) | 42 | false | false | 0 | 8 | 14 | 41 | 19 | 22 | null | null |
kmate/raw-feldspar | src/Feldspar/Run/Marshal.hs | bsd-3-clause | -- | A version of 'marshalledStream' that takes 'ExternalCompilerOpts' as
-- additional argument
marshalledStream' :: (MarshalFeld a, MarshalFeld b)
=> CompilerOpts
-> ExternalCompilerOpts
-> (a -> Run b) -- ^ Function to compile
-> (([HaskellRep a] -> IO [HaskellRep b]) -> IO c)
-- ^ Function that has access to the compiled executable as a function
-> IO c
marshalledStream' opts eopts f body =
withCompiled' opts eopts (streamStdIO f) $ \g ->
body $ \is -> do
parse toHaskell <$> g (fromHaskell is)
-- | Compile a function and make it available as an 'IO' function. The compiled
-- function will be applied repeatedly over the list of inputs producing a list
-- of outputs. Note that compilation only happens once, even if the function is
-- used many times in the body. | 823 | marshalledStream' :: (MarshalFeld a, MarshalFeld b)
=> CompilerOpts
-> ExternalCompilerOpts
-> (a -> Run b) -- ^ Function to compile
-> (([HaskellRep a] -> IO [HaskellRep b]) -> IO c)
-- ^ Function that has access to the compiled executable as a function
-> IO c
marshalledStream' opts eopts f body =
withCompiled' opts eopts (streamStdIO f) $ \g ->
body $ \is -> do
parse toHaskell <$> g (fromHaskell is)
-- | Compile a function and make it available as an 'IO' function. The compiled
-- function will be applied repeatedly over the list of inputs producing a list
-- of outputs. Note that compilation only happens once, even if the function is
-- used many times in the body. | 726 | marshalledStream' opts eopts f body =
withCompiled' opts eopts (streamStdIO f) $ \g ->
body $ \is -> do
parse toHaskell <$> g (fromHaskell is)
-- | Compile a function and make it available as an 'IO' function. The compiled
-- function will be applied repeatedly over the list of inputs producing a list
-- of outputs. Note that compilation only happens once, even if the function is
-- used many times in the body. | 433 | true | true | 0 | 17 | 182 | 155 | 80 | 75 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp NumSparks = _ILIT(381) | 35 | tagOf_PrimOp NumSparks = _ILIT(381) | 35 | tagOf_PrimOp NumSparks = _ILIT(381) | 35 | false | false | 0 | 6 | 3 | 15 | 7 | 8 | null | null |
noinia/virtual-persistent-fs | src/System/FileSystemOperations.hs | bsd-3-clause | createDirectory :: path -> FSOperation path writer reader ()
createDirectory p = liftF (CreateDirectory p ()) | 111 | createDirectory :: path -> FSOperation path writer reader ()
createDirectory p = liftF (CreateDirectory p ()) | 111 | createDirectory p = liftF (CreateDirectory p ()) | 48 | false | true | 0 | 8 | 17 | 42 | 20 | 22 | null | null |
ennocramer/hindent | src/HIndent/Styles/ChrisDone.hs | bsd-3-clause | -- | Pretty print type signatures like
--
-- foo :: (Show x,Read x)
-- => (Foo -> Bar)
-- -> Maybe Int
-- -> (Char -> X -> Y)
-- -> IO ()
--
decl :: Decl NodeInfo -> Printer s ()
decl (TypeDecl _ head ty) =
do write "type "
pretty head
write " = "
(fits,st) <- fitsOnOneLine (pretty ty)
if fits
then put st
else do newline
indented 2 (pretty ty) | 415 | decl :: Decl NodeInfo -> Printer s ()
decl (TypeDecl _ head ty) =
do write "type "
pretty head
write " = "
(fits,st) <- fitsOnOneLine (pretty ty)
if fits
then put st
else do newline
indented 2 (pretty ty) | 258 | decl (TypeDecl _ head ty) =
do write "type "
pretty head
write " = "
(fits,st) <- fitsOnOneLine (pretty ty)
if fits
then put st
else do newline
indented 2 (pretty ty) | 220 | true | true | 0 | 12 | 145 | 117 | 57 | 60 | null | null |
DaMSL/K3 | src/Language/K3/Parser/DataTypes.hs | apache-2.0 | k3Keywords :: [[Char]]
k3Keywords = [
{- Types -}
"int", "bool", "real", "string",
"immut", "mut", "witness", "option", "ind" , "collection",
{- Declarations -}
"declare", "fun", "trigger", "source", "sink", "feed",
{- Expressions -}
"let", "in", "if", "then", "else", "case", "of", "bind", "as",
"and", "or", "not",
{- Values -}
"true", "false", "ind", "Some", "None", "empty",
{- Annotation declarations -}
"annotation", "lifted", "provides", "requires", "given", "type",
{- Annotation keywords -}
"self", "structure", "horizon", "content", "forall",
{- Metaprogramming keywords -}
"control", "label", "expr", "decl", "literal", "labeltype", "shared", "for",
{- Effect signature keywords -}
"with", "symbol", "effects", "return", "fresh", "none", "io",
{- Syntactic sugar keywords -}
"typedef",
{- Delayed messages. -}
"delay", "override", "edge"
] | 949 | k3Keywords :: [[Char]]
k3Keywords = [
{- Types -}
"int", "bool", "real", "string",
"immut", "mut", "witness", "option", "ind" , "collection",
{- Declarations -}
"declare", "fun", "trigger", "source", "sink", "feed",
{- Expressions -}
"let", "in", "if", "then", "else", "case", "of", "bind", "as",
"and", "or", "not",
{- Values -}
"true", "false", "ind", "Some", "None", "empty",
{- Annotation declarations -}
"annotation", "lifted", "provides", "requires", "given", "type",
{- Annotation keywords -}
"self", "structure", "horizon", "content", "forall",
{- Metaprogramming keywords -}
"control", "label", "expr", "decl", "literal", "labeltype", "shared", "for",
{- Effect signature keywords -}
"with", "symbol", "effects", "return", "fresh", "none", "io",
{- Syntactic sugar keywords -}
"typedef",
{- Delayed messages. -}
"delay", "override", "edge"
] | 949 | k3Keywords = [
{- Types -}
"int", "bool", "real", "string",
"immut", "mut", "witness", "option", "ind" , "collection",
{- Declarations -}
"declare", "fun", "trigger", "source", "sink", "feed",
{- Expressions -}
"let", "in", "if", "then", "else", "case", "of", "bind", "as",
"and", "or", "not",
{- Values -}
"true", "false", "ind", "Some", "None", "empty",
{- Annotation declarations -}
"annotation", "lifted", "provides", "requires", "given", "type",
{- Annotation keywords -}
"self", "structure", "horizon", "content", "forall",
{- Metaprogramming keywords -}
"control", "label", "expr", "decl", "literal", "labeltype", "shared", "for",
{- Effect signature keywords -}
"with", "symbol", "effects", "return", "fresh", "none", "io",
{- Syntactic sugar keywords -}
"typedef",
{- Delayed messages. -}
"delay", "override", "edge"
] | 926 | false | true | 0 | 8 | 208 | 226 | 149 | 77 | null | null |
jfdm/hUML | src/MsgDiagram/Parser.hs | bsd-3-clause | doParse :: Parser MsgDiagram
doParse = do steps <- many parseStep
eof
return $ steps
<?> "Parse Protocol" | 141 | doParse :: Parser MsgDiagram
doParse = do steps <- many parseStep
eof
return $ steps
<?> "Parse Protocol" | 141 | doParse = do steps <- many parseStep
eof
return $ steps
<?> "Parse Protocol" | 112 | false | true | 0 | 9 | 53 | 38 | 17 | 21 | null | null |
technogeeky/zeroth | ppsrc-respaced/Language/Haskell/TH/ZeroTH/GetOpt.hs | bsd-3-clause | tempJustSplices' = addP tempJustSplices setTempJustSplices | 63 | tempJustSplices' = addP tempJustSplices setTempJustSplices | 63 | tempJustSplices' = addP tempJustSplices setTempJustSplices | 63 | false | false | 0 | 5 | 9 | 11 | 5 | 6 | null | null |
mariusae/simplenote-hs | Network/Simplenote/Request.hs | bsd-3-clause | b64EncodeString :: String -> String
b64EncodeString = B64.encode . US.encode | 76 | b64EncodeString :: String -> String
b64EncodeString = B64.encode . US.encode | 76 | b64EncodeString = B64.encode . US.encode | 40 | false | true | 0 | 6 | 9 | 23 | 12 | 11 | null | null |
owickstrom/websub | src/Network/HTTP/WebSub/Middleware.hs | mpl-2.0 | subscriptionCallbacks :: Subscriptions c -> BS.ByteString -> Middleware
subscriptionCallbacks subscriptions basePath app req respond =
case (requestMethod req, BS.stripPrefix (basePath <> "/") (rawPathInfo req)) of
(method, Just subscriptionId)
| BS.null subscriptionId ->
respond $ responseLBS status404 [] "Subscription Not Found"
| otherwise ->
case method of
_
| method == methodGet ->
verifySubscriptionHandler
subscriptions
(SubscriptionId subscriptionId)
req
respond
| method == methodPost ->
distributeContentHandler
subscriptions
(SubscriptionId subscriptionId)
req
respond
| otherwise -> app req respond
(_, Nothing) -> app req respond | 885 | subscriptionCallbacks :: Subscriptions c -> BS.ByteString -> Middleware
subscriptionCallbacks subscriptions basePath app req respond =
case (requestMethod req, BS.stripPrefix (basePath <> "/") (rawPathInfo req)) of
(method, Just subscriptionId)
| BS.null subscriptionId ->
respond $ responseLBS status404 [] "Subscription Not Found"
| otherwise ->
case method of
_
| method == methodGet ->
verifySubscriptionHandler
subscriptions
(SubscriptionId subscriptionId)
req
respond
| method == methodPost ->
distributeContentHandler
subscriptions
(SubscriptionId subscriptionId)
req
respond
| otherwise -> app req respond
(_, Nothing) -> app req respond | 885 | subscriptionCallbacks subscriptions basePath app req respond =
case (requestMethod req, BS.stripPrefix (basePath <> "/") (rawPathInfo req)) of
(method, Just subscriptionId)
| BS.null subscriptionId ->
respond $ responseLBS status404 [] "Subscription Not Found"
| otherwise ->
case method of
_
| method == methodGet ->
verifySubscriptionHandler
subscriptions
(SubscriptionId subscriptionId)
req
respond
| method == methodPost ->
distributeContentHandler
subscriptions
(SubscriptionId subscriptionId)
req
respond
| otherwise -> app req respond
(_, Nothing) -> app req respond | 813 | false | true | 4 | 13 | 320 | 209 | 100 | 109 | null | null |
OS2World/DEV-UTIL-HUGS | oldlib/SimpleQueue.hs | bsd-3-clause | reverse (Q xs ys) = Q ys xs | 27 | reverse (Q xs ys) = Q ys xs | 27 | reverse (Q xs ys) = Q ys xs | 27 | false | false | 0 | 6 | 7 | 23 | 10 | 13 | null | null |
SiestaMadokaist/writescheme | test/Ramadoka/Parser/LispValSpec.hs | bsd-3-clause | ratio :: Integer -> Integer -> LispVal
ratio a b = Number $ Rational a b | 74 | ratio :: Integer -> Integer -> LispVal
ratio a b = Number $ Rational a b | 72 | ratio a b = Number $ Rational a b | 33 | false | true | 0 | 8 | 17 | 38 | 17 | 21 | null | null |
Muzietto/transformerz | haskell/grabmuller/grabmuller_01.hs | mit | eval1 env (Var varName) = return $ fromJust $ Map.lookup varName env | 74 | eval1 env (Var varName) = return $ fromJust $ Map.lookup varName env | 74 | eval1 env (Var varName) = return $ fromJust $ Map.lookup varName env | 74 | false | false | 0 | 7 | 17 | 34 | 15 | 19 | null | null |
Skyfold/postgrest | src/PostgREST/DbRequestBuilder.hs | mit | addRangeToNode :: NonnegRange -> ReadRequest -> ReadRequest
addRangeToNode r (Node (q,i) f) = Node (q{range_=r}, i) f | 117 | addRangeToNode :: NonnegRange -> ReadRequest -> ReadRequest
addRangeToNode r (Node (q,i) f) = Node (q{range_=r}, i) f | 117 | addRangeToNode r (Node (q,i) f) = Node (q{range_=r}, i) f | 57 | false | true | 0 | 8 | 16 | 62 | 32 | 30 | null | null |
lingxiao/CIS700 | depricated/CountMinSketch4.hs | bsd-3-clause | inits _ = pass | 18 | inits _ = pass | 18 | inits _ = pass | 18 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
markgrebe/haskell-craft | HaskellCraft/Craft.hs | bsd-3-clause | playerSetTile :: (Int, Int, Int) -> Craft ()
playerSetTile = Method . PlayerSetTile | 83 | playerSetTile :: (Int, Int, Int) -> Craft ()
playerSetTile = Method . PlayerSetTile | 83 | playerSetTile = Method . PlayerSetTile | 38 | false | true | 0 | 7 | 12 | 33 | 18 | 15 | null | null |
gergoerdi/sstg | src/sstg-dump.hs | bsd-3-clause | main = do
stgbs <- getArgs
groups <- concat <$> mapM readStgb stgbs
forM_ groups $ \group -> do
forM group $ \(SStgBinding name _) ->
putStrLn $ showSDoc $ ppr name | 183 | main = do
stgbs <- getArgs
groups <- concat <$> mapM readStgb stgbs
forM_ groups $ \group -> do
forM group $ \(SStgBinding name _) ->
putStrLn $ showSDoc $ ppr name | 183 | main = do
stgbs <- getArgs
groups <- concat <$> mapM readStgb stgbs
forM_ groups $ \group -> do
forM group $ \(SStgBinding name _) ->
putStrLn $ showSDoc $ ppr name | 183 | false | false | 1 | 15 | 50 | 82 | 36 | 46 | null | null |
brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Projects/Sinks/Update.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
psuUploadType :: Lens' ProjectsSinksUpdate (Maybe Text)
psuUploadType
= lens _psuUploadType
(\ s a -> s{_psuUploadType = a}) | 203 | psuUploadType :: Lens' ProjectsSinksUpdate (Maybe Text)
psuUploadType
= lens _psuUploadType
(\ s a -> s{_psuUploadType = a}) | 132 | psuUploadType
= lens _psuUploadType
(\ s a -> s{_psuUploadType = a}) | 76 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
sol/hspec-expectations | src/Test/Hspec/Expectations/Floating.hs | mit | ulpDistance :: (RealFloat a, Storable a) => a -> a -> Integer
ulpDistance a b = abs (toWord a - toWord b)
where
toWord = fromIntegral . floatingToWord64 | 158 | ulpDistance :: (RealFloat a, Storable a) => a -> a -> Integer
ulpDistance a b = abs (toWord a - toWord b)
where
toWord = fromIntegral . floatingToWord64 | 158 | ulpDistance a b = abs (toWord a - toWord b)
where
toWord = fromIntegral . floatingToWord64 | 96 | false | true | 0 | 8 | 33 | 67 | 33 | 34 | null | null |
iblumenfeld/saw-core | src/Verifier/SAW/TermNet.hs | bsd-3-clause | {-return items whose key could unify with t-}
unify_term :: Pattern t => Net a -> t -> [a]
unify_term net t = extract_leaves (matching True (toPat t) net []) | 157 | unify_term :: Pattern t => Net a -> t -> [a]
unify_term net t = extract_leaves (matching True (toPat t) net []) | 111 | unify_term net t = extract_leaves (matching True (toPat t) net []) | 66 | true | true | 0 | 9 | 29 | 61 | 30 | 31 | null | null |
alexvong1995/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | divHtml :: MarkdownParser (F Blocks)
divHtml = try $ do
guardEnabled Ext_native_divs
(TagOpen _ attrs, rawtag) <- htmlTag (~== TagOpen "div" [])
-- we set stateInHtmlBlock so that closing tags that can be either block or
-- inline will not be parsed as inline tags
oldInHtmlBlock <- stateInHtmlBlock <$> getState
updateState $ \st -> st{ stateInHtmlBlock = Just "div" }
bls <- option "" (blankline >> option "" blanklines)
contents <- mconcat <$>
many (notFollowedBy' (htmlTag (~== TagClose "div")) >> block)
closed <- option False (True <$ htmlTag (~== TagClose "div"))
if closed
then do
updateState $ \st -> st{ stateInHtmlBlock = oldInHtmlBlock }
let ident = fromMaybe "" $ lookup "id" attrs
let classes = maybe [] words $ lookup "class" attrs
let keyvals = [(k,v) | (k,v) <- attrs, k /= "id" && k /= "class"]
return $ B.divWith (ident, classes, keyvals) <$> contents
else -- avoid backtracing
return $ return (B.rawBlock "html" (rawtag <> bls)) <> contents | 1,046 | divHtml :: MarkdownParser (F Blocks)
divHtml = try $ do
guardEnabled Ext_native_divs
(TagOpen _ attrs, rawtag) <- htmlTag (~== TagOpen "div" [])
-- we set stateInHtmlBlock so that closing tags that can be either block or
-- inline will not be parsed as inline tags
oldInHtmlBlock <- stateInHtmlBlock <$> getState
updateState $ \st -> st{ stateInHtmlBlock = Just "div" }
bls <- option "" (blankline >> option "" blanklines)
contents <- mconcat <$>
many (notFollowedBy' (htmlTag (~== TagClose "div")) >> block)
closed <- option False (True <$ htmlTag (~== TagClose "div"))
if closed
then do
updateState $ \st -> st{ stateInHtmlBlock = oldInHtmlBlock }
let ident = fromMaybe "" $ lookup "id" attrs
let classes = maybe [] words $ lookup "class" attrs
let keyvals = [(k,v) | (k,v) <- attrs, k /= "id" && k /= "class"]
return $ B.divWith (ident, classes, keyvals) <$> contents
else -- avoid backtracing
return $ return (B.rawBlock "html" (rawtag <> bls)) <> contents | 1,046 | divHtml = try $ do
guardEnabled Ext_native_divs
(TagOpen _ attrs, rawtag) <- htmlTag (~== TagOpen "div" [])
-- we set stateInHtmlBlock so that closing tags that can be either block or
-- inline will not be parsed as inline tags
oldInHtmlBlock <- stateInHtmlBlock <$> getState
updateState $ \st -> st{ stateInHtmlBlock = Just "div" }
bls <- option "" (blankline >> option "" blanklines)
contents <- mconcat <$>
many (notFollowedBy' (htmlTag (~== TagClose "div")) >> block)
closed <- option False (True <$ htmlTag (~== TagClose "div"))
if closed
then do
updateState $ \st -> st{ stateInHtmlBlock = oldInHtmlBlock }
let ident = fromMaybe "" $ lookup "id" attrs
let classes = maybe [] words $ lookup "class" attrs
let keyvals = [(k,v) | (k,v) <- attrs, k /= "id" && k /= "class"]
return $ B.divWith (ident, classes, keyvals) <$> contents
else -- avoid backtracing
return $ return (B.rawBlock "html" (rawtag <> bls)) <> contents | 1,009 | false | true | 0 | 18 | 245 | 367 | 183 | 184 | null | null |
JustinUnger/haskell-book | ch12/ch12.hs | mit | vowelFirst (x:xs) = if x `elem` "aeiou" then True else False | 60 | vowelFirst (x:xs) = if x `elem` "aeiou" then True else False | 60 | vowelFirst (x:xs) = if x `elem` "aeiou" then True else False | 60 | false | false | 0 | 7 | 10 | 30 | 17 | 13 | null | null |
tjakway/ghcjvm | compiler/basicTypes/Literal.hs | bsd-3-clause | mkLitInteger :: Integer -> Type -> Literal
mkLitInteger = LitInteger | 68 | mkLitInteger :: Integer -> Type -> Literal
mkLitInteger = LitInteger | 68 | mkLitInteger = LitInteger | 25 | false | true | 0 | 6 | 9 | 19 | 10 | 9 | null | null |
nettsundere/cyberlog | src/Main.hs | bsd-3-clause | main :: IO ()
main = do
response <- (parseCommand <$> getArgs)
case response of
Just cmd -> perform cmd
Nothing -> putStrLn usageMessage | 149 | main :: IO ()
main = do
response <- (parseCommand <$> getArgs)
case response of
Just cmd -> perform cmd
Nothing -> putStrLn usageMessage | 149 | main = do
response <- (parseCommand <$> getArgs)
case response of
Just cmd -> perform cmd
Nothing -> putStrLn usageMessage | 135 | false | true | 0 | 11 | 36 | 64 | 28 | 36 | null | null |
parapluu/encore | src/back/CodeGen/CCodeNames.hs | bsd-3-clause | futMsgTypeName :: Ty.Type -> ID.Name -> CCode Name
futMsgTypeName cls mname =
Nam $ encoreName "fut_msg" (qualifyRefType cls ++ "_" ++ show mname ++ "_t") | 158 | futMsgTypeName :: Ty.Type -> ID.Name -> CCode Name
futMsgTypeName cls mname =
Nam $ encoreName "fut_msg" (qualifyRefType cls ++ "_" ++ show mname ++ "_t") | 158 | futMsgTypeName cls mname =
Nam $ encoreName "fut_msg" (qualifyRefType cls ++ "_" ++ show mname ++ "_t") | 107 | false | true | 2 | 10 | 28 | 66 | 30 | 36 | null | null |
JamieBeverley/InnerEar | src/InnerEar/Types/Data.hs | gpl-3.0 | toDatum (ExerciseConfigured j) = Configured <$> decode j | 56 | toDatum (ExerciseConfigured j) = Configured <$> decode j | 56 | toDatum (ExerciseConfigured j) = Configured <$> decode j | 56 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
xu-hao/QueryArrow | QueryArrow-common/src/QueryArrow/Parser.hs | bsd-3-clause | varp :: FOParser Var
varp = Var <$> identifier | 46 | varp :: FOParser Var
varp = Var <$> identifier | 46 | varp = Var <$> identifier | 25 | false | true | 2 | 6 | 8 | 25 | 10 | 15 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Lex.hs | gpl-2.0 | parseRules ("Lex/Flex","RegExpr (") =
(((parseRules ("Lex/Flex","RegExpr Base")))
<|>
((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))
<|>
((pRegExpr regex_'2e >>= withAttribute StringTok))
<|>
(currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr (")) >> pDefault >>= withAttribute StringTok)) | 341 | parseRules ("Lex/Flex","RegExpr (") =
(((parseRules ("Lex/Flex","RegExpr Base")))
<|>
((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))
<|>
((pRegExpr regex_'2e >>= withAttribute StringTok))
<|>
(currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr (")) >> pDefault >>= withAttribute StringTok)) | 341 | parseRules ("Lex/Flex","RegExpr (") =
(((parseRules ("Lex/Flex","RegExpr Base")))
<|>
((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))
<|>
((pRegExpr regex_'2e >>= withAttribute StringTok))
<|>
(currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr (")) >> pDefault >>= withAttribute StringTok)) | 341 | false | false | 0 | 15 | 56 | 125 | 67 | 58 | null | null |
tomtitchener/RealSimpleMusic | tests/MainTestSuite.hs | cc0-1.0 | tests :: TestTree
tests =
testGroup "Example"
[
testCase "mid slice" testSliceInMiddle
, testProperty "slice all is id" propSliceAllIsOriginalList
, testProperty "slice one is head" propSliceFirstIsHead
, testCase "rotateTo" testRotateTo
, testProperty "rotateTo head is id" propRotateToFirstIsSame
, testCase "enh chromatic pitch class vals" testEnhChromPitchClassValues
, testCase "chromatic scale index" testGetChromaticScaleIndex
, testCase "major scale interval" testMajorScaleInterval
, testProperty "major scale intervals" propMajorScaleIntervals
, testProperty "major scale" propMajorScaleId
, testProperty "natural minor scale" propNaturalMinorScaleId
-- ScoreToMidi
, testCase "mapVoicessToDifferentChannelss" testMapVoicessToDifferentChannelss
, testCase "mapManyVoicessToDifferentChannelss"testMapManyVoicessToDifferentChannelss
, testCase "mapVoicessToUniformChannelss" testMapVoicessToUniformChannelss
, testProperty "testSynthesizeDurationSpan" testSynthesizeDurationSpan
, testProperty "testSynthesizeCrescendoSpan" testSynthesizeCrescendoSpan
, testProperty "testSynthesizeDecrescendoSpan" testSynthesizeDecrescendoSpan
, testProperty "testSynthesizeUpPanSpan" testSynthesizeUpPanSpan
, testProperty "testSynthesizeDownPanSpan" testSynthesizeDownPanSpan
, testProperty "testSynthesizeAccelerandoSpan" testSynthesizeAccelerandoSpan
, testProperty "testSynthesizeRitardandoSpan" testSynthesizeRitardandoSpan
-- ScoreToLilypond
, testCase "testAccentNames" testAccentNames
, testCase "testRenderPitchOctaves" testRenderPitchOctaves
, testCase "testRenderPitchAccidentals" testRenderPitchAccidentals
, testCase "testRenderRhythmBase" testRenderRhythmBase
, testCase "testRenderRhythmDots" testRenderRhythmDots
, testCase "testRenderRhythmTies" testRenderRhythmTies
, testCase "testRenderNote" testRenderNote
, testCase "testRenderAccentedNote" testRenderAccentedNote
, testCase "testRenderRest" testRenderRest
, testCase "testRenderPercussionNote" testRenderPercussionNote
, testCase "testRenderAccentedPercussionNote" testRenderAccentedPercussionNote
, testCase "testRenderTiedNote" testRenderTiedNote
, testCase "testRenderNotes" testRenderNotes
--}
] | 2,926 | tests :: TestTree
tests =
testGroup "Example"
[
testCase "mid slice" testSliceInMiddle
, testProperty "slice all is id" propSliceAllIsOriginalList
, testProperty "slice one is head" propSliceFirstIsHead
, testCase "rotateTo" testRotateTo
, testProperty "rotateTo head is id" propRotateToFirstIsSame
, testCase "enh chromatic pitch class vals" testEnhChromPitchClassValues
, testCase "chromatic scale index" testGetChromaticScaleIndex
, testCase "major scale interval" testMajorScaleInterval
, testProperty "major scale intervals" propMajorScaleIntervals
, testProperty "major scale" propMajorScaleId
, testProperty "natural minor scale" propNaturalMinorScaleId
-- ScoreToMidi
, testCase "mapVoicessToDifferentChannelss" testMapVoicessToDifferentChannelss
, testCase "mapManyVoicessToDifferentChannelss"testMapManyVoicessToDifferentChannelss
, testCase "mapVoicessToUniformChannelss" testMapVoicessToUniformChannelss
, testProperty "testSynthesizeDurationSpan" testSynthesizeDurationSpan
, testProperty "testSynthesizeCrescendoSpan" testSynthesizeCrescendoSpan
, testProperty "testSynthesizeDecrescendoSpan" testSynthesizeDecrescendoSpan
, testProperty "testSynthesizeUpPanSpan" testSynthesizeUpPanSpan
, testProperty "testSynthesizeDownPanSpan" testSynthesizeDownPanSpan
, testProperty "testSynthesizeAccelerandoSpan" testSynthesizeAccelerandoSpan
, testProperty "testSynthesizeRitardandoSpan" testSynthesizeRitardandoSpan
-- ScoreToLilypond
, testCase "testAccentNames" testAccentNames
, testCase "testRenderPitchOctaves" testRenderPitchOctaves
, testCase "testRenderPitchAccidentals" testRenderPitchAccidentals
, testCase "testRenderRhythmBase" testRenderRhythmBase
, testCase "testRenderRhythmDots" testRenderRhythmDots
, testCase "testRenderRhythmTies" testRenderRhythmTies
, testCase "testRenderNote" testRenderNote
, testCase "testRenderAccentedNote" testRenderAccentedNote
, testCase "testRenderRest" testRenderRest
, testCase "testRenderPercussionNote" testRenderPercussionNote
, testCase "testRenderAccentedPercussionNote" testRenderAccentedPercussionNote
, testCase "testRenderTiedNote" testRenderTiedNote
, testCase "testRenderNotes" testRenderNotes
--}
] | 2,926 | tests =
testGroup "Example"
[
testCase "mid slice" testSliceInMiddle
, testProperty "slice all is id" propSliceAllIsOriginalList
, testProperty "slice one is head" propSliceFirstIsHead
, testCase "rotateTo" testRotateTo
, testProperty "rotateTo head is id" propRotateToFirstIsSame
, testCase "enh chromatic pitch class vals" testEnhChromPitchClassValues
, testCase "chromatic scale index" testGetChromaticScaleIndex
, testCase "major scale interval" testMajorScaleInterval
, testProperty "major scale intervals" propMajorScaleIntervals
, testProperty "major scale" propMajorScaleId
, testProperty "natural minor scale" propNaturalMinorScaleId
-- ScoreToMidi
, testCase "mapVoicessToDifferentChannelss" testMapVoicessToDifferentChannelss
, testCase "mapManyVoicessToDifferentChannelss"testMapManyVoicessToDifferentChannelss
, testCase "mapVoicessToUniformChannelss" testMapVoicessToUniformChannelss
, testProperty "testSynthesizeDurationSpan" testSynthesizeDurationSpan
, testProperty "testSynthesizeCrescendoSpan" testSynthesizeCrescendoSpan
, testProperty "testSynthesizeDecrescendoSpan" testSynthesizeDecrescendoSpan
, testProperty "testSynthesizeUpPanSpan" testSynthesizeUpPanSpan
, testProperty "testSynthesizeDownPanSpan" testSynthesizeDownPanSpan
, testProperty "testSynthesizeAccelerandoSpan" testSynthesizeAccelerandoSpan
, testProperty "testSynthesizeRitardandoSpan" testSynthesizeRitardandoSpan
-- ScoreToLilypond
, testCase "testAccentNames" testAccentNames
, testCase "testRenderPitchOctaves" testRenderPitchOctaves
, testCase "testRenderPitchAccidentals" testRenderPitchAccidentals
, testCase "testRenderRhythmBase" testRenderRhythmBase
, testCase "testRenderRhythmDots" testRenderRhythmDots
, testCase "testRenderRhythmTies" testRenderRhythmTies
, testCase "testRenderNote" testRenderNote
, testCase "testRenderAccentedNote" testRenderAccentedNote
, testCase "testRenderRest" testRenderRest
, testCase "testRenderPercussionNote" testRenderPercussionNote
, testCase "testRenderAccentedPercussionNote" testRenderAccentedPercussionNote
, testCase "testRenderTiedNote" testRenderTiedNote
, testCase "testRenderNotes" testRenderNotes
--}
] | 2,908 | false | true | 0 | 7 | 930 | 299 | 148 | 151 | null | null |
seagull-kamome/Data-Diff | Data/Diff.hs | bsd-3-clause | nodeCommonLength :: Node -> Int
nodeCommonLength = either (const 0) id | 70 | nodeCommonLength :: Node -> Int
nodeCommonLength = either (const 0) id | 70 | nodeCommonLength = either (const 0) id | 38 | false | true | 0 | 7 | 10 | 26 | 13 | 13 | null | null |
gatlin/psilo | src/Lib/Types/TypeCheck.hs | gpl-3.0 | unify ty (TVar tv) = bind tv ty | 31 | unify ty (TVar tv) = bind tv ty | 31 | unify ty (TVar tv) = bind tv ty | 31 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
jjeffrey/hungarian | Hungarian.hs | mit | --MATRIX OPTIMIZATION--
optimize :: Int -> Matrix Int -> [(Int,Int)] -> [(MatrixLine,Int)] -> Matrix Int
optimize val matr srch pp =
if isOptimal matr srch pp
then matr
else let matr2 = moreOptimizedMatrix matr (map fst pp)
newSearch = findInMatrix val matr2
minPairs = removeRedundantPairs newSearch $ producePairs newSearch
in optimize val matr2 newSearch minPairs | 482 | optimize :: Int -> Matrix Int -> [(Int,Int)] -> [(MatrixLine,Int)] -> Matrix Int
optimize val matr srch pp =
if isOptimal matr srch pp
then matr
else let matr2 = moreOptimizedMatrix matr (map fst pp)
newSearch = findInMatrix val matr2
minPairs = removeRedundantPairs newSearch $ producePairs newSearch
in optimize val matr2 newSearch minPairs | 457 | optimize val matr srch pp =
if isOptimal matr srch pp
then matr
else let matr2 = moreOptimizedMatrix matr (map fst pp)
newSearch = findInMatrix val matr2
minPairs = removeRedundantPairs newSearch $ producePairs newSearch
in optimize val matr2 newSearch minPairs | 376 | true | true | 0 | 12 | 170 | 138 | 69 | 69 | null | null |
mightymoose/liquidhaskell | benchmarks/hmatrix-0.15.0.1/lib/Data/Packed/ST.hs | bsd-3-clause | unsafeThawMatrix :: Storable t => Matrix t -> ST s (STMatrix s t)
unsafeThawMatrix = unsafeIOToST . return . STMatrix | 117 | unsafeThawMatrix :: Storable t => Matrix t -> ST s (STMatrix s t)
unsafeThawMatrix = unsafeIOToST . return . STMatrix | 117 | unsafeThawMatrix = unsafeIOToST . return . STMatrix | 51 | false | true | 0 | 10 | 19 | 52 | 23 | 29 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | blazingly = id | 14 | blazingly = id | 14 | blazingly = id | 14 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
sonyandy/fd | src/Control/Monad/FD/Internal/State.hs | bsd-3-clause | modify :: Monad m => (s -> s) -> StateT s m ()
modify f = state $ \ s -> () :*: f s | 83 | modify :: Monad m => (s -> s) -> StateT s m ()
modify f = state $ \ s -> () :*: f s | 83 | modify f = state $ \ s -> () :*: f s | 36 | false | true | 0 | 8 | 24 | 59 | 29 | 30 | null | null |
basvandijk/binary | src/Data/Binary/Builder/Base.hs | bsd-3-clause | -- | Map the resulting list of bytestrings.
mapBuilder :: (L.ByteString -> L.ByteString) -> Builder
mapBuilder f = Builder (fmap f .) | 133 | mapBuilder :: (L.ByteString -> L.ByteString) -> Builder
mapBuilder f = Builder (fmap f .) | 89 | mapBuilder f = Builder (fmap f .) | 33 | true | true | 0 | 8 | 21 | 40 | 21 | 19 | null | null |
tismith/tlisp | write-yourself-a-scheme/listings/listing8.hs | mit | parseAtom :: Parser LispVal
parseAtom = do first <- letter <|> symbol
rest <- many (letter <|> digit <|> symbol)
let atom = [first] ++ rest
return $ case atom of
"#t" -> Bool True
"#f" -> Bool False
otherwise -> Atom atom | 345 | parseAtom :: Parser LispVal
parseAtom = do first <- letter <|> symbol
rest <- many (letter <|> digit <|> symbol)
let atom = [first] ++ rest
return $ case atom of
"#t" -> Bool True
"#f" -> Bool False
otherwise -> Atom atom | 345 | parseAtom = do first <- letter <|> symbol
rest <- many (letter <|> digit <|> symbol)
let atom = [first] ++ rest
return $ case atom of
"#t" -> Bool True
"#f" -> Bool False
otherwise -> Atom atom | 317 | false | true | 1 | 12 | 166 | 104 | 47 | 57 | null | null |
agentm/project-m36 | src/lib/ProjectM36/TypeConstructor.hs | unlicense | name (PrimitiveTypeConstructor name' _) = name' | 47 | name (PrimitiveTypeConstructor name' _) = name' | 47 | name (PrimitiveTypeConstructor name' _) = name' | 47 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | ID of the creative associated with the campaign. This is a required
-- field.
ccaCreativeId :: Lens' CampaignCreativeAssociation (Maybe Int64)
ccaCreativeId
= lens _ccaCreativeId
(\ s a -> s{_ccaCreativeId = a})
. mapping _Coerce | 248 | ccaCreativeId :: Lens' CampaignCreativeAssociation (Maybe Int64)
ccaCreativeId
= lens _ccaCreativeId
(\ s a -> s{_ccaCreativeId = a})
. mapping _Coerce | 165 | ccaCreativeId
= lens _ccaCreativeId
(\ s a -> s{_ccaCreativeId = a})
. mapping _Coerce | 100 | true | true | 2 | 8 | 49 | 61 | 29 | 32 | null | null |
Schpin/schpin-chassis | schpin_robot_lib/src/Data/SCAD.hs | gpl-3.0 | lengthVectorToString :: V3 Length -> String
lengthVectorToString (V3 x y z) = vectorToString $ V3 (x /~ mm) (y /~ mm) (z /~ mm) | 127 | lengthVectorToString :: V3 Length -> String
lengthVectorToString (V3 x y z) = vectorToString $ V3 (x /~ mm) (y /~ mm) (z /~ mm) | 127 | lengthVectorToString (V3 x y z) = vectorToString $ V3 (x /~ mm) (y /~ mm) (z /~ mm) | 83 | false | true | 0 | 8 | 23 | 63 | 32 | 31 | null | null |
ivan-m/servant-auth-token | src/Servant/Server/Auth/Token/Model.hs | bsd-3-clause | toAuthUserGroup :: UserGroup -> (AuthUserGroup, AuthUserGroupId -> [AuthUserGroupUsers], AuthUserGroupId -> [AuthUserGroupPerms])
toAuthUserGroup UserGroup{..} = (ag, users, perms)
where
ag = AuthUserGroup {
authUserGroupName = userGroupName
, authUserGroupParent = toKey <$> userGroupParent
}
users i = (\ui -> AuthUserGroupUsers i (toKey $ ui)) <$> userGroupUsers
perms i = (\perm -> AuthUserGroupPerms i perm) <$> userGroupPermissions
-- | Insert user group into RDBMS | 496 | toAuthUserGroup :: UserGroup -> (AuthUserGroup, AuthUserGroupId -> [AuthUserGroupUsers], AuthUserGroupId -> [AuthUserGroupPerms])
toAuthUserGroup UserGroup{..} = (ag, users, perms)
where
ag = AuthUserGroup {
authUserGroupName = userGroupName
, authUserGroupParent = toKey <$> userGroupParent
}
users i = (\ui -> AuthUserGroupUsers i (toKey $ ui)) <$> userGroupUsers
perms i = (\perm -> AuthUserGroupPerms i perm) <$> userGroupPermissions
-- | Insert user group into RDBMS | 496 | toAuthUserGroup UserGroup{..} = (ag, users, perms)
where
ag = AuthUserGroup {
authUserGroupName = userGroupName
, authUserGroupParent = toKey <$> userGroupParent
}
users i = (\ui -> AuthUserGroupUsers i (toKey $ ui)) <$> userGroupUsers
perms i = (\perm -> AuthUserGroupPerms i perm) <$> userGroupPermissions
-- | Insert user group into RDBMS | 366 | false | true | 4 | 10 | 85 | 162 | 81 | 81 | null | null |
dlewissandy/lambda-blas | test/Gen.hs | bsd-3-clause | genNVector :: (Storable a) => Gen a -> Int -> Gen (Vector a)
genNVector gen n = vectorOf n gen >>= return.fromList | 114 | genNVector :: (Storable a) => Gen a -> Int -> Gen (Vector a)
genNVector gen n = vectorOf n gen >>= return.fromList | 114 | genNVector gen n = vectorOf n gen >>= return.fromList | 53 | false | true | 0 | 11 | 21 | 61 | 28 | 33 | null | null |
moddyz/euler | p21/p21.hs | mit | main = putStrLn $ show $ sum [n | n <- [2..10000], amicable n] | 62 | main = putStrLn $ show $ sum [n | n <- [2..10000], amicable n] | 62 | main = putStrLn $ show $ sum [n | n <- [2..10000], amicable n] | 62 | false | false | 0 | 10 | 13 | 40 | 20 | 20 | null | null |
sternenseemann/large-hashable | test/Data/LargeHashable/Tests/Class.hs | bsd-3-clause | prop_hashQuintupleUniqueness :: (Int, Int, Int, Int, Int) -> (Int, Int, Int, Int, Int) -> Bool
prop_hashQuintupleUniqueness = generic_uniquenessProp | 148 | prop_hashQuintupleUniqueness :: (Int, Int, Int, Int, Int) -> (Int, Int, Int, Int, Int) -> Bool
prop_hashQuintupleUniqueness = generic_uniquenessProp | 148 | prop_hashQuintupleUniqueness = generic_uniquenessProp | 53 | false | true | 0 | 7 | 17 | 49 | 30 | 19 | null | null |
tibbe/ghc | compiler/cmm/PprC.hs | bsd-3-clause | pprExpr1 e@(CmmReg _reg) = pprExpr e | 37 | pprExpr1 e@(CmmReg _reg) = pprExpr e | 37 | pprExpr1 e@(CmmReg _reg) = pprExpr e | 37 | false | false | 0 | 8 | 6 | 21 | 10 | 11 | null | null |
jchitel/ProjectEuler.hs | Problems/Problem0021.hs | mit | amicableNumbers :: [Integer]
amicableNumbers = filter isAmicable [1..] | 70 | amicableNumbers :: [Integer]
amicableNumbers = filter isAmicable [1..] | 70 | amicableNumbers = filter isAmicable [1..] | 41 | false | true | 0 | 7 | 7 | 28 | 13 | 15 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/ExtensionPredicates.hs | bsd-3-clause | -- | Is the <https://www.opengl.org/registry/specs/NV/float_buffer.txt NV_float_buffer> extension supported?
-- Note that in the presence of multiple contexts with different capabilities,
-- this might be wrong. Use 'glGetNVFloatBuffer' in those cases instead.
gl_NV_float_buffer :: Bool
gl_NV_float_buffer = member "GL_NV_float_buffer" extensions | 347 | gl_NV_float_buffer :: Bool
gl_NV_float_buffer = member "GL_NV_float_buffer" extensions | 86 | gl_NV_float_buffer = member "GL_NV_float_buffer" extensions | 59 | true | true | 0 | 5 | 38 | 19 | 11 | 8 | null | null |
nevrenato/Hets_Fork | CASL/Freeness.hs | gpl-2.0 | -- | identifier of the make function
makeId :: Id
makeId = mkId [mkSimpleId "make"] | 83 | makeId :: Id
makeId = mkId [mkSimpleId "make"] | 46 | makeId = mkId [mkSimpleId "make"] | 33 | true | true | 0 | 7 | 14 | 21 | 11 | 10 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/HaXml/src/Text/XML/HaXml/Types.hs | bsd-3-clause | info (CRef _ i) = i | 19 | info (CRef _ i) = i | 19 | info (CRef _ i) = i | 19 | false | false | 0 | 6 | 5 | 18 | 8 | 10 | null | null |
spechub/Hets | OWL2/ParseMS.hs | gpl-2.0 | iteral :: GA.PrefixMap -> CharParser st Literal
literal pm = do
f <- skips $ try floatingPointLit
<|> fmap decToFloat decimalLit
return $ NumberLit f
<|> skips (stringLiteral pm)
<|> booleanLit pm
<?> "Literal"
| 234 | literal :: GA.PrefixMap -> CharParser st Literal
literal pm = do
f <- skips $ try floatingPointLit
<|> fmap decToFloat decimalLit
return $ NumberLit f
<|> skips (stringLiteral pm)
<|> booleanLit pm
<?> "Literal" | 234 | literal pm = do
f <- skips $ try floatingPointLit
<|> fmap decToFloat decimalLit
return $ NumberLit f
<|> skips (stringLiteral pm)
<|> booleanLit pm
<?> "Literal" | 185 | false | true | 8 | 10 | 57 | 89 | 41 | 48 | null | null |
christiaanb/ghc | compiler/main/HscTypes.hs | bsd-3-clause | -- | Returns @True@ if there should be no interface-file declaration
-- for this thing on its own: either it is built-in, or it is part
-- of some other declaration, or it is generated implicitly by some
-- other declaration.
isImplicitTyThing :: TyThing -> Bool
isImplicitTyThing (AConLike cl) = case cl of
RealDataCon {} -> True
PatSynCon {} -> False | 426 | isImplicitTyThing :: TyThing -> Bool
isImplicitTyThing (AConLike cl) = case cl of
RealDataCon {} -> True
PatSynCon {} -> False | 200 | isImplicitTyThing (AConLike cl) = case cl of
RealDataCon {} -> True
PatSynCon {} -> False | 163 | true | true | 0 | 9 | 134 | 58 | 29 | 29 | null | null |
frantisekfarka/ghc-dsi | libraries/base/Data/Data.hs | bsd-3-clause | tuple2DataType :: DataType
tuple2DataType = mkDataType "Prelude.(,)" [tuple2Constr] | 83 | tuple2DataType :: DataType
tuple2DataType = mkDataType "Prelude.(,)" [tuple2Constr] | 83 | tuple2DataType = mkDataType "Prelude.(,)" [tuple2Constr] | 56 | false | true | 0 | 6 | 7 | 25 | 11 | 14 | null | null |
osa1/language-lua | src/Language/Lua/Annotated/Simplify.hs | bsd-3-clause | sStat (A.Label _ n) = Label (sName n) | 37 | sStat (A.Label _ n) = Label (sName n) | 37 | sStat (A.Label _ n) = Label (sName n) | 37 | false | false | 0 | 7 | 7 | 29 | 13 | 16 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.