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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jaseemabid/lisper | src/Lisper/Core.hs | mit | unwords' :: [Scheme] -> String
unwords' = unwords . map show | 60 | unwords' :: [Scheme] -> String
unwords' = unwords . map show | 60 | unwords' = unwords . map show | 29 | false | true | 1 | 7 | 10 | 33 | 14 | 19 | null | null |
Sam-Serpoosh/WatchIt | src/Renderer.hs | bsd-3-clause | alignWarnings :: [Warning] -> [String]
alignWarnings warns =
let alignedCats = alignStrings $ map (show . categ) warns
overs = map (show . overPaid) warns
in map (\(cat, over) -> cat ++ arrow ++ over) (zip alignedCats overs) | 240 | alignWarnings :: [Warning] -> [String]
alignWarnings warns =
let alignedCats = alignStrings $ map (show . categ) warns
overs = map (show . overPaid) warns
in map (\(cat, over) -> cat ++ arrow ++ over) (zip alignedCats overs) | 240 | alignWarnings warns =
let alignedCats = alignStrings $ map (show . categ) warns
overs = map (show . overPaid) warns
in map (\(cat, over) -> cat ++ arrow ++ over) (zip alignedCats overs) | 201 | false | true | 0 | 12 | 53 | 110 | 55 | 55 | null | null |
MfesGA/Smtlib | Smtlib/Parsers/ResponseParsers.hs | mit | parseCmdGetModelResponse :: ParsecT String u Identity CmdResponse
parseCmdGetModelResponse = liftM CmdGetModelResponse parseGetModelResponse | 140 | parseCmdGetModelResponse :: ParsecT String u Identity CmdResponse
parseCmdGetModelResponse = liftM CmdGetModelResponse parseGetModelResponse | 140 | parseCmdGetModelResponse = liftM CmdGetModelResponse parseGetModelResponse | 74 | false | true | 0 | 5 | 11 | 25 | 12 | 13 | null | null |
sdiehl/llvm-pp | src/LLVM/General/Pretty.hs | mit | ppCall :: Instruction -> Doc
ppCall Call { function = Right f,..}
= tail <+> "call" <+> pp resultType <+> ftype <+> pp f <> parens (commas $ fmap pp arguments)
where
tail = if isTailCall tailCallKind then "tail" else empty
(functionType@FunctionType {..}) = referencedType (typeOf f)
ftype = if isVarArg || isFunctionPtr resultType
then ppFunctionArgumentTypes functionType <> "*"
else empty
referencedType (PointerType t _) = referencedType t
referencedType t = t
-- xxx: tail call kind hack
isTailCall Nothing = False
isTailCall (Just a) = True | 645 | ppCall :: Instruction -> Doc
ppCall Call { function = Right f,..}
= tail <+> "call" <+> pp resultType <+> ftype <+> pp f <> parens (commas $ fmap pp arguments)
where
tail = if isTailCall tailCallKind then "tail" else empty
(functionType@FunctionType {..}) = referencedType (typeOf f)
ftype = if isVarArg || isFunctionPtr resultType
then ppFunctionArgumentTypes functionType <> "*"
else empty
referencedType (PointerType t _) = referencedType t
referencedType t = t
-- xxx: tail call kind hack
isTailCall Nothing = False
isTailCall (Just a) = True | 645 | ppCall Call { function = Right f,..}
= tail <+> "call" <+> pp resultType <+> ftype <+> pp f <> parens (commas $ fmap pp arguments)
where
tail = if isTailCall tailCallKind then "tail" else empty
(functionType@FunctionType {..}) = referencedType (typeOf f)
ftype = if isVarArg || isFunctionPtr resultType
then ppFunctionArgumentTypes functionType <> "*"
else empty
referencedType (PointerType t _) = referencedType t
referencedType t = t
-- xxx: tail call kind hack
isTailCall Nothing = False
isTailCall (Just a) = True | 616 | false | true | 6 | 10 | 185 | 199 | 99 | 100 | null | null |
norm2782/uuagc | src/Parser.hs | bsd-3-clause | parseAG :: Options -> [FilePath] -> String -> IO (AG,[Message Token Pos])
parseAG opts searchPath file = do
(es,_,_,_,mesg) <- parseFile False opts searchPath file
return (AG es, mesg)
--marcos | 198 | parseAG :: Options -> [FilePath] -> String -> IO (AG,[Message Token Pos])
parseAG opts searchPath file = do
(es,_,_,_,mesg) <- parseFile False opts searchPath file
return (AG es, mesg)
--marcos | 198 | parseAG opts searchPath file = do
(es,_,_,_,mesg) <- parseFile False opts searchPath file
return (AG es, mesg)
--marcos | 124 | false | true | 0 | 11 | 34 | 97 | 51 | 46 | null | null |
league/postgrest | src/PostgREST/Parsers.hs | mit | pField :: Parser Field
pField = lexeme $ (,) <$> pFieldName <*> optionMaybe pJsonPath | 85 | pField :: Parser Field
pField = lexeme $ (,) <$> pFieldName <*> optionMaybe pJsonPath | 85 | pField = lexeme $ (,) <$> pFieldName <*> optionMaybe pJsonPath | 62 | false | true | 0 | 8 | 13 | 32 | 16 | 16 | null | null |
cutsea110/aop | src/FixPrime.hs | bsd-3-clause | meta' :: Functor f => (f a -> a) -> (a -> b) -> (b -> f b) -> Fix f -> Fix f
meta' phi e psi = ana psi . e . cata phi | 117 | meta' :: Functor f => (f a -> a) -> (a -> b) -> (b -> f b) -> Fix f -> Fix f
meta' phi e psi = ana psi . e . cata phi | 117 | meta' phi e psi = ana psi . e . cata phi | 40 | false | true | 0 | 11 | 35 | 88 | 42 | 46 | null | null |
HaskellCNOrg/snap-web | src/Text/Digestive/FormExt.hs | bsd-3-clause | checkMaxLengthWith :: Monad m
=> Int
-> Text
-> Form Text m Text -> Form Text m Text
checkMaxLengthWith l msg = check (msg `T.append` " exceeds max length " `T.append` intToText) maxLength
where maxLength = (<= l) . T.length
intToText = T.pack (show l) | 368 | checkMaxLengthWith :: Monad m
=> Int
-> Text
-> Form Text m Text -> Form Text m Text
checkMaxLengthWith l msg = check (msg `T.append` " exceeds max length " `T.append` intToText) maxLength
where maxLength = (<= l) . T.length
intToText = T.pack (show l) | 368 | checkMaxLengthWith l msg = check (msg `T.append` " exceeds max length " `T.append` intToText) maxLength
where maxLength = (<= l) . T.length
intToText = T.pack (show l) | 217 | false | true | 0 | 9 | 160 | 106 | 55 | 51 | null | null |
ricardopenyamari/ir2haskell | clir-parser-haskell-master/lib/sexp-grammar/src/Language/SexpGrammar.hs | gpl-2.0 | ----------------------------------------------------------------------
-- Sexp interface
-- | Run grammar in parsing direction
parseSexp :: SexpG a -> Sexp -> Either String a
parseSexp g a =
runGrammarMonad Sexp.dummyPos showPos (runParse g a)
where
showPos (Sexp.Position fn line col) = fn ++ ":" ++ show line ++ ":" ++ show col
-- | Run grammar in generating direction | 380 | parseSexp :: SexpG a -> Sexp -> Either String a
parseSexp g a =
runGrammarMonad Sexp.dummyPos showPos (runParse g a)
where
showPos (Sexp.Position fn line col) = fn ++ ":" ++ show line ++ ":" ++ show col
-- | Run grammar in generating direction | 252 | parseSexp g a =
runGrammarMonad Sexp.dummyPos showPos (runParse g a)
where
showPos (Sexp.Position fn line col) = fn ++ ":" ++ show line ++ ":" ++ show col
-- | Run grammar in generating direction | 204 | true | true | 0 | 8 | 65 | 97 | 48 | 49 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/coreSyn/CoreUtils.hs | bsd-3-clause | applyTypeToArg fun_ty _ = funResultTy fun_ty | 56 | applyTypeToArg fun_ty _ = funResultTy fun_ty | 56 | applyTypeToArg fun_ty _ = funResultTy fun_ty | 56 | false | false | 0 | 5 | 17 | 14 | 6 | 8 | null | null |
Sword-Smith/hfasto | src/AMD64RegAlloc.hs | mit | getSuccessorsH n (AMD64.JZ l : insts) allInsts = [n + 1, findLabel l allInsts] : getSuccessorsH (n + 1) insts allInsts | 119 | getSuccessorsH n (AMD64.JZ l : insts) allInsts = [n + 1, findLabel l allInsts] : getSuccessorsH (n + 1) insts allInsts | 119 | getSuccessorsH n (AMD64.JZ l : insts) allInsts = [n + 1, findLabel l allInsts] : getSuccessorsH (n + 1) insts allInsts | 119 | false | false | 0 | 9 | 21 | 58 | 29 | 29 | null | null |
alexbaluta/courseography | dependencies/HaXml-1.25.3/src/Text/XML/HaXml/ParseLazy.hs | gpl-3.0 | conditionalsect :: XParser ConditionalSect
conditionalsect = oneOf'
[ ( "INCLUDE"
, do tok TokSectionOpen
peRef (tok (TokSection INCLUDEx))
p <- posn
tok TokSqOpen `onFail` failBadP "missing [ after INCLUDE"
i <- many (peRef extsubsetdecl)
tok TokSectionClose
`onFail` failBadP ("missing ]]> for INCLUDE section"
++"\n begun at "++show p)
return (IncludeSect i))
, ( "IGNORE"
, do tok TokSectionOpen
peRef (tok (TokSection IGNOREx))
p <- posn
tok TokSqOpen `onFail` failBadP "missing [ after IGNORE"
i <- many newIgnore -- many ignoresectcontents
tok TokSectionClose
`onFail` failBadP ("missing ]]> for IGNORE section"
++"\n begun at "++show p)
return (IgnoreSect []))
] `adjustErr` ("in a conditional section,\n"++) | 991 | conditionalsect :: XParser ConditionalSect
conditionalsect = oneOf'
[ ( "INCLUDE"
, do tok TokSectionOpen
peRef (tok (TokSection INCLUDEx))
p <- posn
tok TokSqOpen `onFail` failBadP "missing [ after INCLUDE"
i <- many (peRef extsubsetdecl)
tok TokSectionClose
`onFail` failBadP ("missing ]]> for INCLUDE section"
++"\n begun at "++show p)
return (IncludeSect i))
, ( "IGNORE"
, do tok TokSectionOpen
peRef (tok (TokSection IGNOREx))
p <- posn
tok TokSqOpen `onFail` failBadP "missing [ after IGNORE"
i <- many newIgnore -- many ignoresectcontents
tok TokSectionClose
`onFail` failBadP ("missing ]]> for IGNORE section"
++"\n begun at "++show p)
return (IgnoreSect []))
] `adjustErr` ("in a conditional section,\n"++) | 991 | conditionalsect = oneOf'
[ ( "INCLUDE"
, do tok TokSectionOpen
peRef (tok (TokSection INCLUDEx))
p <- posn
tok TokSqOpen `onFail` failBadP "missing [ after INCLUDE"
i <- many (peRef extsubsetdecl)
tok TokSectionClose
`onFail` failBadP ("missing ]]> for INCLUDE section"
++"\n begun at "++show p)
return (IncludeSect i))
, ( "IGNORE"
, do tok TokSectionOpen
peRef (tok (TokSection IGNOREx))
p <- posn
tok TokSqOpen `onFail` failBadP "missing [ after IGNORE"
i <- many newIgnore -- many ignoresectcontents
tok TokSectionClose
`onFail` failBadP ("missing ]]> for IGNORE section"
++"\n begun at "++show p)
return (IgnoreSect []))
] `adjustErr` ("in a conditional section,\n"++) | 948 | false | true | 0 | 14 | 377 | 248 | 118 | 130 | null | null |
mitochon/hoosalind | src/problems/kmer.hs | mit | subs s t =
let (m,_) = splitAt (length t) s
n = subs (tail s) t
in if (m == t) then (True:n) else (False:n) | 122 | subs s t =
let (m,_) = splitAt (length t) s
n = subs (tail s) t
in if (m == t) then (True:n) else (False:n) | 122 | subs s t =
let (m,_) = splitAt (length t) s
n = subs (tail s) t
in if (m == t) then (True:n) else (False:n) | 122 | false | false | 0 | 11 | 40 | 85 | 44 | 41 | null | null |
YoEight/eventstore | tests/Test/Integration/Tests.hs | bsd-3-clause | updatePersistentTest :: Connection -> IO ()
updatePersistentTest conn = do
let def = defaultPersistentSubscriptionSettings
stream <- freshStreamId
_ <- createPersistentSubscription conn "group" stream def Nothing >>= wait
r <- updatePersistentSubscription conn "group" stream def Nothing >>= wait
case r of
Nothing -> return ()
Just e -> fail $ "Exception arised: " <> show e
-------------------------------------------------------------------------------- | 494 | updatePersistentTest :: Connection -> IO ()
updatePersistentTest conn = do
let def = defaultPersistentSubscriptionSettings
stream <- freshStreamId
_ <- createPersistentSubscription conn "group" stream def Nothing >>= wait
r <- updatePersistentSubscription conn "group" stream def Nothing >>= wait
case r of
Nothing -> return ()
Just e -> fail $ "Exception arised: " <> show e
-------------------------------------------------------------------------------- | 494 | updatePersistentTest conn = do
let def = defaultPersistentSubscriptionSettings
stream <- freshStreamId
_ <- createPersistentSubscription conn "group" stream def Nothing >>= wait
r <- updatePersistentSubscription conn "group" stream def Nothing >>= wait
case r of
Nothing -> return ()
Just e -> fail $ "Exception arised: " <> show e
-------------------------------------------------------------------------------- | 450 | false | true | 0 | 12 | 93 | 127 | 57 | 70 | null | null |
yuga/ghc-mod | Language/Haskell/GhcMod/Gap.hs | bsd-3-clause | deSugar _ e hs_env = snd <$> deSugarExpr hs_env e | 51 | deSugar _ e hs_env = snd <$> deSugarExpr hs_env e | 51 | deSugar _ e hs_env = snd <$> deSugarExpr hs_env e | 51 | false | false | 0 | 6 | 11 | 22 | 10 | 12 | null | null |
devonhollowood/secret-santa | src/Main.hs | mit | doubleSendGuardFile :: FileName
doubleSendGuardFile = "already-sent.guard" | 74 | doubleSendGuardFile :: FileName
doubleSendGuardFile = "already-sent.guard" | 74 | doubleSendGuardFile = "already-sent.guard" | 42 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
romildo/gsynt | src/Factorization.hs | isc | divisions [x] = [([], [x]), ([x], [])] | 38 | divisions [x] = [([], [x]), ([x], [])] | 38 | divisions [x] = [([], [x]), ([x], [])] | 38 | false | false | 0 | 7 | 6 | 40 | 24 | 16 | null | null |
input-output-hk/pos-haskell-prototype | acid-state-exts/src/Serokell/AcidState/Util.hs | mit | -- | Apply all updates and remove all data from local state which is
-- unnecessary for state restoration.
tidyLocalState :: MonadIO m => AcidState st -> FilePath -> m ()
tidyLocalState st path =
liftIO (createCheckpoint st) >> createAndDiscardArchive st path | 263 | tidyLocalState :: MonadIO m => AcidState st -> FilePath -> m ()
tidyLocalState st path =
liftIO (createCheckpoint st) >> createAndDiscardArchive st path | 156 | tidyLocalState st path =
liftIO (createCheckpoint st) >> createAndDiscardArchive st path | 92 | true | true | 0 | 9 | 45 | 63 | 29 | 34 | null | null |
siddhanathan/yi | yi-keymap-vim/src/Yi/Keymap/Vim/Ex/Commands/Undo.hs | gpl-2.0 | parse :: EventString -> Maybe ExCommand
parse (Ev s) | s `elem` ["u", "undo"] =
Just pureExCommand {
cmdAction = BufferA undoB
, cmdShow = "undo"
, cmdComplete = return ["undo"]
} | 248 | parse :: EventString -> Maybe ExCommand
parse (Ev s) | s `elem` ["u", "undo"] =
Just pureExCommand {
cmdAction = BufferA undoB
, cmdShow = "undo"
, cmdComplete = return ["undo"]
} | 248 | parse (Ev s) | s `elem` ["u", "undo"] =
Just pureExCommand {
cmdAction = BufferA undoB
, cmdShow = "undo"
, cmdComplete = return ["undo"]
} | 208 | false | true | 0 | 10 | 100 | 77 | 41 | 36 | null | null |
markcwhitfield/nunavut | src/Nunavut/Activator.hs | mit | tanhActivator :: Activator
tanhActivator = diagActivator Tanh tanh ((1 -) . (** 2) . tanh) | 111 | tanhActivator :: Activator
tanhActivator = diagActivator Tanh tanh ((1 -) . (** 2) . tanh) | 111 | tanhActivator = diagActivator Tanh tanh ((1 -) . (** 2) . tanh) | 84 | false | true | 1 | 9 | 35 | 40 | 21 | 19 | null | null |
nevrenato/HetsAlloy | Maude/Sign.hs | gpl-2.0 | partialOp s = s | 15 | partialOp s = s | 15 | partialOp s = s | 15 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ke00n/alabno | backend/complexity_analyser/testFiles/MP/student/MP.hs | mit | replaceWord :: String -> KeywordDefs -> String
replaceWord xs [] = xs | 69 | replaceWord :: String -> KeywordDefs -> String
replaceWord xs [] = xs | 69 | replaceWord xs [] = xs | 22 | false | true | 0 | 6 | 11 | 31 | 14 | 17 | null | null |
KarimxD/Evolverbetert | src/Parameters.hs | mit | -- -1 and 0 turn off, 1 and 2 turn on
-- * Probabilities for mutation and environmental change
envSwitchProb = 3e-4 * fromIntegral outputStep :: Prob | 150 | envSwitchProb = 3e-4 * fromIntegral outputStep :: Prob | 54 | envSwitchProb = 3e-4 * fromIntegral outputStep :: Prob | 54 | true | false | 0 | 6 | 27 | 18 | 10 | 8 | null | null |
leichunfeng/learnyouahaskell | baby.hs | mit | length' xs = sum [1 | _ <- xs] | 30 | length' xs = sum [1 | _ <- xs] | 30 | length' xs = sum [1 | _ <- xs] | 30 | false | false | 1 | 8 | 8 | 27 | 11 | 16 | null | null |
snoyberg/convertible | testsrc/TestTime.hs | lgpl-2.1 | propPTCPT :: POSIXTime -> Result
propPTCPT x =
Right testval @=? do r1 <- safeConvert testval
safeConvert (r1 :: CTime)
where testval = (convert ((truncate x)::Integer))::POSIXTime -- CTime doesn't support picosecs | 256 | propPTCPT :: POSIXTime -> Result
propPTCPT x =
Right testval @=? do r1 <- safeConvert testval
safeConvert (r1 :: CTime)
where testval = (convert ((truncate x)::Integer))::POSIXTime -- CTime doesn't support picosecs | 256 | propPTCPT x =
Right testval @=? do r1 <- safeConvert testval
safeConvert (r1 :: CTime)
where testval = (convert ((truncate x)::Integer))::POSIXTime -- CTime doesn't support picosecs | 223 | false | true | 2 | 9 | 72 | 85 | 42 | 43 | null | null |
bgwines/zora | Zora/List.hs | bsd-3-clause | running_bests :: forall a. (Ord a) => [a] -> [a]
running_bests = running_bests_by compare | 89 | running_bests :: forall a. (Ord a) => [a] -> [a]
running_bests = running_bests_by compare | 89 | running_bests = running_bests_by compare | 40 | false | true | 0 | 8 | 13 | 38 | 21 | 17 | null | null |
statusfailed/aeson-traversal | src/Data/Aeson/Traversal.hs | mit | -- | Like 'key', but for Arrays with Int indexes
nth :: Int -> Traversal' Value Value
nth i = _Array . ix i | 107 | nth :: Int -> Traversal' Value Value
nth i = _Array . ix i | 58 | nth i = _Array . ix i | 21 | true | true | 0 | 6 | 23 | 31 | 15 | 16 | null | null |
phischu/fragnix | builtins/ghc-prim/GHC.Prim.hs | bsd-3-clause | timesWord# :: Word# -> Word# -> Word#
timesWord# = timesWord# | 61 | timesWord# :: Word# -> Word# -> Word#
timesWord# = timesWord# | 61 | timesWord# = timesWord# | 23 | false | true | 0 | 6 | 9 | 19 | 10 | 9 | null | null |
konn/hint-forked | src/Hint/Reflection.hs | bsd-3-clause | asModElem df(GHC.ATyCon tc) = Data (getUnqualName df tc)
(map (getUnqualName df) $ GHC.tyConDataCons tc) | 145 | asModElem df(GHC.ATyCon tc) = Data (getUnqualName df tc)
(map (getUnqualName df) $ GHC.tyConDataCons tc) | 145 | asModElem df(GHC.ATyCon tc) = Data (getUnqualName df tc)
(map (getUnqualName df) $ GHC.tyConDataCons tc) | 145 | false | false | 0 | 10 | 54 | 53 | 25 | 28 | null | null |
melted/llvm-pretty | src/Text/LLVM/AST.hs | bsd-3-clause | ppFCmpOp Folt = text "olt" | 28 | ppFCmpOp Folt = text "olt" | 28 | ppFCmpOp Folt = text "olt" | 28 | false | false | 1 | 5 | 6 | 15 | 5 | 10 | null | null |
sonyandy/perm | Control/Monad/Perm/Internal.hs | bsd-3-clause | -- | Unwrap a 'Perm', combining actions using the 'Alternative' for @f@.
sum1 :: Alternative m => Perm m a -> m a
sum1 m = runPerm m (<|>) | 138 | sum1 :: Alternative m => Perm m a -> m a
sum1 m = runPerm m (<|>) | 65 | sum1 m = runPerm m (<|>) | 24 | true | true | 0 | 8 | 28 | 47 | 21 | 26 | null | null |
beni55/libmpd-haskell | src/Network/MPD/Util.hs | mit | -- Takes an association list with recurring keys and groups each cycle of keys
-- with their values together. There can be several keys that begin cycles,
-- (the elements of the first parameter).
splitGroups :: [ByteString] -> [(ByteString, ByteString)] -> [[(ByteString, ByteString)]]
splitGroups groupHeads = go
where
go [] = []
go (x:xs) =
let
(ys, zs) = Prelude.break isGroupHead xs
in
(x:ys) : go zs
isGroupHead = (`elem` groupHeads) . fst
-- A helper for running a Parser, turning errors into Nothing. | 557 | splitGroups :: [ByteString] -> [(ByteString, ByteString)] -> [[(ByteString, ByteString)]]
splitGroups groupHeads = go
where
go [] = []
go (x:xs) =
let
(ys, zs) = Prelude.break isGroupHead xs
in
(x:ys) : go zs
isGroupHead = (`elem` groupHeads) . fst
-- A helper for running a Parser, turning errors into Nothing. | 359 | splitGroups groupHeads = go
where
go [] = []
go (x:xs) =
let
(ys, zs) = Prelude.break isGroupHead xs
in
(x:ys) : go zs
isGroupHead = (`elem` groupHeads) . fst
-- A helper for running a Parser, turning errors into Nothing. | 269 | true | true | 4 | 11 | 132 | 148 | 76 | 72 | null | null |
Erdwolf/autotool-bonn | src/NFA/Nerode/Incongruent/Config.hs | gpl-2.0 | example :: Config Char
example = Config
{ alphabet = mkSet "ab"
, nondet_automaton_size = 5
, wanted = 4
} | 138 | example :: Config Char
example = Config
{ alphabet = mkSet "ab"
, nondet_automaton_size = 5
, wanted = 4
} | 138 | example = Config
{ alphabet = mkSet "ab"
, nondet_automaton_size = 5
, wanted = 4
} | 115 | false | true | 0 | 7 | 52 | 37 | 21 | 16 | null | null |
dolio/vector | Data/Vector.hs | bsd-3-clause | foldl' = G.foldl' | 17 | foldl' = G.foldl' | 17 | foldl' = G.foldl' | 17 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
NorfairKing/sus-depot | shared/shared/xmonad/Actions.hs | gpl-2.0 | suspend :: X ()
suspend = spawn "pm-suspend" | 44 | suspend :: X ()
suspend = spawn "pm-suspend" | 44 | suspend = spawn "pm-suspend" | 28 | false | true | 0 | 7 | 7 | 25 | 10 | 15 | null | null |
ryantm/ghc | compiler/main/DynFlags.hs | bsd-3-clause | wayTag WayNDP = "ndp" | 26 | wayTag WayNDP = "ndp" | 26 | wayTag WayNDP = "ndp" | 26 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
haskell-works/oarsome | app/Main.hs | bsd-3-clause | myAwaitForever :: Monad m => (a -> Conduit a m b) -> Conduit a m b
myAwaitForever f = C.await >>= maybe (return ()) (\w -> f w >> myAwaitForever f) | 147 | myAwaitForever :: Monad m => (a -> Conduit a m b) -> Conduit a m b
myAwaitForever f = C.await >>= maybe (return ()) (\w -> f w >> myAwaitForever f) | 147 | myAwaitForever f = C.await >>= maybe (return ()) (\w -> f w >> myAwaitForever f) | 80 | false | true | 0 | 10 | 30 | 83 | 40 | 43 | null | null |
shayan-najd/QFeldspar | Tests/GADTHigherOrder.hs | gpl-3.0 | dbl :: Exp '[Word32 -> Word32 -> Word32] (Word32 -> Word32)
dbl = Abs (\ x -> Prm Zro (x `Ext` (x `Ext` Emp))) | 110 | dbl :: Exp '[Word32 -> Word32 -> Word32] (Word32 -> Word32)
dbl = Abs (\ x -> Prm Zro (x `Ext` (x `Ext` Emp))) | 110 | dbl = Abs (\ x -> Prm Zro (x `Ext` (x `Ext` Emp))) | 50 | false | true | 0 | 12 | 23 | 75 | 40 | 35 | null | null |
aaronc/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | pprintRaw bound RType = text "RType" | 36 | pprintRaw bound RType = text "RType" | 36 | pprintRaw bound RType = text "RType" | 36 | false | false | 1 | 5 | 5 | 19 | 6 | 13 | null | null |
alphaHeavy/cabal | Cabal/Distribution/PackageDescription/Check.hs | bsd-3-clause | repoTypeDirname Monotone = ["_MTN"] | 37 | repoTypeDirname Monotone = ["_MTN"] | 37 | repoTypeDirname Monotone = ["_MTN"] | 37 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Environments/Sessions/EntityTypes/Get.hs | mpl-2.0 | -- | JSONP
plaesetgCallback :: Lens' ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesGet (Maybe Text)
plaesetgCallback
= lens _plaesetgCallback
(\ s a -> s{_plaesetgCallback = a}) | 193 | plaesetgCallback :: Lens' ProjectsLocationsAgentsEnvironmentsSessionsEntityTypesGet (Maybe Text)
plaesetgCallback
= lens _plaesetgCallback
(\ s a -> s{_plaesetgCallback = a}) | 182 | plaesetgCallback
= lens _plaesetgCallback
(\ s a -> s{_plaesetgCallback = a}) | 85 | true | true | 0 | 8 | 27 | 49 | 25 | 24 | null | null |
ihc/futhark | src/Futhark/Pass/ExplicitAllocations.hs | isc | simplifiable :: (Engine.SimplifiableLore lore,
ExpAttr lore ~ (),
BodyAttr lore ~ (),
Op lore ~ MemOp inner,
Allocator lore (PatAllocM lore)) =>
(inner -> Engine.SimpleM lore (Engine.OpWithWisdom inner))
-> SimpleOps lore
simplifiable simplifyInnerOp =
SimpleOps mkExpAttrS' mkBodyS' mkLetNamesS' simplifyOp
where mkExpAttrS' _ pat e =
return $ Engine.mkWiseExpAttr pat () e
mkBodyS' _ bnds res = return $ mkWiseBody () bnds res
mkLetNamesS' vtable names e = do
pat' <- bindPatternWithAllocations env names $
removeExpWisdom e
return $ mkWiseLetStm pat' (defAux ()) e
where env = removeScopeWisdom $ ST.toScope vtable
simplifyOp (Alloc size space) = Alloc <$> Engine.simplify size <*> pure space
simplifyOp (Inner k) = Inner <$> simplifyInnerOp k | 940 | simplifiable :: (Engine.SimplifiableLore lore,
ExpAttr lore ~ (),
BodyAttr lore ~ (),
Op lore ~ MemOp inner,
Allocator lore (PatAllocM lore)) =>
(inner -> Engine.SimpleM lore (Engine.OpWithWisdom inner))
-> SimpleOps lore
simplifiable simplifyInnerOp =
SimpleOps mkExpAttrS' mkBodyS' mkLetNamesS' simplifyOp
where mkExpAttrS' _ pat e =
return $ Engine.mkWiseExpAttr pat () e
mkBodyS' _ bnds res = return $ mkWiseBody () bnds res
mkLetNamesS' vtable names e = do
pat' <- bindPatternWithAllocations env names $
removeExpWisdom e
return $ mkWiseLetStm pat' (defAux ()) e
where env = removeScopeWisdom $ ST.toScope vtable
simplifyOp (Alloc size space) = Alloc <$> Engine.simplify size <*> pure space
simplifyOp (Inner k) = Inner <$> simplifyInnerOp k | 940 | simplifiable simplifyInnerOp =
SimpleOps mkExpAttrS' mkBodyS' mkLetNamesS' simplifyOp
where mkExpAttrS' _ pat e =
return $ Engine.mkWiseExpAttr pat () e
mkBodyS' _ bnds res = return $ mkWiseBody () bnds res
mkLetNamesS' vtable names e = do
pat' <- bindPatternWithAllocations env names $
removeExpWisdom e
return $ mkWiseLetStm pat' (defAux ()) e
where env = removeScopeWisdom $ ST.toScope vtable
simplifyOp (Alloc size space) = Alloc <$> Engine.simplify size <*> pure space
simplifyOp (Inner k) = Inner <$> simplifyInnerOp k | 621 | false | true | 4 | 13 | 303 | 302 | 139 | 163 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | Required for insert. A descriptive name of the data feed.
dName :: Lens' Datafeed (Maybe Text)
dName = lens _dName (\ s a -> s{_dName = a}) | 144 | dName :: Lens' Datafeed (Maybe Text)
dName = lens _dName (\ s a -> s{_dName = a}) | 81 | dName = lens _dName (\ s a -> s{_dName = a}) | 44 | true | true | 0 | 9 | 28 | 46 | 25 | 21 | null | null |
ideas-edu/ideas | src/Ideas/Common/Strategy/Traversal.hs | apache-2.0 | oncebu :: (IsStrategy f, Navigator a) => f a -> Strategy a
oncebu = traverse [once, bottomup] | 94 | oncebu :: (IsStrategy f, Navigator a) => f a -> Strategy a
oncebu = traverse [once, bottomup] | 93 | oncebu = traverse [once, bottomup] | 34 | false | true | 0 | 7 | 17 | 45 | 23 | 22 | null | null |
RossMeikleham/GB-Assembler | GBParser.hs | mit | parseStackReg :: Parser StackRegister
parseStackReg = (reserved "af" >> return StackRegAF)
<|> (reserved "bc" >> return StackRegBC)
<|> (reserved "de" >> return StackRegDE)
<|> (reserved "hl" >> return StackRegHL) | 261 | parseStackReg :: Parser StackRegister
parseStackReg = (reserved "af" >> return StackRegAF)
<|> (reserved "bc" >> return StackRegBC)
<|> (reserved "de" >> return StackRegDE)
<|> (reserved "hl" >> return StackRegHL) | 261 | parseStackReg = (reserved "af" >> return StackRegAF)
<|> (reserved "bc" >> return StackRegBC)
<|> (reserved "de" >> return StackRegDE)
<|> (reserved "hl" >> return StackRegHL) | 223 | false | true | 0 | 10 | 76 | 78 | 37 | 41 | null | null |
uuhan/Idris-dev | src/Idris/Parser/Helpers.hs | bsd-3-clause | accessibility' :: IdrisParser Accessibility
accessibility'
= do reserved "public";
gotexp <- optional (reserved "export")
case gotexp of
Just _ -> return ()
Nothing -> do
ist <- get
fc <- getFC
put ist { parserWarnings =
(fc, Msg "'public' is deprecated. Use 'public export' instead.")
: parserWarnings ist }
return Public
<|> do reserved "abstract";
ist <- get
fc <- getFC
put ist { parserWarnings =
(fc, Msg "The 'abstract' keyword is deprecated. Use 'export' instead.")
: parserWarnings ist }
return Frozen
<|> do reserved "export"; return Frozen
<|> do reserved "private"; return Private
<?> "accessibility modifier" | 1,059 | accessibility' :: IdrisParser Accessibility
accessibility'
= do reserved "public";
gotexp <- optional (reserved "export")
case gotexp of
Just _ -> return ()
Nothing -> do
ist <- get
fc <- getFC
put ist { parserWarnings =
(fc, Msg "'public' is deprecated. Use 'public export' instead.")
: parserWarnings ist }
return Public
<|> do reserved "abstract";
ist <- get
fc <- getFC
put ist { parserWarnings =
(fc, Msg "The 'abstract' keyword is deprecated. Use 'export' instead.")
: parserWarnings ist }
return Frozen
<|> do reserved "export"; return Frozen
<|> do reserved "private"; return Private
<?> "accessibility modifier" | 1,059 | accessibility'
= do reserved "public";
gotexp <- optional (reserved "export")
case gotexp of
Just _ -> return ()
Nothing -> do
ist <- get
fc <- getFC
put ist { parserWarnings =
(fc, Msg "'public' is deprecated. Use 'public export' instead.")
: parserWarnings ist }
return Public
<|> do reserved "abstract";
ist <- get
fc <- getFC
put ist { parserWarnings =
(fc, Msg "The 'abstract' keyword is deprecated. Use 'export' instead.")
: parserWarnings ist }
return Frozen
<|> do reserved "export"; return Frozen
<|> do reserved "private"; return Private
<?> "accessibility modifier" | 1,015 | false | true | 12 | 17 | 535 | 227 | 102 | 125 | null | null |
ekr/tamarin-prover | lib/term/src/Term/UnitTests.hs | gpl-3.0 | runTest :: WithMaude a -> IO a
runTest m = do
hnd <- startMaude "maude" allMaudeSig
return $ m `runReader` hnd
{-
runTest $ matchLNTerm [ pair(xor [x5,x6],xor [x4,x5,x6]) `MatchWith` pair(x5,xor [x5,x4]) ]
should be matchable if next matchable also
runTest $ matchLNTerm [ pair(xor [x5,x6],xor [x4,x5,x6]) `MatchWith` pair(x5,xor [x5,x6]) ]
-}
-- convenience abbreviations
---------------------------------------------------------------------------------- | 469 | runTest :: WithMaude a -> IO a
runTest m = do
hnd <- startMaude "maude" allMaudeSig
return $ m `runReader` hnd
{-
runTest $ matchLNTerm [ pair(xor [x5,x6],xor [x4,x5,x6]) `MatchWith` pair(x5,xor [x5,x4]) ]
should be matchable if next matchable also
runTest $ matchLNTerm [ pair(xor [x5,x6],xor [x4,x5,x6]) `MatchWith` pair(x5,xor [x5,x6]) ]
-}
-- convenience abbreviations
---------------------------------------------------------------------------------- | 469 | runTest m = do
hnd <- startMaude "maude" allMaudeSig
return $ m `runReader` hnd
{-
runTest $ matchLNTerm [ pair(xor [x5,x6],xor [x4,x5,x6]) `MatchWith` pair(x5,xor [x5,x4]) ]
should be matchable if next matchable also
runTest $ matchLNTerm [ pair(xor [x5,x6],xor [x4,x5,x6]) `MatchWith` pair(x5,xor [x5,x6]) ]
-}
-- convenience abbreviations
---------------------------------------------------------------------------------- | 438 | false | true | 0 | 8 | 69 | 56 | 27 | 29 | null | null |
seckcoder/vector | Data/Vector/Generic.hs | bsd-3-clause | fold1M m = Bundle.fold1M m . stream | 35 | fold1M m = Bundle.fold1M m . stream | 35 | fold1M m = Bundle.fold1M m . stream | 35 | false | false | 1 | 7 | 6 | 22 | 8 | 14 | null | null |
jeremyong/Yaiba | Yaiba/Polynomial.hs | bsd-3-clause | maybeAdd a Nothing = Just a | 27 | maybeAdd a Nothing = Just a | 27 | maybeAdd a Nothing = Just a | 27 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
spacekitteh/smcghc | compiler/llvmGen/LlvmCodeGen/Base.hs | bsd-3-clause | -- | Allocate a new global unnamed metadata identifier
getMetaUniqueId :: LlvmM Int
getMetaUniqueId = LlvmM $ \env -> return (envFreshMeta env, env { envFreshMeta = envFreshMeta env + 1}) | 187 | getMetaUniqueId :: LlvmM Int
getMetaUniqueId = LlvmM $ \env -> return (envFreshMeta env, env { envFreshMeta = envFreshMeta env + 1}) | 132 | getMetaUniqueId = LlvmM $ \env -> return (envFreshMeta env, env { envFreshMeta = envFreshMeta env + 1}) | 103 | true | true | 0 | 12 | 29 | 51 | 27 | 24 | null | null |
rafalnowak/RaytracaH | src/RaytracaH/Math.hs | apache-2.0 | limitedToOne :: Float -> Float
limitedToOne = min 1.0 | 53 | limitedToOne :: Float -> Float
limitedToOne = min 1.0 | 53 | limitedToOne = min 1.0 | 22 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
mattias-lundell/timber-llvm | src/Desugar2.hs | bsd-3-clause | dsExp (ELit l) = return (ELit l) | 49 | dsExp (ELit l) = return (ELit l) | 49 | dsExp (ELit l) = return (ELit l) | 49 | false | false | 0 | 7 | 23 | 24 | 11 | 13 | null | null |
TeofilC/Turing | Machine.hs | mit | standardDesc :: Config -> String
standardDesc Config{states = s} = take 10000 $ foldl f "" (M.toList s)
where
f a ((st,re),(Action pr d, nxt)) = a ++ showSt st ++ showSy re ++ showSy pr ++ show d ++ showSt nxt ++ ";"
showSt = reverse . showSt'
showSt' 0 = "D"
showSt' n = 'A':showSt' (n-1)
showSy = reverse . showSy'
showSy' 0 = "D"
showSy' n = 'C':showSy' (n-1) | 392 | standardDesc :: Config -> String
standardDesc Config{states = s} = take 10000 $ foldl f "" (M.toList s)
where
f a ((st,re),(Action pr d, nxt)) = a ++ showSt st ++ showSy re ++ showSy pr ++ show d ++ showSt nxt ++ ";"
showSt = reverse . showSt'
showSt' 0 = "D"
showSt' n = 'A':showSt' (n-1)
showSy = reverse . showSy'
showSy' 0 = "D"
showSy' n = 'C':showSy' (n-1) | 392 | standardDesc Config{states = s} = take 10000 $ foldl f "" (M.toList s)
where
f a ((st,re),(Action pr d, nxt)) = a ++ showSt st ++ showSy re ++ showSy pr ++ show d ++ showSt nxt ++ ";"
showSt = reverse . showSt'
showSt' 0 = "D"
showSt' n = 'A':showSt' (n-1)
showSy = reverse . showSy'
showSy' 0 = "D"
showSy' n = 'C':showSy' (n-1) | 359 | false | true | 6 | 15 | 101 | 206 | 101 | 105 | null | null |
pepijnkokke/ab_grammar | Eff1.hs | mit | rdwrr :: (Int,[String])
rdwrr = run . (`runReader` (1::Int)) . runWriter $ rdwr | 79 | rdwrr :: (Int,[String])
rdwrr = run . (`runReader` (1::Int)) . runWriter $ rdwr | 79 | rdwrr = run . (`runReader` (1::Int)) . runWriter $ rdwr | 55 | false | true | 0 | 9 | 12 | 51 | 28 | 23 | null | null |
boothead/hierarchy | src/Hierarchy.hs | bsd-3-clause | grouped :: (Ord a) => Fold a b -> Fold a (Map a b)
grouped = groupedBy id | 73 | grouped :: (Ord a) => Fold a b -> Fold a (Map a b)
grouped = groupedBy id | 73 | grouped = groupedBy id | 22 | false | true | 0 | 9 | 17 | 45 | 22 | 23 | null | null |
ctford/Idris-Elba-dev | src/IRTS/Simplified.hs | bsd-3-clause | mkfapp f args = mkapp' f args [] where
mkapp' f [] args = return $ f (reverse args)
mkapp' f ((ty, (x, Nothing)) : xs) args = mkapp' f xs ((ty, x) : args)
mkapp' f ((ty, (x, Just e)) : xs) args
= do sc <- mkapp' f xs ((ty, x) : args)
return (SLet x e sc) | 282 | mkfapp f args = mkapp' f args [] where
mkapp' f [] args = return $ f (reverse args)
mkapp' f ((ty, (x, Nothing)) : xs) args = mkapp' f xs ((ty, x) : args)
mkapp' f ((ty, (x, Just e)) : xs) args
= do sc <- mkapp' f xs ((ty, x) : args)
return (SLet x e sc) | 282 | mkfapp f args = mkapp' f args [] where
mkapp' f [] args = return $ f (reverse args)
mkapp' f ((ty, (x, Nothing)) : xs) args = mkapp' f xs ((ty, x) : args)
mkapp' f ((ty, (x, Just e)) : xs) args
= do sc <- mkapp' f xs ((ty, x) : args)
return (SLet x e sc) | 282 | false | false | 0 | 13 | 87 | 178 | 92 | 86 | null | null |
Tener/ProCoGraM | src/Grammar.hs | bsd-3-clause | mut1 gr = do
(k,v) <- equiprobable' (Map.assocs gr)
let l = length v
if l < 2 then return gr else do
i1 <- uniformR (0,l-1)
i2 <- uniformR (0,l-2)
let (v0,(e0:v1)) = splitAt i1 v
(v2,(e1:v3)) = splitAt i2 (v0++v1)
p0'Old = fst e0
p1'Old = fst e1
p0'Val = snd e0
p1'Val = snd e1
pTotal = p0'Old + p1'Old
pNew' <- uniformR (0, pTotal)
let pNew = if pNew' == 0 then pTotal / 2 else pNew'
p0'New = pNew
p1'New = pTotal - pNew
e0' = (p0'New,p0'Val)
e1' = (p1'New,p1'Val)
return $ Map.adjust (const ([e0',e1'] ++ v2 ++ v3)) k gr
-- 2. choose random production, modify results (right hand side) | 684 | mut1 gr = do
(k,v) <- equiprobable' (Map.assocs gr)
let l = length v
if l < 2 then return gr else do
i1 <- uniformR (0,l-1)
i2 <- uniformR (0,l-2)
let (v0,(e0:v1)) = splitAt i1 v
(v2,(e1:v3)) = splitAt i2 (v0++v1)
p0'Old = fst e0
p1'Old = fst e1
p0'Val = snd e0
p1'Val = snd e1
pTotal = p0'Old + p1'Old
pNew' <- uniformR (0, pTotal)
let pNew = if pNew' == 0 then pTotal / 2 else pNew'
p0'New = pNew
p1'New = pTotal - pNew
e0' = (p0'New,p0'Val)
e1' = (p1'New,p1'Val)
return $ Map.adjust (const ([e0',e1'] ++ v2 ++ v3)) k gr
-- 2. choose random production, modify results (right hand side) | 684 | mut1 gr = do
(k,v) <- equiprobable' (Map.assocs gr)
let l = length v
if l < 2 then return gr else do
i1 <- uniformR (0,l-1)
i2 <- uniformR (0,l-2)
let (v0,(e0:v1)) = splitAt i1 v
(v2,(e1:v3)) = splitAt i2 (v0++v1)
p0'Old = fst e0
p1'Old = fst e1
p0'Val = snd e0
p1'Val = snd e1
pTotal = p0'Old + p1'Old
pNew' <- uniformR (0, pTotal)
let pNew = if pNew' == 0 then pTotal / 2 else pNew'
p0'New = pNew
p1'New = pTotal - pNew
e0' = (p0'New,p0'Val)
e1' = (p1'New,p1'Val)
return $ Map.adjust (const ([e0',e1'] ++ v2 ++ v3)) k gr
-- 2. choose random production, modify results (right hand side) | 684 | false | false | 0 | 17 | 212 | 320 | 166 | 154 | null | null |
johntyree/brnfckr | src/Brnfckr/Eval.hs | gpl-3.0 | valInput :: BrainFuck ()
valInput = do
W { mem = Ptr ls _ rs, dataInput = i } <- lift get
case i of
(byte:rest) -> lift $ put W { mem = Ptr ls byte rs, dataInput = rest }
_ -> throwE InsufficientInput | 212 | valInput :: BrainFuck ()
valInput = do
W { mem = Ptr ls _ rs, dataInput = i } <- lift get
case i of
(byte:rest) -> lift $ put W { mem = Ptr ls byte rs, dataInput = rest }
_ -> throwE InsufficientInput | 212 | valInput = do
W { mem = Ptr ls _ rs, dataInput = i } <- lift get
case i of
(byte:rest) -> lift $ put W { mem = Ptr ls byte rs, dataInput = rest }
_ -> throwE InsufficientInput | 187 | false | true | 0 | 15 | 57 | 111 | 54 | 57 | null | null |
adamwalker/xbee | Xbee.hs | bsd-3-clause | lsb :: Word16 -> Word8
lsb dat = fromIntegral $ dat .&. 0x00ff | 62 | lsb :: Word16 -> Word8
lsb dat = fromIntegral $ dat .&. 0x00ff | 62 | lsb dat = fromIntegral $ dat .&. 0x00ff | 39 | false | true | 2 | 7 | 12 | 32 | 14 | 18 | null | null |
hesselink/stack | src/Stack/Build/Execute.hs | bsd-3-clause | generateHpcReport
:: M env m
=> Path Abs Dir -> Path Abs Dir -> Path Abs Dir -> [Path Abs File] -> m ()
generateHpcReport _ _ _ [] = return () | 150 | generateHpcReport
:: M env m
=> Path Abs Dir -> Path Abs Dir -> Path Abs Dir -> [Path Abs File] -> m ()
generateHpcReport _ _ _ [] = return () | 150 | generateHpcReport _ _ _ [] = return () | 38 | false | true | 0 | 11 | 39 | 83 | 38 | 45 | null | null |
dysinger/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | The fixed price for the term.
psPrice :: Lens' PriceSchedule (Maybe Double)
psPrice = lens _psPrice (\s a -> s { _psPrice = a }) | 133 | psPrice :: Lens' PriceSchedule (Maybe Double)
psPrice = lens _psPrice (\s a -> s { _psPrice = a }) | 98 | psPrice = lens _psPrice (\s a -> s { _psPrice = a }) | 52 | true | true | 1 | 9 | 26 | 49 | 25 | 24 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxTEXT_ATTR_BULLET_STYLE_STANDARD :: Int
wxTEXT_ATTR_BULLET_STYLE_STANDARD = 0x00000200 | 101 | wxTEXT_ATTR_BULLET_STYLE_STANDARD :: Int
wxTEXT_ATTR_BULLET_STYLE_STANDARD = 0x00000200 | 101 | wxTEXT_ATTR_BULLET_STYLE_STANDARD = 0x00000200 | 53 | false | true | 0 | 4 | 19 | 11 | 6 | 5 | null | null |
imccoy/utopia | src/Code.hs | mit | maybeResult_nothing = app (var "construct") [("construct_with", lamArgId "maybeResult_nothing"), ("construct_payload", lit (Text ""))] | 134 | maybeResult_nothing = app (var "construct") [("construct_with", lamArgId "maybeResult_nothing"), ("construct_payload", lit (Text ""))] | 134 | maybeResult_nothing = app (var "construct") [("construct_with", lamArgId "maybeResult_nothing"), ("construct_payload", lit (Text ""))] | 134 | false | false | 1 | 10 | 11 | 51 | 25 | 26 | null | null |
alphalambda/codeworld | codeworld-api/src/CodeWorld/Reflex.hs | apache-2.0 | playPauseButton ::
( PerformEvent t m,
Adjustable t m,
MonadIO (Performable m),
PostBuild t m,
MonadHold t m,
MonadFix m
) =>
Dynamic t Double ->
Dynamic t Bool ->
Point ->
ReactiveProgram t m (Event t ())
playPauseButton hoverAlpha running pos = do
systemDraw $
uncurry translated pos
<$> (bool (playButton <$> hoverAlpha) (pauseButton <$> hoverAlpha) =<< running)
click <- ffilter (onRect 0.8 0.8 pos) <$> getPointerClick
return $ () <$ click
where
playButton a =
colored
(RGBA 0 0 0 a)
(solidPolygon [(-0.2, 0.25), (-0.2, -0.25), (0.2, 0)])
<> colored (RGBA 0.2 0.2 0.2 a) (rectangle 0.8 0.8)
<> colored (RGBA 0.8 0.8 0.8 a) (solidRectangle 0.8 0.8)
pauseButton a =
colored
(RGBA 0 0 0 a)
( translated (-0.15) 0 (solidRectangle 0.2 0.6)
<> translated 0.15 0 (solidRectangle 0.2 0.6)
)
<> colored (RGBA 0.2 0.2 0.2 a) (rectangle 0.8 0.8)
<> colored (RGBA 0.8 0.8 0.8 a) (solidRectangle 0.8 0.8) | 1,050 | playPauseButton ::
( PerformEvent t m,
Adjustable t m,
MonadIO (Performable m),
PostBuild t m,
MonadHold t m,
MonadFix m
) =>
Dynamic t Double ->
Dynamic t Bool ->
Point ->
ReactiveProgram t m (Event t ())
playPauseButton hoverAlpha running pos = do
systemDraw $
uncurry translated pos
<$> (bool (playButton <$> hoverAlpha) (pauseButton <$> hoverAlpha) =<< running)
click <- ffilter (onRect 0.8 0.8 pos) <$> getPointerClick
return $ () <$ click
where
playButton a =
colored
(RGBA 0 0 0 a)
(solidPolygon [(-0.2, 0.25), (-0.2, -0.25), (0.2, 0)])
<> colored (RGBA 0.2 0.2 0.2 a) (rectangle 0.8 0.8)
<> colored (RGBA 0.8 0.8 0.8 a) (solidRectangle 0.8 0.8)
pauseButton a =
colored
(RGBA 0 0 0 a)
( translated (-0.15) 0 (solidRectangle 0.2 0.6)
<> translated 0.15 0 (solidRectangle 0.2 0.6)
)
<> colored (RGBA 0.2 0.2 0.2 a) (rectangle 0.8 0.8)
<> colored (RGBA 0.8 0.8 0.8 a) (solidRectangle 0.8 0.8) | 1,050 | playPauseButton hoverAlpha running pos = do
systemDraw $
uncurry translated pos
<$> (bool (playButton <$> hoverAlpha) (pauseButton <$> hoverAlpha) =<< running)
click <- ffilter (onRect 0.8 0.8 pos) <$> getPointerClick
return $ () <$ click
where
playButton a =
colored
(RGBA 0 0 0 a)
(solidPolygon [(-0.2, 0.25), (-0.2, -0.25), (0.2, 0)])
<> colored (RGBA 0.2 0.2 0.2 a) (rectangle 0.8 0.8)
<> colored (RGBA 0.8 0.8 0.8 a) (solidRectangle 0.8 0.8)
pauseButton a =
colored
(RGBA 0 0 0 a)
( translated (-0.15) 0 (solidRectangle 0.2 0.6)
<> translated 0.15 0 (solidRectangle 0.2 0.6)
)
<> colored (RGBA 0.2 0.2 0.2 a) (rectangle 0.8 0.8)
<> colored (RGBA 0.8 0.8 0.8 a) (solidRectangle 0.8 0.8) | 812 | false | true | 1 | 14 | 307 | 437 | 218 | 219 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/String.hs | mit | deStringQualStmt (GroupUsing l exp) = GroupUsing (id l) (deStringExp exp) | 73 | deStringQualStmt (GroupUsing l exp) = GroupUsing (id l) (deStringExp exp) | 73 | deStringQualStmt (GroupUsing l exp) = GroupUsing (id l) (deStringExp exp) | 73 | false | false | 0 | 7 | 9 | 34 | 16 | 18 | null | null |
ryantm/ghc | compiler/main/DynFlags.hs | bsd-3-clause | wayDesc WayDebug = "Debug" | 29 | wayDesc WayDebug = "Debug" | 29 | wayDesc WayDebug = "Debug" | 29 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
DougBurke/swish | src/Swish/RDF/Query.hs | lgpl-2.1 | rdfQueryBack1 nodeq initv qas (ta:tas) = concat
[ rdfQueryBack1 nodeq (nv:initv) qas tas
| nv <- rdfQueryBack2 nodeq qas ta ] | 133 | rdfQueryBack1 nodeq initv qas (ta:tas) = concat
[ rdfQueryBack1 nodeq (nv:initv) qas tas
| nv <- rdfQueryBack2 nodeq qas ta ] | 133 | rdfQueryBack1 nodeq initv qas (ta:tas) = concat
[ rdfQueryBack1 nodeq (nv:initv) qas tas
| nv <- rdfQueryBack2 nodeq qas ta ] | 133 | false | false | 0 | 9 | 28 | 59 | 29 | 30 | null | null |
soenkehahn/edith | Edith/Core.hs | agpl-3.0 | (==%:) :: Char -> (Edith (), Maybe Handler) -> Handler
c ==%: action = EventCharacter c =%: action | 98 | (==%:) :: Char -> (Edith (), Maybe Handler) -> Handler
c ==%: action = EventCharacter c =%: action | 98 | c ==%: action = EventCharacter c =%: action | 43 | false | true | 0 | 10 | 17 | 49 | 24 | 25 | null | null |
yigitozkavci/ivy | src/Cenary/Parser.hs | mit | funModifier :: Parser FunModifier
funModifier =
reserved "pure" $> PureModifier | 81 | funModifier :: Parser FunModifier
funModifier =
reserved "pure" $> PureModifier | 81 | funModifier =
reserved "pure" $> PureModifier | 47 | false | true | 2 | 6 | 11 | 28 | 11 | 17 | null | null |
DavidAlphaFox/ghc | libraries/bytestring/bench/CSV.hs | bsd-3-clause | renderRowBinB :: Row -> BinB.Builder
renderRowBinB [] = mempty | 66 | renderRowBinB :: Row -> BinB.Builder
renderRowBinB [] = mempty | 66 | renderRowBinB [] = mempty | 29 | false | true | 0 | 8 | 12 | 28 | 12 | 16 | null | null |
danidiaz/lens | src/System/FilePath/Lens.hs | bsd-3-clause | -- | A 'Lens' for reading and writing to the full filename
--
-- Note: This is /not/ a legal 'Lens', unless you are careful to ensure that generated
-- filename 'FilePath' components are not null and do not contain any
-- elements of 'System.FilePath.pathSeparators's.
--
-- >>> filename .~ "name.txt" $ "path/name.png"
-- "path/name.txt"
filename :: Lens' FilePath FilePath
filename f p = (takeDirectory p </>) <$> f (takeFileName p) | 434 | filename :: Lens' FilePath FilePath
filename f p = (takeDirectory p </>) <$> f (takeFileName p) | 95 | filename f p = (takeDirectory p </>) <$> f (takeFileName p) | 59 | true | true | 0 | 8 | 70 | 49 | 28 | 21 | null | null |
lehins/unm-hip | Data/Image/Convolution.hs | gpl-3.0 | convolveCols' :: (Image img,
Num (Pixel img)) => Kernel (Pixel img) -> img -> img
convolveCols' k = convolve' k' where
k' = listArray ((0,0), (rows-1,0)) ls where
ls = elems k
rows = length ls
{-| Given a 2D list consisting solely of pixels representing a 2D
convolution kernel and an image, convolve returns the 2D discrete
periodic convolution of the image with the kernel.
>>>convolve [[1,1,1],[1,-8,1],[1,1,1]] frog
<https://raw.github.com/jcollard/unm-hip/master/examples/convolve.jpg>
-} | 543 | convolveCols' :: (Image img,
Num (Pixel img)) => Kernel (Pixel img) -> img -> img
convolveCols' k = convolve' k' where
k' = listArray ((0,0), (rows-1,0)) ls where
ls = elems k
rows = length ls
{-| Given a 2D list consisting solely of pixels representing a 2D
convolution kernel and an image, convolve returns the 2D discrete
periodic convolution of the image with the kernel.
>>>convolve [[1,1,1],[1,-8,1],[1,1,1]] frog
<https://raw.github.com/jcollard/unm-hip/master/examples/convolve.jpg>
-} | 543 | convolveCols' k = convolve' k' where
k' = listArray ((0,0), (rows-1,0)) ls where
ls = elems k
rows = length ls
{-| Given a 2D list consisting solely of pixels representing a 2D
convolution kernel and an image, convolve returns the 2D discrete
periodic convolution of the image with the kernel.
>>>convolve [[1,1,1],[1,-8,1],[1,1,1]] frog
<https://raw.github.com/jcollard/unm-hip/master/examples/convolve.jpg>
-} | 443 | false | true | 0 | 10 | 120 | 113 | 58 | 55 | null | null |
yiannist/ganeti | test/hs/Test/Ganeti/Query/Instance.hs | bsd-2-clause | fakeInstanceInfo :: InstanceInfo
fakeInstanceInfo = InstanceInfo 0 InstanceStateRunning 0 0 | 91 | fakeInstanceInfo :: InstanceInfo
fakeInstanceInfo = InstanceInfo 0 InstanceStateRunning 0 0 | 91 | fakeInstanceInfo = InstanceInfo 0 InstanceStateRunning 0 0 | 58 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
pauldoo/scratch | RealWorldHaskell/ch05/PutJSON.hs | isc | putJValue :: JValue -> IO ()
putJValue v = putStrLn (renderJValue v) | 68 | putJValue :: JValue -> IO ()
putJValue v = putStrLn (renderJValue v) | 68 | putJValue v = putStrLn (renderJValue v) | 39 | false | true | 0 | 7 | 11 | 32 | 15 | 17 | null | null |
johnjcamilleri/hpsg | NLP/AVM/Test.hs | mit | suite_uni_bind :: IO ()
suite_uni_bind = do
-- http://cs.haifa.ac.il/~shuly/teaching/06/nlp/ug2.pdf
let
num_sg = vmkAVM [("NUM",ValAtom "sg")]
per_3rd = vmkAVM [("PERS",ValAtom "3rd")]
num_per = vmkAVM [("NUM",ValAtom "sg"),("PERS",ValAtom "3rd")]
a = mkAVM' [ ("F",ValIndex 1) ]
[ (1, num_sg) ]
b = mkAVM' [ ("F",ValIndex 2) ]
[ (2, per_3rd) ]
aub = mkAVM' [ ("F",ValIndex 1) ]
[ (1, num_per) ]
-- putStrLn $ ppAVM $ a ⊔ b
-- putStrLn $ ppAVM $ aub
assert $ a ⊔ b ~= aub | 553 | suite_uni_bind :: IO ()
suite_uni_bind = do
-- http://cs.haifa.ac.il/~shuly/teaching/06/nlp/ug2.pdf
let
num_sg = vmkAVM [("NUM",ValAtom "sg")]
per_3rd = vmkAVM [("PERS",ValAtom "3rd")]
num_per = vmkAVM [("NUM",ValAtom "sg"),("PERS",ValAtom "3rd")]
a = mkAVM' [ ("F",ValIndex 1) ]
[ (1, num_sg) ]
b = mkAVM' [ ("F",ValIndex 2) ]
[ (2, per_3rd) ]
aub = mkAVM' [ ("F",ValIndex 1) ]
[ (1, num_per) ]
-- putStrLn $ ppAVM $ a ⊔ b
-- putStrLn $ ppAVM $ aub
assert $ a ⊔ b ~= aub | 553 | suite_uni_bind = do
-- http://cs.haifa.ac.il/~shuly/teaching/06/nlp/ug2.pdf
let
num_sg = vmkAVM [("NUM",ValAtom "sg")]
per_3rd = vmkAVM [("PERS",ValAtom "3rd")]
num_per = vmkAVM [("NUM",ValAtom "sg"),("PERS",ValAtom "3rd")]
a = mkAVM' [ ("F",ValIndex 1) ]
[ (1, num_sg) ]
b = mkAVM' [ ("F",ValIndex 2) ]
[ (2, per_3rd) ]
aub = mkAVM' [ ("F",ValIndex 1) ]
[ (1, num_per) ]
-- putStrLn $ ppAVM $ a ⊔ b
-- putStrLn $ ppAVM $ aub
assert $ a ⊔ b ~= aub | 529 | false | true | 0 | 13 | 161 | 203 | 113 | 90 | null | null |
kosmikus/cabal | cabal-install/Distribution/Client/Setup.hs | bsd-3-clause | -- ------------------------------------------------------------
-- * Other commands
-- ------------------------------------------------------------
updateCommand :: CommandUI (Flag Verbosity)
updateCommand = CommandUI {
commandName = "update",
commandSynopsis = "Updates list of known packages.",
commandDescription = Just $ \_ ->
"For all known remote repositories, download the package list.\n",
commandNotes = Just $ \_ ->
relevantConfigValuesText ["remote-repo"
,"remote-repo-cache"
,"local-repo"],
commandUsage = usageFlags "update",
commandDefaultFlags = toFlag normal,
commandOptions = \_ -> [optionVerbosity id const]
} | 765 | updateCommand :: CommandUI (Flag Verbosity)
updateCommand = CommandUI {
commandName = "update",
commandSynopsis = "Updates list of known packages.",
commandDescription = Just $ \_ ->
"For all known remote repositories, download the package list.\n",
commandNotes = Just $ \_ ->
relevantConfigValuesText ["remote-repo"
,"remote-repo-cache"
,"local-repo"],
commandUsage = usageFlags "update",
commandDefaultFlags = toFlag normal,
commandOptions = \_ -> [optionVerbosity id const]
} | 616 | updateCommand = CommandUI {
commandName = "update",
commandSynopsis = "Updates list of known packages.",
commandDescription = Just $ \_ ->
"For all known remote repositories, download the package list.\n",
commandNotes = Just $ \_ ->
relevantConfigValuesText ["remote-repo"
,"remote-repo-cache"
,"local-repo"],
commandUsage = usageFlags "update",
commandDefaultFlags = toFlag normal,
commandOptions = \_ -> [optionVerbosity id const]
} | 571 | true | true | 1 | 11 | 205 | 120 | 68 | 52 | null | null |
everyevery/programming_study | lgecodejam/2014-mar/a/a.hs | mit | solve :: [(Int,Int,Int,Int)] -> [(Int,Int,Int,Int)] -> Map.Map (Int,Int) Int -> Int -> [Int] -> (Int,Int) -> (Int,Int)
solve [lr] [] area prev [y] (count,size) = (count+1, max size (((y-prev)* (x2 lr-x1 lr))+prevSize))
where prevSize = head (Map.elems area)
--solve active rect:rects area prev y (count,size)
-- | y1 rect < head y = solve nextActive rects nextArea nextPrev nextY nextRet
-- where nextActive = -- (head y) 에 해당하는 것을 active에서 제거하고 해당되는
-- nextArea
-- | y1 rect > head y = solve nextActive rect:rects nextArea nextPrev nextY nextRet
-- where nextA | 688 | solve :: [(Int,Int,Int,Int)] -> [(Int,Int,Int,Int)] -> Map.Map (Int,Int) Int -> Int -> [Int] -> (Int,Int) -> (Int,Int)
solve [lr] [] area prev [y] (count,size) = (count+1, max size (((y-prev)* (x2 lr-x1 lr))+prevSize))
where prevSize = head (Map.elems area)
--solve active rect:rects area prev y (count,size)
-- | y1 rect < head y = solve nextActive rects nextArea nextPrev nextY nextRet
-- where nextActive = -- (head y) 에 해당하는 것을 active에서 제거하고 해당되는
-- nextArea
-- | y1 rect > head y = solve nextActive rect:rects nextArea nextPrev nextY nextRet
-- where nextA | 688 | solve [lr] [] area prev [y] (count,size) = (count+1, max size (((y-prev)* (x2 lr-x1 lr))+prevSize))
where prevSize = head (Map.elems area)
--solve active rect:rects area prev y (count,size)
-- | y1 rect < head y = solve nextActive rects nextArea nextPrev nextY nextRet
-- where nextActive = -- (head y) 에 해당하는 것을 active에서 제거하고 해당되는
-- nextArea
-- | y1 rect > head y = solve nextActive rect:rects nextArea nextPrev nextY nextRet
-- where nextA | 569 | false | true | 0 | 13 | 219 | 193 | 111 | 82 | null | null |
nikai3d/ce-challenges | hard/distinct_subsequences.hs | bsd-3-clause | main :: IO ()
main = do
[inpFile] <- getArgs
input <- readFile inpFile
putStr . unlines . map (show . subs . splitOn ",") $ lines input | 147 | main :: IO ()
main = do
[inpFile] <- getArgs
input <- readFile inpFile
putStr . unlines . map (show . subs . splitOn ",") $ lines input | 147 | main = do
[inpFile] <- getArgs
input <- readFile inpFile
putStr . unlines . map (show . subs . splitOn ",") $ lines input | 133 | false | true | 0 | 12 | 39 | 71 | 33 | 38 | null | null |
sseefried/shady-gen | src/Data/NatTrie.hs | agpl-3.0 | trie :: NatFun f -> NatTrie f
trie h = NT (h Zero) (trie (O . h . Succ)) | 72 | trie :: NatFun f -> NatTrie f
trie h = NT (h Zero) (trie (O . h . Succ)) | 72 | trie h = NT (h Zero) (trie (O . h . Succ)) | 42 | false | true | 0 | 10 | 18 | 52 | 25 | 27 | null | null |
alexbecker/blogdown | test/Test.hs | agpl-3.0 | testBold = expectSuccess "bold" inline "**abc**" "<b>abc</b>" | 61 | testBold = expectSuccess "bold" inline "**abc**" "<b>abc</b>" | 61 | testBold = expectSuccess "bold" inline "**abc**" "<b>abc</b>" | 61 | false | false | 0 | 5 | 6 | 15 | 7 | 8 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_POINT_SIZE_MAX :: GLenum
gl_POINT_SIZE_MAX = 0x8127 | 54 | gl_POINT_SIZE_MAX :: GLenum
gl_POINT_SIZE_MAX = 0x8127 | 54 | gl_POINT_SIZE_MAX = 0x8127 | 26 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ethercrow/yi | yi-core/src/Yi/Config/Simple.hs | gpl-2.0 | -- | Set to 'Exclusive' for an emacs-like behaviour. Consider starting
-- with 'defaultEmacsConfig', 'defaultVimConfig', or
-- 'defaultCuaConfig' to instead.
regionStyle :: Field RegionStyle
regionStyle = configRegionStyleA | 223 | regionStyle :: Field RegionStyle
regionStyle = configRegionStyleA | 65 | regionStyle = configRegionStyleA | 32 | true | true | 0 | 5 | 26 | 17 | 10 | 7 | null | null |
ucam-cl-dtg/naps-camfort | Extensions/Units.hs | mit | showCat Magic = "Magic" | 27 | showCat Magic = "Magic" | 27 | showCat Magic = "Magic" | 27 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
urv/fixhs | src/Data/FIX/Spec/FIX40.hs | lgpl-2.1 | tTimeInForce :: FIXTag
tTimeInForce = FIXTag
{ tName = "TimeInForce"
, tnum = 59
, tparser = toFIXChar
, arbitraryValue = FIXChar <$> (return 'A') } | 161 | tTimeInForce :: FIXTag
tTimeInForce = FIXTag
{ tName = "TimeInForce"
, tnum = 59
, tparser = toFIXChar
, arbitraryValue = FIXChar <$> (return 'A') } | 161 | tTimeInForce = FIXTag
{ tName = "TimeInForce"
, tnum = 59
, tparser = toFIXChar
, arbitraryValue = FIXChar <$> (return 'A') } | 138 | false | true | 0 | 10 | 38 | 57 | 30 | 27 | null | null |
UnNetHack/pinobot | lib/NetHack/Data/Monster.hs | mit | hasFlag :: MonsterFlag -> Monster -> Bool
hasFlag flag = elem flag . moFlags | 76 | hasFlag :: MonsterFlag -> Monster -> Bool
hasFlag flag = elem flag . moFlags | 76 | hasFlag flag = elem flag . moFlags | 34 | false | true | 0 | 6 | 13 | 29 | 14 | 15 | null | null |
krapsh/kraps-haskell | src/Spark/Core/Internal/Arithmetics.hs | apache-2.0 | performOp :: (GeneralizedHomo2 x1 x2) =>
HomoColOp2 ->
x1 ->
x2 ->
GeneralizedHomoReturn x1 x2
performOp f x1 x2 = _projectHomo x1 x2 f | 143 | performOp :: (GeneralizedHomo2 x1 x2) =>
HomoColOp2 ->
x1 ->
x2 ->
GeneralizedHomoReturn x1 x2
performOp f x1 x2 = _projectHomo x1 x2 f | 143 | performOp f x1 x2 = _projectHomo x1 x2 f | 40 | false | true | 0 | 10 | 31 | 57 | 27 | 30 | null | null |
brendanhay/gogol | gogol-billing/gen/Network/Google/Resource/CloudBilling/BillingAccounts/Patch.hs | mpl-2.0 | -- | V1 error format.
bapXgafv :: Lens' BillingAccountsPatch (Maybe Xgafv)
bapXgafv = lens _bapXgafv (\ s a -> s{_bapXgafv = a}) | 128 | bapXgafv :: Lens' BillingAccountsPatch (Maybe Xgafv)
bapXgafv = lens _bapXgafv (\ s a -> s{_bapXgafv = a}) | 106 | bapXgafv = lens _bapXgafv (\ s a -> s{_bapXgafv = a}) | 53 | true | true | 1 | 9 | 21 | 52 | 25 | 27 | null | null |
juodaspaulius/clafer | src/Language/Clafer/Intermediate/Desugarer.hs | mit | sugarQuant IAll = error "sugarQaunt was called on IAll, this is not allowed!" | 77 | sugarQuant IAll = error "sugarQaunt was called on IAll, this is not allowed!" | 77 | sugarQuant IAll = error "sugarQaunt was called on IAll, this is not allowed!" | 77 | false | false | 1 | 5 | 12 | 16 | 5 | 11 | null | null |
egaburov/funstuff | Haskell/misc/nfa.hs | apache-2.0 | t Q2 A = [Q3,Q4] | 16 | t Q2 A = [Q3,Q4] | 16 | t Q2 A = [Q3,Q4] | 16 | false | false | 0 | 5 | 4 | 19 | 9 | 10 | null | null |
ulricha/dsh-example-queries | Queries/TPCH/Standard/Q4.hs | bsd-3-clause | -- | TPC-H Query Q4 (abstraction-heavy DSH style)
-- Compute the number of problematic orders per priority level.
q4 :: Day -> Q [(Text, Integer)]
q4 startDate =
sortWith fst [ tup2 op (length g) | (view -> (op, g)) <- groupWithKey id oids]
where
interval = Interval startDate (C.addGregorianMonthsRollOver 3 startDate)
oids = problematicOrders interval
--------------------------------------------------------------------------------
-- | TPC-H Query Q4 (literal transcription with 'null') | 510 | q4 :: Day -> Q [(Text, Integer)]
q4 startDate =
sortWith fst [ tup2 op (length g) | (view -> (op, g)) <- groupWithKey id oids]
where
interval = Interval startDate (C.addGregorianMonthsRollOver 3 startDate)
oids = problematicOrders interval
--------------------------------------------------------------------------------
-- | TPC-H Query Q4 (literal transcription with 'null') | 396 | q4 startDate =
sortWith fst [ tup2 op (length g) | (view -> (op, g)) <- groupWithKey id oids]
where
interval = Interval startDate (C.addGregorianMonthsRollOver 3 startDate)
oids = problematicOrders interval
--------------------------------------------------------------------------------
-- | TPC-H Query Q4 (literal transcription with 'null') | 363 | true | true | 2 | 10 | 85 | 121 | 59 | 62 | null | null |
caiorss/Functional-Programming | haskell/rwh/ch14/MultiplyTo.hs | unlicense | guarded :: Bool -> [a] -> [a]
guarded True xs = xs | 51 | guarded :: Bool -> [a] -> [a]
guarded True xs = xs | 51 | guarded True xs = xs | 21 | false | true | 0 | 9 | 12 | 36 | 17 | 19 | null | null |
mrakgr/futhark | src/Futhark/Optimise/Simplifier/Rules.hs | bsd-3-clause | removeEmptySplits _ _ =
cannotSimplify | 40 | removeEmptySplits _ _ =
cannotSimplify | 40 | removeEmptySplits _ _ =
cannotSimplify | 40 | false | false | 0 | 5 | 6 | 11 | 5 | 6 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/playpen/hcpn/src/NetAux.hs | unlicense | getArcTrans (NetObject{object=(TP t _ _ _)}) = t | 48 | getArcTrans (NetObject{object=(TP t _ _ _)}) = t | 48 | getArcTrans (NetObject{object=(TP t _ _ _)}) = t | 48 | false | false | 0 | 11 | 7 | 33 | 17 | 16 | null | null |
sgillespie/ghc | compiler/basicTypes/Id.hs | bsd-3-clause | isPrimOpId_maybe id = case Var.idDetails id of
PrimOpId op -> Just op
_ -> Nothing | 140 | isPrimOpId_maybe id = case Var.idDetails id of
PrimOpId op -> Just op
_ -> Nothing | 140 | isPrimOpId_maybe id = case Var.idDetails id of
PrimOpId op -> Just op
_ -> Nothing | 140 | false | false | 0 | 8 | 72 | 36 | 16 | 20 | null | null |
rahulmutt/ghcvm | libraries/eta-meta/Language/Eta/Meta/Lib.hs | bsd-3-clause | recUpdE :: ExpQ -> [Q (Name,Exp)] -> ExpQ
recUpdE e fs = do { e1 <- e; flds <- sequence fs; return (RecUpdE e1 flds) } | 118 | recUpdE :: ExpQ -> [Q (Name,Exp)] -> ExpQ
recUpdE e fs = do { e1 <- e; flds <- sequence fs; return (RecUpdE e1 flds) } | 118 | recUpdE e fs = do { e1 <- e; flds <- sequence fs; return (RecUpdE e1 flds) } | 76 | false | true | 0 | 9 | 25 | 71 | 36 | 35 | null | null |
cje/hilbert | test/THilbert.hs | bsd-3-clause | prop_trailingSetBitsSymmetric :: Property
prop_trailingSetBitsSymmetric = forAll (choose (10, 1000::Integer)) $ \i ->
forAll (suchThat (choose (5, 20::Integer)) (\nn -> 0 < 2^nn - 1 - i)) $ \n ->
let
v1 = minPrecision i
v2 = minPrecision (2^n - 2 - i)
in
trailingSetBits v1 == trailingSetBits v2 | 508 | prop_trailingSetBitsSymmetric :: Property
prop_trailingSetBitsSymmetric = forAll (choose (10, 1000::Integer)) $ \i ->
forAll (suchThat (choose (5, 20::Integer)) (\nn -> 0 < 2^nn - 1 - i)) $ \n ->
let
v1 = minPrecision i
v2 = minPrecision (2^n - 2 - i)
in
trailingSetBits v1 == trailingSetBits v2 | 508 | prop_trailingSetBitsSymmetric = forAll (choose (10, 1000::Integer)) $ \i ->
forAll (suchThat (choose (5, 20::Integer)) (\nn -> 0 < 2^nn - 1 - i)) $ \n ->
let
v1 = minPrecision i
v2 = minPrecision (2^n - 2 - i)
in
trailingSetBits v1 == trailingSetBits v2 | 466 | false | true | 0 | 17 | 260 | 144 | 75 | 69 | null | null |
rvl/hsoz | test/Network/Hawk/Tests.hs | bsd-3-clause | testServerAuth11 = testCase "errors on an invalid authentication header: no scheme" $ do
res <- testAuth "!@#" 1353788437 testReq4
checkAuthFail "string" res -- fixme: "Invalid header syntax" | 195 | testServerAuth11 = testCase "errors on an invalid authentication header: no scheme" $ do
res <- testAuth "!@#" 1353788437 testReq4
checkAuthFail "string" res -- fixme: "Invalid header syntax" | 195 | testServerAuth11 = testCase "errors on an invalid authentication header: no scheme" $ do
res <- testAuth "!@#" 1353788437 testReq4
checkAuthFail "string" res -- fixme: "Invalid header syntax" | 195 | false | false | 1 | 10 | 30 | 40 | 16 | 24 | null | null |
travitch/hsqml | src/Graphics/QML/Types/Classes.hs | bsd-3-clause | createClass :: forall tt. (MetaObject tt)
=> String -- ^ The class name (derived from Typeable usually)
-> InternalClassDefinition tt
-> IO (MetaClass tt)
createClass name (InternalClassDef _ _ properties methods signals _ _) = do
-- This is the moc step; metaData is equivalent to the
-- qt_meta_data_<TYPE> array that moc produces. metaStrData is
-- equivalent to qt_meta_stringdata_<TYPE>.
let moc@(MOCOutput metaData metaStrData) =
compileClass name signals methods properties
-- Convert all of the class description stuff into C-compatible
-- types (arrays of Storable types).
metaDataPtr <- newArray metaData `debug` show moc
metaStrDataPtr <- newArray metaStrData
methodsPtr <- mapM (marshalFunc . methodFunc) methods >>= newArray
pReads <- mapM (marshalFunc . propertyReadFunc) properties
let trWr p = case propertyWriteFunc p of
Nothing -> return nullFunPtr
Just w -> marshalFunc w
pWrites <- mapM trWr properties
-- The array of accessors and mutators is arranged such that the
-- read and write functions for a given property are adjacent in the
-- array, so we do the interleaving step here.
propertiesPtr <- newArray $ interleave pReads pWrites
-- Create a QMetaObject wrapper around the class description we just
-- built.
hndl <- hsqmlCreateClass metaDataPtr metaStrDataPtr methodsPtr propertiesPtr
return $ case hndl of
Just hndl' -> MetaClass (TypeName name) hndl'
Nothing -> error "Failed to create QML class." | 1,551 | createClass :: forall tt. (MetaObject tt)
=> String -- ^ The class name (derived from Typeable usually)
-> InternalClassDefinition tt
-> IO (MetaClass tt)
createClass name (InternalClassDef _ _ properties methods signals _ _) = do
-- This is the moc step; metaData is equivalent to the
-- qt_meta_data_<TYPE> array that moc produces. metaStrData is
-- equivalent to qt_meta_stringdata_<TYPE>.
let moc@(MOCOutput metaData metaStrData) =
compileClass name signals methods properties
-- Convert all of the class description stuff into C-compatible
-- types (arrays of Storable types).
metaDataPtr <- newArray metaData `debug` show moc
metaStrDataPtr <- newArray metaStrData
methodsPtr <- mapM (marshalFunc . methodFunc) methods >>= newArray
pReads <- mapM (marshalFunc . propertyReadFunc) properties
let trWr p = case propertyWriteFunc p of
Nothing -> return nullFunPtr
Just w -> marshalFunc w
pWrites <- mapM trWr properties
-- The array of accessors and mutators is arranged such that the
-- read and write functions for a given property are adjacent in the
-- array, so we do the interleaving step here.
propertiesPtr <- newArray $ interleave pReads pWrites
-- Create a QMetaObject wrapper around the class description we just
-- built.
hndl <- hsqmlCreateClass metaDataPtr metaStrDataPtr methodsPtr propertiesPtr
return $ case hndl of
Just hndl' -> MetaClass (TypeName name) hndl'
Nothing -> error "Failed to create QML class." | 1,551 | createClass name (InternalClassDef _ _ properties methods signals _ _) = do
-- This is the moc step; metaData is equivalent to the
-- qt_meta_data_<TYPE> array that moc produces. metaStrData is
-- equivalent to qt_meta_stringdata_<TYPE>.
let moc@(MOCOutput metaData metaStrData) =
compileClass name signals methods properties
-- Convert all of the class description stuff into C-compatible
-- types (arrays of Storable types).
metaDataPtr <- newArray metaData `debug` show moc
metaStrDataPtr <- newArray metaStrData
methodsPtr <- mapM (marshalFunc . methodFunc) methods >>= newArray
pReads <- mapM (marshalFunc . propertyReadFunc) properties
let trWr p = case propertyWriteFunc p of
Nothing -> return nullFunPtr
Just w -> marshalFunc w
pWrites <- mapM trWr properties
-- The array of accessors and mutators is arranged such that the
-- read and write functions for a given property are adjacent in the
-- array, so we do the interleaving step here.
propertiesPtr <- newArray $ interleave pReads pWrites
-- Create a QMetaObject wrapper around the class description we just
-- built.
hndl <- hsqmlCreateClass metaDataPtr metaStrDataPtr methodsPtr propertiesPtr
return $ case hndl of
Just hndl' -> MetaClass (TypeName name) hndl'
Nothing -> error "Failed to create QML class." | 1,351 | false | true | 0 | 13 | 337 | 304 | 146 | 158 | null | null |
facebookincubator/duckling | Duckling/Time/PT/Rules.hs | bsd-3-clause | ruleTwoTimeTokensSeparatedBy :: Rule
ruleTwoTimeTokensSeparatedBy = Rule
{ name = "two time tokens separated by \",\""
, pattern =
[ Predicate isNotLatent
, regex ","
, Predicate isNotLatent
]
, prod = \tokens -> case tokens of
(Token Time td1:_:Token Time td2:_) ->
Token Time <$> intersect td1 td2
_ -> Nothing
} | 358 | ruleTwoTimeTokensSeparatedBy :: Rule
ruleTwoTimeTokensSeparatedBy = Rule
{ name = "two time tokens separated by \",\""
, pattern =
[ Predicate isNotLatent
, regex ","
, Predicate isNotLatent
]
, prod = \tokens -> case tokens of
(Token Time td1:_:Token Time td2:_) ->
Token Time <$> intersect td1 td2
_ -> Nothing
} | 358 | ruleTwoTimeTokensSeparatedBy = Rule
{ name = "two time tokens separated by \",\""
, pattern =
[ Predicate isNotLatent
, regex ","
, Predicate isNotLatent
]
, prod = \tokens -> case tokens of
(Token Time td1:_:Token Time td2:_) ->
Token Time <$> intersect td1 td2
_ -> Nothing
} | 321 | false | true | 0 | 16 | 95 | 111 | 57 | 54 | null | null |
olsner/ghc | compiler/iface/IfaceType.hs | bsd-3-clause | -- | Extract a IfaceTvBndr from a IfaceTyConBinder
ifTyConBinderTyVar :: IfaceTyConBinder -> IfaceTvBndr
ifTyConBinderTyVar = binderVar | 135 | ifTyConBinderTyVar :: IfaceTyConBinder -> IfaceTvBndr
ifTyConBinderTyVar = binderVar | 84 | ifTyConBinderTyVar = binderVar | 30 | true | true | 0 | 5 | 15 | 16 | 9 | 7 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.