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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jberthold/deployR-hs | src/DeployR.hs | apache-2.0 | getMgr :: IO Manager
getMgr = newManager defaultManagerSettings | 63 | getMgr :: IO Manager
getMgr = newManager defaultManagerSettings | 63 | getMgr = newManager defaultManagerSettings | 42 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
kumasento/accelerate | Data/Array/Accelerate/Analysis/Match.hs | bsd-3-clause | matchPrimFun PrimLNot PrimLNot = Just REFL | 70 | matchPrimFun PrimLNot PrimLNot = Just REFL | 70 | matchPrimFun PrimLNot PrimLNot = Just REFL | 70 | false | false | 0 | 5 | 33 | 14 | 6 | 8 | null | null |
christiaanb/ghc | compiler/nativeGen/PIC.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- On Darwin, we have to generate our own stub code for lazy binding..
-- For each processor architecture, there are two versions, one for PIC
-- and one for non-PIC.
--
-- Whenever you change something in this assembler output, make sure
-- the splitter in driver/split/ghc-split.lprl recognizes the new output
pprImportedSymbol :: DynFlags -> Platform -> CLabel -> SDoc
pprImportedSymbol dflags platform@(Platform { platformArch = ArchPPC, platformOS = OSDarwin }) importedLbl
| Just (CodeStub, lbl) <- dynamicLinkerLabelInfo importedLbl
= case gopt Opt_PIC dflags of
False ->
vcat [
ptext (sLit ".symbol_stub"),
ptext (sLit "L") <> pprCLabel platform lbl <> ptext (sLit "$stub:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\tlis r11,ha16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr)"),
ptext (sLit "\tlwz r12,lo16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr)(r11)"),
ptext (sLit "\tmtctr r12"),
ptext (sLit "\taddi r11,r11,lo16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr)"),
ptext (sLit "\tbctr")
]
True ->
vcat [
ptext (sLit ".section __TEXT,__picsymbolstub1,")
<> ptext (sLit "symbol_stubs,pure_instructions,32"),
ptext (sLit "\t.align 2"),
ptext (sLit "L") <> pprCLabel platform lbl <> ptext (sLit "$stub:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\tmflr r0"),
ptext (sLit "\tbcl 20,31,L0$") <> pprCLabel platform lbl,
ptext (sLit "L0$") <> pprCLabel platform lbl <> char ':',
ptext (sLit "\tmflr r11"),
ptext (sLit "\taddis r11,r11,ha16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr-L0$") <> pprCLabel platform lbl <> char ')',
ptext (sLit "\tmtlr r0"),
ptext (sLit "\tlwzu r12,lo16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr-L0$") <> pprCLabel platform lbl
<> ptext (sLit ")(r11)"),
ptext (sLit "\tmtctr r12"),
ptext (sLit "\tbctr")
]
$+$ vcat [
ptext (sLit ".lazy_symbol_pointer"),
ptext (sLit "L") <> pprCLabel platform lbl <> ptext (sLit "$lazy_ptr:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\t.long dyld_stub_binding_helper")]
| Just (SymbolPtr, lbl) <- dynamicLinkerLabelInfo importedLbl
= vcat [
ptext (sLit ".non_lazy_symbol_pointer"),
char 'L' <> pprCLabel platform lbl <> ptext (sLit "$non_lazy_ptr:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\t.long\t0")]
| otherwise
= empty | 3,291 | pprImportedSymbol :: DynFlags -> Platform -> CLabel -> SDoc
pprImportedSymbol dflags platform@(Platform { platformArch = ArchPPC, platformOS = OSDarwin }) importedLbl
| Just (CodeStub, lbl) <- dynamicLinkerLabelInfo importedLbl
= case gopt Opt_PIC dflags of
False ->
vcat [
ptext (sLit ".symbol_stub"),
ptext (sLit "L") <> pprCLabel platform lbl <> ptext (sLit "$stub:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\tlis r11,ha16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr)"),
ptext (sLit "\tlwz r12,lo16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr)(r11)"),
ptext (sLit "\tmtctr r12"),
ptext (sLit "\taddi r11,r11,lo16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr)"),
ptext (sLit "\tbctr")
]
True ->
vcat [
ptext (sLit ".section __TEXT,__picsymbolstub1,")
<> ptext (sLit "symbol_stubs,pure_instructions,32"),
ptext (sLit "\t.align 2"),
ptext (sLit "L") <> pprCLabel platform lbl <> ptext (sLit "$stub:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\tmflr r0"),
ptext (sLit "\tbcl 20,31,L0$") <> pprCLabel platform lbl,
ptext (sLit "L0$") <> pprCLabel platform lbl <> char ':',
ptext (sLit "\tmflr r11"),
ptext (sLit "\taddis r11,r11,ha16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr-L0$") <> pprCLabel platform lbl <> char ')',
ptext (sLit "\tmtlr r0"),
ptext (sLit "\tlwzu r12,lo16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr-L0$") <> pprCLabel platform lbl
<> ptext (sLit ")(r11)"),
ptext (sLit "\tmtctr r12"),
ptext (sLit "\tbctr")
]
$+$ vcat [
ptext (sLit ".lazy_symbol_pointer"),
ptext (sLit "L") <> pprCLabel platform lbl <> ptext (sLit "$lazy_ptr:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\t.long dyld_stub_binding_helper")]
| Just (SymbolPtr, lbl) <- dynamicLinkerLabelInfo importedLbl
= vcat [
ptext (sLit ".non_lazy_symbol_pointer"),
char 'L' <> pprCLabel platform lbl <> ptext (sLit "$non_lazy_ptr:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\t.long\t0")]
| otherwise
= empty | 2,897 | pprImportedSymbol dflags platform@(Platform { platformArch = ArchPPC, platformOS = OSDarwin }) importedLbl
| Just (CodeStub, lbl) <- dynamicLinkerLabelInfo importedLbl
= case gopt Opt_PIC dflags of
False ->
vcat [
ptext (sLit ".symbol_stub"),
ptext (sLit "L") <> pprCLabel platform lbl <> ptext (sLit "$stub:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\tlis r11,ha16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr)"),
ptext (sLit "\tlwz r12,lo16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr)(r11)"),
ptext (sLit "\tmtctr r12"),
ptext (sLit "\taddi r11,r11,lo16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr)"),
ptext (sLit "\tbctr")
]
True ->
vcat [
ptext (sLit ".section __TEXT,__picsymbolstub1,")
<> ptext (sLit "symbol_stubs,pure_instructions,32"),
ptext (sLit "\t.align 2"),
ptext (sLit "L") <> pprCLabel platform lbl <> ptext (sLit "$stub:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\tmflr r0"),
ptext (sLit "\tbcl 20,31,L0$") <> pprCLabel platform lbl,
ptext (sLit "L0$") <> pprCLabel platform lbl <> char ':',
ptext (sLit "\tmflr r11"),
ptext (sLit "\taddis r11,r11,ha16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr-L0$") <> pprCLabel platform lbl <> char ')',
ptext (sLit "\tmtlr r0"),
ptext (sLit "\tlwzu r12,lo16(L") <> pprCLabel platform lbl
<> ptext (sLit "$lazy_ptr-L0$") <> pprCLabel platform lbl
<> ptext (sLit ")(r11)"),
ptext (sLit "\tmtctr r12"),
ptext (sLit "\tbctr")
]
$+$ vcat [
ptext (sLit ".lazy_symbol_pointer"),
ptext (sLit "L") <> pprCLabel platform lbl <> ptext (sLit "$lazy_ptr:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\t.long dyld_stub_binding_helper")]
| Just (SymbolPtr, lbl) <- dynamicLinkerLabelInfo importedLbl
= vcat [
ptext (sLit ".non_lazy_symbol_pointer"),
char 'L' <> pprCLabel platform lbl <> ptext (sLit "$non_lazy_ptr:"),
ptext (sLit "\t.indirect_symbol") <+> pprCLabel platform lbl,
ptext (sLit "\t.long\t0")]
| otherwise
= empty | 2,837 | true | true | 2 | 17 | 1,148 | 813 | 391 | 422 | null | null |
mikeizbicki/dominion | src/Dominion/Rules.hs | bsd-3-clause | updatePlayerState
:: WhichPlayer
-> (PlayerState -> PlayerState)
-> (GameState -> GameState )
updatePlayerState w f gs = case updatePlayerStateM w (Just . f) gs of
Just gs -> gs | 196 | updatePlayerState
:: WhichPlayer
-> (PlayerState -> PlayerState)
-> (GameState -> GameState )
updatePlayerState w f gs = case updatePlayerStateM w (Just . f) gs of
Just gs -> gs | 196 | updatePlayerState w f gs = case updatePlayerStateM w (Just . f) gs of
Just gs -> gs | 87 | false | true | 2 | 10 | 47 | 72 | 35 | 37 | null | null |
Concelo/concelo | src/Database/Concelo/VMap.hs | bsd-3-clause | delete version key = modify version key (const Nothing) | 55 | delete version key = modify version key (const Nothing) | 55 | delete version key = modify version key (const Nothing) | 55 | false | false | 1 | 7 | 8 | 28 | 11 | 17 | null | null |
aslatter/xhb | build-utils/src/Generate/Build.hs | bsd-3-clause | --
runGenerate :: ReaderData -> Generate a -> a
runGenerate r m = runReader m r | 80 | runGenerate :: ReaderData -> Generate a -> a
runGenerate r m = runReader m r | 76 | runGenerate r m = runReader m r | 31 | true | true | 0 | 8 | 16 | 40 | 17 | 23 | null | null |
ownclo/alohas | src/Common.hs | bsd-3-clause | isConflict _ = False | 20 | isConflict _ = False | 20 | isConflict _ = False | 20 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
philopon/apiary-benchmark | src/wai-routes.hs | mit | returnT :: Text -> Handler App
returnT = runHandlerM . text | 59 | returnT :: Text -> Handler App
returnT = runHandlerM . text | 59 | returnT = runHandlerM . text | 28 | false | true | 0 | 7 | 10 | 28 | 12 | 16 | null | null |
arnabgho/HLearn | src/HLearn/Optimization/Multivariate.hs | bsd-3-clause | fminunc_cgd_ ::
( Hilbert v
, ClassicalLogic v
) => ConjugateMethod v -> MultivariateMinimizer 1 cxt Iterator_cgd v
fminunc_cgd_ conj lineSearch stop x0 f = {-# SCC fminunc_cgd #-}
iterate (step_cgd lineSearch conj f) stop $ Iterator_cgd
{ _cgd_x1 = x0
, _cgd_fx1 = f $ x0
, _cgd_f'x1 = f' $ x0
, _cgd_alpha = 1e-2
, _cgd_f'x0 = 2 *. f' x0
, _cgd_s0 = f' x0
, _cgd_f = (f $)
}
where
f' = (derivative f $) | 496 | fminunc_cgd_ ::
( Hilbert v
, ClassicalLogic v
) => ConjugateMethod v -> MultivariateMinimizer 1 cxt Iterator_cgd v
fminunc_cgd_ conj lineSearch stop x0 f = {-# SCC fminunc_cgd #-}
iterate (step_cgd lineSearch conj f) stop $ Iterator_cgd
{ _cgd_x1 = x0
, _cgd_fx1 = f $ x0
, _cgd_f'x1 = f' $ x0
, _cgd_alpha = 1e-2
, _cgd_f'x0 = 2 *. f' x0
, _cgd_s0 = f' x0
, _cgd_f = (f $)
}
where
f' = (derivative f $) | 496 | fminunc_cgd_ conj lineSearch stop x0 f = {-# SCC fminunc_cgd #-}
iterate (step_cgd lineSearch conj f) stop $ Iterator_cgd
{ _cgd_x1 = x0
, _cgd_fx1 = f $ x0
, _cgd_f'x1 = f' $ x0
, _cgd_alpha = 1e-2
, _cgd_f'x0 = 2 *. f' x0
, _cgd_s0 = f' x0
, _cgd_f = (f $)
}
where
f' = (derivative f $) | 368 | false | true | 1 | 8 | 172 | 167 | 86 | 81 | null | null |
ikuehne/craeft-hs | lib/Craeft/Lexer.hs | gpl-3.0 | parens :: Parser a -> Parser a
parens = Tok.parens lexer | 56 | parens :: Parser a -> Parser a
parens = Tok.parens lexer | 56 | parens = Tok.parens lexer | 25 | false | true | 0 | 7 | 10 | 31 | 13 | 18 | null | null |
pyr/himpy | System/Himpy/Config.hs | mit | get_rcp ("network", _) = NetworkRecipe | 38 | get_rcp ("network", _) = NetworkRecipe | 38 | get_rcp ("network", _) = NetworkRecipe | 38 | false | false | 0 | 6 | 4 | 15 | 8 | 7 | null | null |
Philonous/d-bus | src/DBus/Signature.hs | mit | toSignature' (TypeArray t) = BS.char8 'a' <> toSignature' t | 59 | toSignature' (TypeArray t) = BS.char8 'a' <> toSignature' t | 59 | toSignature' (TypeArray t) = BS.char8 'a' <> toSignature' t | 59 | false | false | 0 | 7 | 8 | 28 | 12 | 16 | null | null |
bananu7/Turnip | src/Turnip/Eval/Eval.hs | mit | opLength :: UnaryOperatorImpl
opLength (Str a) = return [Number . fromIntegral $ length a] | 90 | opLength :: UnaryOperatorImpl
opLength (Str a) = return [Number . fromIntegral $ length a] | 90 | opLength (Str a) = return [Number . fromIntegral $ length a] | 60 | false | true | 0 | 8 | 13 | 37 | 18 | 19 | null | null |
spechub/Hets | HasCASL/ToItem.hs | gpl-2.0 | polyIdToItem :: PolyId -> Item
polyIdToItem i@(PolyId _ _ rg) = mkItem ("OpId", pretty i) rg [] | 95 | polyIdToItem :: PolyId -> Item
polyIdToItem i@(PolyId _ _ rg) = mkItem ("OpId", pretty i) rg [] | 95 | polyIdToItem i@(PolyId _ _ rg) = mkItem ("OpId", pretty i) rg [] | 64 | false | true | 0 | 8 | 16 | 49 | 25 | 24 | null | null |
haskell/haddock | haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | bsd-2-clause | ppSigType :: Unicode -> Qualification -> HideEmptyContexts -> HsSigType DocNameI -> Html
ppSigType unicode qual emptyCtxts sig_ty = ppr_sig_ty (reparenSigType sig_ty) unicode qual emptyCtxts | 191 | ppSigType :: Unicode -> Qualification -> HideEmptyContexts -> HsSigType DocNameI -> Html
ppSigType unicode qual emptyCtxts sig_ty = ppr_sig_ty (reparenSigType sig_ty) unicode qual emptyCtxts | 191 | ppSigType unicode qual emptyCtxts sig_ty = ppr_sig_ty (reparenSigType sig_ty) unicode qual emptyCtxts | 101 | false | true | 0 | 10 | 24 | 59 | 27 | 32 | null | null |
Sgoettschkes/learning | haskell/ProjectEuler/src/Problems/Problem024.hs | mit | perms xs = concatMap (\x -> map (x:) $ perms $ delete x xs) xs | 62 | perms xs = concatMap (\x -> map (x:) $ perms $ delete x xs) xs | 62 | perms xs = concatMap (\x -> map (x:) $ perms $ delete x xs) xs | 62 | false | false | 0 | 11 | 14 | 42 | 21 | 21 | null | null |
lennart/tidal-midi | Sound/Tidal/Tetra.hs | gpl-3.0 | btnfreq = makeF oscPolysynth "btnfreq" | 42 | btnfreq = makeF oscPolysynth "btnfreq" | 42 | btnfreq = makeF oscPolysynth "btnfreq" | 42 | false | false | 0 | 5 | 8 | 11 | 5 | 6 | null | null |
Lykos/Sara | src/lib/Sara/Z3/SymbolicExecutor.hs | gpl-3.0 | symbolicExecuteImpure (Sy.Integer n _ _) = setNewTmpVar ["integer"] Integer $ A.IntConst n | 134 | symbolicExecuteImpure (Sy.Integer n _ _) = setNewTmpVar ["integer"] Integer $ A.IntConst n | 134 | symbolicExecuteImpure (Sy.Integer n _ _) = setNewTmpVar ["integer"] Integer $ A.IntConst n | 134 | false | false | 0 | 8 | 55 | 38 | 18 | 20 | null | null |
sanjoy/echoes | src/Codegen/X86.hs | gpl-3.0 | lirNodeToMachineInst' _ _ (BinOpLN DivLOp _ _ _) = return [
Unimplemented "i not know to divide!"] | 100 | lirNodeToMachineInst' _ _ (BinOpLN DivLOp _ _ _) = return [
Unimplemented "i not know to divide!"] | 100 | lirNodeToMachineInst' _ _ (BinOpLN DivLOp _ _ _) = return [
Unimplemented "i not know to divide!"] | 100 | false | false | 0 | 7 | 18 | 34 | 16 | 18 | null | null |
vollmerm/shallow-fission | tests/n-body/src-acc/Common/Util.hs | bsd-3-clause | -- | Dot product of a vector
--
dot :: (Elt a, IsNum a) => Exp (Vec a) -> Exp (Vec a) -> Exp a
dot v1 v2
= let (x1,y1,z1) = unlift v1
(x2,y2,z2) = unlift v2
in
x1 * x2 + y1 * y2 + z1 * z2 | 205 | dot :: (Elt a, IsNum a) => Exp (Vec a) -> Exp (Vec a) -> Exp a
dot v1 v2
= let (x1,y1,z1) = unlift v1
(x2,y2,z2) = unlift v2
in
x1 * x2 + y1 * y2 + z1 * z2 | 173 | dot v1 v2
= let (x1,y1,z1) = unlift v1
(x2,y2,z2) = unlift v2
in
x1 * x2 + y1 * y2 + z1 * z2 | 110 | true | true | 0 | 11 | 67 | 129 | 64 | 65 | null | null |
maximkulkin/aeson | examples/Simplest.hs | bsd-3-clause | parseJSON _ = empty | 28 | parseJSON _ = empty | 28 | parseJSON _ = empty | 28 | false | false | 0 | 4 | 12 | 10 | 4 | 6 | null | null |
fmapfmapfmap/amazonka | amazonka-swf/test/Test/AWS/Gen/SWF.hs | mpl-2.0 | -- Responses
testListOpenWorkflowExecutionsResponse :: WorkflowExecutionInfos -> TestTree
testListOpenWorkflowExecutionsResponse = res
"ListOpenWorkflowExecutionsResponse"
"fixture/ListOpenWorkflowExecutionsResponse.proto"
sWF
(Proxy :: Proxy ListOpenWorkflowExecutions) | 287 | testListOpenWorkflowExecutionsResponse :: WorkflowExecutionInfos -> TestTree
testListOpenWorkflowExecutionsResponse = res
"ListOpenWorkflowExecutionsResponse"
"fixture/ListOpenWorkflowExecutionsResponse.proto"
sWF
(Proxy :: Proxy ListOpenWorkflowExecutions) | 273 | testListOpenWorkflowExecutionsResponse = res
"ListOpenWorkflowExecutionsResponse"
"fixture/ListOpenWorkflowExecutionsResponse.proto"
sWF
(Proxy :: Proxy ListOpenWorkflowExecutions) | 196 | true | true | 0 | 6 | 33 | 37 | 18 | 19 | null | null |
qnikst/ygruq | Handler/Quote.hs | bsd-2-clause | getQuoteShowR :: QuoteId -> Handler RepHtml
getQuoteShowR q = do
quote <- runDB $ get404 q
defaultLayout $ do
let quoteId = Just q
$(widgetFile "quote-show") | 181 | getQuoteShowR :: QuoteId -> Handler RepHtml
getQuoteShowR q = do
quote <- runDB $ get404 q
defaultLayout $ do
let quoteId = Just q
$(widgetFile "quote-show") | 181 | getQuoteShowR q = do
quote <- runDB $ get404 q
defaultLayout $ do
let quoteId = Just q
$(widgetFile "quote-show") | 137 | false | true | 0 | 13 | 49 | 64 | 28 | 36 | null | null |
nandor/hcasm | HCasm.hs | bsd-3-clause | -- Parses the newline character
eol :: Parsec String u ()
eol
= void $ many1 (oneOf "\r\n") | 93 | eol :: Parsec String u ()
eol
= void $ many1 (oneOf "\r\n") | 61 | eol
= void $ many1 (oneOf "\r\n") | 35 | true | true | 0 | 8 | 19 | 36 | 17 | 19 | null | null |
mbakke/ganeti | src/Ganeti/Storage/Drbd/Parser.hs | bsd-2-clause | -- | Skips spaces and the given string, then executes a parser and
-- returns its result.
skipSpacesAndString :: Text -> Parser a -> Parser a
skipSpacesAndString s parser =
skipSpaces
*> A.string s
*> parser | 213 | skipSpacesAndString :: Text -> Parser a -> Parser a
skipSpacesAndString s parser =
skipSpaces
*> A.string s
*> parser | 123 | skipSpacesAndString s parser =
skipSpaces
*> A.string s
*> parser | 71 | true | true | 4 | 8 | 41 | 54 | 25 | 29 | null | null |
brodyberg/Notes | addition/WordNumber.hs | mit | digitToWord :: Int -> Maybe String
digitToWord n =
case n of
0 -> Just "zero"
1 -> Just "one"
2 -> Just "two"
3 -> Just "three"
4 -> Just "four"
5 -> Just "five"
6 -> Just "six"
7 -> Just "seven"
8 -> Just "eight"
9 -> Just "nine"
_ -> Nothing
-- words :: String -> [String]
-- words s = | 336 | digitToWord :: Int -> Maybe String
digitToWord n =
case n of
0 -> Just "zero"
1 -> Just "one"
2 -> Just "two"
3 -> Just "three"
4 -> Just "four"
5 -> Just "five"
6 -> Just "six"
7 -> Just "seven"
8 -> Just "eight"
9 -> Just "nine"
_ -> Nothing
-- words :: String -> [String]
-- words s = | 336 | digitToWord n =
case n of
0 -> Just "zero"
1 -> Just "one"
2 -> Just "two"
3 -> Just "three"
4 -> Just "four"
5 -> Just "five"
6 -> Just "six"
7 -> Just "seven"
8 -> Just "eight"
9 -> Just "nine"
_ -> Nothing
-- words :: String -> [String]
-- words s = | 301 | false | true | 2 | 6 | 113 | 63 | 48 | 15 | null | null |
zaxtax/hakaru | haskell/Language/Hakaru/Sample.hs | bsd-3-clause | runEvaluate
:: (ABT Term abt)
=> abt '[] a
-> Value a
runEvaluate prog = evaluate prog emptyEnv | 107 | runEvaluate
:: (ABT Term abt)
=> abt '[] a
-> Value a
runEvaluate prog = evaluate prog emptyEnv | 107 | runEvaluate prog = evaluate prog emptyEnv | 41 | false | true | 0 | 10 | 29 | 51 | 23 | 28 | null | null |
vollmerm/accelerate-apart | Data/Array/Accelerate/Apart/Exp.hs | bsd-3-clause | minToC (NumScalarType ty@(FloatingNumType _)) a b = ccall (ty `postfix` "fmin") [a,b] | 85 | minToC (NumScalarType ty@(FloatingNumType _)) a b = ccall (ty `postfix` "fmin") [a,b] | 85 | minToC (NumScalarType ty@(FloatingNumType _)) a b = ccall (ty `postfix` "fmin") [a,b] | 85 | false | false | 0 | 10 | 11 | 48 | 26 | 22 | null | null |
DimaSamoz/thodo | src/Parsing.hs | mit | parseGroup :: Parsec String () TaskGroup
parseGroup = do
category <- parseCategory
notasks <- tryNoTasks
tasks <- if notasks
then return []
else case category of
RelTime rt -> many $ try (parseTask (Rel rt))
Custom _ -> many $ try (parseTask None)
return TaskGroup {_category = category, _tasks = tasks} | 379 | parseGroup :: Parsec String () TaskGroup
parseGroup = do
category <- parseCategory
notasks <- tryNoTasks
tasks <- if notasks
then return []
else case category of
RelTime rt -> many $ try (parseTask (Rel rt))
Custom _ -> many $ try (parseTask None)
return TaskGroup {_category = category, _tasks = tasks} | 379 | parseGroup = do
category <- parseCategory
notasks <- tryNoTasks
tasks <- if notasks
then return []
else case category of
RelTime rt -> many $ try (parseTask (Rel rt))
Custom _ -> many $ try (parseTask None)
return TaskGroup {_category = category, _tasks = tasks} | 338 | false | true | 1 | 18 | 126 | 133 | 62 | 71 | null | null |
nakamuray/htig | HTIG/IRCServer/Main.hs | bsd-3-clause | runSession :: (ISession s g l) => TVar g -> Server s g l -> Connection -> IO ()
runSession g srv conn = do
debug ("start session for" :: String, conn)
l <- newTVarIO =<< initLocal srv
s <- initSession srv conn
-- TODO: handle exception
runIRCM (runSession' s) g l conn | 288 | runSession :: (ISession s g l) => TVar g -> Server s g l -> Connection -> IO ()
runSession g srv conn = do
debug ("start session for" :: String, conn)
l <- newTVarIO =<< initLocal srv
s <- initSession srv conn
-- TODO: handle exception
runIRCM (runSession' s) g l conn | 288 | runSession g srv conn = do
debug ("start session for" :: String, conn)
l <- newTVarIO =<< initLocal srv
s <- initSession srv conn
-- TODO: handle exception
runIRCM (runSession' s) g l conn | 208 | false | true | 0 | 10 | 72 | 118 | 56 | 62 | null | null |
mortberg/AlgTop | Algebra/SNF_SparseF2.hs | bsd-3-clause | -- Maximum dimensiom of random matrices
size :: Int
size = 50 | 61 | size :: Int
size = 50 | 21 | size = 50 | 9 | true | true | 0 | 6 | 11 | 19 | 8 | 11 | null | null |
DarkEld3r/hGitStats | gitWrappers/Oid.hs | bsd-3-clause | oidFromStr :: String -> IO Oid
oidFromStr hash = do
oid <- oidCreate
checkResult (withCString hash $ \hash' -> git_oid_fromstr oid hash')
$ "git_oid_fromstr(" ++ hash ++ ") failed."
return oid | 203 | oidFromStr :: String -> IO Oid
oidFromStr hash = do
oid <- oidCreate
checkResult (withCString hash $ \hash' -> git_oid_fromstr oid hash')
$ "git_oid_fromstr(" ++ hash ++ ") failed."
return oid | 203 | oidFromStr hash = do
oid <- oidCreate
checkResult (withCString hash $ \hash' -> git_oid_fromstr oid hash')
$ "git_oid_fromstr(" ++ hash ++ ") failed."
return oid | 172 | false | true | 0 | 14 | 41 | 72 | 33 | 39 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpInfo JBool2IntOp = mkGenPrimOp (fsLit "jbool2int#") [] [jboolPrimTy] intPrimTy | 85 | primOpInfo JBool2IntOp = mkGenPrimOp (fsLit "jbool2int#") [] [jboolPrimTy] intPrimTy | 85 | primOpInfo JBool2IntOp = mkGenPrimOp (fsLit "jbool2int#") [] [jboolPrimTy] intPrimTy | 85 | false | false | 0 | 7 | 9 | 29 | 14 | 15 | null | null |
opentower/carnap | Carnap-Server/Handler/Instuctor.hs | gpl-3.0 | saveTo thedir fn file = do
datadir <- appDataRoot <$> (appSettings <$> getYesod)
let path = datadir </> thedir
liftIO $
do createDirectoryIfMissing True path
e <- doesFileExist (path </> fn)
if e then removeFile (path </> fn) else return ()
fileMove file (path </> fn) | 350 | saveTo thedir fn file = do
datadir <- appDataRoot <$> (appSettings <$> getYesod)
let path = datadir </> thedir
liftIO $
do createDirectoryIfMissing True path
e <- doesFileExist (path </> fn)
if e then removeFile (path </> fn) else return ()
fileMove file (path </> fn) | 350 | saveTo thedir fn file = do
datadir <- appDataRoot <$> (appSettings <$> getYesod)
let path = datadir </> thedir
liftIO $
do createDirectoryIfMissing True path
e <- doesFileExist (path </> fn)
if e then removeFile (path </> fn) else return ()
fileMove file (path </> fn) | 350 | false | false | 0 | 13 | 127 | 117 | 55 | 62 | null | null |
ganeti-github-testing/ganeti-test-1 | test/hs/Test/Ganeti/Ssconf.hs | bsd-2-clause | prop_filename :: Ssconf.SSKey -> Property
prop_filename key =
printTestCase "Key doesn't start with correct prefix" $
Ssconf.sSFilePrefix `isPrefixOf` Ssconf.keyToFilename "" key | 184 | prop_filename :: Ssconf.SSKey -> Property
prop_filename key =
printTestCase "Key doesn't start with correct prefix" $
Ssconf.sSFilePrefix `isPrefixOf` Ssconf.keyToFilename "" key | 184 | prop_filename key =
printTestCase "Key doesn't start with correct prefix" $
Ssconf.sSFilePrefix `isPrefixOf` Ssconf.keyToFilename "" key | 142 | false | true | 0 | 7 | 26 | 42 | 21 | 21 | null | null |
termite2/tsl | Frontend/StatementInline.hs | bsd-3-clause | statSimplify' (SCase p _ c cs md) = -- Case labels must be side-effect-free, so it is ok to
-- evaluate them in advance
do (ssc,c') <- exprSimplify c
(sscs,clabs') <- (liftM unzip) $ mapM exprSimplify (fst $ unzip cs)
cstats <- mapM statSimplify (snd $ unzip cs)
md' <- Tr.sequence $ fmap statSimplify md
return $ concat sscs ++ ssc ++ [SCase p Nothing c' (zip clabs' cstats) md'] | 687 | statSimplify' (SCase p _ c cs md) = -- Case labels must be side-effect-free, so it is ok to
-- evaluate them in advance
do (ssc,c') <- exprSimplify c
(sscs,clabs') <- (liftM unzip) $ mapM exprSimplify (fst $ unzip cs)
cstats <- mapM statSimplify (snd $ unzip cs)
md' <- Tr.sequence $ fmap statSimplify md
return $ concat sscs ++ ssc ++ [SCase p Nothing c' (zip clabs' cstats) md'] | 687 | statSimplify' (SCase p _ c cs md) = -- Case labels must be side-effect-free, so it is ok to
-- evaluate them in advance
do (ssc,c') <- exprSimplify c
(sscs,clabs') <- (liftM unzip) $ mapM exprSimplify (fst $ unzip cs)
cstats <- mapM statSimplify (snd $ unzip cs)
md' <- Tr.sequence $ fmap statSimplify md
return $ concat sscs ++ ssc ++ [SCase p Nothing c' (zip clabs' cstats) md'] | 687 | false | false | 0 | 12 | 376 | 160 | 77 | 83 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/Pretty/Concrete.hs | bsd-3-clause | ppPrimOp p Nor (e1 :* e2 :* End) = ppApply2 p "nor" e1 e2 | 66 | ppPrimOp p Nor (e1 :* e2 :* End) = ppApply2 p "nor" e1 e2 | 66 | ppPrimOp p Nor (e1 :* e2 :* End) = ppApply2 p "nor" e1 e2 | 66 | false | false | 0 | 8 | 22 | 36 | 16 | 20 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/WebGLRenderingContextBase.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContextBase.isBuffer Mozilla WebGLRenderingContextBase.isBuffer documentation>
isBuffer_ ::
(MonadDOM m, IsWebGLRenderingContextBase self) =>
self -> Maybe WebGLBuffer -> m ()
isBuffer_ self buffer
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "isBuffer"
[toJSVal buffer])) | 407 | isBuffer_ ::
(MonadDOM m, IsWebGLRenderingContextBase self) =>
self -> Maybe WebGLBuffer -> m ()
isBuffer_ self buffer
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "isBuffer"
[toJSVal buffer])) | 258 | isBuffer_ self buffer
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "isBuffer"
[toJSVal buffer])) | 139 | true | true | 0 | 12 | 84 | 86 | 41 | 45 | null | null |
cnc-patch/disass | src/Language/Assembly/X86.hs | bsd-3-clause | instrToString :: [Instruction] -> ShowStyle -> [[Char]]
instrToString insts style =
map showInstr insts
where
showInstr = case style of
IntelStyle -> showIntel
AttStyle -> showAtt
-- | Test function for disassembling the contents of a binary file and
-- displaying it in the provided style ("IntelStyle" or "AttStyle"). | 344 | instrToString :: [Instruction] -> ShowStyle -> [[Char]]
instrToString insts style =
map showInstr insts
where
showInstr = case style of
IntelStyle -> showIntel
AttStyle -> showAtt
-- | Test function for disassembling the contents of a binary file and
-- displaying it in the provided style ("IntelStyle" or "AttStyle"). | 344 | instrToString insts style =
map showInstr insts
where
showInstr = case style of
IntelStyle -> showIntel
AttStyle -> showAtt
-- | Test function for disassembling the contents of a binary file and
-- displaying it in the provided style ("IntelStyle" or "AttStyle"). | 288 | false | true | 0 | 8 | 73 | 64 | 34 | 30 | null | null |
dimara/ganeti | src/Ganeti/Daemon.hs | bsd-2-clause | oForceNode :: OptType
oForceNode =
(Option "" ["force-node"]
(NoArg (\ opts -> Ok opts { optForceNode = True }))
"Force the daemon to run on a different node than the master",
OptComplNone) | 200 | oForceNode :: OptType
oForceNode =
(Option "" ["force-node"]
(NoArg (\ opts -> Ok opts { optForceNode = True }))
"Force the daemon to run on a different node than the master",
OptComplNone) | 200 | oForceNode =
(Option "" ["force-node"]
(NoArg (\ opts -> Ok opts { optForceNode = True }))
"Force the daemon to run on a different node than the master",
OptComplNone) | 178 | false | true | 0 | 14 | 42 | 61 | 31 | 30 | null | null |
thoughtpolice/binary-serialise-cbor | Data/Binary/Serialise/CBOR/Read.hs | bsd-3-clause | tryConsumeStringIndef :: Word8 -> DecodedToken ()
tryConsumeStringIndef hdr = case fromIntegral hdr :: Word of
0x7f -> DecodedToken 1 ()
_ -> DecodeFailure
| 165 | tryConsumeStringIndef :: Word8 -> DecodedToken ()
tryConsumeStringIndef hdr = case fromIntegral hdr :: Word of
0x7f -> DecodedToken 1 ()
_ -> DecodeFailure
| 165 | tryConsumeStringIndef hdr = case fromIntegral hdr :: Word of
0x7f -> DecodedToken 1 ()
_ -> DecodeFailure
| 115 | false | true | 4 | 7 | 32 | 52 | 25 | 27 | null | null |
fmapfmapfmap/amazonka | amazonka-iam/gen/Network/AWS/IAM/ListRolePolicies.hs | mpl-2.0 | -- | The response status code.
lrprsResponseStatus :: Lens' ListRolePoliciesResponse Int
lrprsResponseStatus = lens _lrprsResponseStatus (\ s a -> s{_lrprsResponseStatus = a}) | 175 | lrprsResponseStatus :: Lens' ListRolePoliciesResponse Int
lrprsResponseStatus = lens _lrprsResponseStatus (\ s a -> s{_lrprsResponseStatus = a}) | 144 | lrprsResponseStatus = lens _lrprsResponseStatus (\ s a -> s{_lrprsResponseStatus = a}) | 86 | true | true | 0 | 9 | 21 | 40 | 22 | 18 | null | null |
michel-steuwer/haskell-patterns | src/Patterns.hs | mit | vecSum1 xs = vecSum0 . join . mapWorkgroup (
join . toGlobal (mapLocal (mapSeq id)) . split 1 .
iterate (log2 wgSize) (
join . mapLocal (reduceSeq (+) 0) . split 2
) .
join . toLocal (mapLocal (mapSeq id)) . split 1
) . split wgSize $ xs
where wgSize = 128 | 308 | vecSum1 xs = vecSum0 . join . mapWorkgroup (
join . toGlobal (mapLocal (mapSeq id)) . split 1 .
iterate (log2 wgSize) (
join . mapLocal (reduceSeq (+) 0) . split 2
) .
join . toLocal (mapLocal (mapSeq id)) . split 1
) . split wgSize $ xs
where wgSize = 128 | 308 | vecSum1 xs = vecSum0 . join . mapWorkgroup (
join . toGlobal (mapLocal (mapSeq id)) . split 1 .
iterate (log2 wgSize) (
join . mapLocal (reduceSeq (+) 0) . split 2
) .
join . toLocal (mapLocal (mapSeq id)) . split 1
) . split wgSize $ xs
where wgSize = 128 | 308 | false | false | 0 | 20 | 104 | 140 | 67 | 73 | null | null |
haskell-distributed/distributed-process-client-server | src/Control/Distributed/Process/ManagedProcess/Server.hs | bsd-3-clause | mkReply :: (Serializable b)
=> CallRef b
-> ProcessReply b s
-> Process (ProcessAction s)
mkReply cRef act
| (NoReply a) <- act = return a
| (CallRef (_, tg')) <- cRef
, (ProcessReply r' a) <- act = sendTo cRef (CallResponse r' tg') >> return a
| (CallRef (_, ct')) <- cRef
, (ProcessReject r' a) <- act = sendTo cRef (CallRejected r' ct') >> return a
| otherwise = die $ ExitOther "mkReply.InvalidState" | 476 | mkReply :: (Serializable b)
=> CallRef b
-> ProcessReply b s
-> Process (ProcessAction s)
mkReply cRef act
| (NoReply a) <- act = return a
| (CallRef (_, tg')) <- cRef
, (ProcessReply r' a) <- act = sendTo cRef (CallResponse r' tg') >> return a
| (CallRef (_, ct')) <- cRef
, (ProcessReject r' a) <- act = sendTo cRef (CallRejected r' ct') >> return a
| otherwise = die $ ExitOther "mkReply.InvalidState" | 476 | mkReply cRef act
| (NoReply a) <- act = return a
| (CallRef (_, tg')) <- cRef
, (ProcessReply r' a) <- act = sendTo cRef (CallResponse r' tg') >> return a
| (CallRef (_, ct')) <- cRef
, (ProcessReject r' a) <- act = sendTo cRef (CallRejected r' ct') >> return a
| otherwise = die $ ExitOther "mkReply.InvalidState" | 362 | false | true | 1 | 11 | 146 | 213 | 102 | 111 | null | null |
rvion/lamdu | Lamdu/GUI/ExpressionEdit/HoleEdit/ResultGroups.hs | gpl-3.0 | mResultsListOf holeInfo baseId (x:xs) = Just
ResultsList
{ _rlPreferred = NotPreferred
, _rlExtraResultsPrefixId = extraResultsPrefixId
, _rlMain = mkResult (prefix <> baseId) x
, _rlExtra = zipWith mkExtra [(0::Int)..] xs
}
where
prefix = prefixId (ehiInfo holeInfo)
mkExtra = mkResult . extraResultId
extraResultId i = mappend extraResultsPrefixId $ WidgetIds.hash i
extraResultsPrefixId = prefix <> WidgetId.Id ["extra results"] <> baseId
mkResult resultId (typ, holeResult) =
Result
{ rType = typ
, rHoleResult = holeResult
, rId = resultId
} | 674 | mResultsListOf holeInfo baseId (x:xs) = Just
ResultsList
{ _rlPreferred = NotPreferred
, _rlExtraResultsPrefixId = extraResultsPrefixId
, _rlMain = mkResult (prefix <> baseId) x
, _rlExtra = zipWith mkExtra [(0::Int)..] xs
}
where
prefix = prefixId (ehiInfo holeInfo)
mkExtra = mkResult . extraResultId
extraResultId i = mappend extraResultsPrefixId $ WidgetIds.hash i
extraResultsPrefixId = prefix <> WidgetId.Id ["extra results"] <> baseId
mkResult resultId (typ, holeResult) =
Result
{ rType = typ
, rHoleResult = holeResult
, rId = resultId
} | 674 | mResultsListOf holeInfo baseId (x:xs) = Just
ResultsList
{ _rlPreferred = NotPreferred
, _rlExtraResultsPrefixId = extraResultsPrefixId
, _rlMain = mkResult (prefix <> baseId) x
, _rlExtra = zipWith mkExtra [(0::Int)..] xs
}
where
prefix = prefixId (ehiInfo holeInfo)
mkExtra = mkResult . extraResultId
extraResultId i = mappend extraResultsPrefixId $ WidgetIds.hash i
extraResultsPrefixId = prefix <> WidgetId.Id ["extra results"] <> baseId
mkResult resultId (typ, holeResult) =
Result
{ rType = typ
, rHoleResult = holeResult
, rId = resultId
} | 674 | false | false | 4 | 11 | 205 | 186 | 99 | 87 | null | null |
GaloisInc/pads-haskell | Examples/First.hs | bsd-3-clause | input_AB = "ab" | 15 | input_AB = "ab" | 15 | input_AB = "ab" | 15 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
MP2E/XMonadContrib | XMonad/Actions/DynamicWorkspaces.hs | bsd-3-clause | -- $usage
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@ file:
--
-- > import XMonad.Actions.DynamicWorkspaces
-- > import XMonad.Actions.CopyWindow(copy)
--
-- Then add keybindings like the following:
--
-- > , ((modm .|. shiftMask, xK_BackSpace), removeWorkspace)
-- > , ((modm .|. shiftMask, xK_v ), selectWorkspace def)
-- > , ((modm, xK_m ), withWorkspace def (windows . W.shift))
-- > , ((modm .|. shiftMask, xK_m ), withWorkspace def (windows . copy))
-- > , ((modm .|. shiftMask, xK_r ), renameWorkspace def)
--
-- > -- mod-[1..9] %! Switch to workspace N
-- > -- mod-shift-[1..9] %! Move client to workspace N
-- > ++
-- > zip (zip (repeat (modm)) [xK_1..xK_9]) (map (withNthWorkspace W.greedyView) [0..])
-- > ++
-- > zip (zip (repeat (modm .|. shiftMask)) [xK_1..xK_9]) (map (withNthWorkspace W.shift) [0..])
--
-- For detailed instructions on editing your key bindings, see
-- "XMonad.Doc.Extending#Editing_key_bindings". See also the documentation for
-- "XMonad.Actions.CopyWindow", 'windows', 'shift', and 'XPConfig'.
mkCompl :: [String] -> String -> IO [String]
mkCompl l s = return $ filter (\x -> take (length s) x == s) l | 1,235 | mkCompl :: [String] -> String -> IO [String]
mkCompl l s = return $ filter (\x -> take (length s) x == s) l | 107 | mkCompl l s = return $ filter (\x -> take (length s) x == s) l | 62 | true | true | 0 | 12 | 246 | 93 | 58 | 35 | null | null |
phischu/fragnix | builtins/base/Data.List.NonEmpty.hs | bsd-3-clause | -- | Converts a normal list to a 'NonEmpty' stream.
--
-- Raises an error if given an empty list.
fromList :: [a] -> NonEmpty a
fromList (a:as) = a :| as | 153 | fromList :: [a] -> NonEmpty a
fromList (a:as) = a :| as | 55 | fromList (a:as) = a :| as | 25 | true | true | 0 | 7 | 31 | 38 | 21 | 17 | null | null |
meiersi/blaze-builder | Criterion/ScalingBenchmark.hs | bsd-3-clause | -- Main function
----------------
main :: IO ()
main = do
let config = defaultConfig
env <- withConfig config measureEnvironment
mapM_ (runAndPlot config env)
[ (compressComparison, defaultPlotConfig { pcLogYAxis = False })
, (packComparison, defaultPlotConfig)
, (zoomedPackComparison, defaultPlotConfig)
]
where
runAndPlot config env (sc, plotConfig) = do
sc' <- withConfig config $ runScalingComparison env sc
mkPlots sc' plotConfig
mkPlots sc plotConfig = sequence_
[ plotScalingComparison outType
(plotConfig {pcBoxPlot = doBoxPlot}) conv sc
| outType <- outTypes PDF ++ outTypes PNG,
doBoxPlot <- [True, False]
]
where
conv = fromIntegral :: Int -> Double
outTypes f = map (uncurry f) [(640,480),(800,600),(1280,1024)]
-- | Comparison of different implementations of packing [Word8]. | 918 | main :: IO ()
main = do
let config = defaultConfig
env <- withConfig config measureEnvironment
mapM_ (runAndPlot config env)
[ (compressComparison, defaultPlotConfig { pcLogYAxis = False })
, (packComparison, defaultPlotConfig)
, (zoomedPackComparison, defaultPlotConfig)
]
where
runAndPlot config env (sc, plotConfig) = do
sc' <- withConfig config $ runScalingComparison env sc
mkPlots sc' plotConfig
mkPlots sc plotConfig = sequence_
[ plotScalingComparison outType
(plotConfig {pcBoxPlot = doBoxPlot}) conv sc
| outType <- outTypes PDF ++ outTypes PNG,
doBoxPlot <- [True, False]
]
where
conv = fromIntegral :: Int -> Double
outTypes f = map (uncurry f) [(640,480),(800,600),(1280,1024)]
-- | Comparison of different implementations of packing [Word8]. | 883 | main = do
let config = defaultConfig
env <- withConfig config measureEnvironment
mapM_ (runAndPlot config env)
[ (compressComparison, defaultPlotConfig { pcLogYAxis = False })
, (packComparison, defaultPlotConfig)
, (zoomedPackComparison, defaultPlotConfig)
]
where
runAndPlot config env (sc, plotConfig) = do
sc' <- withConfig config $ runScalingComparison env sc
mkPlots sc' plotConfig
mkPlots sc plotConfig = sequence_
[ plotScalingComparison outType
(plotConfig {pcBoxPlot = doBoxPlot}) conv sc
| outType <- outTypes PDF ++ outTypes PNG,
doBoxPlot <- [True, False]
]
where
conv = fromIntegral :: Int -> Double
outTypes f = map (uncurry f) [(640,480),(800,600),(1280,1024)]
-- | Comparison of different implementations of packing [Word8]. | 869 | true | true | 0 | 11 | 237 | 267 | 142 | 125 | null | null |
brendanhay/gogol | gogol-analyticsreporting/gen/Network/Google/AnalyticsReporting/Types/Product.hs | mpl-2.0 | -- | URL of the page where this goal was completed.
gdGoalCompletionLocation :: Lens' GoalData (Maybe Text)
gdGoalCompletionLocation
= lens _gdGoalCompletionLocation
(\ s a -> s{_gdGoalCompletionLocation = a}) | 217 | gdGoalCompletionLocation :: Lens' GoalData (Maybe Text)
gdGoalCompletionLocation
= lens _gdGoalCompletionLocation
(\ s a -> s{_gdGoalCompletionLocation = a}) | 165 | gdGoalCompletionLocation
= lens _gdGoalCompletionLocation
(\ s a -> s{_gdGoalCompletionLocation = a}) | 109 | true | true | 2 | 9 | 35 | 55 | 25 | 30 | null | null |
wereHamster/publicsuffix-haskell | src/Data/PublicSuffix.hs | mit | registeredDomain :: String -> Maybe String
registeredDomain domain = if domain == suffix
then Nothing
else Just $ mconcat $ intersperse "." $ reverse $ take (suffixLabelsLength + 1) domainLabels
where
suffix = publicSuffix domain
suffixLabelsLength = length $ toLabels suffix
domainLabels = reverse $ toLabels domain | 357 | registeredDomain :: String -> Maybe String
registeredDomain domain = if domain == suffix
then Nothing
else Just $ mconcat $ intersperse "." $ reverse $ take (suffixLabelsLength + 1) domainLabels
where
suffix = publicSuffix domain
suffixLabelsLength = length $ toLabels suffix
domainLabels = reverse $ toLabels domain | 357 | registeredDomain domain = if domain == suffix
then Nothing
else Just $ mconcat $ intersperse "." $ reverse $ take (suffixLabelsLength + 1) domainLabels
where
suffix = publicSuffix domain
suffixLabelsLength = length $ toLabels suffix
domainLabels = reverse $ toLabels domain | 314 | false | true | 2 | 8 | 87 | 103 | 50 | 53 | null | null |
conal/ghc-mod | GHCMod.hs | bsd-3-clause | toLisp :: [String] -> String
toLisp ms = "(" ++ unwords quoted ++ ")\n"
where
quote x = "\"" ++ x ++ "\""
quoted = map quote ms | 143 | toLisp :: [String] -> String
toLisp ms = "(" ++ unwords quoted ++ ")\n"
where
quote x = "\"" ++ x ++ "\""
quoted = map quote ms | 143 | toLisp ms = "(" ++ unwords quoted ++ ")\n"
where
quote x = "\"" ++ x ++ "\""
quoted = map quote ms | 114 | false | true | 6 | 7 | 43 | 75 | 31 | 44 | null | null |
brendanhay/gogol | gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs | mpl-2.0 | -- | Resource type for include conditions.
icKind :: Lens' IncludeConditions Text
icKind = lens _icKind (\ s a -> s{_icKind = a}) | 129 | icKind :: Lens' IncludeConditions Text
icKind = lens _icKind (\ s a -> s{_icKind = a}) | 86 | icKind = lens _icKind (\ s a -> s{_icKind = a}) | 47 | true | true | 0 | 9 | 22 | 40 | 22 | 18 | null | null |
duairc/pipes | src/Control/Pipe/Text.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Similar to 'iterate', except the iteration function is monadic.
iterateM :: Monad m => (Char -> m Char) -> Char -> Producer Text m b
iterateM f a = PL.iterateM f a >+> pipe T.singleton | 268 | iterateM :: Monad m => (Char -> m Char) -> Char -> Producer Text m b
iterateM f a = PL.iterateM f a >+> pipe T.singleton | 120 | iterateM f a = PL.iterateM f a >+> pipe T.singleton | 51 | true | true | 0 | 10 | 37 | 70 | 33 | 37 | null | null |
ardumont/haskell-lab | test/AnagramTests.hs | gpl-2.0 | testSentenceAnagrams1 :: Test.HUnit.Test
testSentenceAnagrams1 = [["en","as","my"],
["en","my","as"],
["man","yes"],
["men","say"],
["as","en","my"],
["as","my","en"],
["sane","my"],
["Sean","my"],
["my","en","as"],
["my","as","en"],
["my","sane"],
["my","Sean"],
["say","men"],
["yes","man"]]
~=?
sentenceAnagrams ["yes", "man"] dicoYesMan
where dicoYesMan = dicoByOccurrences ["en", "as", "my",
"en", "my", "as",
"man", "yes", "men",
"say", "as", "en",
"my", "as", "my",
"en", "sane", "my",
"Sean", "my", "my",
"en", "as", "my",
"as", "en", "my",
"sane", "my", "Sean",
"say", "men", "yes",
"man"] | 1,427 | testSentenceAnagrams1 :: Test.HUnit.Test
testSentenceAnagrams1 = [["en","as","my"],
["en","my","as"],
["man","yes"],
["men","say"],
["as","en","my"],
["as","my","en"],
["sane","my"],
["Sean","my"],
["my","en","as"],
["my","as","en"],
["my","sane"],
["my","Sean"],
["say","men"],
["yes","man"]]
~=?
sentenceAnagrams ["yes", "man"] dicoYesMan
where dicoYesMan = dicoByOccurrences ["en", "as", "my",
"en", "my", "as",
"man", "yes", "men",
"say", "as", "en",
"my", "as", "my",
"en", "sane", "my",
"Sean", "my", "my",
"en", "as", "my",
"as", "en", "my",
"sane", "my", "Sean",
"say", "men", "yes",
"man"] | 1,427 | testSentenceAnagrams1 = [["en","as","my"],
["en","my","as"],
["man","yes"],
["men","say"],
["as","en","my"],
["as","my","en"],
["sane","my"],
["Sean","my"],
["my","en","as"],
["my","as","en"],
["my","sane"],
["my","Sean"],
["say","men"],
["yes","man"]]
~=?
sentenceAnagrams ["yes", "man"] dicoYesMan
where dicoYesMan = dicoByOccurrences ["en", "as", "my",
"en", "my", "as",
"man", "yes", "men",
"say", "as", "en",
"my", "as", "my",
"en", "sane", "my",
"Sean", "my", "my",
"en", "as", "my",
"as", "en", "my",
"sane", "my", "Sean",
"say", "men", "yes",
"man"] | 1,386 | false | true | 0 | 7 | 890 | 286 | 185 | 101 | null | null |
rueshyna/gogol | gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'PlayListStatus' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'plsPrivacyStatus'
playListStatus
:: PlayListStatus
playListStatus =
PlayListStatus'
{ _plsPrivacyStatus = Nothing
} | 306 | playListStatus
:: PlayListStatus
playListStatus =
PlayListStatus'
{ _plsPrivacyStatus = Nothing
} | 113 | playListStatus =
PlayListStatus'
{ _plsPrivacyStatus = Nothing
} | 76 | true | true | 0 | 6 | 60 | 24 | 16 | 8 | null | null |
egison/egison | hs-src/Language/Egison/Desugar.hs | mit | desugarPattern' (InductiveOrPApplyPat name pats) = IInductiveOrPApplyPat name <$> mapM desugarPattern' pats | 107 | desugarPattern' (InductiveOrPApplyPat name pats) = IInductiveOrPApplyPat name <$> mapM desugarPattern' pats | 107 | desugarPattern' (InductiveOrPApplyPat name pats) = IInductiveOrPApplyPat name <$> mapM desugarPattern' pats | 107 | false | false | 0 | 7 | 10 | 29 | 13 | 16 | null | null |
bitemyapp/ganeti | src/Ganeti/HTools/Loader.hs | bsd-2-clause | -- | Given am indexed node list, and the name of the master, mark it as such.
setMaster :: (Monad m) => NameAssoc -> Node.List -> String -> m Node.List
setMaster node_names node_idx master = do
kmaster <- maybe (fail $ "Master node " ++ master ++ " unknown") return $
M.lookup master node_names
let mnode = Container.find kmaster node_idx
return $ Container.add kmaster (Node.setMaster mnode True) node_idx
-- | Given the nodes with the location tags already set correctly, compute
-- the location score for an instance. | 540 | setMaster :: (Monad m) => NameAssoc -> Node.List -> String -> m Node.List
setMaster node_names node_idx master = do
kmaster <- maybe (fail $ "Master node " ++ master ++ " unknown") return $
M.lookup master node_names
let mnode = Container.find kmaster node_idx
return $ Container.add kmaster (Node.setMaster mnode True) node_idx
-- | Given the nodes with the location tags already set correctly, compute
-- the location score for an instance. | 462 | setMaster node_names node_idx master = do
kmaster <- maybe (fail $ "Master node " ++ master ++ " unknown") return $
M.lookup master node_names
let mnode = Container.find kmaster node_idx
return $ Container.add kmaster (Node.setMaster mnode True) node_idx
-- | Given the nodes with the location tags already set correctly, compute
-- the location score for an instance. | 388 | true | true | 0 | 13 | 107 | 129 | 63 | 66 | null | null |
zeyuanxy/haskell-playground | ninety-nine-haskell-problems/vol3/28A.hs | mit | main :: IO ()
main = do
let value = lsort ["abc","de","fgh","de","ijkl","mn","o"]
print value
let value' = lsort' ["abc","de","fgh","de","ijkl","mn","o"]
print value' | 182 | main :: IO ()
main = do
let value = lsort ["abc","de","fgh","de","ijkl","mn","o"]
print value
let value' = lsort' ["abc","de","fgh","de","ijkl","mn","o"]
print value' | 182 | main = do
let value = lsort ["abc","de","fgh","de","ijkl","mn","o"]
print value
let value' = lsort' ["abc","de","fgh","de","ijkl","mn","o"]
print value' | 168 | false | true | 0 | 11 | 36 | 94 | 50 | 44 | null | null |
bjpop/blip | blipcompiler/src/Blip/Compiler/Utils.hs | bsd-3-clause | isRelativeJump SETUP_WITH = True | 32 | isRelativeJump SETUP_WITH = True | 32 | isRelativeJump SETUP_WITH = True | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mainland/dph | dph-prim-interface/Data/Array/Parallel/Unlifted.hs | bsd-3-clause | mzipWith = notImplemented "mzipWith" | 59 | mzipWith = notImplemented "mzipWith" | 59 | mzipWith = notImplemented "mzipWith" | 59 | false | false | 0 | 5 | 26 | 9 | 4 | 5 | null | null |
joe9/barrelfish | tools/hamlet/Parser.hs | mit | comma = P.comma lexer | 26 | comma = P.comma lexer | 26 | comma = P.comma lexer | 26 | false | false | 1 | 6 | 8 | 14 | 5 | 9 | null | null |
shlevy/ghc | compiler/basicTypes/PatSyn.hs | bsd-3-clause | -- | Extract the type for any given labelled field of the 'DataCon'
patSynFieldType :: PatSyn -> FieldLabelString -> Type
patSynFieldType ps label
= case find ((== label) . flLabel . fst) (psFieldLabels ps `zip` psArgs ps) of
Just (_, ty) -> ty
Nothing -> pprPanic "dataConFieldType" (ppr ps <+> ppr label) | 320 | patSynFieldType :: PatSyn -> FieldLabelString -> Type
patSynFieldType ps label
= case find ((== label) . flLabel . fst) (psFieldLabels ps `zip` psArgs ps) of
Just (_, ty) -> ty
Nothing -> pprPanic "dataConFieldType" (ppr ps <+> ppr label) | 252 | patSynFieldType ps label
= case find ((== label) . flLabel . fst) (psFieldLabels ps `zip` psArgs ps) of
Just (_, ty) -> ty
Nothing -> pprPanic "dataConFieldType" (ppr ps <+> ppr label) | 198 | true | true | 0 | 11 | 65 | 103 | 53 | 50 | null | null |
sgillespie/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | {-
************************************************************************
* *
\subsection{Tau, sigma and rho}
* *
************************************************************************
-}
mkSigmaTy :: [TyVarBinder] -> [PredType] -> Type -> Type
mkSigmaTy bndrs theta tau = mkForAllTys bndrs (mkPhiTy theta tau) | 453 | mkSigmaTy :: [TyVarBinder] -> [PredType] -> Type -> Type
mkSigmaTy bndrs theta tau = mkForAllTys bndrs (mkPhiTy theta tau) | 122 | mkSigmaTy bndrs theta tau = mkForAllTys bndrs (mkPhiTy theta tau) | 65 | true | true | 0 | 7 | 169 | 50 | 26 | 24 | null | null |
greydot/iproute | Data/IP/Op.hs | bsd-3-clause | {-|
The 'toMatchedTo' function take an 'Addr' address and an 'AddrRange',
and returns 'True' if the range contains the address.
>>> ("127.0.2.0" :: IPv4) `isMatchedTo` makeAddrRange "127.0.2.1" 24
True
>>> ("127.0.2.0" :: IPv4) `isMatchedTo` makeAddrRange "127.0.2.1" 32
False
>>> ("2001:DB8::1" :: IPv6) `isMatchedTo` makeAddrRange "2001:DB8::1" 32
True
>>> ("2001:DB8::" :: IPv6) `isMatchedTo` makeAddrRange "2001:DB8::1" 128
False
-}
isMatchedTo :: Addr a => a -> AddrRange a -> Bool
isMatchedTo a r = a `masked` mask r == addr r | 538 | isMatchedTo :: Addr a => a -> AddrRange a -> Bool
isMatchedTo a r = a `masked` mask r == addr r | 95 | isMatchedTo a r = a `masked` mask r == addr r | 45 | true | true | 0 | 8 | 84 | 51 | 25 | 26 | null | null |
Codas/yesod-live | exec/Cabal.hs | bsd-2-clause | getLbi :: IO (Maybe LocalBuildInfo)
getLbi =
do currentDir <- getCurrentDirectory
distDir <- mightExist (currentDir </> "dist")
mapM getPersistBuildConfig distDir | 174 | getLbi :: IO (Maybe LocalBuildInfo)
getLbi =
do currentDir <- getCurrentDirectory
distDir <- mightExist (currentDir </> "dist")
mapM getPersistBuildConfig distDir | 174 | getLbi =
do currentDir <- getCurrentDirectory
distDir <- mightExist (currentDir </> "dist")
mapM getPersistBuildConfig distDir | 138 | false | true | 0 | 10 | 31 | 52 | 24 | 28 | null | null |
spechub/Hets | OWL2/ProveFact.hs | gpl-2.0 | factJarS :: String
factJarS = "OWLFact.jar" | 43 | factJarS :: String
factJarS = "OWLFact.jar" | 43 | factJarS = "OWLFact.jar" | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
pbrisbin/pbrisbin.com | Main.hs | gpl-2.0 | -- | Replaces @<host>/foo/index.html@ with @<host>/foo@ for the given host
replaceIndexURLs :: String -> Item String -> Compiler (Item String)
replaceIndexURLs host = replace (host <> "/.*/index.html") P.takeDirectory | 217 | replaceIndexURLs :: String -> Item String -> Compiler (Item String)
replaceIndexURLs host = replace (host <> "/.*/index.html") P.takeDirectory | 142 | replaceIndexURLs host = replace (host <> "/.*/index.html") P.takeDirectory | 74 | true | true | 0 | 10 | 27 | 53 | 25 | 28 | null | null |
AlbinTheander/oden | test/Oden/Assertions.hs | mit | shouldSucceedWith :: (Eq v, Show v, Show e) => Either e v -> v -> Expectation
(Left err) `shouldSucceedWith` _ = expectationFailure . show $ err | 155 | shouldSucceedWith :: (Eq v, Show v, Show e) => Either e v -> v -> Expectation
(Left err) `shouldSucceedWith` _ = expectationFailure . show $ err | 155 | (Left err) `shouldSucceedWith` _ = expectationFailure . show $ err | 77 | false | true | 0 | 7 | 36 | 67 | 34 | 33 | null | null |
tvh/llvm-general-quote | src/LLVM/General/Quote/Parser/Monad.hs | bsd-3-clause | maybePeekChar :: P (Maybe Char)
maybePeekChar = do
inp <- getInput
case alexGetChar inp of
Nothing -> return Nothing
Just (c, _) -> return (Just c) | 173 | maybePeekChar :: P (Maybe Char)
maybePeekChar = do
inp <- getInput
case alexGetChar inp of
Nothing -> return Nothing
Just (c, _) -> return (Just c) | 173 | maybePeekChar = do
inp <- getInput
case alexGetChar inp of
Nothing -> return Nothing
Just (c, _) -> return (Just c) | 141 | false | true | 0 | 12 | 51 | 70 | 33 | 37 | null | null |
tolysz/prepare-ghcjs | spec-lts8/base/GHC/IO/Handle/Text.hs | bsd-3-clause | writeChunk :: Handle__ -> Ptr Word8 -> Int -> IO ()
writeChunk h_@Handle__{..} ptr bytes
| Just fd <- cast haDevice = RawIO.write (fd::FD) ptr bytes
| otherwise = error "Todo: hPutBuf" | 190 | writeChunk :: Handle__ -> Ptr Word8 -> Int -> IO ()
writeChunk h_@Handle__{..} ptr bytes
| Just fd <- cast haDevice = RawIO.write (fd::FD) ptr bytes
| otherwise = error "Todo: hPutBuf" | 190 | writeChunk h_@Handle__{..} ptr bytes
| Just fd <- cast haDevice = RawIO.write (fd::FD) ptr bytes
| otherwise = error "Todo: hPutBuf" | 138 | false | true | 1 | 9 | 37 | 88 | 42 | 46 | null | null |
abbradar/yaxmpp | src/Network/XMPP/Message.hs | bsd-3-clause | imInHandler :: MonadStream m => IMRef m -> InStanza -> m (Maybe (Maybe StanzaError))
imInHandler (IMRef {..}) (InStanza { istFrom = Just from, istType = InMessage (Right imType), istChildren })
| Just bodyRes <- localizedFromElement (jcName "body") istChildren = Just <$> do
let res = runExcept $ do
let getEither = either throwE return
imBody <- getEither bodyRes
imSubject <- mapM getEither $ localizedFromElement (jcName "subject") istChildren
let thread = listToMaybe $ cur $/ XC.element (jcName "thread") &| curElement
imThread <- mapM (getEither . getThread) thread
let imExtended = cur $/ checkName ((/= Just jcNS) . nameNamespace) &| curElement
return IMMessage {..}
case res of
Left e -> return $ Just e
Right msg -> do
Handler.call imHandler (from, msg)
return Nothing
where cur = fromChildren istChildren
getThread e@(Element { elementNodes = [NodeContent imId] }) = return IMThread { imParent = getAttr "parent" e
, ..
}
getThread _ = Left $ badRequest "getThread: invalid thread element" | 1,335 | imInHandler :: MonadStream m => IMRef m -> InStanza -> m (Maybe (Maybe StanzaError))
imInHandler (IMRef {..}) (InStanza { istFrom = Just from, istType = InMessage (Right imType), istChildren })
| Just bodyRes <- localizedFromElement (jcName "body") istChildren = Just <$> do
let res = runExcept $ do
let getEither = either throwE return
imBody <- getEither bodyRes
imSubject <- mapM getEither $ localizedFromElement (jcName "subject") istChildren
let thread = listToMaybe $ cur $/ XC.element (jcName "thread") &| curElement
imThread <- mapM (getEither . getThread) thread
let imExtended = cur $/ checkName ((/= Just jcNS) . nameNamespace) &| curElement
return IMMessage {..}
case res of
Left e -> return $ Just e
Right msg -> do
Handler.call imHandler (from, msg)
return Nothing
where cur = fromChildren istChildren
getThread e@(Element { elementNodes = [NodeContent imId] }) = return IMThread { imParent = getAttr "parent" e
, ..
}
getThread _ = Left $ badRequest "getThread: invalid thread element" | 1,335 | imInHandler (IMRef {..}) (InStanza { istFrom = Just from, istType = InMessage (Right imType), istChildren })
| Just bodyRes <- localizedFromElement (jcName "body") istChildren = Just <$> do
let res = runExcept $ do
let getEither = either throwE return
imBody <- getEither bodyRes
imSubject <- mapM getEither $ localizedFromElement (jcName "subject") istChildren
let thread = listToMaybe $ cur $/ XC.element (jcName "thread") &| curElement
imThread <- mapM (getEither . getThread) thread
let imExtended = cur $/ checkName ((/= Just jcNS) . nameNamespace) &| curElement
return IMMessage {..}
case res of
Left e -> return $ Just e
Right msg -> do
Handler.call imHandler (from, msg)
return Nothing
where cur = fromChildren istChildren
getThread e@(Element { elementNodes = [NodeContent imId] }) = return IMThread { imParent = getAttr "parent" e
, ..
}
getThread _ = Left $ badRequest "getThread: invalid thread element" | 1,250 | false | true | 1 | 24 | 491 | 413 | 195 | 218 | null | null |
dorchard/gram_lang | frontend/src/Language/Granule/Checker/KindsImplicit.hs | bsd-3-clause | kindIsKind :: Kind -> Bool
kindIsKind (KPromote (TyCon (internalName -> "Kind"))) = True | 88 | kindIsKind :: Kind -> Bool
kindIsKind (KPromote (TyCon (internalName -> "Kind"))) = True | 88 | kindIsKind (KPromote (TyCon (internalName -> "Kind"))) = True | 61 | false | true | 0 | 10 | 12 | 41 | 20 | 21 | null | null |
AlexeyRaga/eta | compiler/ETA/Main/DynFlags.hs | bsd-3-clause | wayRTSOnly WayProf = False | 30 | wayRTSOnly WayProf = False | 30 | wayRTSOnly WayProf = False | 30 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
bjpop/berp | libs/src/Berp/Compile/Monad.hs | bsd-3-clause | freshVarRaw :: Compile String
freshVarRaw = do
u <- gets unique
modify $ \state -> state { unique = u + 1 }
return ("_t_" ++ show u) | 141 | freshVarRaw :: Compile String
freshVarRaw = do
u <- gets unique
modify $ \state -> state { unique = u + 1 }
return ("_t_" ++ show u) | 141 | freshVarRaw = do
u <- gets unique
modify $ \state -> state { unique = u + 1 }
return ("_t_" ++ show u) | 111 | false | true | 0 | 12 | 36 | 70 | 32 | 38 | null | null |
cullina/Extractor | src/Fibonacci.hs | bsd-3-clause | removeLeadingOne [] = Nothing | 37 | removeLeadingOne [] = Nothing | 37 | removeLeadingOne [] = Nothing | 37 | false | false | 0 | 6 | 11 | 11 | 5 | 6 | null | null |
mrakgr/futhark | src/Futhark/Pass/ExtractKernels.hs | bsd-3-clause | distributeIfPossible :: KernelAcc -> KernelM (Maybe KernelAcc)
distributeIfPossible acc = do
nest <- asks kernelNest
tryDistribute nest (kernelTargets acc) (kernelStms acc) >>= \case
Nothing -> return Nothing
Just (targets, kernel) -> do
addKernel kernel
return $ Just KernelAcc { kernelTargets = targets
, kernelStms = []
} | 408 | distributeIfPossible :: KernelAcc -> KernelM (Maybe KernelAcc)
distributeIfPossible acc = do
nest <- asks kernelNest
tryDistribute nest (kernelTargets acc) (kernelStms acc) >>= \case
Nothing -> return Nothing
Just (targets, kernel) -> do
addKernel kernel
return $ Just KernelAcc { kernelTargets = targets
, kernelStms = []
} | 408 | distributeIfPossible acc = do
nest <- asks kernelNest
tryDistribute nest (kernelTargets acc) (kernelStms acc) >>= \case
Nothing -> return Nothing
Just (targets, kernel) -> do
addKernel kernel
return $ Just KernelAcc { kernelTargets = targets
, kernelStms = []
} | 345 | false | true | 0 | 17 | 130 | 121 | 58 | 63 | null | null |
geraldus/yesod | yesod-auth/Yesod/Auth.hs | mit | getLoginR :: AuthHandler master Html
getLoginR = setUltDestReferer' >> loginHandler | 83 | getLoginR :: AuthHandler master Html
getLoginR = setUltDestReferer' >> loginHandler | 83 | getLoginR = setUltDestReferer' >> loginHandler | 46 | false | true | 2 | 6 | 9 | 27 | 11 | 16 | null | null |
GaloisInc/halvm-ghc | compiler/coreSyn/CoreUtils.hs | bsd-3-clause | exprIsTrivial (Case e _ _ []) = exprIsTrivial e | 48 | exprIsTrivial (Case e _ _ []) = exprIsTrivial e | 48 | exprIsTrivial (Case e _ _ []) = exprIsTrivial e | 48 | false | false | 0 | 8 | 9 | 26 | 12 | 14 | null | null |
ndmitchell/fossilizer | Util.hs | apache-2.0 | findIndexValue :: (a -> Bool) -> [a] -> Maybe (Int, a)
findIndexValue f xs = find (f . snd) $ zip [0..] xs | 106 | findIndexValue :: (a -> Bool) -> [a] -> Maybe (Int, a)
findIndexValue f xs = find (f . snd) $ zip [0..] xs | 106 | findIndexValue f xs = find (f . snd) $ zip [0..] xs | 51 | false | true | 0 | 8 | 22 | 65 | 34 | 31 | null | null |
mauroblanco/fpnla | src/FPNLA/Operations/Parameters.hs | bsd-3-clause | elemTrans_m i j (Trans m) = elem_m j i m | 40 | elemTrans_m i j (Trans m) = elem_m j i m | 40 | elemTrans_m i j (Trans m) = elem_m j i m | 40 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
brendanhay/gogol | gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/ManagedConfigurationsforDevice/Update.hs | mpl-2.0 | -- | The ID of the enterprise.
mcduEnterpriseId :: Lens' ManagedConfigurationsforDeviceUpdate Text
mcduEnterpriseId
= lens _mcduEnterpriseId
(\ s a -> s{_mcduEnterpriseId = a}) | 184 | mcduEnterpriseId :: Lens' ManagedConfigurationsforDeviceUpdate Text
mcduEnterpriseId
= lens _mcduEnterpriseId
(\ s a -> s{_mcduEnterpriseId = a}) | 153 | mcduEnterpriseId
= lens _mcduEnterpriseId
(\ s a -> s{_mcduEnterpriseId = a}) | 85 | true | true | 0 | 9 | 30 | 42 | 22 | 20 | null | null |
timjb/halma | halma-telegram-bot/src/Game/Halma/TelegramBot/Controller.hs | mit | halmaBot :: GlobalBotM ()
halmaBot = do
updates <- getUpdatesRetry
mapM_ handleUpdate updates
halmaBot | 108 | halmaBot :: GlobalBotM ()
halmaBot = do
updates <- getUpdatesRetry
mapM_ handleUpdate updates
halmaBot | 108 | halmaBot = do
updates <- getUpdatesRetry
mapM_ handleUpdate updates
halmaBot | 82 | false | true | 0 | 7 | 19 | 34 | 15 | 19 | null | null |
yiannist/ganeti | src/Ganeti/Query/Server.hs | bsd-2-clause | main :: MainFn () PrepResult
main _ _ (server, cref, jq) = do
-- Subscribe to config udpates. If the config changes, write new config and
-- check if the changes should trigger the scheduler.
initConfigReader $ \newConfig -> do
runScheduler <- atomicModifyIORef cref $ \oldConfig ->
case (oldConfig, newConfig) of
(Ok old, Ok new) -> (newConfig, configChangeNeedsRescheduling old new)
_ -> (newConfig, True) -- no old or new config, schedule
when runScheduler (updateStatusAndScheduleSomeJobs jq)
let creader = readIORef cref
qlockFile <- jobQueueLockFile
_ <- lockFile qlockFile >>= exitIfBad "Failed to obtain the job-queue lock"
qlock <- newLock
_ <- P.installHandler P.sigCHLD P.Ignore Nothing
_ <- forkIO . void $ activateMasterIP
initJQScheduler jq
finally
(forever $ U.listener (luxiHandler (qlock, jq, creader)) server)
(closeServer server >> removeFile qlockFile) | 955 | main :: MainFn () PrepResult
main _ _ (server, cref, jq) = do
-- Subscribe to config udpates. If the config changes, write new config and
-- check if the changes should trigger the scheduler.
initConfigReader $ \newConfig -> do
runScheduler <- atomicModifyIORef cref $ \oldConfig ->
case (oldConfig, newConfig) of
(Ok old, Ok new) -> (newConfig, configChangeNeedsRescheduling old new)
_ -> (newConfig, True) -- no old or new config, schedule
when runScheduler (updateStatusAndScheduleSomeJobs jq)
let creader = readIORef cref
qlockFile <- jobQueueLockFile
_ <- lockFile qlockFile >>= exitIfBad "Failed to obtain the job-queue lock"
qlock <- newLock
_ <- P.installHandler P.sigCHLD P.Ignore Nothing
_ <- forkIO . void $ activateMasterIP
initJQScheduler jq
finally
(forever $ U.listener (luxiHandler (qlock, jq, creader)) server)
(closeServer server >> removeFile qlockFile) | 955 | main _ _ (server, cref, jq) = do
-- Subscribe to config udpates. If the config changes, write new config and
-- check if the changes should trigger the scheduler.
initConfigReader $ \newConfig -> do
runScheduler <- atomicModifyIORef cref $ \oldConfig ->
case (oldConfig, newConfig) of
(Ok old, Ok new) -> (newConfig, configChangeNeedsRescheduling old new)
_ -> (newConfig, True) -- no old or new config, schedule
when runScheduler (updateStatusAndScheduleSomeJobs jq)
let creader = readIORef cref
qlockFile <- jobQueueLockFile
_ <- lockFile qlockFile >>= exitIfBad "Failed to obtain the job-queue lock"
qlock <- newLock
_ <- P.installHandler P.sigCHLD P.Ignore Nothing
_ <- forkIO . void $ activateMasterIP
initJQScheduler jq
finally
(forever $ U.listener (luxiHandler (qlock, jq, creader)) server)
(closeServer server >> removeFile qlockFile) | 926 | false | true | 0 | 18 | 209 | 267 | 131 | 136 | null | null |
SwiftsNamesake/SpriteClip | src/SpriteClip/Events.hs | mit | ondragstatus :: App.App state -> DragContext -> Maybe DragAction -> TimeStamp -> IO ()
ondragstatus app context maction timestamp = do
Cairo.liftIO $ putStrLn "Drag status"
return ()
-- |
-- ondragmotion :: | 212 | ondragstatus :: App.App state -> DragContext -> Maybe DragAction -> TimeStamp -> IO ()
ondragstatus app context maction timestamp = do
Cairo.liftIO $ putStrLn "Drag status"
return ()
-- |
-- ondragmotion :: | 212 | ondragstatus app context maction timestamp = do
Cairo.liftIO $ putStrLn "Drag status"
return ()
-- |
-- ondragmotion :: | 125 | false | true | 0 | 10 | 38 | 71 | 33 | 38 | null | null |
k0001/gtk2hs | tools/c2hs/chs/CHS.hs | gpl-3.0 | parseOptPrefix True (CHSTokWith _ :
CHSTokPrefix _ :
CHSTokEqual _ :
CHSTokString _ str:
toks) = return (Just str, toks) | 236 | parseOptPrefix True (CHSTokWith _ :
CHSTokPrefix _ :
CHSTokEqual _ :
CHSTokString _ str:
toks) = return (Just str, toks) | 236 | parseOptPrefix True (CHSTokWith _ :
CHSTokPrefix _ :
CHSTokEqual _ :
CHSTokString _ str:
toks) = return (Just str, toks) | 236 | false | false | 0 | 11 | 135 | 58 | 26 | 32 | null | null |
transtone/transconfig | .xmonad/xmonad.hs | mit | myBorderWidth = 0 | 19 | myBorderWidth = 0 | 19 | myBorderWidth = 0 | 19 | false | false | 1 | 5 | 4 | 10 | 3 | 7 | null | null |
singingwolfboy/citeproc-hs | src/Text/CSL/Output/Plain.hs | bsd-3-clause | (<+>) :: String -> String -> String
[] <+> ss = ss | 50 | (<+>) :: String -> String -> String
[] <+> ss = ss | 50 | [] <+> ss = ss | 14 | false | true | 0 | 10 | 11 | 30 | 15 | 15 | null | null |
eggzilla/StockholmAlignment | Biobase/StockholmAlignment/Import.hs | gpl-3.0 | mergeResAToken :: [StockholmToken] -> [StockholmToken]
mergeResAToken _token = entries
where rIds = nub (map rId _token)
entries = concatMap (mergeRAIdToken _token) rIds | 179 | mergeResAToken :: [StockholmToken] -> [StockholmToken]
mergeResAToken _token = entries
where rIds = nub (map rId _token)
entries = concatMap (mergeRAIdToken _token) rIds | 179 | mergeResAToken _token = entries
where rIds = nub (map rId _token)
entries = concatMap (mergeRAIdToken _token) rIds | 124 | false | true | 1 | 7 | 31 | 59 | 30 | 29 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/fgl/Data/Graph/Inductive/Internal/RootPath.hs | bsd-3-clause | getLPathNodes :: Node -> LRTree a -> Path
getLPathNodes v = (\(LP p)->map fst p) . getLPath v | 93 | getLPathNodes :: Node -> LRTree a -> Path
getLPathNodes v = (\(LP p)->map fst p) . getLPath v | 93 | getLPathNodes v = (\(LP p)->map fst p) . getLPath v | 51 | false | true | 0 | 9 | 17 | 56 | 26 | 30 | null | null |
jberthold/deployR-hs | src/DeployR/Mockup.hs | apache-2.0 | -- universal log/fail handler
failWithLog1 :: (Show a) => Text -> a -> Handler (DRResponse b)
failWithLog1 req arg1 = do liftIO (T.putStrLn msg)
return failed
where failed = DRError { drCookie = Nothing
, drErrCode = 666
, drError = msg }
msg = T.intercalate "\t" [ "MOCK SERVER:\tRequest"
, req, T.pack $ show arg1 ]
-- fail handler which accepts and sets a cookie header, with 1 argument | 519 | failWithLog1 :: (Show a) => Text -> a -> Handler (DRResponse b)
failWithLog1 req arg1 = do liftIO (T.putStrLn msg)
return failed
where failed = DRError { drCookie = Nothing
, drErrCode = 666
, drError = msg }
msg = T.intercalate "\t" [ "MOCK SERVER:\tRequest"
, req, T.pack $ show arg1 ]
-- fail handler which accepts and sets a cookie header, with 1 argument | 489 | failWithLog1 req arg1 = do liftIO (T.putStrLn msg)
return failed
where failed = DRError { drCookie = Nothing
, drErrCode = 666
, drError = msg }
msg = T.intercalate "\t" [ "MOCK SERVER:\tRequest"
, req, T.pack $ show arg1 ]
-- fail handler which accepts and sets a cookie header, with 1 argument | 425 | true | true | 1 | 10 | 199 | 123 | 64 | 59 | null | null |
sacundim/free-operational | tests/Properties/Applicative.hs | bsd-3-clause | prop_InterpretCompile :: ProgramAp (ReaderI String) Int -> Property
prop_InterpretCompile prog = prog =-= compileAp (viewAp prog) | 129 | prop_InterpretCompile :: ProgramAp (ReaderI String) Int -> Property
prop_InterpretCompile prog = prog =-= compileAp (viewAp prog) | 129 | prop_InterpretCompile prog = prog =-= compileAp (viewAp prog) | 61 | false | true | 0 | 8 | 15 | 42 | 20 | 22 | null | null |
tomjaguarpaw/postgresql-simple | src/Database/PostgreSQL/Simple/Errors.hs | bsd-3-clause | -- Parsers just try to extract quoted strings from error messages, number
-- of quoted strings depend on error type.
scanTillQuote :: Parser ByteString
scanTillQuote = scan False go
where go True _ = Just False -- escaped character
go False '"' = Nothing -- end parse
go False '\\' = Just True -- next one is escaped
go _ _ = Just False | 362 | scanTillQuote :: Parser ByteString
scanTillQuote = scan False go
where go True _ = Just False -- escaped character
go False '"' = Nothing -- end parse
go False '\\' = Just True -- next one is escaped
go _ _ = Just False | 245 | scanTillQuote = scan False go
where go True _ = Just False -- escaped character
go False '"' = Nothing -- end parse
go False '\\' = Just True -- next one is escaped
go _ _ = Just False | 210 | true | true | 2 | 5 | 89 | 85 | 38 | 47 | null | null |
erikd-ambiata/haskell-sanitize | main/haskell-sanitize.hs | bsd-3-clause | main :: IO ()
main =
print $ dodgy 8 5 | 40 | main :: IO ()
main =
print $ dodgy 8 5 | 40 | main =
print $ dodgy 8 5 | 26 | false | true | 2 | 7 | 12 | 33 | 13 | 20 | null | null |
irwingarry/iterpret | app/Interpreter.hs | bsd-3-clause | runRun :: Run a -> IO (Either String (a, Env))
runRun p = runExceptT (runStateT p Map.empty) | 92 | runRun :: Run a -> IO (Either String (a, Env))
runRun p = runExceptT (runStateT p Map.empty) | 92 | runRun p = runExceptT (runStateT p Map.empty) | 45 | false | true | 0 | 10 | 16 | 55 | 26 | 29 | null | null |
spechub/Hets | HasCASL/TypeDecl.hs | gpl-2.0 | anaTypeItem :: GenKind -> [DataPat] -> Annoted TypeItem
-> State Env (Maybe TypeItem)
anaTypeItem gk tys aitm = case item aitm of
TypeDecl pats kind ps -> anaTypeDecl pats kind ps
SubtypeDecl pats t ps -> anaSubtypeDecl pats t ps
IsoDecl pats ps -> anaIsoDecl pats ps
SubtypeDefn pat v t f ps -> anaSubtypeDefn aitm pat v t f ps
AliasType pat mk sc ps -> anaAliasType pat mk sc ps
Datatype d -> do
mD <- anaDatatype gk tys $ replaceAnnoted d aitm
case mD of
Nothing -> return Nothing
Just newD -> return $ Just $ Datatype newD
-- | pre-analyse a data type for 'anaDatatype' | 646 | anaTypeItem :: GenKind -> [DataPat] -> Annoted TypeItem
-> State Env (Maybe TypeItem)
anaTypeItem gk tys aitm = case item aitm of
TypeDecl pats kind ps -> anaTypeDecl pats kind ps
SubtypeDecl pats t ps -> anaSubtypeDecl pats t ps
IsoDecl pats ps -> anaIsoDecl pats ps
SubtypeDefn pat v t f ps -> anaSubtypeDefn aitm pat v t f ps
AliasType pat mk sc ps -> anaAliasType pat mk sc ps
Datatype d -> do
mD <- anaDatatype gk tys $ replaceAnnoted d aitm
case mD of
Nothing -> return Nothing
Just newD -> return $ Just $ Datatype newD
-- | pre-analyse a data type for 'anaDatatype' | 646 | anaTypeItem gk tys aitm = case item aitm of
TypeDecl pats kind ps -> anaTypeDecl pats kind ps
SubtypeDecl pats t ps -> anaSubtypeDecl pats t ps
IsoDecl pats ps -> anaIsoDecl pats ps
SubtypeDefn pat v t f ps -> anaSubtypeDefn aitm pat v t f ps
AliasType pat mk sc ps -> anaAliasType pat mk sc ps
Datatype d -> do
mD <- anaDatatype gk tys $ replaceAnnoted d aitm
case mD of
Nothing -> return Nothing
Just newD -> return $ Just $ Datatype newD
-- | pre-analyse a data type for 'anaDatatype' | 548 | false | true | 12 | 10 | 181 | 189 | 96 | 93 | null | null |
philopon/pylon | Graphics/Pylon/Binding/Pango/Cairo.hs | mit | updateLayout :: Cairo s -> Layout -> IO ()
updateLayout (Cairo c) (Layout f'l) = withForeignPtr f'l $ \lay ->
pango_cairo_update_layout c lay | 145 | updateLayout :: Cairo s -> Layout -> IO ()
updateLayout (Cairo c) (Layout f'l) = withForeignPtr f'l $ \lay ->
pango_cairo_update_layout c lay | 145 | updateLayout (Cairo c) (Layout f'l) = withForeignPtr f'l $ \lay ->
pango_cairo_update_layout c lay | 102 | false | true | 0 | 8 | 26 | 61 | 29 | 32 | null | null |
massysett/penny | penny/lib/Penny/Copper/Decopperize.hs | bsd-3-clause | dExchNonNeu :: ExchNonNeu t a -> DecNonZero
dExchNonNeu x = case x of
ExchNonNeu'PluMinNonNeutral c -> dPluMinNonNeutral c
ExchNonNeu'NonNeutral c -> c'DecNonZero'DecPositive positive
. dNonNeutral $ c | 209 | dExchNonNeu :: ExchNonNeu t a -> DecNonZero
dExchNonNeu x = case x of
ExchNonNeu'PluMinNonNeutral c -> dPluMinNonNeutral c
ExchNonNeu'NonNeutral c -> c'DecNonZero'DecPositive positive
. dNonNeutral $ c | 209 | dExchNonNeu x = case x of
ExchNonNeu'PluMinNonNeutral c -> dPluMinNonNeutral c
ExchNonNeu'NonNeutral c -> c'DecNonZero'DecPositive positive
. dNonNeutral $ c | 165 | false | true | 4 | 6 | 34 | 54 | 26 | 28 | null | null |
Macil-dev/verhface-ll | src/Bindings/Verba/ErrorCodes.hs | unlicense | verr 3 = VerbaError 3 "E_DRIVER" "Ошибка датчика случайных чисел" | 81 | verr 3 = VerbaError 3 "E_DRIVER" "Ошибка датчика случайных чисел" | 81 | verr 3 = VerbaError 3 "E_DRIVER" "Ошибка датчика случайных чисел" | 81 | false | false | 1 | 5 | 25 | 19 | 7 | 12 | null | null |
mariefarrell/Hets | Common/MathLink.hs | gpl-2.0 | dfINPUTNAMEPKT = 8 | 18 | dfINPUTNAMEPKT = 8 | 18 | dfINPUTNAMEPKT = 8 | 18 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.