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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rueshyna/gogol | gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'VideoProcessingDetailsProcessingProgress' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'vpdppTimeLeftMs'
--
-- * 'vpdppPartsTotal'
--
-- * 'vpdppPartsProcessed'
videoProcessingDetailsProcessingProgress
:... | 560 | videoProcessingDetailsProcessingProgress
:: VideoProcessingDetailsProcessingProgress
videoProcessingDetailsProcessingProgress =
VideoProcessingDetailsProcessingProgress'
{ _vpdppTimeLeftMs = Nothing
, _vpdppPartsTotal = Nothing
, _vpdppPartsProcessed = Nothing
} | 286 | videoProcessingDetailsProcessingProgress =
VideoProcessingDetailsProcessingProgress'
{ _vpdppTimeLeftMs = Nothing
, _vpdppPartsTotal = Nothing
, _vpdppPartsProcessed = Nothing
} | 197 | true | true | 0 | 6 | 84 | 40 | 28 | 12 | null | null |
fredcy/elm-format | parser/src/Parse/Helpers.hs | bsd-3-clause | str :: IParser (String, Bool)
str =
expecting "a string" $
do (s, multi) <- choice [ multiStr, singleStr ]
result <- processAs T.stringLiteral . sandwich '\"' $ concat s
return (result, multi)
where
rawString quote insides =
quote >> manyTill insides quote
multiStr =
do res... | 1,060 | str :: IParser (String, Bool)
str =
expecting "a string" $
do (s, multi) <- choice [ multiStr, singleStr ]
result <- processAs T.stringLiteral . sandwich '\"' $ concat s
return (result, multi)
where
rawString quote insides =
quote >> manyTill insides quote
multiStr =
do res... | 1,060 | str =
expecting "a string" $
do (s, multi) <- choice [ multiStr, singleStr ]
result <- processAs T.stringLiteral . sandwich '\"' $ concat s
return (result, multi)
where
rawString quote insides =
quote >> manyTill insides quote
multiStr =
do result <- rawString (try (string ... | 1,030 | false | true | 1 | 12 | 318 | 352 | 175 | 177 | null | null |
simonced/haskell-kata | email-parser-stack/src/Lib.hs | gpl-3.0 | searchSubject :: String -> String
searchSubject content = head (content =~ "^Subject: (.*)" :: [[String]]) !! 1 | 111 | searchSubject :: String -> String
searchSubject content = head (content =~ "^Subject: (.*)" :: [[String]]) !! 1 | 111 | searchSubject content = head (content =~ "^Subject: (.*)" :: [[String]]) !! 1 | 77 | false | true | 0 | 8 | 16 | 47 | 23 | 24 | null | null |
meiersi/bytestring-builder | tests/builder/Data/ByteString/Lazy/Builder/Tests.hs | bsd-3-clause | testsUtf8 :: [Test]
testsUtf8 =
[ testBuilderConstr "charUtf8" charUtf8_list charUtf8
, testBuilderConstr "stringUtf8" (concatMap charUtf8_list) stringUtf8
] | 163 | testsUtf8 :: [Test]
testsUtf8 =
[ testBuilderConstr "charUtf8" charUtf8_list charUtf8
, testBuilderConstr "stringUtf8" (concatMap charUtf8_list) stringUtf8
] | 163 | testsUtf8 =
[ testBuilderConstr "charUtf8" charUtf8_list charUtf8
, testBuilderConstr "stringUtf8" (concatMap charUtf8_list) stringUtf8
] | 143 | false | true | 0 | 8 | 22 | 40 | 21 | 19 | null | null |
forste/haReFork | refactorer/RefacDupTrans.hs | bsd-3-clause | myZip _ _ _ = [] | 26 | myZip _ _ _ = [] | 26 | myZip _ _ _ = [] | 26 | false | false | 1 | 6 | 15 | 15 | 6 | 9 | null | null |
batterseapower/lattices | Algebra/Lattice.hs | bsd-3-clause | unsafeGfp :: (Eq a, BoundedMeetSemiLattice a) => (a -> a) -> a
unsafeGfp = PO.unsafeGfpFrom top | 95 | unsafeGfp :: (Eq a, BoundedMeetSemiLattice a) => (a -> a) -> a
unsafeGfp = PO.unsafeGfpFrom top | 95 | unsafeGfp = PO.unsafeGfpFrom top | 32 | false | true | 0 | 9 | 15 | 49 | 23 | 26 | null | null |
phischu/fragnix | tests/packages/scotty/Data.ByteString.Builder.hs | bsd-3-clause | word64BE :: Word64 -> Builder
word64BE = P.primFixed P.word64BE | 63 | word64BE :: Word64 -> Builder
word64BE = P.primFixed P.word64BE | 63 | word64BE = P.primFixed P.word64BE | 33 | false | true | 0 | 6 | 8 | 22 | 11 | 11 | null | null |
nightscape/platform | shared/src/Unison/Typechecker/Components.hs | mit | -- | Order bindings by dependencies and group into components.
-- Each component consists of > 1 bindings, each of which depends
-- transitively on all other bindings in the component.
--
-- 1-element components may or may not depend on themselves.
--
-- The order is such that a component at index i will not depend
-- ... | 1,551 | components :: Var v => [(v, Term v)] -> [[(v, Term v)]]
components bs =
let
varIds = Map.fromList (map fst bs `zip` [(0::Int)..])
varId v = fromJust $ Map.lookup v varIds -- something horribly wrong if this bombs
-- use ints as keys for graph to preserve original source order as much as possible
(grap... | 658 | components bs =
let
varIds = Map.fromList (map fst bs `zip` [(0::Int)..])
varId v = fromJust $ Map.lookup v varIds -- something horribly wrong if this bombs
-- use ints as keys for graph to preserve original source order as much as possible
(graph, toNode, _) =
Graph.graphFromEdges [ ((v,b), var... | 602 | true | true | 0 | 15 | 337 | 306 | 173 | 133 | null | null |
sdiehl/ghc | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | iselExpr64 (CmmMachOp (MO_Add _) [e1,e2]) = do
ChildCode64 code1 r1lo <- iselExpr64 e1
ChildCode64 code2 r2lo <- iselExpr64 e2
(rlo,rhi) <- getNewRegPairNat II32
let
r1hi = getHiVRegFromLo r1lo
r2hi = getHiVRegFromLo r2lo
code = code1 `appOL`
code2 `appOL`
... | 429 | iselExpr64 (CmmMachOp (MO_Add _) [e1,e2]) = do
ChildCode64 code1 r1lo <- iselExpr64 e1
ChildCode64 code2 r2lo <- iselExpr64 e2
(rlo,rhi) <- getNewRegPairNat II32
let
r1hi = getHiVRegFromLo r1lo
r2hi = getHiVRegFromLo r2lo
code = code1 `appOL`
code2 `appOL`
... | 429 | iselExpr64 (CmmMachOp (MO_Add _) [e1,e2]) = do
ChildCode64 code1 r1lo <- iselExpr64 e1
ChildCode64 code2 r2lo <- iselExpr64 e2
(rlo,rhi) <- getNewRegPairNat II32
let
r1hi = getHiVRegFromLo r1lo
r2hi = getHiVRegFromLo r2lo
code = code1 `appOL`
code2 `appOL`
... | 429 | false | false | 0 | 13 | 147 | 150 | 72 | 78 | null | null |
haroldcarr/utah-haskell | 2015-09-17-REST-client-wreq-aeson-foldr/solution/src/Service/Interact.hs | apache-2.0 | showOutput m = "<- name:" ++ name m ++ ", score:" ++ show (score m) ++ ", challenge: " ++ txt m | 95 | showOutput m = "<- name:" ++ name m ++ ", score:" ++ show (score m) ++ ", challenge: " ++ txt m | 95 | showOutput m = "<- name:" ++ name m ++ ", score:" ++ show (score m) ++ ", challenge: " ++ txt m | 95 | false | false | 3 | 10 | 21 | 48 | 20 | 28 | null | null |
forste/haReFork | refactorer/RefacTypeSig.hs | bsd-3-clause | -- (Typ (HsTyVar (nameToTypePNT (head types))) ) )
nameToTypePNT :: String -> PNT
nameToTypePNT id = (PNT (PN (UnQual id) (S loc0)) (Type (TypeInfo {defType = Nothing, constructors = [], fields = []})) (N (Just loc0))) | 222 | nameToTypePNT :: String -> PNT
nameToTypePNT id = (PNT (PN (UnQual id) (S loc0)) (Type (TypeInfo {defType = Nothing, constructors = [], fields = []})) (N (Just loc0))) | 167 | nameToTypePNT id = (PNT (PN (UnQual id) (S loc0)) (Type (TypeInfo {defType = Nothing, constructors = [], fields = []})) (N (Just loc0))) | 136 | true | true | 0 | 12 | 39 | 94 | 51 | 43 | null | null |
nomeata/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprInstr (NEG reg1 reg2) = pprUnary (sLit "neg") reg1 reg2 | 58 | pprInstr (NEG reg1 reg2) = pprUnary (sLit "neg") reg1 reg2 | 58 | pprInstr (NEG reg1 reg2) = pprUnary (sLit "neg") reg1 reg2 | 58 | false | false | 0 | 7 | 9 | 30 | 14 | 16 | null | null |
abdulrahimnizamani/OccamStar | LogicAgentOld.hs | gpl-2.0 | valid (x :& Neg y) = valid (Neg (x :> y)) | 41 | valid (x :& Neg y) = valid (Neg (x :> y)) | 41 | valid (x :& Neg y) = valid (Neg (x :> y)) | 41 | false | false | 0 | 9 | 10 | 35 | 17 | 18 | null | null |
batterseapower/hashtables | Data/HashTable/MArray.hs | bsd-3-clause | longestChain :: (MonadRef m, MArray arr (ArrayElement key val) m)
=> HashTable arr m key val -> m [(key,val)]
longestChain = mapReduce id (maximumBy lengthCmp)
where lengthCmp (_:x)(_:y) = lengthCmp x y
lengthCmp [] [] = EQ
lengthCmp [] _ = LT
lengthCmp _ [] = GT | 319 | longestChain :: (MonadRef m, MArray arr (ArrayElement key val) m)
=> HashTable arr m key val -> m [(key,val)]
longestChain = mapReduce id (maximumBy lengthCmp)
where lengthCmp (_:x)(_:y) = lengthCmp x y
lengthCmp [] [] = EQ
lengthCmp [] _ = LT
lengthCmp _ [] = GT | 319 | longestChain = mapReduce id (maximumBy lengthCmp)
where lengthCmp (_:x)(_:y) = lengthCmp x y
lengthCmp [] [] = EQ
lengthCmp [] _ = LT
lengthCmp _ [] = GT | 196 | false | true | 3 | 9 | 102 | 143 | 73 | 70 | null | null |
Tim-Tom/scratch | single-substitution-cipher/single-substitution.hs | unlicense | getWordsRec "" words = reverse words | 36 | getWordsRec "" words = reverse words | 36 | getWordsRec "" words = reverse words | 36 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
urbanslug/ghc | compiler/cmm/CmmType.hs | bsd-3-clause | vec2b64 = vec 2 b64 | 19 | vec2b64 = vec 2 b64 | 19 | vec2b64 = vec 2 b64 | 19 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
christiaanb/ghc | compiler/deSugar/DsBinds.hs | bsd-3-clause | dsEvTypeable :: EvTypeable -> DsM CoreExpr
dsEvTypeable ev =
do tyCl <- dsLookupTyCon typeableClassName
typeRepTc <- dsLookupTyCon typeRepTyConName
let tyRepType = mkTyConApp typeRepTc []
(ty, rep) <-
case ev of
EvTypeableTyCon tc ks ->
do ctr <- dsLookupGloba... | 4,344 | dsEvTypeable :: EvTypeable -> DsM CoreExpr
dsEvTypeable ev =
do tyCl <- dsLookupTyCon typeableClassName
typeRepTc <- dsLookupTyCon typeRepTyConName
let tyRepType = mkTyConApp typeRepTc []
(ty, rep) <-
case ev of
EvTypeableTyCon tc ks ->
do ctr <- dsLookupGloba... | 4,344 | dsEvTypeable ev =
do tyCl <- dsLookupTyCon typeableClassName
typeRepTc <- dsLookupTyCon typeRepTyConName
let tyRepType = mkTyConApp typeRepTc []
(ty, rep) <-
case ev of
EvTypeableTyCon tc ks ->
do ctr <- dsLookupGlobalId mkPolyTyConAppName
mkTyC... | 4,301 | false | true | 8 | 24 | 1,705 | 1,083 | 505 | 578 | null | null |
stevezhee/pec | src/PecGen.hs | bsd-3-clause | hLet :: String -> H.Exp -> H.Exp -> H.Exp
hLet a b c = Let (BDecls [hNameBind a b]) c | 85 | hLet :: String -> H.Exp -> H.Exp -> H.Exp
hLet a b c = Let (BDecls [hNameBind a b]) c | 85 | hLet a b c = Let (BDecls [hNameBind a b]) c | 43 | false | true | 0 | 9 | 19 | 55 | 27 | 28 | null | null |
jwiegley/hnix | src/Nix/String.hs | bsd-3-clause | -- | Returns True if the NixString has an associated context
stringHasContext :: NixString -> Bool
stringHasContext (NixString _ c) = not (null c) | 146 | stringHasContext :: NixString -> Bool
stringHasContext (NixString _ c) = not (null c) | 85 | stringHasContext (NixString _ c) = not (null c) | 47 | true | true | 0 | 7 | 23 | 36 | 18 | 18 | null | null |
jstolarek/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprSizeSizeOpReg :: LitString -> Size -> Size -> Operand -> Reg -> SDoc
pprSizeSizeOpReg name size1 size2 op1 reg2
= hcat [
pprMnemonic name size2,
pprOperand size1 op1,
comma,
pprReg size2 reg2
] | 234 | pprSizeSizeOpReg :: LitString -> Size -> Size -> Operand -> Reg -> SDoc
pprSizeSizeOpReg name size1 size2 op1 reg2
= hcat [
pprMnemonic name size2,
pprOperand size1 op1,
comma,
pprReg size2 reg2
] | 234 | pprSizeSizeOpReg name size1 size2 op1 reg2
= hcat [
pprMnemonic name size2,
pprOperand size1 op1,
comma,
pprReg size2 reg2
] | 162 | false | true | 0 | 9 | 70 | 72 | 36 | 36 | null | null |
mattias-lundell/timber-llvm | src/Config.hs | bsd-3-clause | readCfg clo = parseCfg (rtsCfg clo) | 35 | readCfg clo = parseCfg (rtsCfg clo) | 35 | readCfg clo = parseCfg (rtsCfg clo) | 35 | false | false | 1 | 7 | 5 | 21 | 8 | 13 | null | null |
Mr-Click/PFQ | Development/SimpleBuilder.hs | gpl-2.0 | showTargets :: Script -> IO ()
showTargets script =
putStrLn "targets:" >> mapM_ putStrLn (nub (map (\(Component t _) -> " " ++ getTargetName t) script)) | 160 | showTargets :: Script -> IO ()
showTargets script =
putStrLn "targets:" >> mapM_ putStrLn (nub (map (\(Component t _) -> " " ++ getTargetName t) script)) | 160 | showTargets script =
putStrLn "targets:" >> mapM_ putStrLn (nub (map (\(Component t _) -> " " ++ getTargetName t) script)) | 129 | false | true | 0 | 14 | 32 | 76 | 36 | 40 | null | null |
lambdageek/insomnia | main-interp/Main.hs | bsd-3-clause | main :: IO ()
main = M.interpreterMain | 38 | main :: IO ()
main = M.interpreterMain | 38 | main = M.interpreterMain | 24 | false | true | 0 | 6 | 6 | 18 | 9 | 9 | null | null |
dschalk/score3 | Main.hs | mit | broadcast :: Text -> ServerState -> IO ()
broadcast message clients = do
T.putStrLn message
forM_ clients $ \(_ , _, _, conn) -> WS.sendTextData conn message | 167 | broadcast :: Text -> ServerState -> IO ()
broadcast message clients = do
T.putStrLn message
forM_ clients $ \(_ , _, _, conn) -> WS.sendTextData conn message | 167 | broadcast message clients = do
T.putStrLn message
forM_ clients $ \(_ , _, _, conn) -> WS.sendTextData conn message | 125 | false | true | 0 | 10 | 36 | 71 | 35 | 36 | null | null |
brendanhay/gamekeeper | src/GameKeeper/Nagios.hs | mpl-2.0 | status serv Check{..} | n >= y = Critical title $ critical serv' n x
| n >= x = Warning title $ warning serv' n y
| otherwise = OK title $ ok serv' n
where
(Right n) = value
(Health x y) = health
... | 350 | status serv Check{..} | n >= y = Critical title $ critical serv' n x
| n >= x = Warning title $ warning serv' n y
| otherwise = OK title $ ok serv' n
where
(Right n) = value
(Health x y) = health
... | 350 | status serv Check{..} | n >= y = Critical title $ critical serv' n x
| n >= x = Warning title $ warning serv' n y
| otherwise = OK title $ ok serv' n
where
(Right n) = value
(Health x y) = health
... | 350 | false | false | 2 | 8 | 181 | 128 | 58 | 70 | null | null |
olsner/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | -- Native word unsigned ops
translateOp dflags WordGeOp = Just (mo_wordUGe dflags) | 89 | translateOp dflags WordGeOp = Just (mo_wordUGe dflags) | 60 | translateOp dflags WordGeOp = Just (mo_wordUGe dflags) | 60 | true | false | 0 | 7 | 18 | 23 | 10 | 13 | null | null |
urbanslug/ghc | compiler/cmm/CmmSink.hs | bsd-3-clause | regAddr _ (CmmGlobal CurrentTSO) _ _ = HeapMem | 51 | regAddr _ (CmmGlobal CurrentTSO) _ _ = HeapMem | 51 | regAddr _ (CmmGlobal CurrentTSO) _ _ = HeapMem | 51 | false | false | 2 | 6 | 12 | 24 | 10 | 14 | null | null |
rsachtl/asm_experiment | src/AbstractStateMachine.hs | mit | pdateFuns [] asm = asm
| 23 | updateFuns [] asm = asm | 23 | updateFuns [] asm = asm | 23 | false | false | 0 | 6 | 5 | 13 | 6 | 7 | null | null |
chemist/highlighter | src/Text/Highlighter/Lexers/Python3Traceback.hs | bsd-3-clause | intb' :: TokenMatcher
intb' =
[ tok "^( File )(\"[^\"]+\")(, line )(\\d+)(, in )(.+)(\\n)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text")])
, tok "^( )(.+)(\... | 797 | intb' :: TokenMatcher
intb' =
[ tok "^( File )(\"[^\"]+\")(, line )(\\d+)(, in )(.+)(\\n)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text")])
, tok "^( )(.+)(\... | 797 | intb' =
[ tok "^( File )(\"[^\"]+\")(, line )(\\d+)(, in )(.+)(\\n)" (ByGroups [(Arbitrary "Text"), (Arbitrary "Name" :. Arbitrary "Builtin"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "Number"), (Arbitrary "Text"), (Arbitrary "Name"), (Arbitrary "Text")])
, tok "^( )(.+)(\\n)" (ByGroups [(Arbit... | 775 | false | true | 0 | 13 | 114 | 293 | 152 | 141 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT34.hs | gpl-3.0 | subset (x:xs) ys = x `elem` xs && subset xs ys | 46 | subset (x:xs) ys = x `elem` xs && subset xs ys | 46 | subset (x:xs) ys = x `elem` xs && subset xs ys | 46 | false | false | 1 | 6 | 10 | 40 | 18 | 22 | null | null |
rueshyna/gogol | gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Messages/List.hs | mpl-2.0 | -- | If supplied, this should be the value of next_page_token returned by an
-- earlier call. This will cause the next page of results to be returned.
pjmlPageToken :: Lens' ProjectsJobsMessagesList (Maybe Text)
pjmlPageToken
= lens _pjmlPageToken
(\ s a -> s{_pjmlPageToken = a}) | 288 | pjmlPageToken :: Lens' ProjectsJobsMessagesList (Maybe Text)
pjmlPageToken
= lens _pjmlPageToken
(\ s a -> s{_pjmlPageToken = a}) | 137 | pjmlPageToken
= lens _pjmlPageToken
(\ s a -> s{_pjmlPageToken = a}) | 76 | true | true | 0 | 9 | 52 | 49 | 26 | 23 | null | null |
Zankoku-Okuno/murex | Murex/Interpreter/Builtin.hs | gpl-3.0 | lastSeq (MurexSeq xs) = case viewr xs of { EmptyR -> Nothing; _ :> x -> Just x } | 80 | lastSeq (MurexSeq xs) = case viewr xs of { EmptyR -> Nothing; _ :> x -> Just x } | 80 | lastSeq (MurexSeq xs) = case viewr xs of { EmptyR -> Nothing; _ :> x -> Just x } | 80 | false | false | 0 | 8 | 18 | 45 | 22 | 23 | null | null |
zmeadows/zwerg | lib/Zwerg/Data/Glyph.hs | mit | cellColors (GlyphMapCell True (PartialGlyph _ fg) (FullGlyph _ _ bg)) = (fg,bg) | 79 | cellColors (GlyphMapCell True (PartialGlyph _ fg) (FullGlyph _ _ bg)) = (fg,bg) | 79 | cellColors (GlyphMapCell True (PartialGlyph _ fg) (FullGlyph _ _ bg)) = (fg,bg) | 79 | false | false | 0 | 8 | 11 | 44 | 22 | 22 | null | null |
DimaSamoz/mezzo | test/TypeSpec.hs | mit | typeSpec :: Spec
typeSpec =
describe "Mezzo.Model.Types" $ do
describe "Harmonic types" $ do
it "should convert roots to pitches" $ do
shouldTypecheck rootToPitch
shouldNotTypecheck rootToPitchInv
it "should sharpen roots" $ do
shouldTy... | 815 | typeSpec :: Spec
typeSpec =
describe "Mezzo.Model.Types" $ do
describe "Harmonic types" $ do
it "should convert roots to pitches" $ do
shouldTypecheck rootToPitch
shouldNotTypecheck rootToPitchInv
it "should sharpen roots" $ do
shouldTy... | 815 | typeSpec =
describe "Mezzo.Model.Types" $ do
describe "Harmonic types" $ do
it "should convert roots to pitches" $ do
shouldTypecheck rootToPitch
shouldNotTypecheck rootToPitchInv
it "should sharpen roots" $ do
shouldTypecheck sharpen
... | 798 | false | true | 0 | 14 | 312 | 146 | 57 | 89 | null | null |
brendanhay/gogol | gogol-safebrowsing/gen/Network/Google/SafeBrowsing/Types/Product.hs | mpl-2.0 | -- | The list updates requested by the clients. The number of responses here
-- may be less than the number of requests sent by clients. This is the
-- case, for example, if the server has no updates for a particular list.
gssvftlurListUpdateResponses :: Lens' GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse ... | 553 | gssvftlurListUpdateResponses :: Lens' GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse [GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse]
gssvftlurListUpdateResponses
= lens _gssvftlurListUpdateResponses
(\ s a -> s{_gssvftlurListUpdateResponses = a})
. _Default
... | 330 | gssvftlurListUpdateResponses
= lens _gssvftlurListUpdateResponses
(\ s a -> s{_gssvftlurListUpdateResponses = a})
. _Default
. _Coerce | 154 | true | true | 2 | 8 | 82 | 59 | 30 | 29 | null | null |
verement/etamoo | src/MOO/Object.hs | bsd-3-clause | getContents :: Object -> [ObjId]
getContents = IS.elems . objectContents | 72 | getContents :: Object -> [ObjId]
getContents = IS.elems . objectContents | 72 | getContents = IS.elems . objectContents | 39 | false | true | 0 | 6 | 9 | 24 | 13 | 11 | null | null |
sinelaw/infernu | src/Infernu/Unify.hs | gpl-2.0 | -- | TUndefined <- TEmptyThis
unify' _ _ (TBody TUndefined) (TBody TEmptyThis) = return () | 90 | unify' _ _ (TBody TUndefined) (TBody TEmptyThis) = return () | 60 | unify' _ _ (TBody TUndefined) (TBody TEmptyThis) = return () | 60 | true | false | 0 | 7 | 14 | 33 | 16 | 17 | null | null |
frantisekfarka/ghc-dsi | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | nopOp Int2AddrOp = True | 27 | nopOp Int2AddrOp = True | 27 | nopOp Int2AddrOp = True | 27 | false | false | 1 | 5 | 7 | 13 | 4 | 9 | null | null |
ilikebits/euler | src/Util.hs | bsd-3-clause | -- Turn a list of digits into a number
fromDigits :: (Integral a) => [a] -> a
fromDigits digits = _fromDigits $ reverse digits | 126 | fromDigits :: (Integral a) => [a] -> a
fromDigits digits = _fromDigits $ reverse digits | 87 | fromDigits digits = _fromDigits $ reverse digits | 48 | true | true | 0 | 8 | 23 | 43 | 21 | 22 | null | null |
zouppen/stratum-tool | src/StratumClient.hs | agpl-3.0 | foreverDump :: Show a => TChan a -> IO b
foreverDump chan = forever $ do
a <- atomically $ readTChan chan
print a | 117 | foreverDump :: Show a => TChan a -> IO b
foreverDump chan = forever $ do
a <- atomically $ readTChan chan
print a | 117 | foreverDump chan = forever $ do
a <- atomically $ readTChan chan
print a | 76 | false | true | 0 | 10 | 27 | 55 | 24 | 31 | null | null |
rueshyna/gogol | gogol-play-moviespartner/gen/Network/Google/Resource/PlayMoviesPartner/Accounts/Avails/List.hs | mpl-2.0 | -- | Filter Avails that match (case-insensitive) any of the given
-- partner-specific custom ids.
aalAltIds :: Lens' AccountsAvailsList [Text]
aalAltIds
= lens _aalAltIds (\ s a -> s{_aalAltIds = a}) .
_Default
. _Coerce | 234 | aalAltIds :: Lens' AccountsAvailsList [Text]
aalAltIds
= lens _aalAltIds (\ s a -> s{_aalAltIds = a}) .
_Default
. _Coerce | 136 | aalAltIds
= lens _aalAltIds (\ s a -> s{_aalAltIds = a}) .
_Default
. _Coerce | 91 | true | true | 0 | 11 | 48 | 54 | 29 | 25 | null | null |
pikajude/concurrent-state | src/Control/Monad/RWS/Concurrent/Strict.hs | mit | execRWSCs :: (MonadFork m, Monoid w)
=> [RWSC r w s m a] -- ^ RWS computations to execute
-> r -- ^ environment
-> s -- ^ initial state
-> m (s, w) -- ^ final state and output
execRWSCs ms r s = liftM (\(_,s',w) -> (s',w)) $ runRWSCs ms r s | 280 | execRWSCs :: (MonadFork m, Monoid w)
=> [RWSC r w s m a] -- ^ RWS computations to execute
-> r -- ^ environment
-> s -- ^ initial state
-> m (s, w)
execRWSCs ms r s = liftM (\(_,s',w) -> (s',w)) $ runRWSCs ms r s | 252 | execRWSCs ms r s = liftM (\(_,s',w) -> (s',w)) $ runRWSCs ms r s | 64 | true | true | 0 | 11 | 93 | 113 | 61 | 52 | null | null |
diagrams/diagrams-contrib | src/Diagrams/TwoD/Path/Boolean.hs | bsd-3-clause | offsetMax :: Offset c V2 Double -> Double
offsetMax (OffsetClosed (V2 m n)) = max (abs m) (abs n) | 97 | offsetMax :: Offset c V2 Double -> Double
offsetMax (OffsetClosed (V2 m n)) = max (abs m) (abs n) | 97 | offsetMax (OffsetClosed (V2 m n)) = max (abs m) (abs n) | 55 | false | true | 2 | 9 | 18 | 58 | 27 | 31 | null | null |
petercrona/spring-clean | src/DependencyGraph.hs | mit | getUnused :: [Result] -> [Node]
getUnused xs = removeUsed (buildAutowiredMap xs) xs | 83 | getUnused :: [Result] -> [Node]
getUnused xs = removeUsed (buildAutowiredMap xs) xs | 83 | getUnused xs = removeUsed (buildAutowiredMap xs) xs | 51 | false | true | 0 | 8 | 11 | 41 | 19 | 22 | null | null |
fmapfmapfmap/amazonka | amazonka-cloudformation/gen/Network/AWS/CloudFormation/Types/Product.hs | mpl-2.0 | -- | The name associated with the stack.
sStackName :: Lens' Stack Text
sStackName = lens _sStackName (\ s a -> s{_sStackName = a}) | 131 | sStackName :: Lens' Stack Text
sStackName = lens _sStackName (\ s a -> s{_sStackName = a}) | 90 | sStackName = lens _sStackName (\ s a -> s{_sStackName = a}) | 59 | true | true | 0 | 9 | 23 | 40 | 22 | 18 | null | null |
radix/json-log-viewer | src/JsonLogViewer/UIUtils.hs | mit | makeCoolList
:: Show b
=> Int
-> T.Text
-> IO (UI.Widget (UI.List a b),
UI.Widget _W)
makeCoolList itemSize label = do
list <- UI.newList itemSize
topBorder <- UI.hBorder >>= UI.withHBorderLabel label
bottomBorder <- UI.hBorder >>= UI.withHBorderLabel "0/0"
bordered <- return topBorder
... | 1,350 | makeCoolList
:: Show b
=> Int
-> T.Text
-> IO (UI.Widget (UI.List a b),
UI.Widget _W)
makeCoolList itemSize label = do
list <- UI.newList itemSize
topBorder <- UI.hBorder >>= UI.withHBorderLabel label
bottomBorder <- UI.hBorder >>= UI.withHBorderLabel "0/0"
bordered <- return topBorder
... | 1,350 | makeCoolList itemSize label = do
list <- UI.newList itemSize
topBorder <- UI.hBorder >>= UI.withHBorderLabel label
bottomBorder <- UI.hBorder >>= UI.withHBorderLabel "0/0"
bordered <- return topBorder
<-->
(UI.vBorder <++> return list <++> UI.vBorder)
<-->
... | 1,247 | false | true | 0 | 21 | 387 | 475 | 220 | 255 | null | null |
mbakke/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | -- * SSH key types
sshkDsa :: String
sshkDsa = Types.sshKeyTypeToRaw DSA | 73 | sshkDsa :: String
sshkDsa = Types.sshKeyTypeToRaw DSA | 53 | sshkDsa = Types.sshKeyTypeToRaw DSA | 35 | true | true | 0 | 6 | 12 | 17 | 9 | 8 | null | null |
vluukkal/aspreify | testaspparse.hs | mit | tshoworhide2 = TestCase $ assertEqual "showorhide 2" (GShow [Plain (Const "waitingfor") [Sym (Var "_"),Sym (Var "_")] True]) (wrapparser showorhide "" "#show waitingfor(_,_).") | 176 | tshoworhide2 = TestCase $ assertEqual "showorhide 2" (GShow [Plain (Const "waitingfor") [Sym (Var "_"),Sym (Var "_")] True]) (wrapparser showorhide "" "#show waitingfor(_,_).") | 176 | tshoworhide2 = TestCase $ assertEqual "showorhide 2" (GShow [Plain (Const "waitingfor") [Sym (Var "_"),Sym (Var "_")] True]) (wrapparser showorhide "" "#show waitingfor(_,_).") | 176 | false | false | 0 | 14 | 21 | 73 | 36 | 37 | null | null |
plow-technologies/ble | src/Bluetooth/Internal/Device.hs | bsd-3-clause | connectTo :: Device -> BluetoothM ()
connectTo dev = callDeviceMethod dev "Connect" | 83 | connectTo :: Device -> BluetoothM ()
connectTo dev = callDeviceMethod dev "Connect" | 83 | connectTo dev = callDeviceMethod dev "Connect" | 46 | false | true | 0 | 7 | 11 | 28 | 13 | 15 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/Setup.hs | bsd-3-clause | allowNewerPrinter (Just (AllowNewerSome pkgs)) = map (Just . display) $ pkgs | 76 | allowNewerPrinter (Just (AllowNewerSome pkgs)) = map (Just . display) $ pkgs | 76 | allowNewerPrinter (Just (AllowNewerSome pkgs)) = map (Just . display) $ pkgs | 76 | false | false | 0 | 9 | 10 | 35 | 17 | 18 | null | null |
clample/lamdabtc | backend/test/Protocol/ServerTest.hs | bsd-3-clause | genericConnectionContext :: ConnectionContext
genericConnectionContext = ConnectionContext
{ _connectionContextVersion = 100
, _myAddr = Addr (0, 0, 0, 0) 80
, _connectionContextPeerAddr = Addr (0, 0, 0, 1) 80
, _connectionContextRelay = True
, _connectionContextTime = fromInteger 10000
, _connectionContext... | 499 | genericConnectionContext :: ConnectionContext
genericConnectionContext = ConnectionContext
{ _connectionContextVersion = 100
, _myAddr = Addr (0, 0, 0, 0) 80
, _connectionContextPeerAddr = Addr (0, 0, 0, 1) 80
, _connectionContextRelay = True
, _connectionContextTime = fromInteger 10000
, _connectionContext... | 499 | genericConnectionContext = ConnectionContext
{ _connectionContextVersion = 100
, _myAddr = Addr (0, 0, 0, 0) 80
, _connectionContextPeerAddr = Addr (0, 0, 0, 1) 80
, _connectionContextRelay = True
, _connectionContextTime = fromInteger 10000
, _connectionContextNetwork = TestNet3
, _mutableContext = Mutab... | 453 | false | true | 0 | 10 | 92 | 124 | 73 | 51 | null | null |
vTurbine/ghc | compiler/codeGen/StgCmmUtils.hs | bsd-3-clause | mkSimpleLit :: DynFlags -> Literal -> CmmLit
mkSimpleLit dflags (MachChar c) = CmmInt (fromIntegral (ord c)) (wordWidth dflags) | 132 | mkSimpleLit :: DynFlags -> Literal -> CmmLit
mkSimpleLit dflags (MachChar c) = CmmInt (fromIntegral (ord c)) (wordWidth dflags) | 132 | mkSimpleLit dflags (MachChar c) = CmmInt (fromIntegral (ord c)) (wordWidth dflags) | 87 | false | true | 0 | 9 | 22 | 53 | 26 | 27 | null | null |
snoyberg/ghc | compiler/basicTypes/OccName.hs | bsd-3-clause | mkDFunOcc :: String -- ^ Typically the class and type glommed together e.g. @OrdMaybe@.
-- Only used in debug mode, for extra clarity
-> Bool -- ^ Is this a hs-boot instance DFun?
-> OccSet -- ^ avoid these Occs
-> OccNa... | 709 | mkDFunOcc :: String -- ^ Typically the class and type glommed together e.g. @OrdMaybe@.
-- Only used in debug mode, for extra clarity
-> Bool -- ^ Is this a hs-boot instance DFun?
-> OccSet -- ^ avoid these Occs
-> OccNa... | 475 | mkDFunOcc info_str is_boot set
= chooseUniqueOcc VarName (prefix ++ info_str) set
where
prefix | is_boot = "$fx"
| otherwise = "$f" | 152 | true | true | 0 | 7 | 238 | 75 | 40 | 35 | null | null |
coreyoconnor/ansi-terminal | includes/Common-Include.hs | bsd-3-clause | cursorDown = hCursorDown stdout | 31 | cursorDown = hCursorDown stdout | 31 | cursorDown = hCursorDown stdout | 31 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
frontrowed/sendgrid | test/Spec.hs | mit | main :: IO ()
main = do
mKey <- fmap (Tagged . T.pack) <$> lookupEnv "API_KEY"
withSession $ \session ->
case mKey :: Maybe (Tagged ApiKey Text) of
Just key -> print =<< runReaderT (sendEmail exampleEmail') (key, session)
Nothing ->
print =<<
postWith (defaults & checkResponse .~ Jus... | 391 | main :: IO ()
main = do
mKey <- fmap (Tagged . T.pack) <$> lookupEnv "API_KEY"
withSession $ \session ->
case mKey :: Maybe (Tagged ApiKey Text) of
Just key -> print =<< runReaderT (sendEmail exampleEmail') (key, session)
Nothing ->
print =<<
postWith (defaults & checkResponse .~ Jus... | 391 | main = do
mKey <- fmap (Tagged . T.pack) <$> lookupEnv "API_KEY"
withSession $ \session ->
case mKey :: Maybe (Tagged ApiKey Text) of
Just key -> print =<< runReaderT (sendEmail exampleEmail') (key, session)
Nothing ->
print =<<
postWith (defaults & checkResponse .~ Just (\_ _ -> pur... | 377 | false | true | 0 | 20 | 91 | 150 | 74 | 76 | null | null |
brendanhay/gogol | gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs | mpl-2.0 | atId :: Lens' AbuseType (Maybe Text)
atId = lens _atId (\ s a -> s{_atId = a}) | 78 | atId :: Lens' AbuseType (Maybe Text)
atId = lens _atId (\ s a -> s{_atId = a}) | 78 | atId = lens _atId (\ s a -> s{_atId = a}) | 41 | false | true | 0 | 9 | 16 | 45 | 24 | 21 | null | null |
ghorn/dynobud | dynobud/examples/Spring.hs | lgpl-3.0 | dirCollOpts :: DirCollOptions
dirCollOpts = def
{ mapStrategy = Unroll
, collocationRoots = Legendre
} | 108 | dirCollOpts :: DirCollOptions
dirCollOpts = def
{ mapStrategy = Unroll
, collocationRoots = Legendre
} | 108 | dirCollOpts = def
{ mapStrategy = Unroll
, collocationRoots = Legendre
} | 78 | false | true | 0 | 7 | 20 | 35 | 17 | 18 | null | null |
enolan/cabal | Cabal/tests/PackageTests/PackageTester.hs | bsd-3-clause | requireSuccess :: (String, ExitCode, String) -> IO ()
requireSuccess (cmd, exitCode, output) =
unless (exitCode == ExitSuccess) $
assertFailure $ "Command " ++ cmd ++ " failed.\n" ++
"output: " ++ output | 223 | requireSuccess :: (String, ExitCode, String) -> IO ()
requireSuccess (cmd, exitCode, output) =
unless (exitCode == ExitSuccess) $
assertFailure $ "Command " ++ cmd ++ " failed.\n" ++
"output: " ++ output | 223 | requireSuccess (cmd, exitCode, output) =
unless (exitCode == ExitSuccess) $
assertFailure $ "Command " ++ cmd ++ " failed.\n" ++
"output: " ++ output | 169 | false | true | 0 | 13 | 51 | 75 | 40 | 35 | null | null |
ssaavedra/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString/Lazy/Char8.hs | bsd-3-clause | -- | /O(n)/ The 'unfoldr' function is analogous to the List \'unfoldr\'.
-- 'unfoldr' builds a ByteString from a seed value. The function takes
-- the element and returns 'Nothing' if it is done producing the
-- ByteString or returns 'Just' @(a,b)@, in which case, @a@ is a
-- prepending to the ByteString and @b@ is us... | 821 | unfoldr :: (a -> Maybe (Char, a)) -> a -> ByteString
unfoldr f = L.unfoldr $ \a -> case f a of
Nothing -> Nothing
Just (c, a') -> Just (c2w c, a')
------------------------------------------------------------------------
-- | 'takeWhile', app... | 454 | unfoldr f = L.unfoldr $ \a -> case f a of
Nothing -> Nothing
Just (c, a') -> Just (c2w c, a')
------------------------------------------------------------------------
-- | 'takeWhile', applied to a predicate @p@ and a ByteString @xs@,
-- ret... | 401 | true | true | 0 | 12 | 206 | 99 | 56 | 43 | null | null |
rudymatela/llcheck | src/Test/LeanCheck/Tiers.hs | bsd-3-clause | -- | Like 'cons1' but lifted over a 'Maybe' result.
--
-- This discard 'Nothing' values.
-- Only 'Just' values are returned.
maybeCons1 :: Listable a => (a -> Maybe b) -> [[b]]
maybeCons1 f = delay $ mapMaybeT f tiers | 219 | maybeCons1 :: Listable a => (a -> Maybe b) -> [[b]]
maybeCons1 f = delay $ mapMaybeT f tiers | 94 | maybeCons1 f = delay $ mapMaybeT f tiers | 42 | true | true | 2 | 10 | 42 | 60 | 30 | 30 | null | null |
pairyo/elm-compiler | src/Validate.hs | bsd-3-clause | validateDeclsHelp
:: Maybe String
-> A.Located D.SourceDecl'
-> [D.SourceDecl]
-> Result.Result wrn Error.Error [D.ValidDecl]
validateDeclsHelp comment (A.A region decl) decls =
let addRest validDecl =
(:) (A.A (region, comment) validDecl)
<$> validateDecls Nothing decls
in
case ... | 728 | validateDeclsHelp
:: Maybe String
-> A.Located D.SourceDecl'
-> [D.SourceDecl]
-> Result.Result wrn Error.Error [D.ValidDecl]
validateDeclsHelp comment (A.A region decl) decls =
let addRest validDecl =
(:) (A.A (region, comment) validDecl)
<$> validateDecls Nothing decls
in
case ... | 728 | validateDeclsHelp comment (A.A region decl) decls =
let addRest validDecl =
(:) (A.A (region, comment) validDecl)
<$> validateDecls Nothing decls
in
case decl of
D.Datatype name tvars ctors ->
addRest (D.Datatype name tvars ctors)
D.TypeAlias name tvars alias ->
addRest ... | 586 | false | true | 0 | 13 | 193 | 248 | 119 | 129 | null | null |
jimburton/steg | etc/InitialMain.hs | mit | matchHeader :: L.ByteString -> L.ByteString -> Maybe L.ByteString
matchHeader prefix str
| prefix `L8.isPrefixOf` str
= Just (L8.dropWhile isSpace (L.drop (L.length prefix) str))
| otherwise
= Nothing | 224 | matchHeader :: L.ByteString -> L.ByteString -> Maybe L.ByteString
matchHeader prefix str
| prefix `L8.isPrefixOf` str
= Just (L8.dropWhile isSpace (L.drop (L.length prefix) str))
| otherwise
= Nothing | 224 | matchHeader prefix str
| prefix `L8.isPrefixOf` str
= Just (L8.dropWhile isSpace (L.drop (L.length prefix) str))
| otherwise
= Nothing | 158 | false | true | 0 | 11 | 50 | 94 | 44 | 50 | null | null |
gridaphobe/target | examples/Map.hs | mit | -- | /O(log n)/. Lookup the value at a key in the map.
--
-- The function will return the corresponding value as @('Just' value)@,
-- or 'Nothing' if the key isn't in the map.
--
-- An example of using @lookup@:
--
-- > import Prelude hiding (lookup)
-- > import Data.Map
-- >
-- > employeeDept = fromList([("John","Sale... | 1,243 | lookup :: Ord k => k -> Map k a -> Maybe a
lookup = go
where
go _ Tip = Nothing
go k (Bin _ kx x l r) = case compare k kx of
LT -> go k l
GT -> go k r
EQ -> Just x
#if __GLASGOW_HASKELL__ >= 700
| 223 | lookup = go
where
go _ Tip = Nothing
go k (Bin _ kx x l r) = case compare k kx of
LT -> go k l
GT -> go k r
EQ -> Just x
#if __GLASGOW_HASKELL__ >= 700
| 180 | true | true | 0 | 8 | 280 | 141 | 82 | 59 | null | null |
kawamuray/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | firstDrbdPort :: Int
firstDrbdPort = 11000 | 42 | firstDrbdPort :: Int
firstDrbdPort = 11000 | 42 | firstDrbdPort = 11000 | 21 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
mscoutermarsh/exercism_coveralls | assignments/haskell/palindrome-products/palindrome-products_test.hs | agpl-3.0 | main :: IO ()
main = exitProperly $ runTestTT $ TestList
[ TestList palindromesTests ] | 93 | main :: IO ()
main = exitProperly $ runTestTT $ TestList
[ TestList palindromesTests ] | 93 | main = exitProperly $ runTestTT $ TestList
[ TestList palindromesTests ] | 79 | false | true | 1 | 8 | 21 | 36 | 16 | 20 | null | null |
paradoja/numerical-analysis-haskell | NA/Image.hs | gpl-3.0 | toList :: Image Word8 -> [Word8]
toList (Image red green blue) = toListAux (elems red) (elems green) (elems blue)
where toListAux (r:rs) (g:gs) (b:bs) = r:g:b:0:toListAux rs gs bs
toListAux _ _ _ = [] | 229 | toList :: Image Word8 -> [Word8]
toList (Image red green blue) = toListAux (elems red) (elems green) (elems blue)
where toListAux (r:rs) (g:gs) (b:bs) = r:g:b:0:toListAux rs gs bs
toListAux _ _ _ = [] | 229 | toList (Image red green blue) = toListAux (elems red) (elems green) (elems blue)
where toListAux (r:rs) (g:gs) (b:bs) = r:g:b:0:toListAux rs gs bs
toListAux _ _ _ = [] | 196 | false | true | 1 | 8 | 63 | 131 | 66 | 65 | null | null |
PuZZleDucK/Hls | Htrue.hs | gpl-3.0 | showVersion :: TrueOptions -> String
showVersion opts | (displayVersion opts) = concat (intersperse "\n" versionText)
| otherwise = "" | 151 | showVersion :: TrueOptions -> String
showVersion opts | (displayVersion opts) = concat (intersperse "\n" versionText)
| otherwise = "" | 151 | showVersion opts | (displayVersion opts) = concat (intersperse "\n" versionText)
| otherwise = "" | 114 | false | true | 0 | 9 | 35 | 58 | 25 | 33 | null | null |
feliposz/learning-stuff | haskell/learn_chapter8.hs | mit | treeList :: (Ord a) => Tree a -> [a]
treeList EmptyTree = [] | 60 | treeList :: (Ord a) => Tree a -> [a]
treeList EmptyTree = [] | 60 | treeList EmptyTree = [] | 23 | false | true | 0 | 7 | 12 | 35 | 18 | 17 | null | null |
isomorphism/csound-expression | src/Csound/Air/Wav.hs | bsd-3-clause | - | Writes mono signals to wav files.
writeWav1 :: String -> Sig -> SE ()
writeWav1 file = writeWav file . \x -> (x, x)
| 120 | writeWav1 :: String -> Sig -> SE ()
writeWav1 file = writeWav file . \x -> (x, x) | 81 | writeWav1 file = writeWav file . \x -> (x, x) | 45 | true | true | 1 | 9 | 26 | 70 | 33 | 37 | null | null |
dbp/hworker | example/src/Main.hs | isc | main = do mvar <- newMVar 3
hworker <- create "printer" (State mvar)
forkIO (worker hworker)
forkIO (monitor hworker)
forkIO (forever $ queue hworker PrintA >> threadDelay 1000000)
forkIO (forever $ queue hworker PrintB >> threadDelay 500000)
forever (threadDe... | 332 | main = do mvar <- newMVar 3
hworker <- create "printer" (State mvar)
forkIO (worker hworker)
forkIO (monitor hworker)
forkIO (forever $ queue hworker PrintA >> threadDelay 1000000)
forkIO (forever $ queue hworker PrintB >> threadDelay 500000)
forever (threadDe... | 332 | main = do mvar <- newMVar 3
hworker <- create "printer" (State mvar)
forkIO (worker hworker)
forkIO (monitor hworker)
forkIO (forever $ queue hworker PrintA >> threadDelay 1000000)
forkIO (forever $ queue hworker PrintB >> threadDelay 500000)
forever (threadDe... | 332 | false | false | 1 | 12 | 99 | 124 | 52 | 72 | null | null |
rimmington/cabal | Cabal/Distribution/InstalledPackageInfo.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- Description of the fields, for parsing/printing
fieldsInstalledPackageInfo :: [FieldDescr InstalledPackageInfo]
fieldsInstalledPackageInfo = basicFieldDescrs ++ installedFieldDescrs | 266 | fieldsInstalledPackageInfo :: [FieldDescr InstalledPackageInfo]
fieldsInstalledPackageInfo = basicFieldDescrs ++ installedFieldDescrs | 133 | fieldsInstalledPackageInfo = basicFieldDescrs ++ installedFieldDescrs | 69 | true | true | 0 | 6 | 18 | 23 | 13 | 10 | null | null |
sebastiaanvisser/salvia-protocol | src/Network/Protocol/Uri/Parser.hs | bsd-3-clause | -- 3.2.2. Host
pHost :: GenParser Char st Host
pHost = diff <$> pRegName -- <|> RegName <$> pRegName
where
diff a = either (const (RegName a)) sep (parse pHostname "" a)
sep a = if hst a then Hostname (Domain a) else ipreg a
ipreg a = if ip a then IP (toIP a) else RegName (intercalate "." a)
hst ... | 1,294 | pHost :: GenParser Char st Host
pHost = diff <$> pRegName -- <|> RegName <$> pRegName
where
diff a = either (const (RegName a)) sep (parse pHostname "" a)
sep a = if hst a then Hostname (Domain a) else ipreg a
ipreg a = if ip a then IP (toIP a) else RegName (intercalate "." a)
hst = not . all i... | 1,277 | pHost = diff <$> pRegName -- <|> RegName <$> pRegName
where
diff a = either (const (RegName a)) sep (parse pHostname "" a)
sep a = if hst a then Hostname (Domain a) else ipreg a
ipreg a = if ip a then IP (toIP a) else RegName (intercalate "." a)
hst = not . all isDigit . headDef "" . dropWhile ... | 1,245 | true | true | 1 | 14 | 447 | 295 | 144 | 151 | null | null |
sdiehl/ghc | hadrian/src/Settings/Default.hs | bsd-3-clause | -- | All default command line arguments.
defaultArgs :: Args
defaultArgs = mconcat
[ defaultBuilderArgs
, sourceArgs defaultSourceArgs
, defaultPackageArgs ] | 169 | defaultArgs :: Args
defaultArgs = mconcat
[ defaultBuilderArgs
, sourceArgs defaultSourceArgs
, defaultPackageArgs ] | 128 | defaultArgs = mconcat
[ defaultBuilderArgs
, sourceArgs defaultSourceArgs
, defaultPackageArgs ] | 108 | true | true | 0 | 6 | 32 | 27 | 15 | 12 | null | null |
tonyday567/trade | src/Data/TBar.hs | mit | timeFold :: NominalDiffTime -> SFold Trade TBar
timeFold grain = SFold toNextClose mappend mempty release flush
where
toNextClose (Trade t p v) =
TBarX (Just $ TBar (ceilingTime t grain) t t p v) [] | 213 | timeFold :: NominalDiffTime -> SFold Trade TBar
timeFold grain = SFold toNextClose mappend mempty release flush
where
toNextClose (Trade t p v) =
TBarX (Just $ TBar (ceilingTime t grain) t t p v) [] | 213 | timeFold grain = SFold toNextClose mappend mempty release flush
where
toNextClose (Trade t p v) =
TBarX (Just $ TBar (ceilingTime t grain) t t p v) [] | 165 | false | true | 0 | 10 | 49 | 88 | 42 | 46 | null | null |
garrettoreilly/doompiler | src/Parser.hs | mit | getId :: [Token] -> [Token]
getId all@(Token Error _ _ _ : xs) = all | 68 | getId :: [Token] -> [Token]
getId all@(Token Error _ _ _ : xs) = all | 68 | getId all@(Token Error _ _ _ : xs) = all | 40 | false | true | 1 | 10 | 14 | 50 | 24 | 26 | null | null |
5outh/Bang | src/Examples/syntaxRebound.hs | mit | music2 = bang $ do
bd <> bd
hc <> cc
where (>>) = (><) | 60 | music2 = bang $ do
bd <> bd
hc <> cc
where (>>) = (><) | 60 | music2 = bang $ do
bd <> bd
hc <> cc
where (>>) = (><) | 60 | false | false | 0 | 8 | 20 | 36 | 19 | 17 | null | null |
wolftune/snowbot | Main.hs | gpl-3.0 | getLog :: Query BotState (Map UTCTime TimeSlice)
getLog = ask >>= return . bsLog | 80 | getLog :: Query BotState (Map UTCTime TimeSlice)
getLog = ask >>= return . bsLog | 80 | getLog = ask >>= return . bsLog | 31 | false | true | 0 | 7 | 13 | 32 | 16 | 16 | null | null |
rahulmutt/ghcvm | compiler/Eta/BasicTypes/OccName.hs | bsd-3-clause | mkSpecOcc = mk_simple_deriv varName "$s" | 51 | mkSpecOcc = mk_simple_deriv varName "$s" | 51 | mkSpecOcc = mk_simple_deriv varName "$s" | 51 | false | false | 0 | 5 | 15 | 11 | 5 | 6 | null | null |
adamwalker/haskell_cudd | Cudd/Imperative.hs | bsd-3-clause | ithVar :: DDManager s u -> Int -> ST s (DDNode s u)
ithVar (DDManager m) i = liftM DDNode $ unsafeIOToST $ c_cuddBddIthVar m (fromIntegral i) | 141 | ithVar :: DDManager s u -> Int -> ST s (DDNode s u)
ithVar (DDManager m) i = liftM DDNode $ unsafeIOToST $ c_cuddBddIthVar m (fromIntegral i) | 141 | ithVar (DDManager m) i = liftM DDNode $ unsafeIOToST $ c_cuddBddIthVar m (fromIntegral i) | 89 | false | true | 0 | 9 | 26 | 70 | 33 | 37 | null | null |
kim/amazonka | amazonka-swf/gen/Network/AWS/SWF/DescribeWorkflowType.hs | mpl-2.0 | -- | 'DescribeWorkflowTypeResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'dwtrConfiguration' @::@ 'WorkflowTypeConfiguration'
--
-- * 'dwtrTypeInfo' @::@ 'WorkflowTypeInfo'
--
describeWorkflowTypeResponse :: WorkflowTypeInfo -- ^ 'dwtrTypeInfo'
... | 566 | describeWorkflowTypeResponse :: WorkflowTypeInfo -- ^ 'dwtrTypeInfo'
-> WorkflowTypeConfiguration -- ^ 'dwtrConfiguration'
-> DescribeWorkflowTypeResponse
describeWorkflowTypeResponse p1 p2 = DescribeWorkflowTypeResponse
{ _dwtrTypeInfo = p1
, _dwtr... | 344 | describeWorkflowTypeResponse p1 p2 = DescribeWorkflowTypeResponse
{ _dwtrTypeInfo = p1
, _dwtrConfiguration = p2
} | 131 | true | true | 0 | 7 | 127 | 52 | 32 | 20 | null | null |
flowbox-public/accelerate-cuda | Data/Array/Accelerate/CUDA/CodeGen/Constant.hs | bsd-3-clause | nonnum (TypeCSChar _) x = [cexp|$char:(chr (fromIntegral x))|] | 62 | nonnum (TypeCSChar _) x = [cexp|$char:(chr (fromIntegral x))|] | 62 | nonnum (TypeCSChar _) x = [cexp|$char:(chr (fromIntegral x))|] | 62 | false | false | 0 | 7 | 7 | 21 | 12 | 9 | null | null |
johnpmayer/elm-compiler | src/Canonicalize/Environment.hs | bsd-3-clause | toDealiaser :: Environment -> Map.Map String String
toDealiaser (Env _ _ adts aliases _) =
let
dealiasAdt (localName, canonicalSet) =
case Set.toList canonicalSet of
[canonicalName] ->
Just (Var.toString canonicalName, localName)
_ ->
Nothing
dealiasAlias (localN... | 815 | toDealiaser :: Environment -> Map.Map String String
toDealiaser (Env _ _ adts aliases _) =
let
dealiasAdt (localName, canonicalSet) =
case Set.toList canonicalSet of
[canonicalName] ->
Just (Var.toString canonicalName, localName)
_ ->
Nothing
dealiasAlias (localN... | 815 | toDealiaser (Env _ _ adts aliases _) =
let
dealiasAdt (localName, canonicalSet) =
case Set.toList canonicalSet of
[canonicalName] ->
Just (Var.toString canonicalName, localName)
_ ->
Nothing
dealiasAlias (localName, canonicalSet) =
case Set.toList canonical... | 763 | false | true | 0 | 15 | 238 | 268 | 137 | 131 | null | null |
wavewave/lhc-analysis-collection | heavyhiggs/MCRun_standardcandle.hs | gpl-3.0 | -- |
getWSetup :: (Double,Int) -> IO (WorkSetup SM)
getWSetup (sqrts,n) = WS <$> getScriptSetup
<*> pure processSetup
<*> pure pset
<*> pure (rsetup sqrts n)
<*> pure (WebDAVRemoteDir "montecarlo/HeavyHiggs/standardcandle... | 322 | getWSetup :: (Double,Int) -> IO (WorkSetup SM)
getWSetup (sqrts,n) = WS <$> getScriptSetup
<*> pure processSetup
<*> pure pset
<*> pure (rsetup sqrts n)
<*> pure (WebDAVRemoteDir "montecarlo/HeavyHiggs/standardcandle") | 316 | getWSetup (sqrts,n) = WS <$> getScriptSetup
<*> pure processSetup
<*> pure pset
<*> pure (rsetup sqrts n)
<*> pure (WebDAVRemoteDir "montecarlo/HeavyHiggs/standardcandle") | 269 | true | true | 0 | 9 | 128 | 86 | 43 | 43 | null | null |
lihlcnkr/codejam | Setup.hs | apache-2.0 | main = do
let ss = checkNumberContains 7341 empty
putStrLn $ show ss | 72 | main = do
let ss = checkNumberContains 7341 empty
putStrLn $ show ss | 72 | main = do
let ss = checkNumberContains 7341 empty
putStrLn $ show ss | 72 | false | false | 0 | 10 | 16 | 30 | 13 | 17 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Layout/Groups/Examples.hs | bsd-2-clause | _tab c l = renamed [CutWordsLeft 1] $ addTabs (tabsShrinker c) (tabsTheme c) l | 78 | _tab c l = renamed [CutWordsLeft 1] $ addTabs (tabsShrinker c) (tabsTheme c) l | 78 | _tab c l = renamed [CutWordsLeft 1] $ addTabs (tabsShrinker c) (tabsTheme c) l | 78 | false | false | 0 | 8 | 13 | 43 | 20 | 23 | null | null |
beni55/aeson | Data/Aeson/Parser/Internal.hs | bsd-3-clause | unescape :: ByteString -> Either String ByteString
unescape s = unsafePerformIO $ do
let len = B.length s
fp <- B.mallocByteString len
-- We perform no bounds checking when writing to the destination
-- string, as unescaping always makes it shorter than the source.
withForeignPtr fp $ \ptr -> do
ret <- Z.... | 1,884 | unescape :: ByteString -> Either String ByteString
unescape s = unsafePerformIO $ do
let len = B.length s
fp <- B.mallocByteString len
-- We perform no bounds checking when writing to the destination
-- string, as unescaping always makes it shorter than the source.
withForeignPtr fp $ \ptr -> do
ret <- Z.... | 1,884 | unescape s = unsafePerformIO $ do
let len = B.length s
fp <- B.mallocByteString len
-- We perform no bounds checking when writing to the destination
-- string, as unescaping always makes it shorter than the source.
withForeignPtr fp $ \ptr -> do
ret <- Z.parseT (go ptr) s
case ret of
Left err ->... | 1,833 | false | true | 1 | 30 | 816 | 590 | 284 | 306 | null | null |
joshcough/L5-Haskell | src/L/L1/L1.hs | mit | l1Interpreter :: Interpreter L1
l1Interpreter = interpL1 | 56 | l1Interpreter :: Interpreter L1
l1Interpreter = interpL1 | 56 | l1Interpreter = interpL1 | 24 | false | true | 1 | 5 | 6 | 18 | 7 | 11 | null | null |
ianagbip1oti/ProC | src/ProC/Interpreter.hs | mit | exec (Print s) = eval s >>= liftIO . putStrLn | 52 | exec (Print s) = eval s >>= liftIO . putStrLn | 52 | exec (Print s) = eval s >>= liftIO . putStrLn | 52 | false | false | 0 | 7 | 16 | 27 | 12 | 15 | null | null |
ghc-android/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | mkTyApps f args = foldl (\ e a -> App e (Type a)) f args | 57 | mkTyApps f args = foldl (\ e a -> App e (Type a)) f args | 57 | mkTyApps f args = foldl (\ e a -> App e (Type a)) f args | 57 | false | false | 1 | 10 | 15 | 44 | 19 | 25 | null | null |
isomorphism/csound-expression | src/Csound/Tab.hs | bsd-3-clause | -- | Sets an absolute size value. As you can do it in the Csound files.
setSize :: Int -> Tab -> Tab
setSize n = updateTabSize $ const (SizePlain n) | 148 | setSize :: Int -> Tab -> Tab
setSize n = updateTabSize $ const (SizePlain n) | 76 | setSize n = updateTabSize $ const (SizePlain n) | 47 | true | true | 2 | 8 | 30 | 42 | 19 | 23 | null | null |
jrahm/DuckTest | src/DuckTest/Internal/State/Instance.hs | bsd-2-clause | handleClass :: InternalState SrcSpan -> String -> [Statement SrcSpan] -> SrcSpan -> DuckTest SrcSpan (InternalState SrcSpan)
{-| Handle observing a class.-}
handleClass state name body pos = do
{- This is done in several parts thanks to Python's annoying
- semantics when it comes to dealing with classes. First... | 2,752 | handleClass :: InternalState SrcSpan -> String -> [Statement SrcSpan] -> SrcSpan -> DuckTest SrcSpan (InternalState SrcSpan)
handleClass state name body pos = do
{- This is done in several parts thanks to Python's annoying
- semantics when it comes to dealing with classes. First stage,
- we infer the *sta... | 2,720 | handleClass state name body pos = do
{- This is done in several parts thanks to Python's annoying
- semantics when it comes to dealing with classes. First stage,
- we infer the *static* varibales of the class. Then we can
- go through and check all the methods as if they are static methods.
-
... | 2,595 | true | true | 0 | 18 | 703 | 512 | 237 | 275 | null | null |
da-x/Algorithm-W-Step-By-Step | Lamdu/Expr/Val/Arbitrary.hs | gpl-3.0 | exprGen :: Arbitrary a => Map V.GlobalId Scheme -> Gen (Val a)
exprGen globals =
(`evalStateT` names) .
(`runReaderT` Env [] globals) $
arbitraryExpr | 161 | exprGen :: Arbitrary a => Map V.GlobalId Scheme -> Gen (Val a)
exprGen globals =
(`evalStateT` names) .
(`runReaderT` Env [] globals) $
arbitraryExpr | 161 | exprGen globals =
(`evalStateT` names) .
(`runReaderT` Env [] globals) $
arbitraryExpr | 98 | false | true | 0 | 9 | 35 | 68 | 36 | 32 | null | null |
nevrenato/HetsAlloy | utils/DrIFT-src/DataP.hs | gpl-2.0 | conrecdecl :: Parser Body
conrecdecl = do
x <- constructorP
(ls, ts) <- record +++ fmap (\ a -> ([], a)) (many type2)
return $ Body x ls ts | 160 | conrecdecl :: Parser Body
conrecdecl = do
x <- constructorP
(ls, ts) <- record +++ fmap (\ a -> ([], a)) (many type2)
return $ Body x ls ts | 160 | conrecdecl = do
x <- constructorP
(ls, ts) <- record +++ fmap (\ a -> ([], a)) (many type2)
return $ Body x ls ts | 134 | false | true | 0 | 14 | 49 | 85 | 41 | 44 | null | null |
romanb/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs | mpl-2.0 | -- | This parameter depends on the repository type.
--
-- For Amazon S3 bundles, set 'Username' to the appropriate IAM access key ID. For HTTP bundles, Git repositories, and Subversion repositories, set
-- 'Username' to the user name.
sUsername :: Lens' Source (Maybe Text)
sUsername = lens _sUsername (\s a -> s { _sUse... | 332 | sUsername :: Lens' Source (Maybe Text)
sUsername = lens _sUsername (\s a -> s { _sUsername = a }) | 97 | sUsername = lens _sUsername (\s a -> s { _sUsername = a }) | 58 | true | true | 0 | 9 | 57 | 49 | 28 | 21 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/iface/BuildTyCl.hs | bsd-3-clause | buildPatSyn :: Name -> Bool
-> (Id,Bool) -> Maybe (Id, Bool)
-> ([TyVar], ThetaType) -- ^ Univ and req
-> ([TyVar], ThetaType) -- ^ Ex and prov
-> [Type] -- ^ Argument types
-> Type -- ^ Result type
-> PatSyn
buildPatS... | 1,183 | buildPatSyn :: Name -> Bool
-> (Id,Bool) -> Maybe (Id, Bool)
-> ([TyVar], ThetaType) -- ^ Univ and req
-> ([TyVar], ThetaType) -- ^ Ex and prov
-> [Type] -- ^ Argument types
-> Type -- ^ Result type
-> PatSyn
buildPatS... | 1,183 | buildPatSyn src_name declared_infix matcher@(matcher_id,_) builder
(univ_tvs, req_theta) (ex_tvs, prov_theta) arg_tys pat_ty
= ASSERT((and [ univ_tvs == univ_tvs'
, ex_tvs == ex_tvs'
, pat_ty `eqType` pat_ty'
, prov_theta `eqTypes` prov_theta'
... | 872 | false | true | 3 | 12 | 392 | 299 | 176 | 123 | null | null |
sebastiaanvisser/AwesomePrelude | src/Generic/Control/Function.hs | bsd-3-clause | undefined :: a
undefined = Prelude.undefined | 44 | undefined :: a
undefined = Prelude.undefined | 44 | undefined = Prelude.undefined | 29 | false | true | 0 | 5 | 5 | 13 | 7 | 6 | null | null |
edsko/cabal | cabal-install/Distribution/Client/Sandbox.hs | bsd-3-clause | getInstalledPackagesInSandbox :: Verbosity -> ConfigFlags
-> Compiler -> ProgramConfiguration
-> IO InstalledPackageIndex
getInstalledPackagesInSandbox verbosity configFlags comp conf = do
sandboxDB <- getSandboxPackageDB configFlags
getPackageDB... | 407 | getInstalledPackagesInSandbox :: Verbosity -> ConfigFlags
-> Compiler -> ProgramConfiguration
-> IO InstalledPackageIndex
getInstalledPackagesInSandbox verbosity configFlags comp conf = do
sandboxDB <- getSandboxPackageDB configFlags
getPackageDB... | 407 | getInstalledPackagesInSandbox verbosity configFlags comp conf = do
sandboxDB <- getSandboxPackageDB configFlags
getPackageDBContents verbosity comp sandboxDB conf
-- | Temporarily add $SANDBOX_DIR/bin to $PATH. | 219 | false | true | 0 | 9 | 109 | 62 | 29 | 33 | null | null |
sgraf812/lowgl | Graphics/GL/Low/Texture.hs | bsd-2-clause | -- | Create a new 2D texture from a blob and its dimensions. Dimensions should
-- be powers of two. The internal format type determines how the data is
-- interpreted.
newTexture2D :: (MonadIO m, Storable a, InternalFormat b)
=> Vector a
-> Dimensions
-> m (Tex2D b)
newTexture2D b... | 851 | newTexture2D :: (MonadIO m, Storable a, InternalFormat b)
=> Vector a
-> Dimensions
-> m (Tex2D b)
newTexture2D bytes (Dimensions w h) = do
n <- liftIO $ alloca (\ptr -> glGenTextures 1 ptr >> peek ptr)
glBindTexture GL_TEXTURE_2D n
tex <- return (Tex2D n)
liftIO . unsafe... | 683 | newTexture2D bytes (Dimensions w h) = do
n <- liftIO $ alloca (\ptr -> glGenTextures 1 ptr >> peek ptr)
glBindTexture GL_TEXTURE_2D n
tex <- return (Tex2D n)
liftIO . unsafeWith bytes $ \ptr -> glTexImage2D
GL_TEXTURE_2D
0
(internalFormat tex)
(fromIntegral w)
(fromIntegral h)
0
(in... | 545 | true | true | 0 | 13 | 212 | 208 | 100 | 108 | null | null |
urbanslug/ghc | testsuite/tests/indexed-types/should_fail/SimpleFail5b.hs | bsd-3-clause | -- must fail: Can't match Int against Char
bar3wrong' D3Int = 1 | 64 | bar3wrong' D3Int = 1 | 21 | bar3wrong' D3Int = 1 | 21 | true | false | 0 | 5 | 12 | 10 | 5 | 5 | null | null |
cmahon/backtests | backtests.hs | bsd-3-clause | cmlPctReturn :: Return
cmlPctReturn = V.scanl (\x y -> x * (1+y)) 1 | 67 | cmlPctReturn :: Return
cmlPctReturn = V.scanl (\x y -> x * (1+y)) 1 | 67 | cmlPctReturn = V.scanl (\x y -> x * (1+y)) 1 | 44 | false | true | 0 | 10 | 12 | 39 | 21 | 18 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.