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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ghc-android/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | justDataConKey = mkPreludeDataConUnique 9 | 67 | justDataConKey = mkPreludeDataConUnique 9 | 67 | justDataConKey = mkPreludeDataConUnique 9 | 67 | false | false | 0 | 5 | 29 | 9 | 4 | 5 | null | null |
lostbean/radio-fm69 | src/Radio/RFM69.hs | bsd-3-clause | putStrLnD :: String -> Radio ()
putStrLnD s = asksCfg debugMode >>= \dbg -> when dbg (liftIO $ putStrLn s) | 106 | putStrLnD :: String -> Radio ()
putStrLnD s = asksCfg debugMode >>= \dbg -> when dbg (liftIO $ putStrLn s) | 106 | putStrLnD s = asksCfg debugMode >>= \dbg -> when dbg (liftIO $ putStrLn s) | 74 | false | true | 0 | 10 | 19 | 50 | 24 | 26 | null | null |
irreverent-pixel-feats/bitbucket | bitbucket-core/test/Test/Irreverent/Bitbucket/Core/Arbitraries.hs | bsd-3-clause | privacies :: Gen Privacy
privacies = elements [Public, Private] | 63 | privacies :: Gen Privacy
privacies = elements [Public, Private] | 63 | privacies = elements [Public, Private] | 38 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
wdanilo/convert | src/Data/Convert/Base.hs | apache-2.0 | casted :: IsoCastable a b => Iso' a b
casted = iso cast cast | 60 | casted :: IsoCastable a b => Iso' a b
casted = iso cast cast | 60 | casted = iso cast cast | 22 | false | true | 0 | 6 | 13 | 30 | 14 | 16 | null | null |
bitemyapp/wreq | Network/Wreq/Lens.hs | bsd-3-clause | -- | A lens onto the numeric identifier of an HTTP status.
statusCode :: Lens' Status Int
statusCode = TH.statusCode | 116 | statusCode :: Lens' Status Int
statusCode = TH.statusCode | 57 | statusCode = TH.statusCode | 26 | true | true | 0 | 5 | 19 | 19 | 10 | 9 | null | null |
brendanhay/gogol | gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs | mpl-2.0 | -- | List of flags.
flrItems :: Lens' FlagsListResponse [Flag]
flrItems
= lens _flrItems (\ s a -> s{_flrItems = a}) .
_Default
. _Coerce | 151 | flrItems :: Lens' FlagsListResponse [Flag]
flrItems
= lens _flrItems (\ s a -> s{_flrItems = a}) .
_Default
. _Coerce | 131 | flrItems
= lens _flrItems (\ s a -> s{_flrItems = a}) .
_Default
. _Coerce | 88 | true | true | 2 | 10 | 38 | 57 | 28 | 29 | null | null |
Bodigrim/katas | src/haskell/2-Befunge-Interpreter.hs | bsd-2-clause | charToUnaryOp :: Char -> Int -> Int
charToUnaryOp '!' a = if a==0 then 1 else 0 | 79 | charToUnaryOp :: Char -> Int -> Int
charToUnaryOp '!' a = if a==0 then 1 else 0 | 79 | charToUnaryOp '!' a = if a==0 then 1 else 0 | 43 | false | true | 0 | 6 | 16 | 36 | 19 | 17 | null | null |
Luizss/TheSystem | src/Command.hs | bsd-3-clause | withArgsMeansError :: Command -> String -> Command
withArgsMeansError cmd "" = cmd | 82 | withArgsMeansError :: Command -> String -> Command
withArgsMeansError cmd "" = cmd | 82 | withArgsMeansError cmd "" = cmd | 31 | false | true | 0 | 6 | 11 | 24 | 12 | 12 | null | null |
glguy/GhcPkgUtils | CabalVersions.hs | bsd-3-clause | entriesToPaths (Tar.Fail e) = fail (show e) | 46 | entriesToPaths (Tar.Fail e) = fail (show e) | 46 | entriesToPaths (Tar.Fail e) = fail (show e) | 46 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
icyfork/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkInexplicablyUnquoted3 = verifyNot checkInexplicablyUnquoted "wget --user-agent='something'" | 101 | prop_checkInexplicablyUnquoted3 = verifyNot checkInexplicablyUnquoted "wget --user-agent='something'" | 101 | prop_checkInexplicablyUnquoted3 = verifyNot checkInexplicablyUnquoted "wget --user-agent='something'" | 101 | false | false | 0 | 5 | 5 | 11 | 5 | 6 | null | null |
luzhuomi/xhaskell | Language/XHaskell/TypeSpec.hs | bsd-3-clause | -- isEmpty :: r -> [| v -> Bool |]
-- |- v : r
isEmpty :: Re -> Q Exp
isEmpty (Star r) = [| \ v -> case v of { [] -> True
; xs@(_:_) -> all $(isEmpty r) xs } |] | 204 | isEmpty :: Re -> Q Exp
isEmpty (Star r) = [| \ v -> case v of { [] -> True
; xs@(_:_) -> all $(isEmpty r) xs } |] | 153 | isEmpty (Star r) = [| \ v -> case v of { [] -> True
; xs@(_:_) -> all $(isEmpty r) xs } |] | 130 | true | true | 0 | 7 | 88 | 32 | 18 | 14 | null | null |
vincenthz/hs-foundation | foundation/Foundation/Partial.hs | bsd-3-clause | fromRight :: Either a b -> Partial b
fromRight x = partial $
case x of
Left _ -> partialError "fromRight" "Left"
Right a -> a
-- Grab the Left value of an Either | 182 | fromRight :: Either a b -> Partial b
fromRight x = partial $
case x of
Left _ -> partialError "fromRight" "Left"
Right a -> a
-- Grab the Left value of an Either | 182 | fromRight x = partial $
case x of
Left _ -> partialError "fromRight" "Left"
Right a -> a
-- Grab the Left value of an Either | 145 | false | true | 0 | 9 | 54 | 63 | 28 | 35 | null | null |
brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Agent/Intents/List.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
pailUploadType :: Lens' ProjectsAgentIntentsList (Maybe Text)
pailUploadType
= lens _pailUploadType
(\ s a -> s{_pailUploadType = a}) | 212 | pailUploadType :: Lens' ProjectsAgentIntentsList (Maybe Text)
pailUploadType
= lens _pailUploadType
(\ s a -> s{_pailUploadType = a}) | 141 | pailUploadType
= lens _pailUploadType
(\ s a -> s{_pailUploadType = a}) | 79 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
takano-akio/ordrea | FRP/Ordrea/Base.hs | cc0-1.0 | expandE :: Event a -> Event [a]
expandE = transformEvent1 (:[]) | 63 | expandE :: Event a -> Event [a]
expandE = transformEvent1 (:[]) | 63 | expandE = transformEvent1 (:[]) | 31 | false | true | 0 | 7 | 10 | 33 | 17 | 16 | null | null |
spinda/liquidhaskell | src/Language/Haskell/Liquid/Spec/Lookup.hs | bsd-3-clause | lookupGhcDataCon :: (GhcLookup n, PPrint n) => Located n -> Ghc DataCon
lookupGhcDataCon = lookupGhcThing "data constructor" tyThingDataCon_maybe | 145 | lookupGhcDataCon :: (GhcLookup n, PPrint n) => Located n -> Ghc DataCon
lookupGhcDataCon = lookupGhcThing "data constructor" tyThingDataCon_maybe | 145 | lookupGhcDataCon = lookupGhcThing "data constructor" tyThingDataCon_maybe | 73 | false | true | 0 | 7 | 17 | 41 | 20 | 21 | null | null |
yugr/sudoku | src/Board.hs | mit | indices (size, _) = [0 .. size - 1] | 35 | indices (size, _) = [0 .. size - 1] | 35 | indices (size, _) = [0 .. size - 1] | 35 | false | false | 0 | 6 | 8 | 25 | 14 | 11 | null | null |
gsnewmark/cis194 | src/Cis194/Week3/Lecture.hs | apache-2.0 | exampleList = Cons (-1) (Cons 2 (Cons (-6) Empty)) | 50 | exampleList = Cons (-1) (Cons 2 (Cons (-6) Empty)) | 50 | exampleList = Cons (-1) (Cons 2 (Cons (-6) Empty)) | 50 | false | false | 0 | 11 | 8 | 37 | 19 | 18 | null | null |
Peaker/git-pushq | PushQ.hs | gpl-2.0 | getTestingBranches :: Git.RepoPath -> IO [(Int, String, Git.Branch)]
getTestingBranches repoPath =
do branches <-
map extractPrefix
<$> filterBranchesByPrefix repoPath "testing/" Git.LocalBranch
return $ sort branches
where
extractPrefix (fullName, branch) =
... | 507 | getTestingBranches :: Git.RepoPath -> IO [(Int, String, Git.Branch)]
getTestingBranches repoPath =
do branches <-
map extractPrefix
<$> filterBranchesByPrefix repoPath "testing/" Git.LocalBranch
return $ sort branches
where
extractPrefix (fullName, branch) =
... | 507 | getTestingBranches repoPath =
do branches <-
map extractPrefix
<$> filterBranchesByPrefix repoPath "testing/" Git.LocalBranch
return $ sort branches
where
extractPrefix (fullName, branch) =
(num, name, branch)
where
(num, name) = f... | 438 | false | true | 2 | 10 | 148 | 124 | 64 | 60 | null | null |
FPtje/GLuaFixer | src/GLua/Parser.hs | lgpl-2.1 | -- lvl7 is unary operators
lvl8 = [(Power, APower)] | 51 | lvl8 = [(Power, APower)] | 24 | lvl8 = [(Power, APower)] | 24 | true | false | 0 | 6 | 8 | 16 | 10 | 6 | null | null |
Hodapp87/ivory | ivory-eval/src/Ivory/Eval.hs | bsd-3-clause | numBinOp :: (forall a. Num a => a -> a -> a) -> Value -> Value -> Value
numBinOp op (Sint8 x) (Sint8 y) = Sint8 (op x y) | 123 | numBinOp :: (forall a. Num a => a -> a -> a) -> Value -> Value -> Value
numBinOp op (Sint8 x) (Sint8 y) = Sint8 (op x y) | 123 | numBinOp op (Sint8 x) (Sint8 y) = Sint8 (op x y) | 51 | false | true | 0 | 10 | 31 | 76 | 38 | 38 | null | null |
wavewave/madgraph-auto-dataset | src/HEP/Automation/MadGraph/Dataset/Set20110330set1.hs | gpl-3.0 | psetup_sixfull_tb :: ProcessSetup
psetup_sixfull_tb = PS {
mversion = MadGraph5
, model = SixFull
, process = processTB
, processBrief = "tb"
, workname = "330SixFull"
} | 190 | psetup_sixfull_tb :: ProcessSetup
psetup_sixfull_tb = PS {
mversion = MadGraph5
, model = SixFull
, process = processTB
, processBrief = "tb"
, workname = "330SixFull"
} | 190 | psetup_sixfull_tb = PS {
mversion = MadGraph5
, model = SixFull
, process = processTB
, processBrief = "tb"
, workname = "330SixFull"
} | 156 | false | true | 0 | 7 | 47 | 53 | 29 | 24 | null | null |
jaspervdj/firefly | src/Firefly/Input/Keys.hs | bsd-3-clause | kpmultiply :: Key
kpmultiply = Key 268 | 38 | kpmultiply :: Key
kpmultiply = Key 268 | 38 | kpmultiply = Key 268 | 20 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
kinoru/wild | src/RawFilePath.hs | agpl-3.0 | getDirectoryContents :: RawFilePath -> IO [RawFilePath]
getDirectoryContents dirPath = bracket open close repeatRead
where
open = openDirStream dirPath
close = closeDirStream
repeatRead stream = do
d <- readDirStream stream
if B.length d == 0 then return [] else do
rest <- repe... | 363 | getDirectoryContents :: RawFilePath -> IO [RawFilePath]
getDirectoryContents dirPath = bracket open close repeatRead
where
open = openDirStream dirPath
close = closeDirStream
repeatRead stream = do
d <- readDirStream stream
if B.length d == 0 then return [] else do
rest <- repe... | 363 | getDirectoryContents dirPath = bracket open close repeatRead
where
open = openDirStream dirPath
close = closeDirStream
repeatRead stream = do
d <- readDirStream stream
if B.length d == 0 then return [] else do
rest <- repeatRead stream
return $ d : rest | 307 | false | true | 0 | 11 | 101 | 111 | 52 | 59 | null | null |
dselsam/tc | src/Kernel/TypeChecker/Internal.hs | gpl-3.0 | unfoldNames :: Expr -> TCMethod Expr
unfoldNames e = case e of
App app -> let (op, args) = getAppOpArgs e in
flip mkAppSeq args <$> unfoldNameCore op
_ -> unfoldNameCore e | 189 | unfoldNames :: Expr -> TCMethod Expr
unfoldNames e = case e of
App app -> let (op, args) = getAppOpArgs e in
flip mkAppSeq args <$> unfoldNameCore op
_ -> unfoldNameCore e | 189 | unfoldNames e = case e of
App app -> let (op, args) = getAppOpArgs e in
flip mkAppSeq args <$> unfoldNameCore op
_ -> unfoldNameCore e | 152 | false | true | 0 | 12 | 49 | 80 | 36 | 44 | null | null |
SAdams601/ParRegexSearch | test/tasty-0.9.0.1/Test/Tasty/Options/Env.hs | mit | suiteEnvOptions :: [Ingredient] -> TestTree -> IO OptionSet
suiteEnvOptions ins tree = getEnvOptions $ suiteOptions ins tree | 124 | suiteEnvOptions :: [Ingredient] -> TestTree -> IO OptionSet
suiteEnvOptions ins tree = getEnvOptions $ suiteOptions ins tree | 124 | suiteEnvOptions ins tree = getEnvOptions $ suiteOptions ins tree | 64 | false | true | 0 | 7 | 16 | 39 | 19 | 20 | null | null |
maxnordlund/yesod | yesod-auth/Yesod/Auth/GoogleEmail2.hs | mit | getPersonValue :: Manager -> Token -> HandlerT site IO A.Value
getPersonValue manager token = do
req2' <- liftIO $ parseUrl "https://www.googleapis.com/plus/v1/people/me"
let req2 = req2'
{ requestHeaders =
[ ("Authorization", encodeUtf8 $ "Bearer " `mappend` accessToken token)
... | 771 | getPersonValue :: Manager -> Token -> HandlerT site IO A.Value
getPersonValue manager token = do
req2' <- liftIO $ parseUrl "https://www.googleapis.com/plus/v1/people/me"
let req2 = req2'
{ requestHeaders =
[ ("Authorization", encodeUtf8 $ "Bearer " `mappend` accessToken token)
... | 771 | getPersonValue manager token = do
req2' <- liftIO $ parseUrl "https://www.googleapis.com/plus/v1/people/me"
let req2 = req2'
{ requestHeaders =
[ ("Authorization", encodeUtf8 $ "Bearer " `mappend` accessToken token)
]
}
res2 <- http req2 manager
va... | 708 | false | true | 0 | 15 | 174 | 128 | 65 | 63 | null | null |
ezyang/ghc | testsuite/tests/deriving/should_run/T3087.hs | bsd-3-clause | ext2Q :: (Data d, Typeable t)
=> (d -> q) -> (forall d1 d2. (Data d1, Data d2) => t d1 d2 -> q)
-> d -> q
ext2Q def ext arg =
case dataCast2 (Q ext) of
Just (Q ext') -> ext' arg
Nothing -> def arg | 224 | ext2Q :: (Data d, Typeable t)
=> (d -> q) -> (forall d1 d2. (Data d1, Data d2) => t d1 d2 -> q)
-> d -> q
ext2Q def ext arg =
case dataCast2 (Q ext) of
Just (Q ext') -> ext' arg
Nothing -> def arg | 224 | ext2Q def ext arg =
case dataCast2 (Q ext) of
Just (Q ext') -> ext' arg
Nothing -> def arg | 106 | false | true | 0 | 13 | 75 | 130 | 64 | 66 | null | null |
elieux/ghc | utils/deriveConstants/Main.hs | bsd-3-clause | defSize :: Where -> Name -> CExpr -> Wanteds
defSize w nameBase cExpr = [(w, GetWord ("SIZEOF_" ++ nameBase) (Fst cExpr))] | 122 | defSize :: Where -> Name -> CExpr -> Wanteds
defSize w nameBase cExpr = [(w, GetWord ("SIZEOF_" ++ nameBase) (Fst cExpr))] | 122 | defSize w nameBase cExpr = [(w, GetWord ("SIZEOF_" ++ nameBase) (Fst cExpr))] | 77 | false | true | 0 | 10 | 20 | 63 | 31 | 32 | null | null |
hvr/text | tests/Tests/Properties.hs | bsd-2-clause | sf_Ord p s =
((compare $ L.filter p s) . L.filter p) `eq`
(compare (S.filter p $ S.streamList s) . S.filter p . S.streamList) | 133 | sf_Ord p s =
((compare $ L.filter p s) . L.filter p) `eq`
(compare (S.filter p $ S.streamList s) . S.filter p . S.streamList) | 133 | sf_Ord p s =
((compare $ L.filter p s) . L.filter p) `eq`
(compare (S.filter p $ S.streamList s) . S.filter p . S.streamList) | 133 | false | false | 0 | 13 | 31 | 81 | 40 | 41 | null | null |
xificurC/scheme-interpreter | Main.hs | bsd-3-clause | eval _ badForm = throwError (BadSpecialForm "unrecognized special form" badForm) | 80 | eval _ badForm = throwError (BadSpecialForm "unrecognized special form" badForm) | 80 | eval _ badForm = throwError (BadSpecialForm "unrecognized special form" badForm) | 80 | false | false | 1 | 7 | 9 | 22 | 10 | 12 | null | null |
pparkkin/eta | compiler/ETA/TypeCheck/TcGenGenerics.hs | bsd-3-clause | mkM1_E :: LHsExpr RdrName -> LHsExpr RdrName
mkM1_E e = nlHsVar m1DataCon_RDR `nlHsApp` e | 89 | mkM1_E :: LHsExpr RdrName -> LHsExpr RdrName
mkM1_E e = nlHsVar m1DataCon_RDR `nlHsApp` e | 89 | mkM1_E e = nlHsVar m1DataCon_RDR `nlHsApp` e | 44 | false | true | 0 | 7 | 13 | 37 | 17 | 20 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp Word64ToWord = _ILIT(1091) | 39 | tagOf_PrimOp Word64ToWord = _ILIT(1091) | 39 | tagOf_PrimOp Word64ToWord = _ILIT(1091) | 39 | false | false | 0 | 6 | 3 | 15 | 7 | 8 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/HTools/Backend/Text.hs | gpl-2.0 | -- * Serialisation functions
-- | Serialize a single group.
serializeGroup :: Group.Group -> String
serializeGroup grp =
printf "%s|%s|%s|%s|%s" (Group.name grp) (Group.uuid grp)
(allocPolicyToRaw (Group.allocPolicy grp))
(intercalate "," (Group.allTags grp))
(intercalate "," (Group.... | 334 | serializeGroup :: Group.Group -> String
serializeGroup grp =
printf "%s|%s|%s|%s|%s" (Group.name grp) (Group.uuid grp)
(allocPolicyToRaw (Group.allocPolicy grp))
(intercalate "," (Group.allTags grp))
(intercalate "," (Group.networks grp)) | 273 | serializeGroup grp =
printf "%s|%s|%s|%s|%s" (Group.name grp) (Group.uuid grp)
(allocPolicyToRaw (Group.allocPolicy grp))
(intercalate "," (Group.allTags grp))
(intercalate "," (Group.networks grp)) | 233 | true | true | 0 | 10 | 70 | 97 | 49 | 48 | null | null |
yu-i9/HaSC | src/HaSC/Prim/ErrorMsg.hs | mit | typeDiffError :: SourcePos -> String -> CType -> CType -> String
typeDiffError pos op ty1 ty2
= makeError pos ["Operands of ", "'" `enclose` op, " must be SAME:\n",
" Left : ", show ty1, "\n",
" Right : ", show ty2] | 264 | typeDiffError :: SourcePos -> String -> CType -> CType -> String
typeDiffError pos op ty1 ty2
= makeError pos ["Operands of ", "'" `enclose` op, " must be SAME:\n",
" Left : ", show ty1, "\n",
" Right : ", show ty2] | 264 | typeDiffError pos op ty1 ty2
= makeError pos ["Operands of ", "'" `enclose` op, " must be SAME:\n",
" Left : ", show ty1, "\n",
" Right : ", show ty2] | 199 | false | true | 0 | 8 | 90 | 77 | 42 | 35 | null | null |
waldheinz/ads | src/lib/Codec/Archive/Tar/Read.hs | gpl-3.0 | getEntry :: ByteString -> Either FormatError (Maybe (Entry, ByteString))
getEntry bs
| BS.length header < 512 = Left TruncatedArchive
-- Tar files end with at least two blocks of all '0'. Checking this serves
-- two purposes. It checks the format but also forces the tail of the data
-- which is necessary to cl... | 3,079 | getEntry :: ByteString -> Either FormatError (Maybe (Entry, ByteString))
getEntry bs
| BS.length header < 512 = Left TruncatedArchive
-- Tar files end with at least two blocks of all '0'. Checking this serves
-- two purposes. It checks the format but also forces the tail of the data
-- which is necessary to cl... | 3,079 | getEntry bs
| BS.length header < 512 = Left TruncatedArchive
-- Tar files end with at least two blocks of all '0'. Checking this serves
-- two purposes. It checks the format but also forces the tail of the data
-- which is necessary to close the file if it came from a lazily read file.
| BS.head bs == 0 = ca... | 3,006 | false | true | 9 | 19 | 1,132 | 869 | 418 | 451 | null | null |
Helium4Haskell/helium | src/Helium/Utils/Texts.hs | gpl-3.0 | lexerEOFInString :: String
lexerEOFInString = select language
[ English :-> "End of file in string literal"
, Dutch :-> "Einde van bestand in tekst constante"
] | 174 | lexerEOFInString :: String
lexerEOFInString = select language
[ English :-> "End of file in string literal"
, Dutch :-> "Einde van bestand in tekst constante"
] | 174 | lexerEOFInString = select language
[ English :-> "End of file in string literal"
, Dutch :-> "Einde van bestand in tekst constante"
] | 147 | false | true | 0 | 6 | 39 | 31 | 16 | 15 | null | null |
hvr/jhc | src/Util/IntBag.hs | mit | natFromInt :: Key -> Nat
natFromInt i = fromIntegral i | 54 | natFromInt :: Key -> Nat
natFromInt i = fromIntegral i | 54 | natFromInt i = fromIntegral i | 29 | false | true | 0 | 5 | 9 | 21 | 10 | 11 | null | null |
dbp/thistle | src/Lang.hs | isc | eval gs env (ESource (ES id' t') def) =
do existing <- gs id'
case existing of
Just (v, t) | t == t' ->
return (v, [VSBase id' t [] v])
_ -> do
v <- eval gs env def
return (fst v, snd v <> [VSBase id' t' [] (fst v)]) | 269 | eval gs env (ESource (ES id' t') def) =
do existing <- gs id'
case existing of
Just (v, t) | t == t' ->
return (v, [VSBase id' t [] v])
_ -> do
v <- eval gs env def
return (fst v, snd v <> [VSBase id' t' [] (fst v)]) | 269 | eval gs env (ESource (ES id' t') def) =
do existing <- gs id'
case existing of
Just (v, t) | t == t' ->
return (v, [VSBase id' t [] v])
_ -> do
v <- eval gs env def
return (fst v, snd v <> [VSBase id' t' [] (fst v)]) | 269 | false | false | 0 | 18 | 105 | 159 | 74 | 85 | null | null |
mkovacs/ipoly | Poly.hs | gpl-3.0 | g :: (Num x, Ord x) => Poly n x c -> x
deg (SSum ts) = foldr (max . degS) 0 (Map.keys ts)
| 92 | deg :: (Num x, Ord x) => Poly n x c -> x
deg (SSum ts) = foldr (max . degS) 0 (Map.keys ts) | 91 | deg (SSum ts) = foldr (max . degS) 0 (Map.keys ts) | 50 | false | true | 0 | 8 | 26 | 71 | 35 | 36 | null | null |
mumuki/mulang | spec/InterpreterSpec.hs | gpl-3.0 | spec :: Spec
spec = do
describe "evalExpr" $ do
context "javascript" $ do
it "rejects logic on number" $ do
lastRef (runjs "1 || 2") `shouldThrow` (errorCall "Exception thrown outside try: Type error: expected two booleans but got (number) 1.0, (number) 2.0")
it "rejects math on bools" $ do
... | 7,054 | spec :: Spec
spec = do
describe "evalExpr" $ do
context "javascript" $ do
it "rejects logic on number" $ do
lastRef (runjs "1 || 2") `shouldThrow` (errorCall "Exception thrown outside try: Type error: expected two booleans but got (number) 1.0, (number) 2.0")
it "rejects math on bools" $ do
... | 7,054 | spec = do
describe "evalExpr" $ do
context "javascript" $ do
it "rejects logic on number" $ do
lastRef (runjs "1 || 2") `shouldThrow` (errorCall "Exception thrown outside try: Type error: expected two booleans but got (number) 1.0, (number) 2.0")
it "rejects math on bools" $ do
lastRe... | 7,041 | false | true | 0 | 22 | 2,344 | 1,537 | 725 | 812 | null | null |
creichert/linear-hs | src/Numeric/Vector.hs | bsd-2-clause | -- internal cross product of 3D vector.
cross3D' :: (Num a) => Vector a -> Vector a -> Vector a
cross3D' (Vector _ xs) (Vector _ ys) = mkVector [ xs!!1 * ys!!2 - xs!!2 * ys!!1,
-(head xs * ys!!2 - xs!!2 * head ys),
head xs * ys!!1 - ... | 336 | cross3D' :: (Num a) => Vector a -> Vector a -> Vector a
cross3D' (Vector _ xs) (Vector _ ys) = mkVector [ xs!!1 * ys!!2 - xs!!2 * ys!!1,
-(head xs * ys!!2 - xs!!2 * head ys),
head xs * ys!!1 - xs!!1 * head ys] | 296 | cross3D' (Vector _ xs) (Vector _ ys) = mkVector [ xs!!1 * ys!!2 - xs!!2 * ys!!1,
-(head xs * ys!!2 - xs!!2 * head ys),
head xs * ys!!1 - xs!!1 * head ys] | 240 | true | true | 0 | 14 | 141 | 156 | 77 | 79 | null | null |
Teaspot-Studio/GPipe-Core | src/Graphics/GPipe/Internal/Texture.hs | mit | texture2DLevels (Texture2D _ _ ls) = ls | 39 | texture2DLevels (Texture2D _ _ ls) = ls | 39 | texture2DLevels (Texture2D _ _ ls) = ls | 39 | false | false | 0 | 6 | 6 | 20 | 9 | 11 | null | null |
olsner/ghc | testsuite/tests/codeGen/should_run/cgrun054.hs | bsd-3-clause | foo A7 = X7 | 11 | foo A7 = X7 | 11 | foo A7 = X7 | 11 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
alanz/haskell-token-utils | src/Language/Haskell/TokenUtils/Utils.hs | unlicense | -- | Neat 2-dimensional drawing of a forest.
drawForestEntry :: Forest (Entry a) -> String
drawForestEntry = unlines . map drawTreeEntry | 137 | drawForestEntry :: Forest (Entry a) -> String
drawForestEntry = unlines . map drawTreeEntry | 92 | drawForestEntry = unlines . map drawTreeEntry | 46 | true | true | 0 | 8 | 21 | 35 | 17 | 18 | null | null |
evansb/jasper | src/Language/Java/Parser/Core.hs | mit | -- | Get the string from a Token context
-- | Will fail if the Token does not store a String
getSS :: T -> String
getSS (TokIdent s) = s | 138 | getSS :: T -> String
getSS (TokIdent s) = s | 45 | getSS (TokIdent s) = s | 24 | true | true | 0 | 6 | 32 | 30 | 15 | 15 | null | null |
bakineggs/k-framework | tools/language-k/Language/K/Core/Parser/Attoparsec.hs | gpl-2.0 | -- | Parse a K application: KLabel(K1,,K2)
kapp :: Parser Builder
kapp = do
(label, argc) <- klabel
argv <- parens (kterm `sepBy` (symbol ",,"))
proceed label argc argv
where proceed label argc argv
| argc == 0 = return label
| argc /= length argv = fail "unexpected number of... | 472 | kapp :: Parser Builder
kapp = do
(label, argc) <- klabel
argv <- parens (kterm `sepBy` (symbol ",,"))
proceed label argc argv
where proceed label argc argv
| argc == 0 = return label
| argc /= length argv = fail "unexpected number of arguments"
| otherwise = ret... | 429 | kapp = do
(label, argc) <- klabel
argv <- parens (kterm `sepBy` (symbol ",,"))
proceed label argc argv
where proceed label argc argv
| argc == 0 = return label
| argc /= length argv = fail "unexpected number of arguments"
| otherwise = return $ label <> " " <> p... | 406 | true | true | 0 | 12 | 138 | 135 | 65 | 70 | null | null |
urbanslug/ghc | testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.hs | bsd-3-clause | unwords :: _ => _
unwords = P.unwords | 37 | unwords :: _ => _
unwords = P.unwords | 37 | unwords = P.unwords | 19 | false | true | 0 | 7 | 7 | 25 | 10 | 15 | null | null |
pparkkin/eta | compiler/ETA/BasicTypes/Literal.hs | bsd-3-clause | pprLiteral _ (MachStr s) = pprHsBytes s | 50 | pprLiteral _ (MachStr s) = pprHsBytes s | 50 | pprLiteral _ (MachStr s) = pprHsBytes s | 50 | false | false | 0 | 7 | 17 | 20 | 9 | 11 | null | null |
arybczak/happstack-server | src/Happstack/Server/RqData.hs | bsd-3-clause | -- | Gets all matches for the named input parameter as strict 'Text's
--
-- Searches the QUERY_STRING followed by the Request body.
--
-- This function assumes the underlying octets are UTF-8 encoded.
--
-- see also: 'lookText'', 'looks' and 'lookBSs'
lookTexts' :: (Functor m, Monad m, HasRqData m) => String -> m [Text... | 375 | lookTexts' :: (Functor m, Monad m, HasRqData m) => String -> m [Text]
lookTexts' = fmap (map LazyText.toStrict) . lookTexts | 123 | lookTexts' = fmap (map LazyText.toStrict) . lookTexts | 53 | true | true | 0 | 9 | 61 | 64 | 36 | 28 | null | null |
kini/ghc-server | src/Server/Commands.hs | bsd-3-clause | dynString :: Dynamic -> String
dynString d = fromDyn d "" | 57 | dynString :: Dynamic -> String
dynString d = fromDyn d "" | 57 | dynString d = fromDyn d "" | 26 | false | true | 0 | 5 | 10 | 23 | 11 | 12 | null | null |
parsonsmatt/servant-persistent | src/Config.hs | mit | -- | A basic 'ConnectionString' for local/test development. Pass in either
-- @""@ for 'Development' or @"test"@ for 'Test'.
connStr :: BS.ByteString -> ConnectionString
connStr sfx = "host=localhost dbname=perservant" <> sfx <> " user=test password=test port=5432" | 265 | connStr :: BS.ByteString -> ConnectionString
connStr sfx = "host=localhost dbname=perservant" <> sfx <> " user=test password=test port=5432" | 140 | connStr sfx = "host=localhost dbname=perservant" <> sfx <> " user=test password=test port=5432" | 95 | true | true | 0 | 6 | 35 | 30 | 16 | 14 | null | null |
ekr/tamarin-prover | lib/theory/src/Theory/Constraint/System/Dot.hs | gpl-3.0 | tryHideNodeId :: NodeId -> System -> System
tryHideNodeId v se = fromMaybe se $ do
guard $ (lvarSort v == LSortNode)
&& notOccursIn unsolvedChains
&& notOccursIn (get sFormulas)
maybe hideAction hideRule (M.lookup v $ get sNodes se)
where
selectPart :: (System :-> S.Set a) -> (a -> Bo... | 3,069 | tryHideNodeId :: NodeId -> System -> System
tryHideNodeId v se = fromMaybe se $ do
guard $ (lvarSort v == LSortNode)
&& notOccursIn unsolvedChains
&& notOccursIn (get sFormulas)
maybe hideAction hideRule (M.lookup v $ get sNodes se)
where
selectPart :: (System :-> S.Set a) -> (a -> Bo... | 3,069 | tryHideNodeId v se = fromMaybe se $ do
guard $ (lvarSort v == LSortNode)
&& notOccursIn unsolvedChains
&& notOccursIn (get sFormulas)
maybe hideAction hideRule (M.lookup v $ get sNodes se)
where
selectPart :: (System :-> S.Set a) -> (a -> Bool) -> [a]
selectPart l p = filter p $ S... | 3,025 | false | true | 0 | 17 | 1,132 | 1,024 | 532 | 492 | null | null |
threetreeslight/learning-haskell | practice/old/20150927.hs | mit | -- ----------------------------------------
-- @ pattern
-- ----------------------------------------
dupHead :: [a] -> [a]
dupHead (x : xs) = x : x : xs | 153 | dupHead :: [a] -> [a]
dupHead (x : xs) = x : x : xs | 51 | dupHead (x : xs) = x : x : xs | 29 | true | true | 0 | 7 | 22 | 42 | 24 | 18 | null | null |
MichaelMackus/hsrl | RL/Event.hs | mit | turnsSince :: (Event -> Bool) -> [Event] -> Int
turnsSince f = length . L.filter isEndOfTurn . takeWhile (not . f) | 114 | turnsSince :: (Event -> Bool) -> [Event] -> Int
turnsSince f = length . L.filter isEndOfTurn . takeWhile (not . f) | 114 | turnsSince f = length . L.filter isEndOfTurn . takeWhile (not . f) | 66 | false | true | 1 | 8 | 20 | 61 | 29 | 32 | null | null |
brendanhay/gogol | gogol-appengine/gen/Network/Google/AppEngine/Types/Product.hs | mpl-2.0 | -- | Continuation token for fetching the next page of results.
lacrNextPageToken :: Lens' ListAuthorizedCertificatesResponse (Maybe Text)
lacrNextPageToken
= lens _lacrNextPageToken
(\ s a -> s{_lacrNextPageToken = a}) | 226 | lacrNextPageToken :: Lens' ListAuthorizedCertificatesResponse (Maybe Text)
lacrNextPageToken
= lens _lacrNextPageToken
(\ s a -> s{_lacrNextPageToken = a}) | 163 | lacrNextPageToken
= lens _lacrNextPageToken
(\ s a -> s{_lacrNextPageToken = a}) | 88 | true | true | 1 | 9 | 35 | 51 | 25 | 26 | null | null |
FranklinChen/Ebnf2ps | src/ParseAux.hs | bsd-3-clause | happyPrepare' ts (ProdRepeat prod) = ProdRepeat (happyPrepare' ts prod) | 71 | happyPrepare' ts (ProdRepeat prod) = ProdRepeat (happyPrepare' ts prod) | 71 | happyPrepare' ts (ProdRepeat prod) = ProdRepeat (happyPrepare' ts prod) | 71 | false | false | 0 | 7 | 8 | 28 | 13 | 15 | null | null |
kmate/raw-feldspar-mcs | examples/Channel.hs | bsd-3-clause | inc :: CoreChan (Store (DPull Int32)) -> CoreChan (Store (DPull Int32)) -> CoreComp ()
inc inp out = forever $ do
slot <- newSlot inp
readChan inp slot
store <- getSlot slot
v <- unsafeFreezeStore store
v' <- initStore $ fmap (+1) v
writeChan out v' | 273 | inc :: CoreChan (Store (DPull Int32)) -> CoreChan (Store (DPull Int32)) -> CoreComp ()
inc inp out = forever $ do
slot <- newSlot inp
readChan inp slot
store <- getSlot slot
v <- unsafeFreezeStore store
v' <- initStore $ fmap (+1) v
writeChan out v' | 273 | inc inp out = forever $ do
slot <- newSlot inp
readChan inp slot
store <- getSlot slot
v <- unsafeFreezeStore store
v' <- initStore $ fmap (+1) v
writeChan out v' | 186 | false | true | 0 | 12 | 69 | 134 | 59 | 75 | null | null |
gaeldeest/himinn | System/USB/HID.hs | mit | hidRead :: HidDevice -> Int -> IO B.ByteString
hidRead dev size = allocaBytes size $ (\ptr -> do res <- c_hid_read dev ptr size
if res == -1 then throwIO HidError
else B.packCStringLen (ptr, fromIntegral res)) | 309 | hidRead :: HidDevice -> Int -> IO B.ByteString
hidRead dev size = allocaBytes size $ (\ptr -> do res <- c_hid_read dev ptr size
if res == -1 then throwIO HidError
else B.packCStringLen (ptr, fromIntegral res)) | 309 | hidRead dev size = allocaBytes size $ (\ptr -> do res <- c_hid_read dev ptr size
if res == -1 then throwIO HidError
else B.packCStringLen (ptr, fromIntegral res)) | 262 | false | true | 0 | 14 | 135 | 97 | 46 | 51 | null | null |
romanb/amazonka | amazonka-dynamodb/gen/Network/AWS/DynamoDB/Types.hs | mpl-2.0 | -- | 'TableDescription' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'tdAttributeDefinitions' @::@ ['AttributeDefinition']
--
-- * 'tdCreationDateTime' @::@ 'UTCTime'
--
-- * 'tdGlobalSecondaryIndexes' @::@ ['GlobalSecondaryIndexDescription']
--
-- * 'tdItemCount' @::@ 'Integer'
--... | 1,576 | tableDescription :: Text -- ^ 'tdTableName'
-> NonEmpty KeySchemaElement -- ^ 'tdKeySchema'
-> TableStatus -- ^ 'tdTableStatus'
-> UTCTime -- ^ 'tdCreationDateTime'
-> ProvisionedThroughputDescription -- ^ 'tdProvisionedThroughput'
-> ... | 931 | tableDescription p1 p2 p3 p4 p5 p6 p7 = TableDescription
{ _tdTableName = p1
, _tdKeySchema = withIso _List1 (const id) p2
, _tdTableStatus = p3
, _tdCreationDateTime = withIso _Time (const id) p4
, _tdProvisionedThroughput = p5
, _tdTableSizeBytes ... | 495 | true | true | 0 | 11 | 403 | 176 | 112 | 64 | null | null |
acowley/ghc | compiler/typecheck/TcTypeNats.hs | bsd-3-clause | isOrderingLitTy :: Type -> Maybe Ordering
isOrderingLitTy tc =
do (tc1,[]) <- splitTyConApp_maybe tc
case () of
_ | tc1 == promotedLTDataCon -> return LT
| tc1 == promotedEQDataCon -> return EQ
| tc1 == promotedGTDataCon -> return GT
| otherwise -> Nothing | 312 | isOrderingLitTy :: Type -> Maybe Ordering
isOrderingLitTy tc =
do (tc1,[]) <- splitTyConApp_maybe tc
case () of
_ | tc1 == promotedLTDataCon -> return LT
| tc1 == promotedEQDataCon -> return EQ
| tc1 == promotedGTDataCon -> return GT
| otherwise -> Nothing | 312 | isOrderingLitTy tc =
do (tc1,[]) <- splitTyConApp_maybe tc
case () of
_ | tc1 == promotedLTDataCon -> return LT
| tc1 == promotedEQDataCon -> return EQ
| tc1 == promotedGTDataCon -> return GT
| otherwise -> Nothing | 270 | false | true | 0 | 13 | 98 | 108 | 49 | 59 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Upgrade.hs | mit | gasBase SingularityCharge = 0 | 29 | gasBase SingularityCharge = 0 | 29 | gasBase SingularityCharge = 0 | 29 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
snoyberg/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | deTagExpr (Case e (TB b _) ty alts) = Case (deTagExpr e) b ty (map deTagAlt alts) | 81 | deTagExpr (Case e (TB b _) ty alts) = Case (deTagExpr e) b ty (map deTagAlt alts) | 81 | deTagExpr (Case e (TB b _) ty alts) = Case (deTagExpr e) b ty (map deTagAlt alts) | 81 | false | false | 0 | 9 | 16 | 52 | 25 | 27 | null | null |
micknelso/language-c | src/Language/CFamily/C/TravMonad.hs | bsd-3-clause | warn :: (Error e, MonadCError m) => e -> m ()
warn err = recordError (changeErrorLevel err LevelWarn) | 101 | warn :: (Error e, MonadCError m) => e -> m ()
warn err = recordError (changeErrorLevel err LevelWarn) | 101 | warn err = recordError (changeErrorLevel err LevelWarn) | 55 | false | true | 0 | 8 | 17 | 49 | 24 | 25 | null | null |
GaloisInc/smaccmpilot-gcs-gateway | SMACCMPilot/GCS/Mavlink/Parser.hs | bsd-3-clause | k :: ParseSt -> Result
ok = Right
| 34 | ok :: ParseSt -> Result
ok = Right | 34 | ok = Right | 10 | false | true | 0 | 7 | 8 | 21 | 9 | 12 | null | null |
hBPF/hBPF | HBPF/Internal.hs | bsd-3-clause | printBPFInstr (IMod a) = "mod " ++ toString a | 52 | printBPFInstr (IMod a) = "mod " ++ toString a | 52 | printBPFInstr (IMod a) = "mod " ++ toString a | 52 | false | false | 0 | 7 | 15 | 22 | 10 | 12 | null | null |
kmels/hledger | hledger-lib/Hledger/Query.hs | gpl-3.0 | -- | Compare two maybe dates, Nothing is earliest.
compareMaybeDates :: Maybe Day -> Maybe Day -> Ordering
compareMaybeDates Nothing Nothing = EQ | 145 | compareMaybeDates :: Maybe Day -> Maybe Day -> Ordering
compareMaybeDates Nothing Nothing = EQ | 94 | compareMaybeDates Nothing Nothing = EQ | 38 | true | true | 0 | 8 | 22 | 37 | 16 | 21 | null | null |
urbanslug/ghc | testsuite/tests/lib/integer/integerBits.hs | bsd-3-clause | px_and_ny :: Integer
px_and_ny = 0x3A4B5C281F6E9D700040AC010600850 | 66 | px_and_ny :: Integer
px_and_ny = 0x3A4B5C281F6E9D700040AC010600850 | 66 | px_and_ny = 0x3A4B5C281F6E9D700040AC010600850 | 45 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
rfw/cosanostra | src/Game/Cosanostra/Resolver/Effect.hs | mit | rewriteOnTarget (effect@Effect{_effectType = Deflected{}}:_) _ act i =
( [ act & actTargets . ix i .~ (effect ^?! effectType . effectTypeDeflectee) ]
, [effect]
) | 174 | rewriteOnTarget (effect@Effect{_effectType = Deflected{}}:_) _ act i =
( [ act & actTargets . ix i .~ (effect ^?! effectType . effectTypeDeflectee) ]
, [effect]
) | 174 | rewriteOnTarget (effect@Effect{_effectType = Deflected{}}:_) _ act i =
( [ act & actTargets . ix i .~ (effect ^?! effectType . effectTypeDeflectee) ]
, [effect]
) | 174 | false | false | 1 | 11 | 37 | 73 | 39 | 34 | null | null |
MattFerraro/projectEuler | 1/arithmetic_series.hs | apache-2.0 | main = do
let sumTo999 = sumall 999
print (sumTo999 3 + sumTo999 5 - sumTo999 15) | 89 | main = do
let sumTo999 = sumall 999
print (sumTo999 3 + sumTo999 5 - sumTo999 15) | 89 | main = do
let sumTo999 = sumall 999
print (sumTo999 3 + sumTo999 5 - sumTo999 15) | 89 | false | false | 1 | 12 | 24 | 48 | 19 | 29 | null | null |
chengzh2008/hpffp | src/ch16-Functor/heavyLifting.hs | bsd-3-clause | b = (fmap . fmap) (++ "lol") (Just ["Hi, ", "Hello"]) | 53 | b = (fmap . fmap) (++ "lol") (Just ["Hi, ", "Hello"]) | 53 | b = (fmap . fmap) (++ "lol") (Just ["Hi, ", "Hello"]) | 53 | false | false | 1 | 8 | 10 | 38 | 19 | 19 | null | null |
adamwalker/hlibBladeRF | src/LibBladeRF/Types.hs | lgpl-2.1 | sizes = [ (FPGA_UNKNOWN, c'BLADERF_FPGA_UNKNOWN)
, (FPGA_40KLE, c'BLADERF_FPGA_40KLE)
, (FPGA_115KLE, c'BLADERF_FPGA_115KLE)
] | 150 | sizes = [ (FPGA_UNKNOWN, c'BLADERF_FPGA_UNKNOWN)
, (FPGA_40KLE, c'BLADERF_FPGA_40KLE)
, (FPGA_115KLE, c'BLADERF_FPGA_115KLE)
] | 150 | sizes = [ (FPGA_UNKNOWN, c'BLADERF_FPGA_UNKNOWN)
, (FPGA_40KLE, c'BLADERF_FPGA_40KLE)
, (FPGA_115KLE, c'BLADERF_FPGA_115KLE)
] | 150 | false | false | 0 | 6 | 35 | 33 | 21 | 12 | null | null |
Daniel-Diaz/processing | Graphics/Web/Processing/Core/TH.hs | bsd-3-clause | replaceInOtherC :: Name -> [Type] -> Q Clause
replaceInOtherC c ts = do
vs <- mapM (\t -> fmap (\v -> (v,t)) $ newName "x") ts
let patf (v,_) = VarP v
bodyf (v,ConT t) = let str = nameBase t
in if str `elem` fmap ("Proc_"++) optimizableTypes
then VarE ... | 1,079 | replaceInOtherC :: Name -> [Type] -> Q Clause
replaceInOtherC c ts = do
vs <- mapM (\t -> fmap (\v -> (v,t)) $ newName "x") ts
let patf (v,_) = VarP v
bodyf (v,ConT t) = let str = nameBase t
in if str `elem` fmap ("Proc_"++) optimizableTypes
then VarE ... | 1,079 | replaceInOtherC c ts = do
vs <- mapM (\t -> fmap (\v -> (v,t)) $ newName "x") ts
let patf (v,_) = VarP v
bodyf (v,ConT t) = let str = nameBase t
in if str `elem` fmap ("Proc_"++) optimizableTypes
then VarE (mkName $ "replaceIn" ++ drop 5 str)
... | 1,033 | false | true | 0 | 20 | 465 | 378 | 191 | 187 | null | null |
nevrenato/Hets_Fork | CASL/Sign.hs | gpl-2.0 | addSort :: SortsKind -> Annoted a -> SORT -> State.State (Sign f e) ()
addSort sk a s = do
e <- State.get
let r = sortRel e
em = emptySortSet e
known = Rel.memberKey s r
if known then addDiags [mkDiag Hint "redeclared sort" s]
else do
State.put e { sortRel = Rel.insertKey s r }
addDiag... | 794 | addSort :: SortsKind -> Annoted a -> SORT -> State.State (Sign f e) ()
addSort sk a s = do
e <- State.get
let r = sortRel e
em = emptySortSet e
known = Rel.memberKey s r
if known then addDiags [mkDiag Hint "redeclared sort" s]
else do
State.put e { sortRel = Rel.insertKey s r }
addDiag... | 794 | addSort sk a s = do
e <- State.get
let r = sortRel e
em = emptySortSet e
known = Rel.memberKey s r
if known then addDiags [mkDiag Hint "redeclared sort" s]
else do
State.put e { sortRel = Rel.insertKey s r }
addDiags $ checkNamePrefix s
case sk of
NonEmptySorts -> when (Set.membe... | 723 | false | true | 0 | 17 | 222 | 300 | 141 | 159 | null | null |
brendanhay/gogol | gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/Firewall/IngressRules/Patch.hs | mpl-2.0 | -- | V1 error format.
afirpXgafv :: Lens' AppsFirewallIngressRulesPatch (Maybe Xgafv)
afirpXgafv
= lens _afirpXgafv (\ s a -> s{_afirpXgafv = a}) | 147 | afirpXgafv :: Lens' AppsFirewallIngressRulesPatch (Maybe Xgafv)
afirpXgafv
= lens _afirpXgafv (\ s a -> s{_afirpXgafv = a}) | 125 | afirpXgafv
= lens _afirpXgafv (\ s a -> s{_afirpXgafv = a}) | 61 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
SWP-Ubau-SoSe2014-Haskell/SWPSoSe14 | src/RailEditor/MenuBar.hs | mit | --checking for a legal path in window title to save whitout dialog
saveFile :: Window -> TextArea -> Gtk.TextBuffer -> Gtk.TextBuffer -> IO Bool
saveFile window area inputB outputB = do
let contRef = textAreaContent area
areaContent <- readIORef contRef
code <- serialize areaContent
dir <- get window windowTitl... | 636 | saveFile :: Window -> TextArea -> Gtk.TextBuffer -> Gtk.TextBuffer -> IO Bool
saveFile window area inputB outputB = do
let contRef = textAreaContent area
areaContent <- readIORef contRef
code <- serialize areaContent
dir <- get window windowTitle
if "/" `isInfixOf` dir && not("/" `isSuffixOf` dir)
then do
... | 569 | saveFile window area inputB outputB = do
let contRef = textAreaContent area
areaContent <- readIORef contRef
code <- serialize areaContent
dir <- get window windowTitle
if "/" `isInfixOf` dir && not("/" `isSuffixOf` dir)
then do
writeFile dir code
return True
else fileDialog window area "SaveFile"... | 491 | true | true | 0 | 11 | 122 | 154 | 73 | 81 | null | null |
achirkin/qua-kit | services/siren/app/Main.hs | mit | responseMsgs (MsgRun token "scenario.geojson.Get" pams _)
| Just (Success scID) <- fromJSON <$> HashMap.lookup "ScID" pams
, msrid <- (fromJSON <$> HashMap.lookup "srid" pams) >>= f = do
conn <- Lens.use connection
eresultBS <- liftIO $ getScenario conn (fromIntegral token) (ScenarioId scID) msrid
yield... | 395 | responseMsgs (MsgRun token "scenario.geojson.Get" pams _)
| Just (Success scID) <- fromJSON <$> HashMap.lookup "ScID" pams
, msrid <- (fromJSON <$> HashMap.lookup "srid" pams) >>= f = do
conn <- Lens.use connection
eresultBS <- liftIO $ getScenario conn (fromIntegral token) (ScenarioId scID) msrid
yield... | 395 | responseMsgs (MsgRun token "scenario.geojson.Get" pams _)
| Just (Success scID) <- fromJSON <$> HashMap.lookup "ScID" pams
, msrid <- (fromJSON <$> HashMap.lookup "srid" pams) >>= f = do
conn <- Lens.use connection
eresultBS <- liftIO $ getScenario conn (fromIntegral token) (ScenarioId scID) msrid
yield... | 395 | false | false | 0 | 13 | 82 | 160 | 72 | 88 | null | null |
tjakway/ghcjvm | compiler/main/DriverPhases.hs | bsd-3-clause | startPhase "lhs-boot" = Unlit HsBootFile | 40 | startPhase "lhs-boot" = Unlit HsBootFile | 40 | startPhase "lhs-boot" = Unlit HsBootFile | 40 | false | false | 1 | 5 | 4 | 15 | 5 | 10 | null | null |
johnjcamilleri/fst | FST/TransducerInterface.hs | bsd-3-clause | -- | Make a transducer deterministic
determinize :: Ord a => Transducer a -> Transducer a
determinize = D.determinize | 117 | determinize :: Ord a => Transducer a -> Transducer a
determinize = D.determinize | 80 | determinize = D.determinize | 27 | true | true | 0 | 8 | 18 | 37 | 16 | 21 | null | null |
atsukotakahashi/wi | src/library/Yi/Mode/Interactive.hs | gpl-2.0 | setInput :: R.YiString -> BufferM ()
setInput val = flip replaceRegionB val =<< getInputRegion | 94 | setInput :: R.YiString -> BufferM ()
setInput val = flip replaceRegionB val =<< getInputRegion | 94 | setInput val = flip replaceRegionB val =<< getInputRegion | 57 | false | true | 0 | 8 | 13 | 40 | 17 | 23 | null | null |
tolysz/hs-tls | core/Network/TLS/Handshake/Common.hs | bsd-3-clause | onRecvStateHandshake :: Context -> RecvState IO -> [Handshake] -> IO (RecvState IO)
onRecvStateHandshake _ recvState [] = return recvState | 140 | onRecvStateHandshake :: Context -> RecvState IO -> [Handshake] -> IO (RecvState IO)
onRecvStateHandshake _ recvState [] = return recvState | 140 | onRecvStateHandshake _ recvState [] = return recvState | 56 | false | true | 0 | 11 | 20 | 54 | 25 | 29 | null | null |
Ornedan/dom3gamestatus | GameInfo.hs | bsd-3-clause | nationName 54 = "LA Mictlan" | 28 | nationName 54 = "LA Mictlan" | 28 | nationName 54 = "LA Mictlan" | 28 | false | false | 1 | 5 | 4 | 13 | 4 | 9 | null | null |
urbanslug/ghc | compiler/ghci/ByteCodeInstr.hs | bsd-3-clause | bciStackUse PUSH_LLL{} = 3 | 37 | bciStackUse PUSH_LLL{} = 3 | 37 | bciStackUse PUSH_LLL{} = 3 | 37 | false | false | 1 | 5 | 14 | 16 | 6 | 10 | null | null |
kkspeed/bitparser | Data/Bitstream/Parser.hs | gpl-3.0 | skipNbytes :: Int -> Parser ()
skipNbytes n = replicateM_ n getWord8 | 68 | skipNbytes :: Int -> Parser ()
skipNbytes n = replicateM_ n getWord8 | 68 | skipNbytes n = replicateM_ n getWord8 | 37 | false | true | 0 | 8 | 11 | 34 | 14 | 20 | null | null |
computation-hs/comp-models | Automata.hs | gpl-2.0 | -- | 'step' is an auxiliary function used to calculate the epsilon closure.
step :: NFA -> ([State], [State]) -> ([State], [State])
step fa (old,acc) =
let new = filter (flip notElem acc) (concatMap (epsilon fa) old)
in (new, acc ++ new) | 241 | step :: NFA -> ([State], [State]) -> ([State], [State])
step fa (old,acc) =
let new = filter (flip notElem acc) (concatMap (epsilon fa) old)
in (new, acc ++ new) | 165 | step fa (old,acc) =
let new = filter (flip notElem acc) (concatMap (epsilon fa) old)
in (new, acc ++ new) | 109 | true | true | 0 | 13 | 45 | 103 | 57 | 46 | null | null |
DanielSchiavini/ampersand | src/Database/Design/Ampersand/FSpec/GenerateUML.hs | gpl-3.0 | requirements :: FSpec -> [Req]
requirements fSpec
= [decl2req d | d <- vrels fSpec]
++[rule2req r | r <- vrules fSpec]
where
decl2req d = Req { reqId = name d
, reqOrig = Right d
, reqPurposes = purposesDefinedIn fSpec (fsLang fSpec) d
}
ru... | 512 | requirements :: FSpec -> [Req]
requirements fSpec
= [decl2req d | d <- vrels fSpec]
++[rule2req r | r <- vrules fSpec]
where
decl2req d = Req { reqId = name d
, reqOrig = Right d
, reqPurposes = purposesDefinedIn fSpec (fsLang fSpec) d
}
ru... | 512 | requirements fSpec
= [decl2req d | d <- vrels fSpec]
++[rule2req r | r <- vrules fSpec]
where
decl2req d = Req { reqId = name d
, reqOrig = Right d
, reqPurposes = purposesDefinedIn fSpec (fsLang fSpec) d
}
rule2req r = Req { reqId = name r... | 481 | false | true | 4 | 10 | 216 | 176 | 84 | 92 | null | null |
ashnikel/haskellbook | ch09/ch09.6_poemLines.hs | mit | splitOnChar c (x : xs)
| c == x = splitOnChar c xs
| otherwise = takeWhile (/= c) (x:xs)
: splitOnChar c (dropWhile(/= c) (x:xs)) | 155 | splitOnChar c (x : xs)
| c == x = splitOnChar c xs
| otherwise = takeWhile (/= c) (x:xs)
: splitOnChar c (dropWhile(/= c) (x:xs)) | 155 | splitOnChar c (x : xs)
| c == x = splitOnChar c xs
| otherwise = takeWhile (/= c) (x:xs)
: splitOnChar c (dropWhile(/= c) (x:xs)) | 155 | false | false | 2 | 9 | 51 | 91 | 44 | 47 | null | null |
jwvg0425/d3d11binding | src/Graphics/D3D11Binding/Types.hs | mit | tex2dArrayDsv :: Word32 -> Word32 -> Word32 -> Dsv
tex2dArrayDsv mipSlice firstArraySlice arraySize = Dsv mipSlice firstArraySlice arraySize | 140 | tex2dArrayDsv :: Word32 -> Word32 -> Word32 -> Dsv
tex2dArrayDsv mipSlice firstArraySlice arraySize = Dsv mipSlice firstArraySlice arraySize | 140 | tex2dArrayDsv mipSlice firstArraySlice arraySize = Dsv mipSlice firstArraySlice arraySize | 89 | false | true | 0 | 7 | 17 | 37 | 18 | 19 | null | null |
input-output-hk/pos-haskell-prototype | tools/post-mortem/src/Util/Safe.hs | mit | runWithFiles ((a, fp) : xs) mode f = runWithFile fp mode $ \h ->
runWithFiles xs mode $ \ys -> f $ (a, h) : ys | 114 | runWithFiles ((a, fp) : xs) mode f = runWithFile fp mode $ \h ->
runWithFiles xs mode $ \ys -> f $ (a, h) : ys | 114 | runWithFiles ((a, fp) : xs) mode f = runWithFile fp mode $ \h ->
runWithFiles xs mode $ \ys -> f $ (a, h) : ys | 114 | false | false | 1 | 9 | 29 | 72 | 36 | 36 | null | null |
nukisman/elm-format-short | src/ElmFormat/Version.hs | bsd-3-clause | asString :: String
asString =
Build_elm_format_short.gitDescribe | 68 | asString :: String
asString =
Build_elm_format_short.gitDescribe | 68 | asString =
Build_elm_format_short.gitDescribe | 49 | false | true | 0 | 6 | 9 | 20 | 8 | 12 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/ParseUtils.hs | bsd-3-clause | commaListFieldWithSep :: Separator -> String -> (a -> Doc) -> ReadP [a] a
-> (b -> [a]) -> ([a] -> b -> b) -> FieldDescr b
commaListFieldWithSep separator name showF readF get set =
liftField get set' $
field name showF' (parseCommaList readF)
where
set' xs b = set (get b ++ xs) b
... | 376 | commaListFieldWithSep :: Separator -> String -> (a -> Doc) -> ReadP [a] a
-> (b -> [a]) -> ([a] -> b -> b) -> FieldDescr b
commaListFieldWithSep separator name showF readF get set =
liftField get set' $
field name showF' (parseCommaList readF)
where
set' xs b = set (get b ++ xs) b
... | 376 | commaListFieldWithSep separator name showF readF get set =
liftField get set' $
field name showF' (parseCommaList readF)
where
set' xs b = set (get b ++ xs) b
showF' = separator . punctuate comma . map showF | 231 | false | true | 2 | 13 | 108 | 169 | 79 | 90 | null | null |
jasonzoladz/persistent | persistent-test/DataTypeTest.hs | mit | truncateUTCTime :: UTCTime -> Gen UTCTime
truncateUTCTime (UTCTime d dift) = do
let pico = fromRational . toRational $ dift :: Pico
picoi= truncate . (*1000000000000) . toRational $ truncateToMicro pico :: Integer
-- https://github.com/lpsmith/postgresql-simple/issues/123
d' = max d $ fromGregorian ... | 380 | truncateUTCTime :: UTCTime -> Gen UTCTime
truncateUTCTime (UTCTime d dift) = do
let pico = fromRational . toRational $ dift :: Pico
picoi= truncate . (*1000000000000) . toRational $ truncateToMicro pico :: Integer
-- https://github.com/lpsmith/postgresql-simple/issues/123
d' = max d $ fromGregorian ... | 380 | truncateUTCTime (UTCTime d dift) = do
let pico = fromRational . toRational $ dift :: Pico
picoi= truncate . (*1000000000000) . toRational $ truncateToMicro pico :: Integer
-- https://github.com/lpsmith/postgresql-simple/issues/123
d' = max d $ fromGregorian 1950 1 1
return $ UTCTime d' $ picosecon... | 338 | false | true | 0 | 13 | 72 | 113 | 56 | 57 | null | null |
wxwxwwxxx/ghc | compiler/simplCore/CSE.hs | bsd-3-clause | lookupCSEnv :: CSEnv -> OutExpr -> Maybe Id
lookupCSEnv (CS { cs_map = csmap }) expr
= case lookupCoreMap csmap expr of
Just (_,e) -> Just e
Nothing -> Nothing | 176 | lookupCSEnv :: CSEnv -> OutExpr -> Maybe Id
lookupCSEnv (CS { cs_map = csmap }) expr
= case lookupCoreMap csmap expr of
Just (_,e) -> Just e
Nothing -> Nothing | 176 | lookupCSEnv (CS { cs_map = csmap }) expr
= case lookupCoreMap csmap expr of
Just (_,e) -> Just e
Nothing -> Nothing | 132 | false | true | 0 | 9 | 46 | 72 | 36 | 36 | null | null |
nejla/nejla-common | src/NejlaCommon/Persistence.hs | bsd-3-clause | -- | Set constraints to IMMEDIATE
undeferrConstraints :: MonadIO m => ReaderT SqlBackend m ()
undeferrConstraints = E.rawExecute "SET CONSTRAINTS ALL IMMEDIATE;" [] | 164 | undeferrConstraints :: MonadIO m => ReaderT SqlBackend m ()
undeferrConstraints = E.rawExecute "SET CONSTRAINTS ALL IMMEDIATE;" [] | 130 | undeferrConstraints = E.rawExecute "SET CONSTRAINTS ALL IMMEDIATE;" [] | 70 | true | true | 0 | 7 | 22 | 37 | 18 | 19 | null | null |
pnlbwh/test-tensormasking | config/Paths.hs | bsd-3-clause | dwi caseid = Nothing | 20 | dwi caseid = Nothing | 20 | dwi caseid = Nothing | 20 | false | false | 0 | 4 | 3 | 9 | 4 | 5 | null | null |
mightymoose/liquidhaskell | benchmarks/vector-0.10.0.1/Data/Vector/Storable/Internal.hs | bsd-3-clause | getPtr (ForeignPtr addr _) = Ptr addr | 37 | getPtr (ForeignPtr addr _) = Ptr addr | 37 | getPtr (ForeignPtr addr _) = Ptr addr | 37 | false | false | 0 | 6 | 6 | 21 | 9 | 12 | null | null |
dmjio/aeson | src/Data/Aeson/Types/Internal.hs | bsd-3-clause | parseFail :: String -> Parser a
parseFail = fail | 48 | parseFail :: String -> Parser a
parseFail = fail | 48 | parseFail = fail | 16 | false | true | 0 | 6 | 8 | 18 | 9 | 9 | null | null |
acowley/ghc | compiler/prelude/THNames.hs | bsd-3-clause | newtypeDIdKey = mkPreludeMiscIdUnique 333 | 50 | newtypeDIdKey = mkPreludeMiscIdUnique 333 | 50 | newtypeDIdKey = mkPreludeMiscIdUnique 333 | 50 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
aaronc/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reflectSpecialName (CaseN fc n) =
reflCall "CaseN" [reflectFC (unwrapFC fc), reflectName n] | 93 | reflectSpecialName (CaseN fc n) =
reflCall "CaseN" [reflectFC (unwrapFC fc), reflectName n] | 93 | reflectSpecialName (CaseN fc n) =
reflCall "CaseN" [reflectFC (unwrapFC fc), reflectName n] | 93 | false | false | 0 | 8 | 13 | 42 | 19 | 23 | null | null |
jwiegley/ghc-release | libraries/haskeline/System/Console/Haskeline/LineState.hs | gpl-3.0 | graphemesToString :: [Grapheme] -> String
graphemesToString = concatMap (\g -> (baseChar g : combiningChars g)) | 111 | graphemesToString :: [Grapheme] -> String
graphemesToString = concatMap (\g -> (baseChar g : combiningChars g)) | 111 | graphemesToString = concatMap (\g -> (baseChar g : combiningChars g)) | 69 | false | true | 0 | 10 | 14 | 42 | 22 | 20 | null | null |
taylor1791/adventofcode | 2015/test/Test/Day14.hs | bsd-2-clause | p2Puzzle :: TestTree
p2Puzzle = testCaseSteps "Puzzle" $ \_-> do
deere <- fmap (sequence . map parse . lines) $ readFile "input/day14.txt"
Right [("Vixen", 1059)] @?= fmap ((bestDeer 2503)) deere | 199 | p2Puzzle :: TestTree
p2Puzzle = testCaseSteps "Puzzle" $ \_-> do
deere <- fmap (sequence . map parse . lines) $ readFile "input/day14.txt"
Right [("Vixen", 1059)] @?= fmap ((bestDeer 2503)) deere | 199 | p2Puzzle = testCaseSteps "Puzzle" $ \_-> do
deere <- fmap (sequence . map parse . lines) $ readFile "input/day14.txt"
Right [("Vixen", 1059)] @?= fmap ((bestDeer 2503)) deere | 178 | false | true | 0 | 15 | 33 | 87 | 43 | 44 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.