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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Concelo/concelo | src/Database/Concelo/Ignis.hs | bsd-3-clause | ignisPipe :: L.Lens' Ignis Pi.Pipe
ignisPipe =
L.lens getIgnisPipe (\x v -> x { getIgnisPipe = v }) | 101 | ignisPipe :: L.Lens' Ignis Pi.Pipe
ignisPipe =
L.lens getIgnisPipe (\x v -> x { getIgnisPipe = v }) | 101 | ignisPipe =
L.lens getIgnisPipe (\x v -> x { getIgnisPipe = v }) | 66 | false | true | 0 | 9 | 19 | 45 | 24 | 21 | null | null |
rahulmutt/ghcvm | libraries/base/GHC/Natural.hs | bsd-3-clause | -- | 'Natural' subtraction. Returns 'Nothing's for non-positive results.
--
-- @since 4.8.0.0
minusNaturalMaybe :: Natural -> Natural -> Maybe Natural
minusNaturalMaybe x (NatS# 0##) = Just x | 199 | minusNaturalMaybe :: Natural -> Natural -> Maybe Natural
minusNaturalMaybe x (NatS# 0##) = Just x | 105 | minusNaturalMaybe x (NatS# 0##) = Just x | 48 | true | true | 0 | 7 | 35 | 44 | 21 | 23 | null | null |
nukisman/elm-format-short | markdown/Cheapskate/Inlines.hs | bsd-3-clause | pCharEntity :: Parser Text
pCharEntity = takeWhile1 (\c -> isAscii c && isLetter c) | 83 | pCharEntity :: Parser Text
pCharEntity = takeWhile1 (\c -> isAscii c && isLetter c) | 83 | pCharEntity = takeWhile1 (\c -> isAscii c && isLetter c) | 56 | false | true | 0 | 9 | 13 | 35 | 17 | 18 | null | null |
Bolt64/wyas | src/PrimitiveFunctions.hs | mit | -- Argument sanity checkers
countArgs :: Integer -> [LispVal] -> IOThrowsError [LispVal]
countArgs numArgs listArgs = case (toInteger $ length listArgs) == numArgs of
True -> return listArgs
False -> throwError $ NumArgs numArgs listArgs | 312 | countArgs :: Integer -> [LispVal] -> IOThrowsError [LispVal]
countArgs numArgs listArgs = case (toInteger $ length listArgs) == numArgs of
True -> return listArgs
False -> throwError $ NumArgs numArgs listArgs | 283 | countArgs numArgs listArgs = case (toInteger $ length listArgs) == numArgs of
True -> return listArgs
False -> throwError $ NumArgs numArgs listArgs | 222 | true | true | 0 | 9 | 109 | 76 | 38 | 38 | null | null |
gibiansky/hlint | src/Hint/Match.hs | bsd-3-clause | checkDefine :: Decl_ -> Maybe (Int, Exp_) -> Exp_ -> Bool
checkDefine x Nothing y = fromNamed x /= fromNamed (transformBi unqual $ head $ fromApps y) | 149 | checkDefine :: Decl_ -> Maybe (Int, Exp_) -> Exp_ -> Bool
checkDefine x Nothing y = fromNamed x /= fromNamed (transformBi unqual $ head $ fromApps y) | 149 | checkDefine x Nothing y = fromNamed x /= fromNamed (transformBi unqual $ head $ fromApps y) | 91 | false | true | 0 | 10 | 26 | 71 | 33 | 38 | null | null |
agocorona/MFlow | Demos/Counter 1.hs | bsd-3-clause | main= runNavigation "" $ transientNav counter | 45 | main= runNavigation "" $ transientNav counter | 45 | main= runNavigation "" $ transientNav counter | 45 | false | false | 0 | 6 | 5 | 16 | 7 | 9 | null | null |
kawu/dawg | src/Data/DAWG/Static/Node.hs | bsd-2-clause | -- | Transition function.
onSym' :: U.Unbox a => Sym -> Node a b -> Maybe (ID, a)
onSym' x (Branch _ t ls) = do
k <- T.index x t
(,) <$> (snd <$> T.byIndex k t)
<*> ls U.!? k | 192 | onSym' :: U.Unbox a => Sym -> Node a b -> Maybe (ID, a)
onSym' x (Branch _ t ls) = do
k <- T.index x t
(,) <$> (snd <$> T.byIndex k t)
<*> ls U.!? k | 166 | onSym' x (Branch _ t ls) = do
k <- T.index x t
(,) <$> (snd <$> T.byIndex k t)
<*> ls U.!? k | 110 | true | true | 0 | 13 | 59 | 106 | 52 | 54 | null | null |
jvictor0/JoSQL | Server/Parser.hs | mit | preLex [] = [] | 14 | preLex [] = [] | 14 | preLex [] = [] | 14 | false | false | 0 | 6 | 3 | 13 | 6 | 7 | null | null |
sgillespie/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | narrowOp Narrow16WordOp = Just (MO_UU_Conv, W16) | 48 | narrowOp Narrow16WordOp = Just (MO_UU_Conv, W16) | 48 | narrowOp Narrow16WordOp = Just (MO_UU_Conv, W16) | 48 | false | false | 0 | 6 | 5 | 18 | 9 | 9 | null | null |
christiaanb/clash-compiler | examples/Reducer.hs | bsd-2-clause | equalDiscr _ _ = False | 46 | equalDiscr _ _ = False | 46 | equalDiscr _ _ = False | 46 | false | false | 0 | 5 | 28 | 11 | 5 | 6 | null | null |
awgn/ass | src/Ass/Compiler.hs | gpl-2.0 | getCompilerVersion Gcc47 = "4.7" | 34 | getCompilerVersion Gcc47 = "4.7" | 34 | getCompilerVersion Gcc47 = "4.7" | 34 | false | false | 0 | 4 | 5 | 10 | 4 | 6 | null | null |
keizo042/quic-prototype | Network/QUIC/Error.hs | bsd-3-clause | err2int InvalidWindowUpdateData = 0x39 | 53 | err2int InvalidWindowUpdateData = 0x39 | 53 | err2int InvalidWindowUpdateData = 0x39 | 53 | false | false | 0 | 5 | 18 | 9 | 4 | 5 | null | null |
sdiehl/ghc | compiler/main/ErrUtils.hs | bsd-3-clause | getCaretDiagnostic :: Severity -> SrcSpan -> IO MsgDoc
getCaretDiagnostic _ (UnhelpfulSpan _) = pure empty | 106 | getCaretDiagnostic :: Severity -> SrcSpan -> IO MsgDoc
getCaretDiagnostic _ (UnhelpfulSpan _) = pure empty | 106 | getCaretDiagnostic _ (UnhelpfulSpan _) = pure empty | 51 | false | true | 0 | 7 | 14 | 36 | 17 | 19 | null | null |
ggreif/clash-compiler | clash-ghc/src-ghc/CLaSH/GHC/GenerateBindings.hs | bsd-2-clause | retype :: HashMap TyConName TyCon
-> ([TmName], BindingMap) -- (visited, bindings)
-> TmName -- top
-> ([TmName], BindingMap)
retype tcm (visited,bindings) current = (visited', HashMap.insert current (ty',tm') bindings')
where
(_,tm) = bindings HashMap.! current
used = Set.toList $ Lens.setOf termFreeIds tm
(visited',bindings') = foldl (retype tcm) (current:visited,bindings) (filter (`notElem` visited) used)
usedTys = map (fst . (bindings' HashMap.!)) used
usedVars = zipWith Var usedTys used
tm' = substTms (zip used usedVars) tm
ty' = runFreshM (termType tcm tm') | 725 | retype :: HashMap TyConName TyCon
-> ([TmName], BindingMap) -- (visited, bindings)
-> TmName -- top
-> ([TmName], BindingMap)
retype tcm (visited,bindings) current = (visited', HashMap.insert current (ty',tm') bindings')
where
(_,tm) = bindings HashMap.! current
used = Set.toList $ Lens.setOf termFreeIds tm
(visited',bindings') = foldl (retype tcm) (current:visited,bindings) (filter (`notElem` visited) used)
usedTys = map (fst . (bindings' HashMap.!)) used
usedVars = zipWith Var usedTys used
tm' = substTms (zip used usedVars) tm
ty' = runFreshM (termType tcm tm') | 725 | retype tcm (visited,bindings) current = (visited', HashMap.insert current (ty',tm') bindings')
where
(_,tm) = bindings HashMap.! current
used = Set.toList $ Lens.setOf termFreeIds tm
(visited',bindings') = foldl (retype tcm) (current:visited,bindings) (filter (`notElem` visited) used)
usedTys = map (fst . (bindings' HashMap.!)) used
usedVars = zipWith Var usedTys used
tm' = substTms (zip used usedVars) tm
ty' = runFreshM (termType tcm tm') | 562 | false | true | 6 | 9 | 233 | 239 | 131 | 108 | null | null |
marco-zanella/minilambda | src/AST.hs | gpl-3.0 | sub (AST.LT m1 m2) x n = AST.LT (sub m1 x n) (sub m2 x n) | 57 | sub (AST.LT m1 m2) x n = AST.LT (sub m1 x n) (sub m2 x n) | 57 | sub (AST.LT m1 m2) x n = AST.LT (sub m1 x n) (sub m2 x n) | 57 | false | false | 1 | 8 | 15 | 52 | 24 | 28 | null | null |
Rydgel/advent-of-code | src/Day9.hs | bsd-3-clause | getPaths :: [Node] -> [Path]
getPaths = zip <*> tail | 52 | getPaths :: [Node] -> [Path]
getPaths = zip <*> tail | 52 | getPaths = zip <*> tail | 23 | false | true | 0 | 6 | 9 | 25 | 14 | 11 | null | null |
jfulseca/Pudding | src/Pudding/Test/Types/Configuration.hs | gpl-3.0 | test_emptySphereSpinors = assertEqual 0 $
V.length (spinors emptySphere) | 74 | test_emptySphereSpinors = assertEqual 0 $
V.length (spinors emptySphere) | 74 | test_emptySphereSpinors = assertEqual 0 $
V.length (spinors emptySphere) | 74 | false | false | 0 | 8 | 9 | 24 | 11 | 13 | null | null |
olsner/ghc | compiler/utils/Outputable.hs | bsd-3-clause | colBinder :: PprColour
colBinder = colGreenFg | 45 | colBinder :: PprColour
colBinder = colGreenFg | 45 | colBinder = colGreenFg | 22 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
changlinli/nikki | src/Base/Types.hs | lgpl-3.0 | availableSorts :: Accessor (EditorScene sort) (SelectTree sort)
availableSorts = accessor availableSorts_ (\ a r -> r{availableSorts_ = a}) | 139 | availableSorts :: Accessor (EditorScene sort) (SelectTree sort)
availableSorts = accessor availableSorts_ (\ a r -> r{availableSorts_ = a}) | 139 | availableSorts = accessor availableSorts_ (\ a r -> r{availableSorts_ = a}) | 75 | false | true | 0 | 9 | 17 | 51 | 27 | 24 | null | null |
TOSPIO/yi | src/library/Yi/Keymap/Vim/Operator.hs | gpl-2.0 | opChange :: VimOperator
opChange = VimOperator {
operatorName = "c"
, operatorApplyToRegionE = \_count (StyledRegion style reg) -> do
s <- withCurrentBuffer $ readRegionRopeWithStyleB reg style
regName <- fmap vsActiveRegister getEditorDyn
setRegisterE regName style s
withCurrentBuffer $ do
point <- deleteRegionWithStyleB reg style
moveTo point
when (style == LineWise) $ do
insertB '\n'
leftB
switchModeE $ Insert 'c'
return Continue
} | 560 | opChange :: VimOperator
opChange = VimOperator {
operatorName = "c"
, operatorApplyToRegionE = \_count (StyledRegion style reg) -> do
s <- withCurrentBuffer $ readRegionRopeWithStyleB reg style
regName <- fmap vsActiveRegister getEditorDyn
setRegisterE regName style s
withCurrentBuffer $ do
point <- deleteRegionWithStyleB reg style
moveTo point
when (style == LineWise) $ do
insertB '\n'
leftB
switchModeE $ Insert 'c'
return Continue
} | 560 | opChange = VimOperator {
operatorName = "c"
, operatorApplyToRegionE = \_count (StyledRegion style reg) -> do
s <- withCurrentBuffer $ readRegionRopeWithStyleB reg style
regName <- fmap vsActiveRegister getEditorDyn
setRegisterE regName style s
withCurrentBuffer $ do
point <- deleteRegionWithStyleB reg style
moveTo point
when (style == LineWise) $ do
insertB '\n'
leftB
switchModeE $ Insert 'c'
return Continue
} | 536 | false | true | 0 | 16 | 182 | 145 | 66 | 79 | null | null |
nomeata/ghc | compiler/llvmGen/Llvm/Types.hs | bsd-3-clause | getLit (LMIntLit i (LMInt 64)) = show (fromInteger i :: Int64) | 62 | getLit (LMIntLit i (LMInt 64)) = show (fromInteger i :: Int64) | 62 | getLit (LMIntLit i (LMInt 64)) = show (fromInteger i :: Int64) | 62 | false | false | 0 | 9 | 10 | 35 | 17 | 18 | null | null |
DavidAlphaFox/darcs | src/Darcs/UI/Commands/Convert.hs | gpl-2.0 | convertDescription :: String
convertDescription = "Convert repositories between various formats." | 97 | convertDescription :: String
convertDescription = "Convert repositories between various formats." | 97 | convertDescription = "Convert repositories between various formats." | 68 | false | true | 0 | 4 | 9 | 11 | 6 | 5 | null | null |
xymostech/hpong | src/Sound/Wave.hs | mit | readFmtSubChunk :: Handle -> MaybeT IO B.ByteString
readFmtSubChunk handle = do
header <- liftIO $ B.hGet handle 8
guard $ (B.unpack $ B.take 4 header) == [0x66, 0x6d, 0x74, 0x20]
let sizeBytes = B.unpack . B.take 4 $ B.drop 4 header
let size = readLittleEndian sizeBytes
chunkData <- liftIO $ B.hGet handle size
return chunkData | 341 | readFmtSubChunk :: Handle -> MaybeT IO B.ByteString
readFmtSubChunk handle = do
header <- liftIO $ B.hGet handle 8
guard $ (B.unpack $ B.take 4 header) == [0x66, 0x6d, 0x74, 0x20]
let sizeBytes = B.unpack . B.take 4 $ B.drop 4 header
let size = readLittleEndian sizeBytes
chunkData <- liftIO $ B.hGet handle size
return chunkData | 341 | readFmtSubChunk handle = do
header <- liftIO $ B.hGet handle 8
guard $ (B.unpack $ B.take 4 header) == [0x66, 0x6d, 0x74, 0x20]
let sizeBytes = B.unpack . B.take 4 $ B.drop 4 header
let size = readLittleEndian sizeBytes
chunkData <- liftIO $ B.hGet handle size
return chunkData | 289 | false | true | 0 | 14 | 66 | 154 | 71 | 83 | null | null |
hsyl20/BOS | src/BookOfSciences.hs | gpl-3.0 | main = do
let chapters = [1,3,2]
defaultPageSize = PageFormat.a4
docInfo = standardDocInfo {
author = toPDFString "Book of Sciences authors",
compressed = False
}
chs <- mapM readChapter chapters
runPdf "out.pdf" docInfo defaultPageSize $ do
generateDocument chs | 310 | main = do
let chapters = [1,3,2]
defaultPageSize = PageFormat.a4
docInfo = standardDocInfo {
author = toPDFString "Book of Sciences authors",
compressed = False
}
chs <- mapM readChapter chapters
runPdf "out.pdf" docInfo defaultPageSize $ do
generateDocument chs | 310 | main = do
let chapters = [1,3,2]
defaultPageSize = PageFormat.a4
docInfo = standardDocInfo {
author = toPDFString "Book of Sciences authors",
compressed = False
}
chs <- mapM readChapter chapters
runPdf "out.pdf" docInfo defaultPageSize $ do
generateDocument chs | 310 | false | false | 0 | 12 | 85 | 85 | 43 | 42 | null | null |
haskell-servant/cretheus | Data/Cretheus.hs | bsd-3-clause | interpretV (Bool !v) = A.Bool v | 33 | interpretV (Bool !v) = A.Bool v | 33 | interpretV (Bool !v) = A.Bool v | 33 | false | false | 0 | 8 | 7 | 21 | 9 | 12 | null | null |
codemac/yi-editor | src/Yi/Syntax/Haskell.hs | gpl-2.0 | -- | Parse a keyword
pKW :: [Token] -> Parser TT (Exp TT) -> Parser TT (Exp TT)
pKW k r = Bin <$> pAtom k <*> r | 111 | pKW :: [Token] -> Parser TT (Exp TT) -> Parser TT (Exp TT)
pKW k r = Bin <$> pAtom k <*> r | 90 | pKW k r = Bin <$> pAtom k <*> r | 31 | true | true | 2 | 10 | 27 | 66 | 31 | 35 | null | null |
FPtje/GLuaParser | src/GLua/PSParser.hs | lgpl-2.1 | pMSatisfy :: (MToken -> Bool) -> AParser MToken
pMSatisfy cond = tokenPrim show updatePosMToken testMToken
where
testMToken :: MToken -> Maybe MToken
testMToken mt = if cond mt then Just mt else Nothing
-- | Get the source position
-- Simply gets the position of the next token
-- Falls back on the collected position when there is no token left | 366 | pMSatisfy :: (MToken -> Bool) -> AParser MToken
pMSatisfy cond = tokenPrim show updatePosMToken testMToken
where
testMToken :: MToken -> Maybe MToken
testMToken mt = if cond mt then Just mt else Nothing
-- | Get the source position
-- Simply gets the position of the next token
-- Falls back on the collected position when there is no token left | 366 | pMSatisfy cond = tokenPrim show updatePosMToken testMToken
where
testMToken :: MToken -> Maybe MToken
testMToken mt = if cond mt then Just mt else Nothing
-- | Get the source position
-- Simply gets the position of the next token
-- Falls back on the collected position when there is no token left | 318 | false | true | 2 | 7 | 81 | 74 | 38 | 36 | null | null |
tarmstrong/hrolldice | Test.hs | bsd-3-clause | prop_acceptAllGoodRolls = forAll (elements goodRollStatements) (\s -> (isJust . maybeParseRollStatement) s == True) | 115 | prop_acceptAllGoodRolls = forAll (elements goodRollStatements) (\s -> (isJust . maybeParseRollStatement) s == True) | 115 | prop_acceptAllGoodRolls = forAll (elements goodRollStatements) (\s -> (isJust . maybeParseRollStatement) s == True) | 115 | false | false | 0 | 11 | 12 | 39 | 20 | 19 | null | null |
dfordivam/lava | Lava/Patterns.hs | bsd-3-clause | par circ1 circ2 (a, b) = (circ1 a, circ2 b) | 43 | par circ1 circ2 (a, b) = (circ1 a, circ2 b) | 43 | par circ1 circ2 (a, b) = (circ1 a, circ2 b) | 43 | false | false | 0 | 6 | 9 | 32 | 16 | 16 | null | null |
petercrona/spring-clean | src/DependencyGraph.hs | mit | getNode :: NodeWithInDegree -> Node
getNode = fst | 49 | getNode :: NodeWithInDegree -> Node
getNode = fst | 49 | getNode = fst | 13 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
sol/pandoc | src/Text/Pandoc/Writers/LaTeX.hs | gpl-2.0 | inlineToLaTeX (Math InlineMath str) = return $ char '$' <> text str <> char '$' | 79 | inlineToLaTeX (Math InlineMath str) = return $ char '$' <> text str <> char '$' | 79 | inlineToLaTeX (Math InlineMath str) = return $ char '$' <> text str <> char '$' | 79 | false | false | 0 | 8 | 14 | 39 | 17 | 22 | null | null |
kinoru/unbreak | src/Main.hs | agpl-3.0 | main :: IO ()
main = do
args <- processArgs arguments
case args of
CmdHelp -> print $ helpText [] HelpFormatDefault arguments
CmdInit -> runInit
CmdCat b -> runCat b
CmdOpen b -> if B.length b == 0
then error "file name can't be empty"
else runOpen Nothing b
CmdLogout -> runLogout
CmdAdd f b -> if B.length b == 0
then error "file name can't be empty"
else runAdd f b
CmdList -> runList | 519 | main :: IO ()
main = do
args <- processArgs arguments
case args of
CmdHelp -> print $ helpText [] HelpFormatDefault arguments
CmdInit -> runInit
CmdCat b -> runCat b
CmdOpen b -> if B.length b == 0
then error "file name can't be empty"
else runOpen Nothing b
CmdLogout -> runLogout
CmdAdd f b -> if B.length b == 0
then error "file name can't be empty"
else runAdd f b
CmdList -> runList | 519 | main = do
args <- processArgs arguments
case args of
CmdHelp -> print $ helpText [] HelpFormatDefault arguments
CmdInit -> runInit
CmdCat b -> runCat b
CmdOpen b -> if B.length b == 0
then error "file name can't be empty"
else runOpen Nothing b
CmdLogout -> runLogout
CmdAdd f b -> if B.length b == 0
then error "file name can't be empty"
else runAdd f b
CmdList -> runList | 505 | false | true | 0 | 13 | 206 | 152 | 71 | 81 | null | null |
ankeshs/numerikell | tmp/Equation.hs | bsd-3-clause | -- |subtract polynomial
sub :: Polynomial -> Polynomial -> Polynomial
sub [] [] = [] | 94 | sub :: Polynomial -> Polynomial -> Polynomial
sub [] [] = [] | 68 | sub [] [] = [] | 22 | true | true | 0 | 6 | 24 | 31 | 16 | 15 | null | null |
evan886/myxmonad | 4bsd/bak/2019/xmonad.hs | mit | -- width of border around windows
myTerminal = "terminator" | 69 | myTerminal = "terminator" | 35 | myTerminal = "terminator" | 35 | true | false | 1 | 5 | 18 | 11 | 4 | 7 | null | null |
markus-git/co-feldspar | src/Feldspar/Hardware/Optimize.hs | bsd-3-clause | constArgs _ = False | 33 | constArgs _ = False | 33 | constArgs _ = False | 33 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
ekr/tamarin-prover | src/Web/Theory.hs | gpl-3.0 | getDiffProofPaths :: LTree CaseName (DiffProofStep a) -> [([String], DiffProofMethod)]
getDiffProofPaths proof = ([], dpsMethod . root $ proof) : go proof
where
go = concatMap paths . M.toList . children
paths (lbl, prf) = ([lbl], dpsMethod . root $ prf) : map (first (lbl:)) (go prf)
-- | Get element _after_ the matching element in the list. | 354 | getDiffProofPaths :: LTree CaseName (DiffProofStep a) -> [([String], DiffProofMethod)]
getDiffProofPaths proof = ([], dpsMethod . root $ proof) : go proof
where
go = concatMap paths . M.toList . children
paths (lbl, prf) = ([lbl], dpsMethod . root $ prf) : map (first (lbl:)) (go prf)
-- | Get element _after_ the matching element in the list. | 354 | getDiffProofPaths proof = ([], dpsMethod . root $ proof) : go proof
where
go = concatMap paths . M.toList . children
paths (lbl, prf) = ([lbl], dpsMethod . root $ prf) : map (first (lbl:)) (go prf)
-- | Get element _after_ the matching element in the list. | 267 | false | true | 0 | 9 | 67 | 142 | 76 | 66 | null | null |
everyevery/programming_study | jmbook/a191.hs | mit | reverse_quardtree :: [Char] -> ([Char], [Char])
reverse_quardtree [] = ([], []) | 79 | reverse_quardtree :: [Char] -> ([Char], [Char])
reverse_quardtree [] = ([], []) | 79 | reverse_quardtree [] = ([], []) | 31 | false | true | 0 | 7 | 10 | 45 | 26 | 19 | null | null |
sdiehl/ghc | compiler/main/DriverPipeline.hs | bsd-3-clause | fixchar c = c | 15 | fixchar c = c | 15 | fixchar c = c | 15 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
thinkpad20/easyjson | src/Text/EasyJson/AST.hs | mit | jsonType :: Json -> Text
jsonType = \case
Number _ -> "number"
String _ -> "string"
Bool _ -> "bool"
Null -> "null"
Array _ -> "array"
Object _ -> "object" | 167 | jsonType :: Json -> Text
jsonType = \case
Number _ -> "number"
String _ -> "string"
Bool _ -> "bool"
Null -> "null"
Array _ -> "array"
Object _ -> "object" | 167 | jsonType = \case
Number _ -> "number"
String _ -> "string"
Bool _ -> "bool"
Null -> "null"
Array _ -> "array"
Object _ -> "object" | 142 | false | true | 0 | 8 | 42 | 68 | 32 | 36 | null | null |
jvranish/TheExperiment | src/Language/TheExperiment/Inferrer/Inferrer.hs | bsd-3-clause | prepareAST :: (Traversable f) => f a -> StateT Int Inferrer (f (TypeRef, NodeId))
prepareAST t = forM t $ \_ -> do
ref <- lift $ newType $ Var Nothing []
n <- getAndModifyT (+1)
return (ref, n) | 199 | prepareAST :: (Traversable f) => f a -> StateT Int Inferrer (f (TypeRef, NodeId))
prepareAST t = forM t $ \_ -> do
ref <- lift $ newType $ Var Nothing []
n <- getAndModifyT (+1)
return (ref, n) | 199 | prepareAST t = forM t $ \_ -> do
ref <- lift $ newType $ Var Nothing []
n <- getAndModifyT (+1)
return (ref, n) | 117 | false | true | 0 | 12 | 44 | 109 | 54 | 55 | null | null |
fritz0705/Graphen | Data/Graphen.hs | mit | -- | showS converts a showable value to an escaped String with quotes
showS :: (Show a) => a -> String
showS = show . show | 122 | showS :: (Show a) => a -> String
showS = show . show | 52 | showS = show . show | 19 | true | true | 0 | 6 | 25 | 29 | 16 | 13 | null | null |
jmct/IterativeCompiler | frontend/CaseLift.hs | mit | abstractExprC (_, ALet ir def body) = ELet ir (map abstractDef def) $ abstractExprC body | 90 | abstractExprC (_, ALet ir def body) = ELet ir (map abstractDef def) $ abstractExprC body | 90 | abstractExprC (_, ALet ir def body) = ELet ir (map abstractDef def) $ abstractExprC body | 90 | false | false | 0 | 8 | 16 | 42 | 20 | 22 | null | null |
ajnsit/wai-routes | src/Routes/Parse.hs | mit | pieceFromString ('!':'+':x) = Left (False, x) | 45 | pieceFromString ('!':'+':x) = Left (False, x) | 45 | pieceFromString ('!':'+':x) = Left (False, x) | 45 | false | false | 0 | 8 | 5 | 29 | 15 | 14 | null | null |
ailiev/faerieplay-compiler | Faerieplay/Intermediate.hs | bsd-3-clause | -- if already scoped, just overwrite the old scope
addScope sc (VScoped scope_old v) = (VScoped sc v) | 105 | addScope sc (VScoped scope_old v) = (VScoped sc v) | 54 | addScope sc (VScoped scope_old v) = (VScoped sc v) | 54 | true | false | 0 | 7 | 21 | 28 | 14 | 14 | null | null |
massysett/pipes-cliff | pipes-cliff/lib/Pipes/Cliff/Core.hs | bsd-3-clause | withProcess
:: IO (a, ProcessHandle)
-- ^ Creates the process
-> (a -> IO b)
-- ^ Uses the process
-> IO b
withProcess acq use = Control.Exception.bracket acq (terminateProcess . snd)
(use . fst) | 207 | withProcess
:: IO (a, ProcessHandle)
-- ^ Creates the process
-> (a -> IO b)
-- ^ Uses the process
-> IO b
withProcess acq use = Control.Exception.bracket acq (terminateProcess . snd)
(use . fst) | 207 | withProcess acq use = Control.Exception.bracket acq (terminateProcess . snd)
(use . fst) | 90 | false | true | 0 | 10 | 46 | 78 | 39 | 39 | null | null |
sdiehl/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | addTickCmdGRHS (XGRHS nec) = noExtCon nec | 41 | addTickCmdGRHS (XGRHS nec) = noExtCon nec | 41 | addTickCmdGRHS (XGRHS nec) = noExtCon nec | 41 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
copland/cmdargs | System/Console/CmdArgs/Implicit/UI.hs | bsd-3-clause | {-
-- | Flag: Specify group membership for this flag
--
-- > {str = def &= group "Repository Management"
-- > ---- Repository Management ----
-- > -s --str=VALUE
group :: String -> Ann
group = FldGroup
-}
-- | Flag: \"Use this flag name for this field.\"
--
-- Add flags which trigger this option.
--
-- > {hello = def &= name "foo"}
-- > -h --hello --foo=VALUE
name :: String -> Ann
name = Name | 404 | name :: String -> Ann
name = Name | 33 | name = Name | 11 | true | true | 0 | 7 | 87 | 29 | 16 | 13 | null | null |
sebastiaanvisser/jail | src/System/IO/Jail/ByteString/Lazy.hs | bsd-3-clause | writeFile :: FilePath -> ByteString -> IO ()
writeFile f b = embedPath "writeFile" (flip B.writeFile b) f | 105 | writeFile :: FilePath -> ByteString -> IO ()
writeFile f b = embedPath "writeFile" (flip B.writeFile b) f | 105 | writeFile f b = embedPath "writeFile" (flip B.writeFile b) f | 60 | false | true | 0 | 8 | 17 | 46 | 22 | 24 | null | null |
edsko/cabal | cabal-install/Distribution/Client/PlanIndex.hs | bsd-3-clause | rootSets :: (PackageFixedDeps pkg, HasUnitId pkg)
=> FakeMap -> Bool -> PackageIndex pkg -> [[UnitId]]
rootSets fakeMap indepGoals index =
if indepGoals then map (:[]) libRoots else [libRoots]
++ setupRoots index
where
libRoots = libraryRoots fakeMap index
-- | Compute the library roots of a plan
--
-- The library roots are the set of packages with no reverse dependencies
-- (no reverse library dependencies but also no reverse setup dependencies). | 478 | rootSets :: (PackageFixedDeps pkg, HasUnitId pkg)
=> FakeMap -> Bool -> PackageIndex pkg -> [[UnitId]]
rootSets fakeMap indepGoals index =
if indepGoals then map (:[]) libRoots else [libRoots]
++ setupRoots index
where
libRoots = libraryRoots fakeMap index
-- | Compute the library roots of a plan
--
-- The library roots are the set of packages with no reverse dependencies
-- (no reverse library dependencies but also no reverse setup dependencies). | 478 | rootSets fakeMap indepGoals index =
if indepGoals then map (:[]) libRoots else [libRoots]
++ setupRoots index
where
libRoots = libraryRoots fakeMap index
-- | Compute the library roots of a plan
--
-- The library roots are the set of packages with no reverse dependencies
-- (no reverse library dependencies but also no reverse setup dependencies). | 366 | false | true | 2 | 10 | 97 | 101 | 54 | 47 | null | null |
ezyang/ghc | compiler/codeGen/CgUtils.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- Information about global registers
baseRegOffset :: DynFlags -> GlobalReg -> Int
baseRegOffset dflags (VanillaReg 1 _) = oFFSET_StgRegTable_rR1 dflags | 239 | baseRegOffset :: DynFlags -> GlobalReg -> Int
baseRegOffset dflags (VanillaReg 1 _) = oFFSET_StgRegTable_rR1 dflags | 118 | baseRegOffset dflags (VanillaReg 1 _) = oFFSET_StgRegTable_rR1 dflags | 72 | true | true | 0 | 7 | 26 | 37 | 19 | 18 | null | null |
robeverest/accelerate | Data/Array/Accelerate/Trafo/Sharing.hs | bsd-3-clause | showPreAccOp Fold1{} = "Fold1" | 41 | showPreAccOp Fold1{} = "Fold1" | 41 | showPreAccOp Fold1{} = "Fold1" | 41 | false | false | 0 | 6 | 14 | 13 | 6 | 7 | null | null |
pacak/cuddly-bassoon | unordered-containers-0.2.8.0/tests/HashMapProperties.hs | bsd-3-clause | pFilterWithKey :: [(Key, Int)] -> Bool
pFilterWithKey = M.filterWithKey p `eq_` HM.filterWithKey p
where p k v = odd (unK k + v)
------------------------------------------------------------------------
-- ** Conversions
-- 'eq_' already calls fromList. | 256 | pFilterWithKey :: [(Key, Int)] -> Bool
pFilterWithKey = M.filterWithKey p `eq_` HM.filterWithKey p
where p k v = odd (unK k + v)
------------------------------------------------------------------------
-- ** Conversions
-- 'eq_' already calls fromList. | 256 | pFilterWithKey = M.filterWithKey p `eq_` HM.filterWithKey p
where p k v = odd (unK k + v)
------------------------------------------------------------------------
-- ** Conversions
-- 'eq_' already calls fromList. | 217 | false | true | 1 | 8 | 35 | 80 | 38 | 42 | null | null |
Bodigrim/katas | src/haskell/2-Befunge-Interpreter.hs | bsd-2-clause | dup :: [Int] -> [Int]
dup [] = [0] | 34 | dup :: [Int] -> [Int]
dup [] = [0] | 34 | dup [] = [0] | 12 | false | true | 0 | 6 | 8 | 29 | 16 | 13 | null | null |
eijian/raytracer | src/Parser.hs | bsd-3-clause | material :: Parser (String, Material)
material = do
--_ <- spaces
_ <- many1 space
_ <- char '-'
t <- mtype
n <- mname
em <- pemittance
rl <- preflectance
tr <- ptransmittance
sp <- pspecularRefl
ir <- pior
df <- pdiffuseness
mt <- pmetalness
sm <- psmoothness
return (n, Material rl df mt tr ir sp)
{- |
>>> parse mtype pname " type : solid\n"
Right "solid"
>>> parse mtype pname " type : solid \n"
Right "solid"
>>> parse mtype pname "type : solid\n"
Left "rt parser" (line 1, column 1):
unexpected "t"
expecting space
>>> parse mtype pname " type : solid a"
Left "rt parser" (line 1, column 18):
unexpected "a"
expecting lf new-line
>>> parse mtype pname " type : sol\n"
Left "rt parser" (line 1, column 11):
unexpected "\n"
expecting "solid"
>>> parse mtype pname " type: solid\n"
Right "solid"
>>> parse mtype pname " type :solid\n"
Left "rt parser" (line 1, column 10):
unexpected "s"
-} | 936 | material :: Parser (String, Material)
material = do
--_ <- spaces
_ <- many1 space
_ <- char '-'
t <- mtype
n <- mname
em <- pemittance
rl <- preflectance
tr <- ptransmittance
sp <- pspecularRefl
ir <- pior
df <- pdiffuseness
mt <- pmetalness
sm <- psmoothness
return (n, Material rl df mt tr ir sp)
{- |
>>> parse mtype pname " type : solid\n"
Right "solid"
>>> parse mtype pname " type : solid \n"
Right "solid"
>>> parse mtype pname "type : solid\n"
Left "rt parser" (line 1, column 1):
unexpected "t"
expecting space
>>> parse mtype pname " type : solid a"
Left "rt parser" (line 1, column 18):
unexpected "a"
expecting lf new-line
>>> parse mtype pname " type : sol\n"
Left "rt parser" (line 1, column 11):
unexpected "\n"
expecting "solid"
>>> parse mtype pname " type: solid\n"
Right "solid"
>>> parse mtype pname " type :solid\n"
Left "rt parser" (line 1, column 10):
unexpected "s"
-} | 936 | material = do
--_ <- spaces
_ <- many1 space
_ <- char '-'
t <- mtype
n <- mname
em <- pemittance
rl <- preflectance
tr <- ptransmittance
sp <- pspecularRefl
ir <- pior
df <- pdiffuseness
mt <- pmetalness
sm <- psmoothness
return (n, Material rl df mt tr ir sp)
{- |
>>> parse mtype pname " type : solid\n"
Right "solid"
>>> parse mtype pname " type : solid \n"
Right "solid"
>>> parse mtype pname "type : solid\n"
Left "rt parser" (line 1, column 1):
unexpected "t"
expecting space
>>> parse mtype pname " type : solid a"
Left "rt parser" (line 1, column 18):
unexpected "a"
expecting lf new-line
>>> parse mtype pname " type : sol\n"
Left "rt parser" (line 1, column 11):
unexpected "\n"
expecting "solid"
>>> parse mtype pname " type: solid\n"
Right "solid"
>>> parse mtype pname " type :solid\n"
Left "rt parser" (line 1, column 10):
unexpected "s"
-} | 898 | false | true | 0 | 9 | 207 | 137 | 63 | 74 | null | null |
gcampax/ghc | compiler/types/Type.hs | bsd-3-clause | isIPPred ty = case tyConAppTyCon_maybe ty of
Just tc -> isIPTyCon tc
_ -> False | 93 | isIPPred ty = case tyConAppTyCon_maybe ty of
Just tc -> isIPTyCon tc
_ -> False | 93 | isIPPred ty = case tyConAppTyCon_maybe ty of
Just tc -> isIPTyCon tc
_ -> False | 93 | false | false | 3 | 6 | 28 | 31 | 15 | 16 | null | null |
elliottt/dang | src/Dang/TypeCheck/Subst.hs | bsd-3-clause | unify :: (Unify a, DangM m) => Subst -> a -> a -> m Subst
unify su a b = inBase (snd `fmap` runStateT su (unify' a b)) | 118 | unify :: (Unify a, DangM m) => Subst -> a -> a -> m Subst
unify su a b = inBase (snd `fmap` runStateT su (unify' a b)) | 118 | unify su a b = inBase (snd `fmap` runStateT su (unify' a b)) | 60 | false | true | 0 | 10 | 27 | 78 | 38 | 40 | null | null |
alphalambda/k12math | prog/graph/graph09complex02.hs | mit | (x1,x2) +| (y1,y2) = (x1+y1,x2+y2) | 34 | (x1,x2) +| (y1,y2) = (x1+y1,x2+y2) | 34 | (x1,x2) +| (y1,y2) = (x1+y1,x2+y2) | 34 | false | false | 0 | 6 | 4 | 38 | 21 | 17 | null | null |
DougBurke/swish | tests/RDFQueryTest.hs | lgpl-2.1 | b_3 = Blank "3" | 17 | b_3 = Blank "3" | 17 | b_3 = Blank "3" | 17 | false | false | 1 | 5 | 5 | 13 | 4 | 9 | null | null |
schell/blocks | src/Game/Tetris.hs | bsd-3-clause | fallRate :: Double
fallRate = 1.0 | 33 | fallRate :: Double
fallRate = 1.0 | 33 | fallRate = 1.0 | 14 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
tolysz/prepare-ghcjs | spec-lts8/aeson/Data/Aeson/Encode.hs | bsd-3-clause | encodeToTextBuilder :: A.Value -> Builder
encodeToTextBuilder = A.encodeToTextBuilder | 85 | encodeToTextBuilder :: A.Value -> Builder
encodeToTextBuilder = A.encodeToTextBuilder | 85 | encodeToTextBuilder = A.encodeToTextBuilder | 43 | false | true | 0 | 7 | 7 | 26 | 11 | 15 | null | null |
olorin/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/AbortVaultLock.hs | mpl-2.0 | -- | Creates a value of 'AbortVaultLockResponse' with the minimum fields required to make a request.
--
abortVaultLockResponse
:: AbortVaultLockResponse
abortVaultLockResponse = AbortVaultLockResponse' | 205 | abortVaultLockResponse
:: AbortVaultLockResponse
abortVaultLockResponse = AbortVaultLockResponse' | 101 | abortVaultLockResponse = AbortVaultLockResponse' | 48 | true | true | 0 | 6 | 26 | 20 | 9 | 11 | null | null |
bitemyapp/ghc | compiler/main/DynFlags.hs | bsd-3-clause | setWarnUnsafe False = return () | 31 | setWarnUnsafe False = return () | 31 | setWarnUnsafe False = return () | 31 | false | false | 1 | 6 | 4 | 17 | 6 | 11 | null | null |
nrolland/react-flux | src/React/Flux/DOM.hs | bsd-3-clause | clipPath_ :: Term eventHandler arg result => arg -> result; clipPath_ = term "clipPath" | 87 | clipPath_ :: Term eventHandler arg result => arg -> result
clipPath_ = term "clipPath" | 86 | clipPath_ = term "clipPath" | 27 | false | true | 0 | 6 | 13 | 30 | 15 | 15 | null | null |
ssaavedra/liquidhaskell | tests/todo/InlineMeasure.hs | bsd-3-clause | {-@ measure foo @-}
foo :: [Int] -> Int
foo [] = 0 | 61 | foo :: [Int] -> Int
foo [] = 0 | 41 | foo [] = 0 | 14 | true | true | 0 | 6 | 23 | 25 | 13 | 12 | null | null |
mstksg/tagged-binary | Data/Binary/Tagged.hs | mit | -- | Encode data into a 'ByteString' with its type data tagged.
--
-- Remember that for now, types are distinguished by their string names, so
-- two types of the same name in different modules will not have unique
-- tags.
encodeTagged :: (Binary a, Typeable a) => a -> ByteString
encodeTagged = encode . tag | 309 | encodeTagged :: (Binary a, Typeable a) => a -> ByteString
encodeTagged = encode . tag | 85 | encodeTagged = encode . tag | 27 | true | true | 1 | 8 | 56 | 47 | 24 | 23 | null | null |
hjwylde/werewolf | app/Game/Werewolf/Variant/Standard/Engine.hs | bsd-3-clause | jesterLynchedText :: Game -> Text
jesterLynchedText game = [iFile|variant/standard/engine/lynching/jester-lynched.txt|]
where
jester = game ^?! players . jesters | 173 | jesterLynchedText :: Game -> Text
jesterLynchedText game = [iFile|variant/standard/engine/lynching/jester-lynched.txt|]
where
jester = game ^?! players . jesters | 173 | jesterLynchedText game = [iFile|variant/standard/engine/lynching/jester-lynched.txt|]
where
jester = game ^?! players . jesters | 139 | false | true | 1 | 6 | 28 | 45 | 22 | 23 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs | mit | decomposeChar '\x1B40' = "\x1B3E\x1B35" | 39 | decomposeChar '\x1B40' = "\x1B3E\x1B35" | 39 | decomposeChar '\x1B40' = "\x1B3E\x1B35" | 39 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
philipcraig/hutton | src/Exercises/Tautology.hs | bsd-3-clause | p5Or :: Prop
p5Or = Or (Var 'A') (Var 'B') | 42 | p5Or :: Prop
p5Or = Or (Var 'A') (Var 'B') | 42 | p5Or = Or (Var 'A') (Var 'B') | 29 | false | true | 0 | 7 | 9 | 28 | 14 | 14 | null | null |
dkandalov/katas | haskell/p99/src/p9x/p00/P00.hs | unlicense | compress (x:xs) = x : compress (consumeHead x xs)
where
consumeHead _ [] = []
consumeHead char ys =
if (head ys) /= char then ys
else consumeHead char (tail ys)
-- P09 | 212 | compress (x:xs) = x : compress (consumeHead x xs)
where
consumeHead _ [] = []
consumeHead char ys =
if (head ys) /= char then ys
else consumeHead char (tail ys)
-- P09 | 212 | compress (x:xs) = x : compress (consumeHead x xs)
where
consumeHead _ [] = []
consumeHead char ys =
if (head ys) /= char then ys
else consumeHead char (tail ys)
-- P09 | 212 | false | false | 1 | 9 | 77 | 88 | 44 | 44 | null | null |
gregorias/Pentago | src/Pentago/AI/Pentago.hs | bsd-3-clause | trivialAIPlayer :: (GameState s, RandomGen g) => Int -> AIPlayer s g
trivialAIPlayer initialDepth gameState =
let possibleMovesCount = length $ getPossiblePlacementOrders gameState
depth = if possibleMovesCount > 10
then initialDepth
else initialDepth + 1
minMaxFunction = if fromJust (whoseTurn gameState) == BlackPlayer
then minimize
else maximize
prunedLeafValueTree = toLeafValueTree
. prune depth
$ generatePentagoGameTree gameState
in do
shuffledTree <- shuffleFirstChildrenInATree prunedLeafValueTree
let (_, maybeMove) = minMaxFunction
$ evaluateTree trivialEvaluate shuffledTree
return $ makeMove (fromJust maybeMove) gameState | 789 | trivialAIPlayer :: (GameState s, RandomGen g) => Int -> AIPlayer s g
trivialAIPlayer initialDepth gameState =
let possibleMovesCount = length $ getPossiblePlacementOrders gameState
depth = if possibleMovesCount > 10
then initialDepth
else initialDepth + 1
minMaxFunction = if fromJust (whoseTurn gameState) == BlackPlayer
then minimize
else maximize
prunedLeafValueTree = toLeafValueTree
. prune depth
$ generatePentagoGameTree gameState
in do
shuffledTree <- shuffleFirstChildrenInATree prunedLeafValueTree
let (_, maybeMove) = minMaxFunction
$ evaluateTree trivialEvaluate shuffledTree
return $ makeMove (fromJust maybeMove) gameState | 789 | trivialAIPlayer initialDepth gameState =
let possibleMovesCount = length $ getPossiblePlacementOrders gameState
depth = if possibleMovesCount > 10
then initialDepth
else initialDepth + 1
minMaxFunction = if fromJust (whoseTurn gameState) == BlackPlayer
then minimize
else maximize
prunedLeafValueTree = toLeafValueTree
. prune depth
$ generatePentagoGameTree gameState
in do
shuffledTree <- shuffleFirstChildrenInATree prunedLeafValueTree
let (_, maybeMove) = minMaxFunction
$ evaluateTree trivialEvaluate shuffledTree
return $ makeMove (fromJust maybeMove) gameState | 720 | false | true | 0 | 13 | 229 | 177 | 87 | 90 | null | null |
wangbj/haskell | ndiv.hs | bsd-2-clause | perfectSquare x = r * r == x
where !r = isqrt x | 49 | perfectSquare x = r * r == x
where !r = isqrt x | 49 | perfectSquare x = r * r == x
where !r = isqrt x | 49 | false | false | 0 | 6 | 14 | 29 | 13 | 16 | null | null |
hspec/hspec | hspec-core/src/Test/Hspec/Core/Formatters/Diff.hs | mit | splitEscape :: String -> Maybe (String, String)
splitEscape xs = splitNumericEscape xs <|> (msum $ map split escapes)
where
split :: String -> Maybe (String, String)
split escape = (,) escape <$> stripPrefix escape xs | 227 | splitEscape :: String -> Maybe (String, String)
splitEscape xs = splitNumericEscape xs <|> (msum $ map split escapes)
where
split :: String -> Maybe (String, String)
split escape = (,) escape <$> stripPrefix escape xs | 227 | splitEscape xs = splitNumericEscape xs <|> (msum $ map split escapes)
where
split :: String -> Maybe (String, String)
split escape = (,) escape <$> stripPrefix escape xs | 179 | false | true | 0 | 8 | 44 | 90 | 45 | 45 | null | null |
SwiftsNamesake/BattleHack-2015 | src/BattleHack/Render.hs | mit | textsize :: String -> Cairo.Render Vector
textsize text = do
extents <- Cairo.textExtents text
return $ Cairo.textExtentsWidth extents :+ Cairo.textExtentsHeight extents
-- | Borrowed from Southpaw
-- TODO: General anchor (?) | 231 | textsize :: String -> Cairo.Render Vector
textsize text = do
extents <- Cairo.textExtents text
return $ Cairo.textExtentsWidth extents :+ Cairo.textExtentsHeight extents
-- | Borrowed from Southpaw
-- TODO: General anchor (?) | 231 | textsize text = do
extents <- Cairo.textExtents text
return $ Cairo.textExtentsWidth extents :+ Cairo.textExtentsHeight extents
-- | Borrowed from Southpaw
-- TODO: General anchor (?) | 189 | false | true | 0 | 10 | 36 | 58 | 27 | 31 | null | null |
oldmanmike/ghc | libraries/base/Data/Typeable/Internal.hs | bsd-3-clause | -- | Helper to fully evaluate 'TyCon' for use as @NFData(rnf)@ implementation
--
-- @since 4.8.0.0
rnfModule :: Module -> ()
rnfModule (Module p m) = rnfTrName p `seq` rnfTrName m | 179 | rnfModule :: Module -> ()
rnfModule (Module p m) = rnfTrName p `seq` rnfTrName m | 80 | rnfModule (Module p m) = rnfTrName p `seq` rnfTrName m | 54 | true | true | 0 | 7 | 30 | 43 | 23 | 20 | null | null |
danr/hipspec | examples/old-examples/hip/ProductiveUseOfFailure.hs | gpl-3.0 | True && x = x | 14 | True && x = x | 14 | True && x = x | 14 | false | false | 3 | 5 | 5 | 15 | 5 | 10 | null | null |
fgaray/shakespeare | Text/Shakespeare.hs | mit | shakespeare :: ShakespeareSettings -> QuasiQuoter
shakespeare r = QuasiQuoter { quoteExp = shakespeareFromString r } | 116 | shakespeare :: ShakespeareSettings -> QuasiQuoter
shakespeare r = QuasiQuoter { quoteExp = shakespeareFromString r } | 116 | shakespeare r = QuasiQuoter { quoteExp = shakespeareFromString r } | 66 | false | true | 0 | 7 | 14 | 29 | 15 | 14 | null | null |
sinelaw/lamdu | Lamdu/GUI/BottleWidgets.hs | gpl-3.0 | makeWordEdit ::
(MonadA m, MonadA f) =>
Property f String ->
Widget.Id ->
WidgetEnvT m (Widget f)
makeWordEdit textRef myId =
makeLineEdit textRef myId <&> deleteKeyEventHandler (noMods EventMap.KeySpace) | 214 | makeWordEdit ::
(MonadA m, MonadA f) =>
Property f String ->
Widget.Id ->
WidgetEnvT m (Widget f)
makeWordEdit textRef myId =
makeLineEdit textRef myId <&> deleteKeyEventHandler (noMods EventMap.KeySpace) | 214 | makeWordEdit textRef myId =
makeLineEdit textRef myId <&> deleteKeyEventHandler (noMods EventMap.KeySpace) | 108 | false | true | 0 | 10 | 37 | 77 | 37 | 40 | null | null |
SuperDrew/sql-server-gen | src/Database/SqlServer/Definition/Table.hs | bsd-2-clause | renderSortOrder :: SortOrder -> Doc
renderSortOrder Ascending = text "ASC" | 74 | renderSortOrder :: SortOrder -> Doc
renderSortOrder Ascending = text "ASC" | 74 | renderSortOrder Ascending = text "ASC" | 38 | false | true | 0 | 5 | 9 | 21 | 10 | 11 | null | null |
batterseapower/chsc | Evaluator/FreeVars.hs | bsd-3-clause | -- | Returns all the variables bound by the heap that we might have to residualise in the splitter
pureHeapBoundVars :: PureHeap -> BoundVars
pureHeapBoundVars = M.keysSet | 171 | pureHeapBoundVars :: PureHeap -> BoundVars
pureHeapBoundVars = M.keysSet | 72 | pureHeapBoundVars = M.keysSet | 29 | true | true | 0 | 5 | 26 | 18 | 10 | 8 | null | null |
urbanslug/ghc | compiler/utils/Util.hs | bsd-3-clause | mapAndUnzip3 :: (a -> (b, c, d)) -> [a] -> ([b], [c], [d])
mapAndUnzip3 _ [] = ([], [], []) | 92 | mapAndUnzip3 :: (a -> (b, c, d)) -> [a] -> ([b], [c], [d])
mapAndUnzip3 _ [] = ([], [], []) | 91 | mapAndUnzip3 _ [] = ([], [], []) | 32 | false | true | 0 | 8 | 20 | 78 | 46 | 32 | null | null |
hpacheco/jasminv | src/Options.hs | gpl-3.0 | isFuncV BothV = True | 20 | isFuncV BothV = True | 20 | isFuncV BothV = True | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
pascalpoizat/vecahaskell | src/Veca/Operations.hs | apache-2.0 | cToTAAddRegular'' (t : ts) = do
TABS n ta beh <- get
let s = source t
let s' = target t
let l = label t
case label t of
InternalLabel (TimeValue 0) InfiniteValue -> do
let newEdge = Edge (toLocation s) CTTau [] [] [] (toLocation s')
put $ TABS n (update ta [] [newEdge] []) beh
return ()
EventLabel e -> if isInput e
then do
let newLoc = Location ("_" ++ show n)
let newEdge1 = Edge (toLocation s) CTTau [] [] [] newLoc
let newEdge2 = Edge newLoc (liftToCTIOEvent e) [] [] [] (toLocation s')
put $ TABS (n + 1) (update ta [newLoc] [newEdge1, newEdge2] []) beh
return ()
else do
let newEdge =
Edge (toLocation s) (liftToCTIOEvent e) [] [] [] (toLocation s')
put $ TABS n (update ta [] [newEdge] []) beh
return ()
_ -> return () | 860 | cToTAAddRegular'' (t : ts) = do
TABS n ta beh <- get
let s = source t
let s' = target t
let l = label t
case label t of
InternalLabel (TimeValue 0) InfiniteValue -> do
let newEdge = Edge (toLocation s) CTTau [] [] [] (toLocation s')
put $ TABS n (update ta [] [newEdge] []) beh
return ()
EventLabel e -> if isInput e
then do
let newLoc = Location ("_" ++ show n)
let newEdge1 = Edge (toLocation s) CTTau [] [] [] newLoc
let newEdge2 = Edge newLoc (liftToCTIOEvent e) [] [] [] (toLocation s')
put $ TABS (n + 1) (update ta [newLoc] [newEdge1, newEdge2] []) beh
return ()
else do
let newEdge =
Edge (toLocation s) (liftToCTIOEvent e) [] [] [] (toLocation s')
put $ TABS n (update ta [] [newEdge] []) beh
return ()
_ -> return () | 860 | cToTAAddRegular'' (t : ts) = do
TABS n ta beh <- get
let s = source t
let s' = target t
let l = label t
case label t of
InternalLabel (TimeValue 0) InfiniteValue -> do
let newEdge = Edge (toLocation s) CTTau [] [] [] (toLocation s')
put $ TABS n (update ta [] [newEdge] []) beh
return ()
EventLabel e -> if isInput e
then do
let newLoc = Location ("_" ++ show n)
let newEdge1 = Edge (toLocation s) CTTau [] [] [] newLoc
let newEdge2 = Edge newLoc (liftToCTIOEvent e) [] [] [] (toLocation s')
put $ TABS (n + 1) (update ta [newLoc] [newEdge1, newEdge2] []) beh
return ()
else do
let newEdge =
Edge (toLocation s) (liftToCTIOEvent e) [] [] [] (toLocation s')
put $ TABS n (update ta [] [newEdge] []) beh
return ()
_ -> return () | 860 | false | false | 0 | 19 | 279 | 441 | 206 | 235 | null | null |
Airtnp/Freshman_Simple_Haskell_Lib | Intro/WIW/IxMonad.hs | mit | get :: IState s s s
get = IState $ \s -> (s, s) | 47 | get :: IState s s s
get = IState $ \s -> (s, s) | 47 | get = IState $ \s -> (s, s) | 27 | false | true | 2 | 7 | 13 | 40 | 19 | 21 | null | null |
RefactoringTools/HaRe | hareview/data/Term2tree.hs | bsd-3-clause | data2tree :: forall phi ix. (Fam phi, Data2Tree phi (PF phi)) => phi ix -> ix -> DT.Tree String
data2tree p = tree2tree . data2tree' p | 134 | data2tree :: forall phi ix. (Fam phi, Data2Tree phi (PF phi)) => phi ix -> ix -> DT.Tree String
data2tree p = tree2tree . data2tree' p | 134 | data2tree p = tree2tree . data2tree' p | 38 | false | true | 0 | 10 | 25 | 66 | 33 | 33 | null | null |
christinem/courseography | vendor/sendfile-0.7.9/src/Network/Socket/SendFile/Util.hs | gpl-3.0 | -- | wraps sendFile' to check arguments
wrapSendFile' :: Integral i => (a -> b -> i -> i -> i -> IO c) -> a -> b -> Integer -> Integer -> Integer -> IO c
wrapSendFile' fun outp inp blockSize off count
-- | count == 0 = return () -- Send nothing -- why do the work? Also, Windows and FreeBSD treat '0' as 'send the whole file'.
| count < 0 = error "SendFile - count must be a positive integer"
| (count /= 0) && (blockSize <= 0) = error "SendFile - blockSize must be a positive integer greater than 1"
| off < 0 = error "SendFile - offset must be a positive integer"
| otherwise = fun outp inp (fromIntegral blockSize) (fromIntegral off) (fromIntegral count) | 697 | wrapSendFile' :: Integral i => (a -> b -> i -> i -> i -> IO c) -> a -> b -> Integer -> Integer -> Integer -> IO c
wrapSendFile' fun outp inp blockSize off count
-- | count == 0 = return () -- Send nothing -- why do the work? Also, Windows and FreeBSD treat '0' as 'send the whole file'.
| count < 0 = error "SendFile - count must be a positive integer"
| (count /= 0) && (blockSize <= 0) = error "SendFile - blockSize must be a positive integer greater than 1"
| off < 0 = error "SendFile - offset must be a positive integer"
| otherwise = fun outp inp (fromIntegral blockSize) (fromIntegral off) (fromIntegral count) | 657 | wrapSendFile' fun outp inp blockSize off count
-- | count == 0 = return () -- Send nothing -- why do the work? Also, Windows and FreeBSD treat '0' as 'send the whole file'.
| count < 0 = error "SendFile - count must be a positive integer"
| (count /= 0) && (blockSize <= 0) = error "SendFile - blockSize must be a positive integer greater than 1"
| off < 0 = error "SendFile - offset must be a positive integer"
| otherwise = fun outp inp (fromIntegral blockSize) (fromIntegral off) (fromIntegral count) | 543 | true | true | 2 | 13 | 171 | 183 | 89 | 94 | null | null |
mzini/hosa | src/HoSA/Data/Index.hs | mit | metaVars :: Term -> [MetaVar]
metaVars Zero = [] | 48 | metaVars :: Term -> [MetaVar]
metaVars Zero = [] | 48 | metaVars Zero = [] | 18 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
mdsteele/fallback | src/Fallback/Event.hs | gpl-3.0 | toSDLKey Key7 = SDL.SDLK_7 | 26 | toSDLKey Key7 = SDL.SDLK_7 | 26 | toSDLKey Key7 = SDL.SDLK_7 | 26 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
bamboo/idris-cil | src/IRTS/Cil/FFI.hs | bsd-3-clause | foreignType :: FDesc -> PrimitiveType
foreignType (FStr exportedDataType) = ValueType "" exportedDataType | 105 | foreignType :: FDesc -> PrimitiveType
foreignType (FStr exportedDataType) = ValueType "" exportedDataType | 105 | foreignType (FStr exportedDataType) = ValueType "" exportedDataType | 67 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
geophf/1HaskellADay | exercises/HAD/Data/Tree/Merkle.hs | mit | mkbb :: Branch a -> BalancedBranch a
mkbb = uncurry BB . (least &&& id) | 71 | mkbb :: Branch a -> BalancedBranch a
mkbb = uncurry BB . (least &&& id) | 71 | mkbb = uncurry BB . (least &&& id) | 34 | false | true | 0 | 7 | 14 | 35 | 17 | 18 | null | null |
jaapweel/bloop | PPrint.hs | gpl-2.0 | indentation n = spaces n | 26 | indentation n = spaces n | 26 | indentation n = spaces n | 26 | false | false | 0 | 5 | 6 | 12 | 5 | 7 | null | null |
hguenther/gtl | lib/Language/GTL/LTL.hs | bsd-3-clause | extractAutomata x = (Just x,[]) | 31 | extractAutomata x = (Just x,[]) | 31 | extractAutomata x = (Just x,[]) | 31 | false | false | 0 | 6 | 4 | 20 | 10 | 10 | null | null |
mstksg/auto | src/Control/Auto/Collection.hs | mit | dZipAuto :: (Serialize a, Monad m)
=> a -- ^ default input value
-> [Auto m a b] -- ^ 'Auto's to zip up
-> Auto m [a] [b]
dZipAuto x0 as = zipAuto x0 as . delay [] | 211 | dZipAuto :: (Serialize a, Monad m)
=> a -- ^ default input value
-> [Auto m a b] -- ^ 'Auto's to zip up
-> Auto m [a] [b]
dZipAuto x0 as = zipAuto x0 as . delay [] | 211 | dZipAuto x0 as = zipAuto x0 as . delay [] | 41 | false | true | 0 | 9 | 86 | 78 | 40 | 38 | null | null |
kfiz/IHaskell | ipython-kernel/src/IHaskell/IPython/Message/Parser.hs | mit | makeDisplayDatas :: Object -> [DisplayData]
makeDisplayDatas dataDict = [DisplayData (read $ unpack mimeType) content | (mimeType, String content) <- HM.toList
dataDict] | 277 | makeDisplayDatas :: Object -> [DisplayData]
makeDisplayDatas dataDict = [DisplayData (read $ unpack mimeType) content | (mimeType, String content) <- HM.toList
dataDict] | 277 | makeDisplayDatas dataDict = [DisplayData (read $ unpack mimeType) content | (mimeType, String content) <- HM.toList
dataDict] | 233 | false | true | 0 | 9 | 128 | 61 | 31 | 30 | null | null |
ExNexu/Idris-dev | src/Idris/Core/Evaluate.hs | bsd-3-clause | lookupNameTotal :: Name -> Context -> [(Name, Totality)]
lookupNameTotal n = map (\(n, (_, _, t, _)) -> (n, t)) . lookupCtxtName n . definitions | 144 | lookupNameTotal :: Name -> Context -> [(Name, Totality)]
lookupNameTotal n = map (\(n, (_, _, t, _)) -> (n, t)) . lookupCtxtName n . definitions | 144 | lookupNameTotal n = map (\(n, (_, _, t, _)) -> (n, t)) . lookupCtxtName n . definitions | 87 | false | true | 0 | 11 | 24 | 77 | 44 | 33 | null | null |
beni55/hermit | src/HERMIT/Dictionary/Undefined.hs | bsd-2-clause | replaceCurrentExprWithUndefinedR :: (BoundVars c, MonadCatch m, HasHermitMEnv m, HasDynFlags m, LiftCoreM m, MonadIO m, MonadThings m) => Rewrite c m CoreExpr
replaceCurrentExprWithUndefinedR = contextfreeT exprTypeM >>= mkUndefinedValT | 236 | replaceCurrentExprWithUndefinedR :: (BoundVars c, MonadCatch m, HasHermitMEnv m, HasDynFlags m, LiftCoreM m, MonadIO m, MonadThings m) => Rewrite c m CoreExpr
replaceCurrentExprWithUndefinedR = contextfreeT exprTypeM >>= mkUndefinedValT | 236 | replaceCurrentExprWithUndefinedR = contextfreeT exprTypeM >>= mkUndefinedValT | 77 | false | true | 0 | 6 | 26 | 70 | 35 | 35 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Elements/Embedded.hs | bsd-3-clause | -- | A short-hand notion for @ el \"img\" ... @
imgN ∷ forall t m a. DomBuilder t m ⇒ m a → m a
imgN children = snd <$> imgN' children | 134 | imgN ∷ forall t m a. DomBuilder t m ⇒ m a → m a
imgN children = snd <$> imgN' children | 86 | imgN children = snd <$> imgN' children | 38 | true | true | 0 | 8 | 32 | 48 | 24 | 24 | null | null |
tvh/llvm-general-quote | src/LLVM/General/Quote/SSA.hs | bsd-3-clause | typeOfOperand MetadataNodeOperand{} = MetadataType | 50 | typeOfOperand MetadataNodeOperand{} = MetadataType | 50 | typeOfOperand MetadataNodeOperand{} = MetadataType | 50 | false | false | 0 | 6 | 3 | 13 | 6 | 7 | null | null |
geraldus/yesod | yesod-core/src/Yesod/Core/Handler.hs | mit | -- | Adds a status and message in the user's session.
--
-- See 'getMessages'.
--
-- @since 1.4.20
addMessage :: MonadHandler m
=> Text -- ^ status
-> Html -- ^ message
-> m ()
addMessage status msg = do
val <- lookupSessionBS msgKey
setSessionBS msgKey $ addMsg val
where
addMsg = maybe msg' (S.append msg' . S.cons W8._nul)
msg' = S.append
(encodeUtf8 status)
(W8._nul `S.cons` L.toStrict (renderHtml msg))
-- | Adds a message in the user's session but uses RenderMessage to allow for i18n
--
-- See 'getMessages'.
--
-- @since 1.4.20 | 604 | addMessage :: MonadHandler m
=> Text -- ^ status
-> Html -- ^ message
-> m ()
addMessage status msg = do
val <- lookupSessionBS msgKey
setSessionBS msgKey $ addMsg val
where
addMsg = maybe msg' (S.append msg' . S.cons W8._nul)
msg' = S.append
(encodeUtf8 status)
(W8._nul `S.cons` L.toStrict (renderHtml msg))
-- | Adds a message in the user's session but uses RenderMessage to allow for i18n
--
-- See 'getMessages'.
--
-- @since 1.4.20 | 505 | addMessage status msg = do
val <- lookupSessionBS msgKey
setSessionBS msgKey $ addMsg val
where
addMsg = maybe msg' (S.append msg' . S.cons W8._nul)
msg' = S.append
(encodeUtf8 status)
(W8._nul `S.cons` L.toStrict (renderHtml msg))
-- | Adds a message in the user's session but uses RenderMessage to allow for i18n
--
-- See 'getMessages'.
--
-- @since 1.4.20 | 394 | true | true | 0 | 10 | 161 | 145 | 75 | 70 | null | null |
bendmorris/scotch | Scotch/Parse/Expressions.hs | gpl-3.0 | notStmt =
do reserved "not"
expr <- expression
return $ Not expr
-- value parsers | 110 | notStmt =
do reserved "not"
expr <- expression
return $ Not expr
-- value parsers | 110 | notStmt =
do reserved "not"
expr <- expression
return $ Not expr
-- value parsers | 110 | false | false | 1 | 9 | 43 | 34 | 13 | 21 | null | null |
siddhanathan/ghc | testsuite/tests/rename/should_compile/timing001.hs | bsd-3-clause | a251 = a252 | 11 | a251 = a252 | 11 | a251 = a252 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.