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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tolysz/yesod | yesod-core/test/YesodCoreTest/Links.hs | mit | getRT4 :: Foo Int Int -> Handler ()
getRT4 _ = return () | 56 | getRT4 :: Foo Int Int -> Handler ()
getRT4 _ = return () | 56 | getRT4 _ = return () | 20 | false | true | 0 | 7 | 12 | 33 | 15 | 18 | null | null |
adamse/haddock | haddock-api/src/Haddock/Interface/Rename.hs | bsd-2-clause | renameForD (ForeignExport lname ltype co x) = do
lname' <- renameL lname
ltype' <- renameLType ltype
return (ForeignExport lname' ltype' co x) | 148 | renameForD (ForeignExport lname ltype co x) = do
lname' <- renameL lname
ltype' <- renameLType ltype
return (ForeignExport lname' ltype' co x) | 148 | renameForD (ForeignExport lname ltype co x) = do
lname' <- renameL lname
ltype' <- renameLType ltype
return (ForeignExport lname' ltype' co x) | 148 | false | false | 0 | 9 | 27 | 59 | 26 | 33 | null | null |
siddhanathan/ghc | compiler/rename/RnTypes.hs | bsd-3-clause | extract_mb f (Just x) acc = f x acc | 35 | extract_mb f (Just x) acc = f x acc | 35 | extract_mb f (Just x) acc = f x acc | 35 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
snoyberg/photosorter | fay/Language/Fay/JQuery.hs | bsd-2-clause | getHtml :: JQuery -> Fay String
getHtml = ffi "%1['html']()" | 60 | getHtml :: JQuery -> Fay String
getHtml = ffi "%1['html']()" | 60 | getHtml = ffi "%1['html']()" | 28 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
christinem/courseography | app/DevelopmentConfig.hs | gpl-3.0 | -- | Enable Google analytics script
enableAnalytics :: Bool
enableAnalytics = False | 83 | enableAnalytics :: Bool
enableAnalytics = False | 47 | enableAnalytics = False | 23 | true | true | 0 | 4 | 11 | 12 | 7 | 5 | null | null |
alios/iho-s57 | library/Data/IHO/S57/Parser.hs | bsd-3-clause | parseDirectory :: [DirectoryEntry] -> Parser [(Text, ByteString)]
parseDirectory = parseFieldsR 0 | 97 | parseDirectory :: [DirectoryEntry] -> Parser [(Text, ByteString)]
parseDirectory = parseFieldsR 0 | 97 | parseDirectory = parseFieldsR 0 | 31 | false | true | 0 | 8 | 10 | 33 | 18 | 15 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_ST_BINARY :: Int
wxSTC_ST_BINARY = 5 | 42 | wxSTC_ST_BINARY :: Int
wxSTC_ST_BINARY = 5 | 42 | wxSTC_ST_BINARY = 5 | 19 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
apyrgio/snf-ganeti | src/Ganeti/HTools/Instance.hs | bsd-2-clause | shrinkByType inst T.FailSpindles =
case disks inst of
[Disk ds sp] -> case sp of
Nothing -> Bad "No spindles, shouldn't have happened"
Just sp' -> let v = sp' - T.unitSpindle
in if v < T.unitSpindle
... | 484 | shrinkByType inst T.FailSpindles =
case disks inst of
[Disk ds sp] -> case sp of
Nothing -> Bad "No spindles, shouldn't have happened"
Just sp' -> let v = sp' - T.unitSpindle
in if v < T.unitSpindle
... | 484 | shrinkByType inst T.FailSpindles =
case disks inst of
[Disk ds sp] -> case sp of
Nothing -> Bad "No spindles, shouldn't have happened"
Just sp' -> let v = sp' - T.unitSpindle
in if v < T.unitSpindle
... | 484 | false | false | 0 | 20 | 227 | 133 | 64 | 69 | null | null |
Kwarrtz/Emyrald | src/Emyrald/Eval.hs | gpl-3.0 | evalExpr _ (App (Num _) _) = Left $ Error "type" "'int' objects are not callable" | 89 | evalExpr _ (App (Num _) _) = Left $ Error "type" "'int' objects are not callable" | 89 | evalExpr _ (App (Num _) _) = Left $ Error "type" "'int' objects are not callable" | 89 | false | false | 0 | 9 | 23 | 34 | 16 | 18 | null | null |
bitemyapp/tandoori | src/Tandoori/GHC.hs | bsd-3-clause | runDyn m = defaultErrorHandler defaultDynFlags $ do
runGhc (Just libdir) $ do
--newSession
dflags <- getSessionDynFlags
_ <- setSessionDynFlags dflags
-- env <- liftIO $ newHscEnv dflags
-- setSession env
m | 309 | runDyn m = defaultErrorHandler defaultDynFlags $ do
runGhc (Just libdir) $ do
--newSession
dflags <- getSessionDynFlags
_ <- setSessionDynFlags dflags
-- env <- liftIO $ newHscEnv dflags
-- setSession env
m | 309 | runDyn m = defaultErrorHandler defaultDynFlags $ do
runGhc (Just libdir) $ do
--newSession
dflags <- getSessionDynFlags
_ <- setSessionDynFlags dflags
-- env <- liftIO $ newHscEnv dflags
-- setSession env
m | 309 | false | false | 0 | 12 | 133 | 55 | 25 | 30 | null | null |
whittle/s3-event | test/Network/AWS/S3/NotificationEventTest.hs | bsd-3-clause | unit_deserialize_bucket :: Expectation
unit_deserialize_bucket =
let json = "{\"name\":\"mybucket\",\"ownerIdentity\":{\"principalId\":\"A3NL1KOZZKExample\"},\"arn\":\"arn:aws:s3:::mybucket\"}"
expected = Bucket (A.BucketName "mybucket") (UserIdentity "A3NL1KOZZKExample") (A.BucketName "arn:aws:s3:::mybucket")
... | 362 | unit_deserialize_bucket :: Expectation
unit_deserialize_bucket =
let json = "{\"name\":\"mybucket\",\"ownerIdentity\":{\"principalId\":\"A3NL1KOZZKExample\"},\"arn\":\"arn:aws:s3:::mybucket\"}"
expected = Bucket (A.BucketName "mybucket") (UserIdentity "A3NL1KOZZKExample") (A.BucketName "arn:aws:s3:::mybucket")
... | 362 | unit_deserialize_bucket =
let json = "{\"name\":\"mybucket\",\"ownerIdentity\":{\"principalId\":\"A3NL1KOZZKExample\"},\"arn\":\"arn:aws:s3:::mybucket\"}"
expected = Bucket (A.BucketName "mybucket") (UserIdentity "A3NL1KOZZKExample") (A.BucketName "arn:aws:s3:::mybucket")
in decode' json `shouldBe` Just expec... | 323 | false | true | 0 | 12 | 33 | 68 | 34 | 34 | null | null |
ingemaradahl/bilder | src/Compiler/Utils.hs | lgpl-3.0 | foldStmM f p s@(SFunDecl _ _ _ _ iss) = foldM (foldStmM f) p iss >>= flip f s | 77 | foldStmM f p s@(SFunDecl _ _ _ _ iss) = foldM (foldStmM f) p iss >>= flip f s | 77 | foldStmM f p s@(SFunDecl _ _ _ _ iss) = foldM (foldStmM f) p iss >>= flip f s | 77 | false | false | 0 | 8 | 18 | 52 | 25 | 27 | null | null |
KaneTW/Idris-dev | src/Pkg/PParser.hs | bsd-3-clause | pClause :: PParser ()
pClause = do reserved "executable"; lchar '=';
exec <- filename
st <- get
put (st { execout = Just exec })
<|> do reserved "main"; lchar '=';
main <- fst <$> iName []
st <- get
put (st { idris_main = main })
... | 3,680 | pClause :: PParser ()
pClause = do reserved "executable"; lchar '=';
exec <- filename
st <- get
put (st { execout = Just exec })
<|> do reserved "main"; lchar '=';
main <- fst <$> iName []
st <- get
put (st { idris_main = main })
... | 3,680 | pClause = do reserved "executable"; lchar '=';
exec <- filename
st <- get
put (st { execout = Just exec })
<|> do reserved "main"; lchar '=';
main <- fst <$> iName []
st <- get
put (st { idris_main = main })
<|> do reserved "sou... | 3,658 | false | true | 54 | 14 | 1,669 | 1,391 | 644 | 747 | null | null |
kaizhang/bioinformatics-toolkit | bioinformatics-toolkit/src/Bio/GO.hs | mit | -- | The top level is 0.
getGOLevel :: GOId -> GOMap -> Int
getGOLevel gid gm = loop 0 [gid]
where
loop l ids | null parents = l
| otherwise = loop (l+1) parents
where
parents = concatMap _subProcessOf $ flip mapMaybe ids $ \i -> M.lookup i gm
{-
getParentById :: GOId -> GOMap -> Ma... | 1,581 | getGOLevel :: GOId -> GOMap -> Int
getGOLevel gid gm = loop 0 [gid]
where
loop l ids | null parents = l
| otherwise = loop (l+1) parents
where
parents = concatMap _subProcessOf $ flip mapMaybe ids $ \i -> M.lookup i gm
{-
getParentById :: GOId -> GOMap -> Maybe GO
getParentById gid ... | 1,556 | getGOLevel gid gm = loop 0 [gid]
where
loop l ids | null parents = l
| otherwise = loop (l+1) parents
where
parents = concatMap _subProcessOf $ flip mapMaybe ids $ \i -> M.lookup i gm
{-
getParentById :: GOId -> GOMap -> Maybe GO
getParentById gid goMap = M.lookup gid goMap >>= _sub... | 1,521 | true | true | 0 | 10 | 482 | 111 | 54 | 57 | null | null |
nicball/playground | Helix.hs | mit | segregateGene (Gaa c) = [((Recessive c), 1.0)] | 46 | segregateGene (Gaa c) = [((Recessive c), 1.0)] | 46 | segregateGene (Gaa c) = [((Recessive c), 1.0)] | 46 | false | false | 0 | 8 | 6 | 31 | 16 | 15 | null | null |
ardumont/hWifi | Network/HWifi.hs | gpl-2.0 | createNewWifi c _ _ = (return . Left . BadCommand . show) c | 59 | createNewWifi c _ _ = (return . Left . BadCommand . show) c | 59 | createNewWifi c _ _ = (return . Left . BadCommand . show) c | 59 | false | false | 0 | 9 | 12 | 31 | 15 | 16 | null | null |
poiuj/pfcc | src/Semant.hs | bsd-3-clause | ioClass = parsedClass "class IO {\
\out_string(x:String) : SELF_TYPE {self};\
\out_int(x : Int) : SELF_TYPE {self};\
\in_string() : String {\"\"};\
\in_int() : Int {0}; };" | 172 | ioClass = parsedClass "class IO {\
\out_string(x:String) : SELF_TYPE {self};\
\out_int(x : Int) : SELF_TYPE {self};\
\in_string() : String {\"\"};\
\in_int() : Int {0}; };" | 172 | ioClass = parsedClass "class IO {\
\out_string(x:String) : SELF_TYPE {self};\
\out_int(x : Int) : SELF_TYPE {self};\
\in_string() : String {\"\"};\
\in_int() : Int {0}; };" | 172 | false | false | 0 | 5 | 24 | 9 | 4 | 5 | null | null |
nomeata/sat-britney | Data/DenseIntSet.hs | gpl-2.0 | -- disjoint
subsetCmp Nil Nil = EQ | 34 | subsetCmp Nil Nil = EQ | 22 | subsetCmp Nil Nil = EQ | 22 | true | false | 1 | 5 | 6 | 17 | 6 | 11 | null | null |
alang9/deque | Data/Deque/NonCat/LessTyped.hs | bsd-3-clause | pushB a (B1 b) = B2 a b | 23 | pushB a (B1 b) = B2 a b | 23 | pushB a (B1 b) = B2 a b | 23 | false | false | 0 | 6 | 7 | 25 | 10 | 15 | null | null |
jeffreyrosenbluth/NYC-meetup | meetup/Trace.hs | mit | pointA = 1 ^& (0.5) | 19 | pointA = 1 ^& (0.5) | 19 | pointA = 1 ^& (0.5) | 19 | false | false | 3 | 5 | 4 | 17 | 7 | 10 | null | null |
tphyahoo/haskoin | haskoin-core/Network/Haskoin/Util.hs | unlicense | decodeToEither :: Binary a => ByteString -> Either String a
decodeToEither bs = case decodeOrFail' bs of
Left (_,_,err) -> Left err
Right (_,_,res) -> Right res
-- | Decode a 'Data.Binary' value. A 'Just' value is returned with the result
-- upon success. Otherwise, 'Nothing' is returned. | 299 | decodeToEither :: Binary a => ByteString -> Either String a
decodeToEither bs = case decodeOrFail' bs of
Left (_,_,err) -> Left err
Right (_,_,res) -> Right res
-- | Decode a 'Data.Binary' value. A 'Just' value is returned with the result
-- upon success. Otherwise, 'Nothing' is returned. | 299 | decodeToEither bs = case decodeOrFail' bs of
Left (_,_,err) -> Left err
Right (_,_,res) -> Right res
-- | Decode a 'Data.Binary' value. A 'Just' value is returned with the result
-- upon success. Otherwise, 'Nothing' is returned. | 239 | false | true | 0 | 9 | 57 | 81 | 41 | 40 | null | null |
hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/FramebufferObjects/Queries.hs | bsd-3-clause | renderbufferBlueSize :: RenderbufferTarget -> GettableStateVar GLint
renderbufferBlueSize rbt = makeGettableStateVar $
getRBPName rbt id RenderbufferBlueSize | 160 | renderbufferBlueSize :: RenderbufferTarget -> GettableStateVar GLint
renderbufferBlueSize rbt = makeGettableStateVar $
getRBPName rbt id RenderbufferBlueSize | 160 | renderbufferBlueSize rbt = makeGettableStateVar $
getRBPName rbt id RenderbufferBlueSize | 91 | false | true | 0 | 7 | 17 | 39 | 16 | 23 | null | null |
ganeti/ganeti | src/Ganeti/OpParams.hs | bsd-2-clause | pZeroingTimeoutFixed :: Field
pZeroingTimeoutFixed =
withDoc "The fixed part of time to wait before declaring the zeroing\
\ operation to have failed" .
optionalField $ simpleField "zeroing_timeout_fixed" [t| Int |] | 230 | pZeroingTimeoutFixed :: Field
pZeroingTimeoutFixed =
withDoc "The fixed part of time to wait before declaring the zeroing\
\ operation to have failed" .
optionalField $ simpleField "zeroing_timeout_fixed" [t| Int |] | 230 | pZeroingTimeoutFixed =
withDoc "The fixed part of time to wait before declaring the zeroing\
\ operation to have failed" .
optionalField $ simpleField "zeroing_timeout_fixed" [t| Int |] | 200 | false | true | 2 | 6 | 44 | 39 | 18 | 21 | null | null |
deepakjois/blaze-svg | src/Text/Blaze/Svg/Internal.hs | bsd-3-clause | -- | Lineto
l :: Show a => a -> a -> Path
l x y = appendToPath
[ "L "
, show x, ",", show y
, " "
] | 107 | l :: Show a => a -> a -> Path
l x y = appendToPath
[ "L "
, show x, ",", show y
, " "
] | 95 | l x y = appendToPath
[ "L "
, show x, ",", show y
, " "
] | 65 | true | true | 0 | 9 | 38 | 62 | 30 | 32 | null | null |
wavewave/MSSMType | src/HEP/Physics/MSSM/OutputPhys.hs | bsd-2-clause | isColored Sbottom1 = True | 26 | isColored Sbottom1 = True | 26 | isColored Sbottom1 = True | 26 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
markflorisson/packages | Pkgs/Parser.hs | bsd-3-clause | parseDef :: Parser Def
parseDef = parseTyDef <|> parseFunDef | 60 | parseDef :: Parser Def
parseDef = parseTyDef <|> parseFunDef | 60 | parseDef = parseTyDef <|> parseFunDef | 37 | false | true | 3 | 6 | 8 | 27 | 12 | 15 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 12726523 = 3793 | 35 | getValueFromProduct 12726523 = 3793 | 35 | getValueFromProduct 12726523 = 3793 | 35 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
gnn/Hets | Adl/Sign.hs | gpl-2.0 | signUnion :: Sign -> Sign -> Result Sign
signUnion s1 s2 = return s1
{ rels = Map.unionWith Set.union (rels s1) (rels s2)
, isas = Rel.union (isas s1) (isas s2) } | 166 | signUnion :: Sign -> Sign -> Result Sign
signUnion s1 s2 = return s1
{ rels = Map.unionWith Set.union (rels s1) (rels s2)
, isas = Rel.union (isas s1) (isas s2) } | 166 | signUnion s1 s2 = return s1
{ rels = Map.unionWith Set.union (rels s1) (rels s2)
, isas = Rel.union (isas s1) (isas s2) } | 125 | false | true | 0 | 10 | 35 | 94 | 45 | 49 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/AppStreamDirectoryConfigServiceAccountCredentials.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appstream-directoryconfig-serviceaccountcredentials.html#cfn-appstream-directoryconfig-serviceaccountcredentials-accountpassword
asdcsacAccountPassword :: Lens' AppStreamDirectoryConfigServiceAccountCredentials (Val Text)
asdcsacAccountPa... | 485 | asdcsacAccountPassword :: Lens' AppStreamDirectoryConfigServiceAccountCredentials (Val Text)
asdcsacAccountPassword = lens _appStreamDirectoryConfigServiceAccountCredentialsAccountPassword (\s a -> s { _appStreamDirectoryConfigServiceAccountCredentialsAccountPassword = a }) | 274 | asdcsacAccountPassword = lens _appStreamDirectoryConfigServiceAccountCredentialsAccountPassword (\s a -> s { _appStreamDirectoryConfigServiceAccountCredentialsAccountPassword = a }) | 181 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
int-e/ivar-simple | src/Data/IVar/Simple/IChan.hs | mit | -- | Create a new channel.
new :: IO (IChan a)
new = IChan `fmap` IVar.new | 74 | new :: IO (IChan a)
new = IChan `fmap` IVar.new | 47 | new = IChan `fmap` IVar.new | 27 | true | true | 0 | 8 | 15 | 35 | 17 | 18 | null | null |
brendanhay/gogol | gogol-dns/gen/Network/Google/DNS/Types/Product.hs | mpl-2.0 | -- | Type of resource.
rrslrKind :: Lens' ResourceRecordSetsListResponse Text
rrslrKind
= lens _rrslrKind (\ s a -> s{_rrslrKind = a}) | 136 | rrslrKind :: Lens' ResourceRecordSetsListResponse Text
rrslrKind
= lens _rrslrKind (\ s a -> s{_rrslrKind = a}) | 113 | rrslrKind
= lens _rrslrKind (\ s a -> s{_rrslrKind = a}) | 58 | true | true | 0 | 9 | 22 | 43 | 22 | 21 | null | null |
icyfork/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | readSpacePart = do
id <- getNextId
x <- many1 whitespace
return $ T_Literal id x | 92 | readSpacePart = do
id <- getNextId
x <- many1 whitespace
return $ T_Literal id x | 92 | readSpacePart = do
id <- getNextId
x <- many1 whitespace
return $ T_Literal id x | 92 | false | false | 1 | 9 | 26 | 39 | 15 | 24 | null | null |
BartMassey/extensible-printf | Text/Printf/Extensible.hs | bsd-3-clause | -- | Calls 'perror' to indicate that there is a type
-- error or similar in the given argument.
errorBadArgument = perror "bad argument" | 136 | errorBadArgument = perror "bad argument" | 40 | errorBadArgument = perror "bad argument" | 40 | true | false | 0 | 5 | 23 | 11 | 6 | 5 | null | null |
twittner/tinylog | src/System/Logger.hs | mpl-2.0 | lmsg :: Level -> (Msg -> Msg)
lmsg Trace = msg (val "T") | 56 | lmsg :: Level -> (Msg -> Msg)
lmsg Trace = msg (val "T") | 56 | lmsg Trace = msg (val "T") | 26 | false | true | 0 | 7 | 12 | 34 | 17 | 17 | null | null |
WraithM/haskell-opaleye | src/Opaleye/Internal/HaskellDB/Sql/Default.hs | bsd-3-clause | showAggrOp AggrVarP = "VarP" | 38 | showAggrOp AggrVarP = "VarP" | 38 | showAggrOp AggrVarP = "VarP" | 38 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
lambdageek/insomnia | src/Insomnia/Types.hs | bsd-3-clause | -- | Construct a fresh type expression composed of a unification var
-- of the given kind applied to sufficiently many ground arguments
-- such that the whole type expression has of kind ⋆.
--
-- @
-- ⌞⋆⌟ = u - u fresh
-- ⌞k1 → ⋯ → kN → ⋆⌟ = apply u (map ⌞·⌟ ks) - u fresh
-- @
-- for example: @⌞a -> (b ->... | 640 | groundUnificationVar :: MonadUnify TypeUnificationError Kind Type m => Kind -> m Type
groundUnificationVar = \ k -> do
tu <- freshUVarT k
go k tu
where
go KType thead = return thead
go (KArr kdom kcod) thead = do
targ <- groundUnificationVar kdom
go kcod (thead `TApp` targ) | 300 | groundUnificationVar = \ k -> do
tu <- freshUVarT k
go k tu
where
go KType thead = return thead
go (KArr kdom kcod) thead = do
targ <- groundUnificationVar kdom
go kcod (thead `TApp` targ) | 214 | true | true | 2 | 10 | 160 | 138 | 64 | 74 | null | null |
allanderek/ipclib | Language/Pepa/Compile/Odes.hs | gpl-2.0 | convertRateExpr :: RateExpr -> ChangeFunction
convertRateExpr (Cident n) = NameAtT $ Qualified.textual n | 108 | convertRateExpr :: RateExpr -> ChangeFunction
convertRateExpr (Cident n) = NameAtT $ Qualified.textual n | 108 | convertRateExpr (Cident n) = NameAtT $ Qualified.textual n | 62 | false | true | 0 | 7 | 16 | 33 | 16 | 17 | null | null |
green-haskell/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | getDFunTyLitKey (StrTyLit n) = mkOccName Name.varName (show n) | 62 | getDFunTyLitKey (StrTyLit n) = mkOccName Name.varName (show n) | 62 | getDFunTyLitKey (StrTyLit n) = mkOccName Name.varName (show n) | 62 | false | false | 0 | 7 | 7 | 28 | 13 | 15 | null | null |
codeimpossible/ohcount | test/src_dir/haskell1.hs | gpl-2.0 | {-|
Parses a host specification in the "name:12345"-style notation into a hostname
and a port number.
As a rather special feature, it returns 6346 as the port number when there is
no port specified. When there is a port specified, but it is unparseable, it
returns Nothing.
-}
parseHostnameWithPort :: String ... | 1,236 | parseHostnameWithPort :: String -> IO (Maybe ((Word8, Word8, Word8, Word8)
,PortNumber))
parseHostnameWithPort str = do maybeHostName <- stringToIP hostNameStr
return $ (do portNum <- maybePortNum
hos... | 948 | parseHostnameWithPort str = do maybeHostName <- stringToIP hostNameStr
return $ (do portNum <- maybePortNum
hostName <- maybeHostName
return (hostName, portNum)
... | 814 | true | true | 1 | 13 | 499 | 192 | 98 | 94 | null | null |
NinjaTrappeur/DobadoBots | src/DobadoBots/Graphics/Editor.hs | bsd-3-clause | removeChar :: EditorState -> T.Text
removeChar (EditorState t cc cl)
| T.length t < 2 = ""
| otherwise = T.intercalate (T.singleton '\n') newLines
where
newLines = insertAt cl alteredLine editorLines
alteredLine = T.concat [fst splittedLine, T.drop 1 $ snd splittedLine]
splittedLine = T.sp... | 414 | removeChar :: EditorState -> T.Text
removeChar (EditorState t cc cl)
| T.length t < 2 = ""
| otherwise = T.intercalate (T.singleton '\n') newLines
where
newLines = insertAt cl alteredLine editorLines
alteredLine = T.concat [fst splittedLine, T.drop 1 $ snd splittedLine]
splittedLine = T.spl... | 413 | removeChar (EditorState t cc cl)
| T.length t < 2 = ""
| otherwise = T.intercalate (T.singleton '\n') newLines
where
newLines = insertAt cl alteredLine editorLines
alteredLine = T.concat [fst splittedLine, T.drop 1 $ snd splittedLine]
splittedLine = T.splitAt cc deleteLine
deleteLine ... | 377 | false | true | 6 | 10 | 96 | 175 | 76 | 99 | null | null |
fmthoma/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | matchContextErrString (StmtCtxt ArrowExpr) = ptext (sLit "'do' block") | 78 | matchContextErrString (StmtCtxt ArrowExpr) = ptext (sLit "'do' block") | 78 | matchContextErrString (StmtCtxt ArrowExpr) = ptext (sLit "'do' block") | 78 | false | false | 0 | 7 | 15 | 24 | 11 | 13 | null | null |
danr/hipspec | examples/old-examples/hip/ProductiveUseOfFailure.hs | gpl-3.0 | even (S Z) = False | 18 | even (S Z) = False | 18 | even (S Z) = False | 18 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
yihuang/xml2json | Text/XML/ToJSON/Builder.hs | bsd-3-clause | closeStack st = closeStack (popStack st) | 49 | closeStack st = closeStack (popStack st) | 49 | closeStack st = closeStack (popStack st) | 49 | false | false | 0 | 7 | 14 | 18 | 8 | 10 | null | null |
markflorisson/hpack | testrepo/bytestring-0.10.4.1/Data/ByteString/Unsafe.hs | bsd-3-clause | -- ---------------------------------------------------------------------
--
-- Extensions to the basic interface
--
-- | A variety of 'head' for non-empty ByteStrings. 'unsafeHead' omits the
-- check for the empty case, so there is an obligation on the programmer
-- to provide a proof that the ByteString is non-empty.... | 458 | unsafeHead :: ByteString -> Word8
unsafeHead (PS x s l) = assert (l > 0) $
inlinePerformIO $ withForeignPtr x $ \p -> peekByteOff p s | 137 | unsafeHead (PS x s l) = assert (l > 0) $
inlinePerformIO $ withForeignPtr x $ \p -> peekByteOff p s | 103 | true | true | 2 | 8 | 76 | 75 | 39 | 36 | null | null |
DarrenMowat/blackbox | tests/results/CombinedTests.hs | unlicense | test0 (Admin s i) = "" | 22 | test0 (Admin s i) = "" | 22 | test0 (Admin s i) = "" | 22 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
Rotsor/factorio-module-selector | factorio-module-selector.hs | unlicense | showModule SpeedModule3 = "s3" | 30 | showModule SpeedModule3 = "s3" | 30 | showModule SpeedModule3 = "s3" | 30 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
shlevy/ghc | compiler/coreSyn/CoreUtils.hs | bsd-3-clause | exprIsTrivial (App e arg) = not (isRuntimeArg arg) && exprIsTrivial e | 74 | exprIsTrivial (App e arg) = not (isRuntimeArg arg) && exprIsTrivial e | 74 | exprIsTrivial (App e arg) = not (isRuntimeArg arg) && exprIsTrivial e | 74 | false | false | 0 | 8 | 15 | 33 | 15 | 18 | null | null |
anton-k/language-css | src/Language/Css/Build/Idents.hs | bsd-3-clause | -- | avoid
avoid :: Idents a => a
avoid = ident "avoid" | 55 | avoid :: Idents a => a
avoid = ident "avoid" | 44 | avoid = ident "avoid" | 21 | true | true | 0 | 7 | 12 | 28 | 12 | 16 | null | null |
alanz/Blobs | lib/DData/Set.hs | lgpl-2.1 | difference t1 t2 = hedgeDiff (const LT) (const GT) t1 t2 | 58 | difference t1 t2 = hedgeDiff (const LT) (const GT) t1 t2 | 58 | difference t1 t2 = hedgeDiff (const LT) (const GT) t1 t2 | 58 | false | false | 0 | 7 | 12 | 32 | 15 | 17 | null | null |
fpco/stackage-cabal | main/Init.hs | mit | version :: String
version = $(simpleVersion CabalInfo.version) | 62 | version :: String
version = $(simpleVersion CabalInfo.version) | 62 | version = $(simpleVersion CabalInfo.version) | 44 | false | true | 0 | 9 | 6 | 27 | 11 | 16 | null | null |
dwdyer/anorak | src/haskell/Anorak/FeatureExtractor.hs | gpl-3.0 | -- | Update a team's form record with the result of the specified match.
addResultToFeatures :: Team -> TeamFeatures -> Result -> TeamFeatures
addResultToFeatures team features (Result _ hteam hgoals ateam agoals _ _)
| team == hteam = addScoreToFeatures features hgoals agoals
| team == ateam = addScoreToFeatur... | 376 | addResultToFeatures :: Team -> TeamFeatures -> Result -> TeamFeatures
addResultToFeatures team features (Result _ hteam hgoals ateam agoals _ _)
| team == hteam = addScoreToFeatures features hgoals agoals
| team == ateam = addScoreToFeatures features agoals hgoals
| otherwise = features | 303 | addResultToFeatures team features (Result _ hteam hgoals ateam agoals _ _)
| team == hteam = addScoreToFeatures features hgoals agoals
| team == ateam = addScoreToFeatures features agoals hgoals
| otherwise = features | 233 | true | true | 0 | 11 | 71 | 105 | 48 | 57 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSL_AUTOTICKS :: Int
wxSL_AUTOTICKS = 16 | 41 | wxSL_AUTOTICKS :: Int
wxSL_AUTOTICKS = 16 | 41 | wxSL_AUTOTICKS = 16 | 19 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
GaloisInc/gidl | src/Gidl/Backend/Tower.hs | bsd-3-clause | defaultconf :: Artifact
defaultconf = artifactCabalFile P.getDataDir "support/tower/default.conf" | 97 | defaultconf :: Artifact
defaultconf = artifactCabalFile P.getDataDir "support/tower/default.conf" | 97 | defaultconf = artifactCabalFile P.getDataDir "support/tower/default.conf" | 73 | false | true | 0 | 6 | 7 | 24 | 10 | 14 | null | null |
OS2World/DEV-UTIL-HUGS | oldlib/MyersStack.hs | bsd-3-clause | lview E = Nothing2 | 18 | lview E = Nothing2 | 18 | lview E = Nothing2 | 18 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_384 (174#) = happyShift action_200 | 41 | action_384 (174#) = happyShift action_200 | 41 | action_384 (174#) = happyShift action_200 | 41 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
li-zhirui/EoplLangs | test/CallByName/ParserSuite.hs | bsd-3-clause | parserFailCase :: (Eq a, Show a) => Parser a -> String -> String -> Test
parserFailCase parser msg input =
TestCase $ assertBool msg (isLeft runP)
where
isLeft (Left _) = True
isLeft (Right _) = False
runP = runParser parser "Test fail case" input | 264 | parserFailCase :: (Eq a, Show a) => Parser a -> String -> String -> Test
parserFailCase parser msg input =
TestCase $ assertBool msg (isLeft runP)
where
isLeft (Left _) = True
isLeft (Right _) = False
runP = runParser parser "Test fail case" input | 264 | parserFailCase parser msg input =
TestCase $ assertBool msg (isLeft runP)
where
isLeft (Left _) = True
isLeft (Right _) = False
runP = runParser parser "Test fail case" input | 191 | false | true | 3 | 8 | 61 | 118 | 53 | 65 | null | null |
upwawet/vision | src/Medialib.hs | gpl-3.0 | requestInfo :: WithMedialib => RequestPriority -> MediaId -> IO ()
requestInfo prio id = atomically $ do
cc <- readTVar cache
withJust cc $ \cc ->
let id' = fromIntegral id
entries = cEntries cc
in case IntMap.lookup id' entries of
Nothing -> do
r <- readTVar reqQ
writeTVar... | 797 | requestInfo :: WithMedialib => RequestPriority -> MediaId -> IO ()
requestInfo prio id = atomically $ do
cc <- readTVar cache
withJust cc $ \cc ->
let id' = fromIntegral id
entries = cEntries cc
in case IntMap.lookup id' entries of
Nothing -> do
r <- readTVar reqQ
writeTVar... | 797 | requestInfo prio id = atomically $ do
cc <- readTVar cache
withJust cc $ \cc ->
let id' = fromIntegral id
entries = cEntries cc
in case IntMap.lookup id' entries of
Nothing -> do
r <- readTVar reqQ
writeTVar reqQ $ PSQ.insert id prio r
writeTVar cache $ Just
... | 730 | false | true | 0 | 24 | 243 | 309 | 142 | 167 | null | null |
QuickChick/Luck | luck/src/Core/IntRep.hs | mit | removeGT x o@(Range low high)
| x > high = Just o
| pred x > low = Just $ Range low (pred x)
| pred x == low = Just $ Point low
| x <= low = Nothing | 176 | removeGT x o@(Range low high)
| x > high = Just o
| pred x > low = Just $ Range low (pred x)
| pred x == low = Just $ Point low
| x <= low = Nothing | 176 | removeGT x o@(Range low high)
| x > high = Just o
| pred x > low = Just $ Range low (pred x)
| pred x == low = Just $ Point low
| x <= low = Nothing | 176 | false | false | 1 | 9 | 67 | 107 | 48 | 59 | null | null |
ihc/futhark | src/Futhark/TypeCheck.hs | isc | funParamsToNameInfos :: [FParam lore]
-> [(VName, NameInfo (Aliases lore))]
funParamsToNameInfos = map nameTypeAndLore
where nameTypeAndLore fparam = (paramName fparam,
FParamInfo $ paramAttr fparam) | 256 | funParamsToNameInfos :: [FParam lore]
-> [(VName, NameInfo (Aliases lore))]
funParamsToNameInfos = map nameTypeAndLore
where nameTypeAndLore fparam = (paramName fparam,
FParamInfo $ paramAttr fparam) | 256 | funParamsToNameInfos = map nameTypeAndLore
where nameTypeAndLore fparam = (paramName fparam,
FParamInfo $ paramAttr fparam) | 159 | false | true | 0 | 10 | 79 | 68 | 35 | 33 | null | null |
peter-fogg/pardoc | src/Text/Pandoc/Writers/Docx.hs | gpl-2.0 | styleToOpenXml :: Style -> [Element]
styleToOpenXml style = parStyle : map toStyle alltoktypes
where alltoktypes = enumFromTo KeywordTok NormalTok
toStyle toktype = mknode "w:style" [("w:type","character"),
("w:customStyle","1"),("w:styleId",show toktype)]
... | 2,342 | styleToOpenXml :: Style -> [Element]
styleToOpenXml style = parStyle : map toStyle alltoktypes
where alltoktypes = enumFromTo KeywordTok NormalTok
toStyle toktype = mknode "w:style" [("w:type","character"),
("w:customStyle","1"),("w:styleId",show toktype)]
... | 2,342 | styleToOpenXml style = parStyle : map toStyle alltoktypes
where alltoktypes = enumFromTo KeywordTok NormalTok
toStyle toktype = mknode "w:style" [("w:type","character"),
("w:customStyle","1"),("w:styleId",show toktype)]
[ mknode "w:name" [("w:val",show t... | 2,305 | false | true | 6 | 21 | 999 | 639 | 340 | 299 | null | null |
olsner/ghc | testsuite/tests/ado/ado004.hs | bsd-3-clause | test2 f = do
x <- f 3
y <- f 4
return (x + y)
-- Test we can also infer the Functor version of the type | 110 | test2 f = do
x <- f 3
y <- f 4
return (x + y)
-- Test we can also infer the Functor version of the type | 110 | test2 f = do
x <- f 3
y <- f 4
return (x + y)
-- Test we can also infer the Functor version of the type | 110 | false | false | 1 | 10 | 34 | 47 | 19 | 28 | null | null |
spikelynch/annales | app/Annales/Emperor.hs | bsd-3-clause | probBirth :: Empire -> Int
probBirth e = case consortAge e of
Nothing -> 0
(Just x) | x > 49 -> 0
(Just x) | x < 16 -> 0
otherwise -> if isBaby e then 0 else 35 | 171 | probBirth :: Empire -> Int
probBirth e = case consortAge e of
Nothing -> 0
(Just x) | x > 49 -> 0
(Just x) | x < 16 -> 0
otherwise -> if isBaby e then 0 else 35 | 171 | probBirth e = case consortAge e of
Nothing -> 0
(Just x) | x > 49 -> 0
(Just x) | x < 16 -> 0
otherwise -> if isBaby e then 0 else 35 | 144 | false | true | 0 | 11 | 50 | 98 | 45 | 53 | null | null |
cfredric/arithmoi | test-suite/Math/NumberTheory/CurvesTests.hs | mit | multiplyRangeProperty :: Shrink2 (Positive Integer) -> Shrink2 (Positive Integer) -> Shrink2 Word -> Property
multiplyRangeProperty (Shrink2 (Positive s)) (Shrink2 (Positive n)) (Shrink2 k) = newPoint s n ==>? \case
SomePoint p -> isValid' p ==> isValid (multiply k p) | 270 | multiplyRangeProperty :: Shrink2 (Positive Integer) -> Shrink2 (Positive Integer) -> Shrink2 Word -> Property
multiplyRangeProperty (Shrink2 (Positive s)) (Shrink2 (Positive n)) (Shrink2 k) = newPoint s n ==>? \case
SomePoint p -> isValid' p ==> isValid (multiply k p) | 270 | multiplyRangeProperty (Shrink2 (Positive s)) (Shrink2 (Positive n)) (Shrink2 k) = newPoint s n ==>? \case
SomePoint p -> isValid' p ==> isValid (multiply k p) | 160 | false | true | 0 | 12 | 40 | 119 | 56 | 63 | null | null |
jdnavarro/smallcheck | test/test.hs | bsd-3-clause | ------------------------------
-- Kinds of tests
------------------------------
prop_size
:: forall a m . (SizeTest a, Monad m)
=> Proxy a -> Property m
prop_size proxy = forAll $
\d ->
count d (series :: Series Identity a) == size proxy (fromIntegral d) | 265 | prop_size
:: forall a m . (SizeTest a, Monad m)
=> Proxy a -> Property m
prop_size proxy = forAll $
\d ->
count d (series :: Series Identity a) == size proxy (fromIntegral d) | 184 | prop_size proxy = forAll $
\d ->
count d (series :: Series Identity a) == size proxy (fromIntegral d) | 107 | true | true | 0 | 10 | 51 | 91 | 47 | 44 | null | null |
aaronlevin/hopts | src/Hopts/Language.hs | gpl-3.0 | parseArgType :: Parser ArgType
parseArgType = do
argType <- many (letter <|> char '-')
case argType of
"switch" -> return SwitchArg
"string" -> return StringArg
_ -> fail $ "`" ++ argType ++ "` is not a valid argument type" | 246 | parseArgType :: Parser ArgType
parseArgType = do
argType <- many (letter <|> char '-')
case argType of
"switch" -> return SwitchArg
"string" -> return StringArg
_ -> fail $ "`" ++ argType ++ "` is not a valid argument type" | 246 | parseArgType = do
argType <- many (letter <|> char '-')
case argType of
"switch" -> return SwitchArg
"string" -> return StringArg
_ -> fail $ "`" ++ argType ++ "` is not a valid argument type" | 215 | false | true | 1 | 13 | 62 | 82 | 36 | 46 | null | null |
bgamari/text | src/Data/Text/Foreign.hs | bsd-2-clause | withCStringLen :: Text -> (CStringLen -> IO a) -> IO a
withCStringLen t act = unsafeUseAsCStringLen (encodeUtf8 t) act | 118 | withCStringLen :: Text -> (CStringLen -> IO a) -> IO a
withCStringLen t act = unsafeUseAsCStringLen (encodeUtf8 t) act | 118 | withCStringLen t act = unsafeUseAsCStringLen (encodeUtf8 t) act | 63 | false | true | 0 | 9 | 18 | 48 | 23 | 25 | null | null |
fsvehla/steam-analytics | src/Parse.hs | mit | totalCents :: String -> Either String Int
totalCents "" = Left "empty input" | 76 | totalCents :: String -> Either String Int
totalCents "" = Left "empty input" | 76 | totalCents "" = Left "empty input" | 34 | false | true | 0 | 7 | 12 | 31 | 13 | 18 | null | null |
adamwalker/sylvan-haskell | Sylvan.hs | bsd-3-clause | c_sylvanComplement :: CLLong
c_sylvanComplement = 0x8000000000000000 | 70 | c_sylvanComplement :: CLLong
c_sylvanComplement = 0x8000000000000000 | 69 | c_sylvanComplement = 0x8000000000000000 | 40 | false | true | 0 | 4 | 7 | 11 | 6 | 5 | null | null |
byorgey/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | defined (PParams _ _ ds) = concatMap defined ds | 47 | defined (PParams _ _ ds) = concatMap defined ds | 47 | defined (PParams _ _ ds) = concatMap defined ds | 47 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
abhin4v/hask-irc | hask-irc-core/Network/IRC/MessageBus.hs | apache-2.0 | newMessageBus :: IO (MessageBus a)
newMessageBus = MessageBus <$> newBroadcastTChanIO | 85 | newMessageBus :: IO (MessageBus a)
newMessageBus = MessageBus <$> newBroadcastTChanIO | 85 | newMessageBus = MessageBus <$> newBroadcastTChanIO | 50 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
ruslantalpa/postgrest | test/SpecHelper.hs | mit | resetDb :: Text -> IO ()
resetDb dbConn = loadFixture dbConn "data" | 67 | resetDb :: Text -> IO ()
resetDb dbConn = loadFixture dbConn "data" | 67 | resetDb dbConn = loadFixture dbConn "data" | 42 | false | true | 0 | 8 | 11 | 34 | 14 | 20 | null | null |
uduki/hsQt | Qtc/Gui/QStyleOptionMenuItem.hs | bsd-2-clause | setMenuRect :: QStyleOptionMenuItem a -> ((Rect)) -> IO ()
setMenuRect x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withCRect x1 $ \crect_x1_x crect_x1_y crect_x1_w crect_x1_h ->
qtc_QStyleOptionMenuItem_setMenuRect_qth cobj_x0 crect_x1_x crect_x1_y crect_x1_w crect_x1_h | 279 | setMenuRect :: QStyleOptionMenuItem a -> ((Rect)) -> IO ()
setMenuRect x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withCRect x1 $ \crect_x1_x crect_x1_y crect_x1_w crect_x1_h ->
qtc_QStyleOptionMenuItem_setMenuRect_qth cobj_x0 crect_x1_x crect_x1_y crect_x1_w crect_x1_h | 279 | setMenuRect x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withCRect x1 $ \crect_x1_x crect_x1_y crect_x1_w crect_x1_h ->
qtc_QStyleOptionMenuItem_setMenuRect_qth cobj_x0 crect_x1_x crect_x1_y crect_x1_w crect_x1_h | 220 | false | true | 0 | 9 | 43 | 82 | 41 | 41 | null | null |
Erdwolf/autotool-bonn | server/src/Util/Xml/Output.hs | gpl-2.0 | xmlStringToOutput :: String -> O.Output
xmlStringToOutput = xoutputToOutput . either error id . readXml | 103 | xmlStringToOutput :: String -> O.Output
xmlStringToOutput = xoutputToOutput . either error id . readXml | 103 | xmlStringToOutput = xoutputToOutput . either error id . readXml | 63 | false | true | 0 | 7 | 13 | 30 | 15 | 15 | null | null |
c0deaddict/project-euler | src/Part1/Problem7.hs | bsd-3-clause | --
-- Problem 7: 10001st prime
--
-- By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see
-- that the 6th prime is 13.
--
-- What is the 10 001st prime number?
-- https://stackoverflow.com/a/27464965/248948
squareRoot :: Integral t => t -> t
squareRoot n
| n > 0 = babylon n
| n == 0 = ... | 472 | squareRoot :: Integral t => t -> t
squareRoot n
| n > 0 = babylon n
| n == 0 = 0
| n < 0 = error "Negative input"
where
babylon a | a > b = babylon b
| True = a
where b = quot (a + quot n a) 2 | 242 | squareRoot n
| n > 0 = babylon n
| n == 0 = 0
| n < 0 = error "Negative input"
where
babylon a | a > b = babylon b
| True = a
where b = quot (a + quot n a) 2 | 207 | true | true | 0 | 12 | 148 | 131 | 64 | 67 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/List.hs | mit | deListPXAttr :: PXAttr l -> PXAttr l
deListPXAttr (PXAttr l xName pat) = PXAttr (id l) (deListXName xName) (deListPat pat) | 122 | deListPXAttr :: PXAttr l -> PXAttr l
deListPXAttr (PXAttr l xName pat) = PXAttr (id l) (deListXName xName) (deListPat pat) | 122 | deListPXAttr (PXAttr l xName pat) = PXAttr (id l) (deListXName xName) (deListPat pat) | 85 | false | true | 0 | 7 | 19 | 59 | 28 | 31 | null | null |
nbrunt/JSHOP | src/CodeCompressor.hs | mit | genAssignList [x] = genAssign x | 35 | genAssignList [x] = genAssign x | 35 | genAssignList [x] = genAssign x | 35 | false | false | 0 | 6 | 8 | 15 | 7 | 8 | null | null |
erochest/cabal-brew | CabalBrew/Types.hs | apache-2.0 | (?>) :: CabalBrewRun a -> (a -> CabalBrewRun b) -> CabalBrewRun (Maybe b)
m ?> n = maybe (return Nothing) (fmap Just . n) =<< safeCabalBrew Nothing m | 149 | (?>) :: CabalBrewRun a -> (a -> CabalBrewRun b) -> CabalBrewRun (Maybe b)
m ?> n = maybe (return Nothing) (fmap Just . n) =<< safeCabalBrew Nothing m | 149 | m ?> n = maybe (return Nothing) (fmap Just . n) =<< safeCabalBrew Nothing m | 75 | false | true | 0 | 11 | 27 | 83 | 39 | 44 | null | null |
aaronc/Idris-dev | src/IRTS/CodegenJavaScript.hs | bsd-3-clause | jsMYOLDBASE :: JS
jsMYOLDBASE = JSIdent "myoldbase" | 51 | jsMYOLDBASE :: JS
jsMYOLDBASE = JSIdent "myoldbase" | 51 | jsMYOLDBASE = JSIdent "myoldbase" | 33 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
jwiegley/hackports | Main.hs | bsd-3-clause | buildDependencies :: PackageDisplayInfo -> String
buildDependencies = intercalate " \\\n\t\t"
. DS.toList . DS.fromList
. deps . dependencies
where deps (x:xs) =
let (Dependency depName ver) = x
(PackageName name) = depName
... | 479 | buildDependencies :: PackageDisplayInfo -> String
buildDependencies = intercalate " \\\n\t\t"
. DS.toList . DS.fromList
. deps . dependencies
where deps (x:xs) =
let (Dependency depName ver) = x
(PackageName name) = depName
... | 479 | buildDependencies = intercalate " \\\n\t\t"
. DS.toList . DS.fromList
. deps . dependencies
where deps (x:xs) =
let (Dependency depName ver) = x
(PackageName name) = depName
in xlatdep name : deps xs
whe... | 429 | false | true | 1 | 13 | 208 | 131 | 63 | 68 | null | null |
shlevy/ghc | compiler/simplCore/OccurAnal.hs | bsd-3-clause | occAnalArgs env (arg:args) one_shots
| isTypeArg arg
= case occAnalArgs env args one_shots of { (uds, args') ->
(uds, arg:args') }
| otherwise
= case argCtxt env one_shots of { (arg_env, one_shots') ->
case occAnal arg_env arg of { (uds1, arg') ->
case occAnalArgs env args one... | 385 | occAnalArgs env (arg:args) one_shots
| isTypeArg arg
= case occAnalArgs env args one_shots of { (uds, args') ->
(uds, arg:args') }
| otherwise
= case argCtxt env one_shots of { (arg_env, one_shots') ->
case occAnal arg_env arg of { (uds1, arg') ->
case occAnalArgs env args one... | 385 | occAnalArgs env (arg:args) one_shots
| isTypeArg arg
= case occAnalArgs env args one_shots of { (uds, args') ->
(uds, arg:args') }
| otherwise
= case argCtxt env one_shots of { (arg_env, one_shots') ->
case occAnal arg_env arg of { (uds1, arg') ->
case occAnalArgs env args one... | 385 | false | false | 0 | 16 | 103 | 160 | 86 | 74 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/NodeTypes/AggregatedList.hs | mpl-2.0 | -- | The maximum number of results per page that should be returned. If the
-- number of available results is larger than \`maxResults\`, Compute
-- Engine returns a \`nextPageToken\` that can be used to get the next page
-- of results in subsequent list requests. Acceptable values are \`0\` to
-- \`500\`, inclusive. (... | 488 | ntalMaxResults :: Lens' NodeTypesAggregatedList Word32
ntalMaxResults
= lens _ntalMaxResults
(\ s a -> s{_ntalMaxResults = a})
. _Coerce | 150 | ntalMaxResults
= lens _ntalMaxResults
(\ s a -> s{_ntalMaxResults = a})
. _Coerce | 95 | true | true | 0 | 10 | 87 | 50 | 28 | 22 | null | null |
facebookincubator/duckling | tests/Duckling/Volume/RO/Tests.hs | bsd-3-clause | tests :: TestTree
tests = testGroup "RO Tests"
[ makeCorpusTest [Seal Volume] corpus
] | 90 | tests :: TestTree
tests = testGroup "RO Tests"
[ makeCorpusTest [Seal Volume] corpus
] | 90 | tests = testGroup "RO Tests"
[ makeCorpusTest [Seal Volume] corpus
] | 72 | false | true | 0 | 9 | 17 | 38 | 16 | 22 | null | null |
brendanhay/gogol | gogol-cloudsearch/gen/Network/Google/Resource/CloudSearch/Operations/Get.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
ogUploadType :: Lens' OperationsGet (Maybe Text)
ogUploadType
= lens _ogUploadType (\ s a -> s{_ogUploadType = a}) | 187 | ogUploadType :: Lens' OperationsGet (Maybe Text)
ogUploadType
= lens _ogUploadType (\ s a -> s{_ogUploadType = a}) | 116 | ogUploadType
= lens _ogUploadType (\ s a -> s{_ogUploadType = a}) | 67 | true | true | 0 | 9 | 28 | 48 | 25 | 23 | null | null |
djfo/foobot | examples/hangman.hs | bsd-3-clause | findChar :: Message -> Maybe Char
findChar m = head . T.unpack <$> findText p m
where
p t = T.length t == 1 | 113 | findChar :: Message -> Maybe Char
findChar m = head . T.unpack <$> findText p m
where
p t = T.length t == 1 | 113 | findChar m = head . T.unpack <$> findText p m
where
p t = T.length t == 1 | 79 | false | true | 1 | 7 | 29 | 64 | 27 | 37 | null | null |
GaloisInc/verification-game | web-prover/src/SecureEncoding.hs | bsd-3-clause | unencapValue :: Serial a => SecurityContext -> Text -> Maybe a
unencapValue secCxt encodedSnap =
do let textToBytes = Base64.decode . Text.encodeUtf8
rawBytes <- option (textToBytes encodedSnap)
-- Extract iv, authTag, cipherText. Decrypt cipherText and verify authTag
let (iv , rawBytes1 ) = LBS.... | 894 | unencapValue :: Serial a => SecurityContext -> Text -> Maybe a
unencapValue secCxt encodedSnap =
do let textToBytes = Base64.decode . Text.encodeUtf8
rawBytes <- option (textToBytes encodedSnap)
-- Extract iv, authTag, cipherText. Decrypt cipherText and verify authTag
let (iv , rawBytes1 ) = LBS.... | 894 | unencapValue secCxt encodedSnap =
do let textToBytes = Base64.decode . Text.encodeUtf8
rawBytes <- option (textToBytes encodedSnap)
-- Extract iv, authTag, cipherText. Decrypt cipherText and verify authTag
let (iv , rawBytes1 ) = LBS.splitAt (fromIntegral ivLength ) rawBytes
(authTag... | 831 | false | true | 3 | 11 | 255 | 218 | 108 | 110 | null | null |
input-output-hk/pos-haskell-prototype | db/src/Pos/DB/Block/Load.hs | mit | getHeaderThrow
:: LoadHeadersMode m
=> HeaderHash -> m BlockHeader
getHeaderThrow hash =
maybeThrow (DBMalformed $ sformat errFmt hash) =<< getHeader hash
where
errFmt = "getBlockThrow: no block header with hash: "%shortHashF | 243 | getHeaderThrow
:: LoadHeadersMode m
=> HeaderHash -> m BlockHeader
getHeaderThrow hash =
maybeThrow (DBMalformed $ sformat errFmt hash) =<< getHeader hash
where
errFmt = "getBlockThrow: no block header with hash: "%shortHashF | 243 | getHeaderThrow hash =
maybeThrow (DBMalformed $ sformat errFmt hash) =<< getHeader hash
where
errFmt = "getBlockThrow: no block header with hash: "%shortHashF | 168 | false | true | 0 | 9 | 48 | 66 | 30 | 36 | null | null |
brendanhay/gogol | gogol-servicemanagement/gen/Network/Google/ServiceManagement/Types/Product.hs | mpl-2.0 | -- | Optional. The resource name of the monitored resource descriptor:
-- \`\"projects\/{project_id}\/monitoredResourceDescriptors\/{type}\"\`
-- where {type} is the value of the \`type\` field in this object and
-- {project_id} is a project ID that provides API-specific context for
-- accessing the type. APIs that do ... | 538 | mrdName :: Lens' MonitoredResourceDescriptor (Maybe Text)
mrdName = lens _mrdName (\ s a -> s{_mrdName = a}) | 108 | mrdName = lens _mrdName (\ s a -> s{_mrdName = a}) | 50 | true | true | 0 | 9 | 73 | 51 | 30 | 21 | null | null |
fyrchik/hfuse3 | app/HelloFS.hs | bsd-3-clause | helloReadDirectory :: FilePath -> IO (Either Errno [(FilePath, FileStat)])
helloReadDirectory "/" = do
ctx <- getFuseContext
n <- getPrivateData ctx >>= _getName
return $ Right [(".", dirStat ctx)
,("..", dirStat ctx)
,(n, fileStat ctx)
] | 308 | helloReadDirectory :: FilePath -> IO (Either Errno [(FilePath, FileStat)])
helloReadDirectory "/" = do
ctx <- getFuseContext
n <- getPrivateData ctx >>= _getName
return $ Right [(".", dirStat ctx)
,("..", dirStat ctx)
,(n, fileStat ctx)
] | 308 | helloReadDirectory "/" = do
ctx <- getFuseContext
n <- getPrivateData ctx >>= _getName
return $ Right [(".", dirStat ctx)
,("..", dirStat ctx)
,(n, fileStat ctx)
] | 233 | false | true | 0 | 12 | 104 | 110 | 55 | 55 | null | null |
teuffy/min-var-ci | src/FP/ImportWizard/Generate.hs | mit | -- EKB TODO check for reserved words?
isValidVarIdent :: String -> Bool
isValidVarIdent [] = False | 98 | isValidVarIdent :: String -> Bool
isValidVarIdent [] = False | 60 | isValidVarIdent [] = False | 26 | true | true | 0 | 6 | 15 | 21 | 11 | 10 | null | null |
jozefg/ds-kanren | test/List.hs | mit | isAppend :: TestTree
isAppend = testProperty "Head Works"
. mapSize (const 3)
. forAll (two . listOf1 $ mkTerm [])
$ \(l, r) -> case runN 1 $ appendo (list l) (list r) of
(t, _) : _ -> t == list (l ++ r)
_ -> False | 297 | isAppend :: TestTree
isAppend = testProperty "Head Works"
. mapSize (const 3)
. forAll (two . listOf1 $ mkTerm [])
$ \(l, r) -> case runN 1 $ appendo (list l) (list r) of
(t, _) : _ -> t == list (l ++ r)
_ -> False | 297 | isAppend = testProperty "Head Works"
. mapSize (const 3)
. forAll (two . listOf1 $ mkTerm [])
$ \(l, r) -> case runN 1 $ appendo (list l) (list r) of
(t, _) : _ -> t == list (l ++ r)
_ -> False | 276 | false | true | 0 | 13 | 130 | 129 | 65 | 64 | null | null |
sebfisch/incremental-sat-solver | Data/Boolean.hs | bsd-3-clause | atChildren _ x = x | 25 | atChildren _ x = x | 25 | atChildren _ x = x | 25 | false | false | 0 | 5 | 11 | 11 | 5 | 6 | null | null |
nevvi/Declarative-D7012E | lab2/Statement.hs | gpl-3.0 | str (While cond doStm) = "while " ++ (Expr.toString cond) ++
" do\n" ++ (toString doStm) ++ "\n" | 121 | str (While cond doStm) = "while " ++ (Expr.toString cond) ++
" do\n" ++ (toString doStm) ++ "\n" | 121 | str (While cond doStm) = "while " ++ (Expr.toString cond) ++
" do\n" ++ (toString doStm) ++ "\n" | 121 | false | false | 0 | 11 | 42 | 48 | 23 | 25 | null | null |
yamadapc/hzulip | examples/src/ZulipCli.hs | gpl-2.0 | streamsFromNames :: [String] -> [Stream]
streamsFromNames = zipWith helper ([0..] :: [Int])
where cs = [Black, Red, Green, Yellow, Blue, Magenta, Cyan]
l = length cs
helper i n = Stream n (cs !! (i `rem` l)) | 225 | streamsFromNames :: [String] -> [Stream]
streamsFromNames = zipWith helper ([0..] :: [Int])
where cs = [Black, Red, Green, Yellow, Blue, Magenta, Cyan]
l = length cs
helper i n = Stream n (cs !! (i `rem` l)) | 225 | streamsFromNames = zipWith helper ([0..] :: [Int])
where cs = [Black, Red, Green, Yellow, Blue, Magenta, Cyan]
l = length cs
helper i n = Stream n (cs !! (i `rem` l)) | 184 | false | true | 2 | 9 | 54 | 106 | 61 | 45 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLBodyElement.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement.onwebkitwillrevealright Mozilla HTMLBodyElement.onwebkitwillrevealright documentation>
webKitWillRevealRight :: EventName HTMLBodyElement Event
webKitWillRevealRight
= unsafeEventName (toJSString "webkitwillrevealright") | 294 | webKitWillRevealRight :: EventName HTMLBodyElement Event
webKitWillRevealRight
= unsafeEventName (toJSString "webkitwillrevealright") | 135 | webKitWillRevealRight
= unsafeEventName (toJSString "webkitwillrevealright") | 78 | true | true | 0 | 7 | 18 | 28 | 13 | 15 | null | null |
brendanhay/gogol | gogol-fitness/gen/Network/Google/Fitness/Types/Product.hs | mpl-2.0 | -- | A data source ID to aggregate. Only data from the specified data source
-- ID will be included in the aggregation. If specified, this data source
-- must exist; the OAuth scopes in the supplied credentials must grant read
-- access to this data type. The dataset in the response will have the same
-- data source ID... | 540 | abDataSourceId :: Lens' AggregateBy (Maybe Text)
abDataSourceId
= lens _abDataSourceId
(\ s a -> s{_abDataSourceId = a}) | 128 | abDataSourceId
= lens _abDataSourceId
(\ s a -> s{_abDataSourceId = a}) | 79 | true | true | 0 | 9 | 99 | 53 | 30 | 23 | null | null |
da-x/ghc | compiler/main/HscMain.hs | bsd-3-clause | oneShotMsg :: HscEnv -> RecompileRequired -> IO ()
oneShotMsg hsc_env recomp =
case recomp of
UpToDate ->
compilationProgressMsg (hsc_dflags hsc_env) $
"compilation IS NOT required"
_ ->
return () | 259 | oneShotMsg :: HscEnv -> RecompileRequired -> IO ()
oneShotMsg hsc_env recomp =
case recomp of
UpToDate ->
compilationProgressMsg (hsc_dflags hsc_env) $
"compilation IS NOT required"
_ ->
return () | 259 | oneShotMsg hsc_env recomp =
case recomp of
UpToDate ->
compilationProgressMsg (hsc_dflags hsc_env) $
"compilation IS NOT required"
_ ->
return () | 208 | false | true | 2 | 8 | 91 | 64 | 30 | 34 | null | null |
meiersi/scyther-proof | src/Scyther/Protocol.hs | gpl-3.0 | patFAV (PAsymPK pt) = patFAV pt | 35 | patFAV (PAsymPK pt) = patFAV pt | 35 | patFAV (PAsymPK pt) = patFAV pt | 35 | false | false | 0 | 6 | 9 | 19 | 8 | 11 | null | null |
ezyang/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | {-
************************************************************************
* *
\subsection[TysPrim-synch-var]{The synchronizing variable type}
* *
**********************************... | 471 | mVarPrimTyCon :: TyCon
mVarPrimTyCon = pcPrimTyCon mVarPrimTyConName [Nominal, Representational] UnliftedRep | 108 | mVarPrimTyCon = pcPrimTyCon mVarPrimTyConName [Nominal, Representational] UnliftedRep | 85 | true | true | 0 | 6 | 160 | 25 | 14 | 11 | null | null |
brendanhay/gogol | gogol-books/gen/Network/Google/Books/Types/Product.hs | mpl-2.0 | usnmfaOptedState :: Lens' UserSettingsNotificationMoreFromAuthors (Maybe Text)
usnmfaOptedState
= lens _usnmfaOptedState
(\ s a -> s{_usnmfaOptedState = a}) | 164 | usnmfaOptedState :: Lens' UserSettingsNotificationMoreFromAuthors (Maybe Text)
usnmfaOptedState
= lens _usnmfaOptedState
(\ s a -> s{_usnmfaOptedState = a}) | 164 | usnmfaOptedState
= lens _usnmfaOptedState
(\ s a -> s{_usnmfaOptedState = a}) | 85 | false | true | 0 | 8 | 24 | 48 | 24 | 24 | null | null |
bernstein/ircfs | Network/IRC/Message/Types.hs | bsd-3-clause | numericMsg 316 = RPL_WHOISCHANOP | 32 | numericMsg 316 = RPL_WHOISCHANOP | 32 | numericMsg 316 = RPL_WHOISCHANOP | 32 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.