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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tamarin-prover/tamarin-prover | lib/theory/src/Theory.hs | gpl-3.0 | itemToRule _ = Nothing | 33 | itemToRule _ = Nothing | 33 | itemToRule _ = Nothing | 33 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
upwawet/vision | src/Clipboard.hs | gpl-3.0 | clipboardTargets :: WithClipboard => TVar [TargetTag]
clipboardTargets = _targets ?_Clipboard | 93 | clipboardTargets :: WithClipboard => TVar [TargetTag]
clipboardTargets = _targets ?_Clipboard | 93 | clipboardTargets = _targets ?_Clipboard | 39 | false | true | 0 | 8 | 9 | 31 | 13 | 18 | null | null |
gridaphobe/ghc | compiler/deSugar/DsArrows.hs | bsd-3-clause | dsCmdStmts ids local_vars out_ids (stmt:stmts) env_ids = do
let bound_vars = mkVarSet (collectLStmtBinders stmt)
let local_vars' = bound_vars `unionVarSet` local_vars
(core_stmts, _fv_stmts, env_ids') <- dsfixCmdStmts ids local_vars' out_ids stmts
(core_stmt, fv_stmt) <- dsCmdLStmt ids local_vars env_ids' stmt env_ids
return (do_compose ids
(mkBigCoreVarTupTy env_ids)
(mkBigCoreVarTupTy env_ids')
(mkBigCoreVarTupTy out_ids)
core_stmt
core_stmts,
fv_stmt) | 573 | dsCmdStmts ids local_vars out_ids (stmt:stmts) env_ids = do
let bound_vars = mkVarSet (collectLStmtBinders stmt)
let local_vars' = bound_vars `unionVarSet` local_vars
(core_stmts, _fv_stmts, env_ids') <- dsfixCmdStmts ids local_vars' out_ids stmts
(core_stmt, fv_stmt) <- dsCmdLStmt ids local_vars env_ids' stmt env_ids
return (do_compose ids
(mkBigCoreVarTupTy env_ids)
(mkBigCoreVarTupTy env_ids')
(mkBigCoreVarTupTy out_ids)
core_stmt
core_stmts,
fv_stmt) | 573 | dsCmdStmts ids local_vars out_ids (stmt:stmts) env_ids = do
let bound_vars = mkVarSet (collectLStmtBinders stmt)
let local_vars' = bound_vars `unionVarSet` local_vars
(core_stmts, _fv_stmts, env_ids') <- dsfixCmdStmts ids local_vars' out_ids stmts
(core_stmt, fv_stmt) <- dsCmdLStmt ids local_vars env_ids' stmt env_ids
return (do_compose ids
(mkBigCoreVarTupTy env_ids)
(mkBigCoreVarTupTy env_ids')
(mkBigCoreVarTupTy out_ids)
core_stmt
core_stmts,
fv_stmt) | 573 | false | false | 0 | 12 | 164 | 149 | 74 | 75 | null | null |
karshan/language-java | Language/Java/Parser.hs | bsd-3-clause | constrDecl :: P (Mod MemberDecl)
constrDecl = do
tps <- lopt typeParams
id <- ident
fps <- formalParams
thr <- lopt throws
bod <- constrBody
return $ \ms -> ConstructorDecl ms tps id fps thr bod | 219 | constrDecl :: P (Mod MemberDecl)
constrDecl = do
tps <- lopt typeParams
id <- ident
fps <- formalParams
thr <- lopt throws
bod <- constrBody
return $ \ms -> ConstructorDecl ms tps id fps thr bod | 219 | constrDecl = do
tps <- lopt typeParams
id <- ident
fps <- formalParams
thr <- lopt throws
bod <- constrBody
return $ \ms -> ConstructorDecl ms tps id fps thr bod | 186 | false | true | 2 | 10 | 60 | 93 | 39 | 54 | null | null |
vikraman/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | gtAddr_RDR = varQual_RDR gHC_PRIM (fsLit "gtAddr#") | 56 | gtAddr_RDR = varQual_RDR gHC_PRIM (fsLit "gtAddr#") | 56 | gtAddr_RDR = varQual_RDR gHC_PRIM (fsLit "gtAddr#") | 56 | false | false | 0 | 7 | 10 | 17 | 8 | 9 | null | null |
xmonad/xmonad-contrib | XMonad/Layout/DecorationMadness.hs | bsd-3-clause | -- | A 'Tall' layout with the xmonad simple decoration, default
-- theme and default shrinker.
--
-- Here you can find a screen shot:
--
-- <http://code.haskell.org/~arossato/xmonadShots/tallSimpleDeco.png>
tallSimpleDeco :: ModifiedLayout (Decoration SimpleDecoration DefaultShrinker) Tall Window
tallSimpleDeco = decoration shrinkText def (Simple True) tall | 359 | tallSimpleDeco :: ModifiedLayout (Decoration SimpleDecoration DefaultShrinker) Tall Window
tallSimpleDeco = decoration shrinkText def (Simple True) tall | 152 | tallSimpleDeco = decoration shrinkText def (Simple True) tall | 61 | true | true | 0 | 7 | 43 | 47 | 26 | 21 | null | null |
meteogrid/sigym-core | tests/TestGeoReference.hs | bsd-3-clause | prop_intersection_of_same_extent_is_id :: Extent -> Bool
prop_intersection_of_same_extent_is_id a = intersection a a == a | 121 | prop_intersection_of_same_extent_is_id :: Extent -> Bool
prop_intersection_of_same_extent_is_id a = intersection a a == a | 121 | prop_intersection_of_same_extent_is_id a = intersection a a == a | 64 | false | true | 0 | 6 | 12 | 27 | 13 | 14 | null | null |
crvs/scythe | src/Math/Graphs.hs | bsd-3-clause | remVertexL :: Eq a => Graph a -> [a] -> Graph a
remVertexL (Graph vs es) l = Graph (vs \\ l) (filter (\x -> from x `notElem` l && to x `notElem` l) es) | 151 | remVertexL :: Eq a => Graph a -> [a] -> Graph a
remVertexL (Graph vs es) l = Graph (vs \\ l) (filter (\x -> from x `notElem` l && to x `notElem` l) es) | 151 | remVertexL (Graph vs es) l = Graph (vs \\ l) (filter (\x -> from x `notElem` l && to x `notElem` l) es) | 103 | false | true | 0 | 13 | 34 | 98 | 50 | 48 | null | null |
rjwright/js-typeomatic | LabelJSAST.hs | apache-2.0 | abelValue (WSString s) n = (LabString s, n + 1)
| 48 | labelValue (WSString s) n = (LabString s, n + 1) | 48 | labelValue (WSString s) n = (LabString s, n + 1) | 48 | false | false | 0 | 7 | 10 | 30 | 15 | 15 | null | null |
timjb/diagrams-rubiks-cube | src/Diagrams/RubiksCube/Model.hs | mit | rotLeft' :: Cube a -> Cube a
rotLeft' (Cube f b l r u d) = Cube r l f b u d | 75 | rotLeft' :: Cube a -> Cube a
rotLeft' (Cube f b l r u d) = Cube r l f b u d | 75 | rotLeft' (Cube f b l r u d) = Cube r l f b u d | 46 | false | true | 0 | 7 | 22 | 53 | 25 | 28 | null | null |
dbp/snaplet-wordpress | src/Web/Offset/Feed.hs | bsd-3-clause | fixNamespace :: Element -> Element
fixNamespace el@(Element _name attrs _content _line) =
el { elAttribs = Attr (QName "xmlns" Nothing Nothing) "http://www.w3.org/2005/Atom" : attrs } | 185 | fixNamespace :: Element -> Element
fixNamespace el@(Element _name attrs _content _line) =
el { elAttribs = Attr (QName "xmlns" Nothing Nothing) "http://www.w3.org/2005/Atom" : attrs } | 185 | fixNamespace el@(Element _name attrs _content _line) =
el { elAttribs = Attr (QName "xmlns" Nothing Nothing) "http://www.w3.org/2005/Atom" : attrs } | 150 | false | true | 0 | 10 | 26 | 60 | 31 | 29 | null | null |
vdweegen/UvA-Software_Testing | Lab1/Final/Exercises.hs | gpl-3.0 | digits x = digits (x `div` 10 ) ++ [x `mod` 10] | 47 | digits x = digits (x `div` 10 ) ++ [x `mod` 10] | 47 | digits x = digits (x `div` 10 ) ++ [x `mod` 10] | 47 | false | false | 0 | 8 | 11 | 34 | 19 | 15 | null | null |
rueshyna/gogol | gogol-maps-coordinate/gen/Network/Google/Resource/Coordinate/Jobs/Patch.hs | mpl-2.0 | -- | Sets the value of custom fields. To set a custom field, pass the field
-- id (from \/team\/teamId\/custom_fields), a URL escaped \'=\' character,
-- and the desired value as a parameter. For example,
-- customField=12%3DAlice. Repeat the parameter for each custom field. Note
-- that \'=\' cannot appear in the parameter value. Specifying an invalid,
-- or inactive enum field will result in an error 500.
jpCustomField :: Lens' JobsPatch [Text]
jpCustomField
= lens _jpCustomField
(\ s a -> s{_jpCustomField = a})
. _Default
. _Coerce | 560 | jpCustomField :: Lens' JobsPatch [Text]
jpCustomField
= lens _jpCustomField
(\ s a -> s{_jpCustomField = a})
. _Default
. _Coerce | 149 | jpCustomField
= lens _jpCustomField
(\ s a -> s{_jpCustomField = a})
. _Default
. _Coerce | 109 | true | true | 3 | 8 | 107 | 64 | 33 | 31 | null | null |
vito/atomo-old | Main.hs | mit | eval e (ADefAttr n@(AVariable o) a v) = do ev <- eval e n
val <- eval e v
case ev of
(AObject n object) -> mutateVal e (Define o) (AObject n (setAVal object (Define a) val))
_ -> throwError $ Unknown $ "Variable `" ++ o ++ "' does not refer to an object." | 437 | eval e (ADefAttr n@(AVariable o) a v) = do ev <- eval e n
val <- eval e v
case ev of
(AObject n object) -> mutateVal e (Define o) (AObject n (setAVal object (Define a) val))
_ -> throwError $ Unknown $ "Variable `" ++ o ++ "' does not refer to an object." | 437 | eval e (ADefAttr n@(AVariable o) a v) = do ev <- eval e n
val <- eval e v
case ev of
(AObject n object) -> mutateVal e (Define o) (AObject n (setAVal object (Define a) val))
_ -> throwError $ Unknown $ "Variable `" ++ o ++ "' does not refer to an object." | 437 | false | false | 0 | 16 | 236 | 134 | 64 | 70 | null | null |
meimisaki/Yampa | src/FRP/Yampa/Event.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- Event merging (disjunction) and joining (conjunction)
------------------------------------------------------------------------------
-- !!! I think this is too complicated. rMerge can be obtained simply by
-- !!! swapping the arguments. So the only time it is possibly of any
-- !!! interest is for partial app. "merge" is inherently dangerous.
-- !!! But this is NOT obvious from its type: it's type is just like
-- !!! the others. This is the only example of such a def.
-- !!! Finally: mergeEvents is left-biased, but this is not reflected in
-- !!! its name.
-- | Left-biased event merge (always prefer left event, if present).
lMerge :: Event a -> Event a -> Event a
le `lMerge` re = event re Event le | 790 | lMerge :: Event a -> Event a -> Event a
le `lMerge` re = event re Event le | 74 | le `lMerge` re = event re Event le | 34 | true | true | 0 | 7 | 122 | 57 | 32 | 25 | null | null |
DavidAlphaFox/darcs | src/Darcs/Repository/Prefs.hs | gpl-2.0 | getDefaultRepoPath :: IO (Maybe String)
getDefaultRepoPath = do
defaults <- getPreflist defaultRepoPref
case defaults of
[] -> return Nothing
(d : _) -> Just `fmap` fixRepoPath d | 204 | getDefaultRepoPath :: IO (Maybe String)
getDefaultRepoPath = do
defaults <- getPreflist defaultRepoPref
case defaults of
[] -> return Nothing
(d : _) -> Just `fmap` fixRepoPath d | 204 | getDefaultRepoPath = do
defaults <- getPreflist defaultRepoPref
case defaults of
[] -> return Nothing
(d : _) -> Just `fmap` fixRepoPath d | 164 | false | true | 2 | 12 | 52 | 77 | 34 | 43 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Readers/MediaWiki.hs | gpl-2.0 | syntaxhighlight :: String -> [Attribute String] -> MWParser Blocks
syntaxhighlight tag attrs = try $ do
let mblang = lookup "lang" attrs
let mbstart = lookup "start" attrs
let mbline = lookup "line" attrs
let classes = maybe [] (:[]) mblang ++ maybe [] (const ["numberLines"]) mbline
let kvs = maybe [] (\x -> [("startFrom",x)]) mbstart
contents <- charsInTags tag
return $ B.codeBlockWith ("",classes,kvs) $ trimCode contents | 440 | syntaxhighlight :: String -> [Attribute String] -> MWParser Blocks
syntaxhighlight tag attrs = try $ do
let mblang = lookup "lang" attrs
let mbstart = lookup "start" attrs
let mbline = lookup "line" attrs
let classes = maybe [] (:[]) mblang ++ maybe [] (const ["numberLines"]) mbline
let kvs = maybe [] (\x -> [("startFrom",x)]) mbstart
contents <- charsInTags tag
return $ B.codeBlockWith ("",classes,kvs) $ trimCode contents | 440 | syntaxhighlight tag attrs = try $ do
let mblang = lookup "lang" attrs
let mbstart = lookup "start" attrs
let mbline = lookup "line" attrs
let classes = maybe [] (:[]) mblang ++ maybe [] (const ["numberLines"]) mbline
let kvs = maybe [] (\x -> [("startFrom",x)]) mbstart
contents <- charsInTags tag
return $ B.codeBlockWith ("",classes,kvs) $ trimCode contents | 373 | false | true | 6 | 10 | 80 | 183 | 95 | 88 | null | null |
DavidAlphaFox/ghc | libraries/haskeline/System/Console/Haskeline/Completion.hs | bsd-3-clause | escapeReplacement :: Maybe Char -> String -> Completion -> Completion
escapeReplacement esc ws f = case esc of
Nothing -> f
Just e -> f {replacement = escape e (replacement f)}
where
escape e (c:cs) | c `elem` (e:ws) = e : c : escape e cs
| otherwise = c : escape e cs
escape _ "" = ""
---------
-- Quoted completion | 360 | escapeReplacement :: Maybe Char -> String -> Completion -> Completion
escapeReplacement esc ws f = case esc of
Nothing -> f
Just e -> f {replacement = escape e (replacement f)}
where
escape e (c:cs) | c `elem` (e:ws) = e : c : escape e cs
| otherwise = c : escape e cs
escape _ "" = ""
---------
-- Quoted completion | 360 | escapeReplacement esc ws f = case esc of
Nothing -> f
Just e -> f {replacement = escape e (replacement f)}
where
escape e (c:cs) | c `elem` (e:ws) = e : c : escape e cs
| otherwise = c : escape e cs
escape _ "" = ""
---------
-- Quoted completion | 290 | false | true | 1 | 12 | 107 | 152 | 76 | 76 | null | null |
rjackson90/b29-tools | Handlers.hs | mit | getChart :: ActionM ()
getChart = do
chart <- param "chart"
setHeader "Content-Type" "application/json"
case descriptorTable chart of
Just table -> do
json $ A.object ["descriptor" A..= table]
status ok200
Nothing -> do
status notFound404 | 316 | getChart :: ActionM ()
getChart = do
chart <- param "chart"
setHeader "Content-Type" "application/json"
case descriptorTable chart of
Just table -> do
json $ A.object ["descriptor" A..= table]
status ok200
Nothing -> do
status notFound404 | 316 | getChart = do
chart <- param "chart"
setHeader "Content-Type" "application/json"
case descriptorTable chart of
Just table -> do
json $ A.object ["descriptor" A..= table]
status ok200
Nothing -> do
status notFound404 | 293 | false | true | 0 | 15 | 112 | 92 | 40 | 52 | null | null |
gorkinovich/Haskell | Checkers/src/Debug.hs | mit | -- **********************************************************************
-- Function: debugPosition
-- Description: This function shows the content of a Position value.
-- **********************************************************************
debugPosition::Position -> IO ()
debugPosition (r, c) = putStr ("("++(show r)++", "++(show c)++")") | 343 | debugPosition::Position -> IO ()
debugPosition (r, c) = putStr ("("++(show r)++", "++(show c)++")") | 99 | debugPosition (r, c) = putStr ("("++(show r)++", "++(show c)++")") | 66 | true | true | 0 | 12 | 30 | 67 | 36 | 31 | null | null |
dysinger/amazonka | amazonka-ec2/gen/Network/AWS/EC2/RunInstances.hs | mpl-2.0 | -- | The ID of the requester that launched the instances on your behalf (for
-- example, AWS Management Console or Auto Scaling).
rirRequesterId :: Lens' RunInstancesResponse (Maybe Text)
rirRequesterId = lens _rirRequesterId (\s a -> s { _rirRequesterId = a }) | 261 | rirRequesterId :: Lens' RunInstancesResponse (Maybe Text)
rirRequesterId = lens _rirRequesterId (\s a -> s { _rirRequesterId = a }) | 131 | rirRequesterId = lens _rirRequesterId (\s a -> s { _rirRequesterId = a }) | 73 | true | true | 0 | 9 | 41 | 47 | 26 | 21 | null | null |
mcmaniac/sync | src/Sync/Hashing/RollingBlocks.hs | bsd-3-clause | toRollingBlocks :: BlockSize -> BL.ByteString -> [RollingHash]
toRollingBlocks s bs = zip [0,fromIntegral s..] $ go (mkR s bs)
where
go !r | isEmptyR r = []
| otherwise = hashR32 r : go (rollBlock r) | 211 | toRollingBlocks :: BlockSize -> BL.ByteString -> [RollingHash]
toRollingBlocks s bs = zip [0,fromIntegral s..] $ go (mkR s bs)
where
go !r | isEmptyR r = []
| otherwise = hashR32 r : go (rollBlock r) | 211 | toRollingBlocks s bs = zip [0,fromIntegral s..] $ go (mkR s bs)
where
go !r | isEmptyR r = []
| otherwise = hashR32 r : go (rollBlock r) | 148 | false | true | 0 | 9 | 47 | 104 | 48 | 56 | null | null |
fmapfmapfmap/amazonka | amazonka-opsworks/test/Test/AWS/Gen/OpsWorks.hs | mpl-2.0 | testCloneStack :: CloneStack -> TestTree
testCloneStack = req
"CloneStack"
"fixture/CloneStack.yaml" | 108 | testCloneStack :: CloneStack -> TestTree
testCloneStack = req
"CloneStack"
"fixture/CloneStack.yaml" | 108 | testCloneStack = req
"CloneStack"
"fixture/CloneStack.yaml" | 67 | false | true | 0 | 5 | 17 | 21 | 10 | 11 | null | null |
takoeight0821/malgo | src/Malgo/Infer/TcEnv.hs | bsd-3-clause | abbrEnv :: Lens' TcEnv (HashMap (Id Type) ([Id Type], Type))
abbrEnv = lens _abbrEnv (\t x -> t {_abbrEnv = x}) | 111 | abbrEnv :: Lens' TcEnv (HashMap (Id Type) ([Id Type], Type))
abbrEnv = lens _abbrEnv (\t x -> t {_abbrEnv = x}) | 111 | abbrEnv = lens _abbrEnv (\t x -> t {_abbrEnv = x}) | 50 | false | true | 1 | 10 | 20 | 70 | 35 | 35 | null | null |
johnjcamilleri/fst | tests/email.hs | bsd-3-clause | -- | An email address using either DNS names or IP address
email :: RReg String
email =
local |> at |> domain |> dot |> tld
<|> local |> at |> ip
where
at = idR (s "@")
dot = "|" `r` "."
-- | Main test function | 229 | email :: RReg String
email =
local |> at |> domain |> dot |> tld
<|> local |> at |> ip
where
at = idR (s "@")
dot = "|" `r` "."
-- | Main test function | 170 | email =
local |> at |> domain |> dot |> tld
<|> local |> at |> ip
where
at = idR (s "@")
dot = "|" `r` "."
-- | Main test function | 149 | true | true | 3 | 8 | 67 | 76 | 40 | 36 | null | null |
EarthCitizen/baskell | src/Eval.hs | bsd-3-clause | evalNumbersWith :: Expression -> Expression -> DoubleBinOp -> IntegerBinOp -> EvalResult
-- evalNumbersWith a b fndOp fniOp = join $ evalNumbers <$> (eval a) <*> (eval b)
evalNumbersWith a b fndOp fniOp =
do
ea <- eval a
eb <- eval b
evalNumbers ea eb
where evalNumbers :: Expression -> Expression -> EvalResult
evalNumbers (StringValue _) _ = leftTypeMisError errMsgNoStringInNum
evalNumbers _ (StringValue _) = leftTypeMisError errMsgNoStringInNum
evalNumbers (BooleanValue _) _ = leftTypeMisError errMsgNoBooleanInNum
evalNumbers _ (BooleanValue _) = leftTypeMisError errMsgNoBooleanInNum
evalNumbers (FloatingValue x) (FloatingValue y) = rightFValue (fndOp x y)
evalNumbers (FloatingValue x) (IntegerValue y) = rightFValue (fndOp x (fromInteger y))
evalNumbers (IntegerValue x) (FloatingValue y) = rightFValue (fndOp (fromInteger x) y)
evalNumbers (IntegerValue x) (IntegerValue y) = rightIValue (fniOp x y) | 1,029 | evalNumbersWith :: Expression -> Expression -> DoubleBinOp -> IntegerBinOp -> EvalResult
evalNumbersWith a b fndOp fniOp =
do
ea <- eval a
eb <- eval b
evalNumbers ea eb
where evalNumbers :: Expression -> Expression -> EvalResult
evalNumbers (StringValue _) _ = leftTypeMisError errMsgNoStringInNum
evalNumbers _ (StringValue _) = leftTypeMisError errMsgNoStringInNum
evalNumbers (BooleanValue _) _ = leftTypeMisError errMsgNoBooleanInNum
evalNumbers _ (BooleanValue _) = leftTypeMisError errMsgNoBooleanInNum
evalNumbers (FloatingValue x) (FloatingValue y) = rightFValue (fndOp x y)
evalNumbers (FloatingValue x) (IntegerValue y) = rightFValue (fndOp x (fromInteger y))
evalNumbers (IntegerValue x) (FloatingValue y) = rightFValue (fndOp (fromInteger x) y)
evalNumbers (IntegerValue x) (IntegerValue y) = rightIValue (fniOp x y) | 947 | evalNumbersWith a b fndOp fniOp =
do
ea <- eval a
eb <- eval b
evalNumbers ea eb
where evalNumbers :: Expression -> Expression -> EvalResult
evalNumbers (StringValue _) _ = leftTypeMisError errMsgNoStringInNum
evalNumbers _ (StringValue _) = leftTypeMisError errMsgNoStringInNum
evalNumbers (BooleanValue _) _ = leftTypeMisError errMsgNoBooleanInNum
evalNumbers _ (BooleanValue _) = leftTypeMisError errMsgNoBooleanInNum
evalNumbers (FloatingValue x) (FloatingValue y) = rightFValue (fndOp x y)
evalNumbers (FloatingValue x) (IntegerValue y) = rightFValue (fndOp x (fromInteger y))
evalNumbers (IntegerValue x) (FloatingValue y) = rightFValue (fndOp (fromInteger x) y)
evalNumbers (IntegerValue x) (IntegerValue y) = rightIValue (fniOp x y) | 858 | true | true | 10 | 9 | 240 | 294 | 144 | 150 | null | null |
charlesrosenbauer/Bzo-Compiler | src/Builtins.hs | gpl-3.0 | isBuiltinFunc "#exp-unop" = 60028 | 37 | isBuiltinFunc "#exp-unop" = 60028 | 37 | isBuiltinFunc "#exp-unop" = 60028 | 37 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
DanielWaterworth/Idris-dev | src/Idris/Core/Elaborate.hs | bsd-3-clause | unique_hole = unique_hole' False | 32 | unique_hole = unique_hole' False | 32 | unique_hole = unique_hole' False | 32 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
mgmeier/extra | src/System/IO/Extra.hs | bsd-3-clause | withTempFile :: (FilePath -> IO a) -> IO a
withTempFile act = do
(file, del) <- newTempFile
act file `finally` del
-- | Provide a function to create a temporary directory, and a way to delete a
-- temporary directory. Most users should use 'withTempDir' which
-- combines these operations. | 303 | withTempFile :: (FilePath -> IO a) -> IO a
withTempFile act = do
(file, del) <- newTempFile
act file `finally` del
-- | Provide a function to create a temporary directory, and a way to delete a
-- temporary directory. Most users should use 'withTempDir' which
-- combines these operations. | 303 | withTempFile act = do
(file, del) <- newTempFile
act file `finally` del
-- | Provide a function to create a temporary directory, and a way to delete a
-- temporary directory. Most users should use 'withTempDir' which
-- combines these operations. | 260 | false | true | 0 | 9 | 63 | 64 | 32 | 32 | null | null |
philopon/apiary | apiary-memcached/src/Web/Apiary/Memcached.hs | mit | getHerokuConfig :: T.Text -> MemcachedConfig -> Heroku -> MaybeT IO MemcachedConfig
getHerokuConfig pfx ci exts = do
svr <- MaybeT $ getHerokuEnv' (pfx `T.append` "_SERVERS") exts
usr <- liftIO $ getHerokuEnv' (pfx `T.append` "_USERNAME") exts
pwd <- liftIO $ getHerokuEnv' (pfx `T.append` "_PASSWORD") exts
let (hst, prtTxt) = T.breakOnEnd ":" svr
prt <- either fail (return . fst) $ T.decimal prtTxt
let auth = Memcached.Plain <$> (T.encodeUtf8 <$> usr) <*> (T.encodeUtf8 <$> pwd)
return ci {connectInfo = (connectInfo ci)
{ Memcached.connectHost = T.unpack $ T.init hst
, Memcached.connectPort = Memcached.PortNumber prt
, Memcached.connectAuth =
maybe id (\a -> (a:)) auth $ Memcached.connectAuth (connectInfo ci)
}}
-- | initialize memcached extension using heroku service.
--
-- compatile:
--
-- * Memcachier
-- * Memcache cloud
-- | 914 | getHerokuConfig :: T.Text -> MemcachedConfig -> Heroku -> MaybeT IO MemcachedConfig
getHerokuConfig pfx ci exts = do
svr <- MaybeT $ getHerokuEnv' (pfx `T.append` "_SERVERS") exts
usr <- liftIO $ getHerokuEnv' (pfx `T.append` "_USERNAME") exts
pwd <- liftIO $ getHerokuEnv' (pfx `T.append` "_PASSWORD") exts
let (hst, prtTxt) = T.breakOnEnd ":" svr
prt <- either fail (return . fst) $ T.decimal prtTxt
let auth = Memcached.Plain <$> (T.encodeUtf8 <$> usr) <*> (T.encodeUtf8 <$> pwd)
return ci {connectInfo = (connectInfo ci)
{ Memcached.connectHost = T.unpack $ T.init hst
, Memcached.connectPort = Memcached.PortNumber prt
, Memcached.connectAuth =
maybe id (\a -> (a:)) auth $ Memcached.connectAuth (connectInfo ci)
}}
-- | initialize memcached extension using heroku service.
--
-- compatile:
--
-- * Memcachier
-- * Memcache cloud
-- | 914 | getHerokuConfig pfx ci exts = do
svr <- MaybeT $ getHerokuEnv' (pfx `T.append` "_SERVERS") exts
usr <- liftIO $ getHerokuEnv' (pfx `T.append` "_USERNAME") exts
pwd <- liftIO $ getHerokuEnv' (pfx `T.append` "_PASSWORD") exts
let (hst, prtTxt) = T.breakOnEnd ":" svr
prt <- either fail (return . fst) $ T.decimal prtTxt
let auth = Memcached.Plain <$> (T.encodeUtf8 <$> usr) <*> (T.encodeUtf8 <$> pwd)
return ci {connectInfo = (connectInfo ci)
{ Memcached.connectHost = T.unpack $ T.init hst
, Memcached.connectPort = Memcached.PortNumber prt
, Memcached.connectAuth =
maybe id (\a -> (a:)) auth $ Memcached.connectAuth (connectInfo ci)
}}
-- | initialize memcached extension using heroku service.
--
-- compatile:
--
-- * Memcachier
-- * Memcache cloud
-- | 830 | false | true | 0 | 16 | 201 | 309 | 161 | 148 | null | null |
Lazersmoke/reee-monads | src/Control/Eff/Parser.hs | bsd-3-clause | runParser :: Parseable s => s -> Eff (Parser s ': r) a -> Eff r [(a,s)]
runParser = runParserCore | 97 | runParser :: Parseable s => s -> Eff (Parser s ': r) a -> Eff r [(a,s)]
runParser = runParserCore | 97 | runParser = runParserCore | 25 | false | true | 0 | 12 | 19 | 63 | 30 | 33 | null | null |
brendanhay/gogol | gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/Installs/Get.hs | mpl-2.0 | -- | V1 error format.
igXgafv :: Lens' InstallsGet (Maybe Xgafv)
igXgafv = lens _igXgafv (\ s a -> s{_igXgafv = a}) | 115 | igXgafv :: Lens' InstallsGet (Maybe Xgafv)
igXgafv = lens _igXgafv (\ s a -> s{_igXgafv = a}) | 93 | igXgafv = lens _igXgafv (\ s a -> s{_igXgafv = a}) | 50 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
cleichner/gitit | src/Network/Gitit/Authentication.hs | gpl-2.0 | registerForm :: GititServerPart Html
registerForm = sharedForm Nothing | 70 | registerForm :: GititServerPart Html
registerForm = sharedForm Nothing | 70 | registerForm = sharedForm Nothing | 33 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
input-output-hk/pos-haskell-prototype | wallet/test/integration/Test/Integration/Framework/DSL.hs | mit | expectAddressInIndexOf
:: (MonadIO m, MonadFail m, MonadReader ctx m, HasHttpClient ctx)
=> Either ClientError WalletAddress
-> m ()
expectAddressInIndexOf = \case
Left e -> wantedSuccessButError e
Right addr -> tryNextPage ((==) addr) 1
where
tryNextPage predicate i = do
addrs <- successfulRequest $ Client.getAddressIndexPaginated
$- Just (fromInteger i)
$- Just 50
when (null addrs) $
fail "expectAddressInIndexOf: couldn't find address in history"
case find predicate addrs of
Nothing -> tryNextPage predicate (i + 1)
Just _ -> return ()
-- | Wait for a transaction to reach one of the given status. Fails after 60
-- seconds if not. | 753 | expectAddressInIndexOf
:: (MonadIO m, MonadFail m, MonadReader ctx m, HasHttpClient ctx)
=> Either ClientError WalletAddress
-> m ()
expectAddressInIndexOf = \case
Left e -> wantedSuccessButError e
Right addr -> tryNextPage ((==) addr) 1
where
tryNextPage predicate i = do
addrs <- successfulRequest $ Client.getAddressIndexPaginated
$- Just (fromInteger i)
$- Just 50
when (null addrs) $
fail "expectAddressInIndexOf: couldn't find address in history"
case find predicate addrs of
Nothing -> tryNextPage predicate (i + 1)
Just _ -> return ()
-- | Wait for a transaction to reach one of the given status. Fails after 60
-- seconds if not. | 753 | expectAddressInIndexOf = \case
Left e -> wantedSuccessButError e
Right addr -> tryNextPage ((==) addr) 1
where
tryNextPage predicate i = do
addrs <- successfulRequest $ Client.getAddressIndexPaginated
$- Just (fromInteger i)
$- Just 50
when (null addrs) $
fail "expectAddressInIndexOf: couldn't find address in history"
case find predicate addrs of
Nothing -> tryNextPage predicate (i + 1)
Just _ -> return ()
-- | Wait for a transaction to reach one of the given status. Fails after 60
-- seconds if not. | 607 | false | true | 0 | 13 | 213 | 207 | 96 | 111 | null | null |
mpickering/hackage-server | Distribution/Server/Features/Distro/State.hs | bsd-3-clause | replaceDistributions :: Distributions -> DistroVersions -> Update Distros ()
replaceDistributions distributions distroVersions = put $ Distros distributions distroVersions | 171 | replaceDistributions :: Distributions -> DistroVersions -> Update Distros ()
replaceDistributions distributions distroVersions = put $ Distros distributions distroVersions | 171 | replaceDistributions distributions distroVersions = put $ Distros distributions distroVersions | 94 | false | true | 0 | 8 | 17 | 40 | 19 | 21 | null | null |
mbakke/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | cvAllEcodes :: FrozenSet (String, String, String)
cvAllEcodes =
ConstantUtils.mkSet
[cvEclustercert,
cvEclustercfg,
cvEclusterdanglinginst,
cvEclusterdanglingnodes,
cvEclusterfilecheck,
cvEgroupdifferentpvsize,
cvEinstancebadnode,
cvEinstancedown,
cvEinstancefaultydisk,
cvEinstancelayout,
cvEinstancemissingcfgparameter,
cvEinstancemissingdisk,
cvEinstancepolicy,
cvEinstancesplitgroups,
cvEinstanceunsuitablenode,
cvEinstancewrongnode,
cvEnodedrbd,
cvEnodedrbdhelper,
cvEnodedrbdversion,
cvEnodefilecheck,
cvEnodefilestoragepaths,
cvEnodefilestoragepathunusable,
cvEnodehooks,
cvEnodehv,
cvEnodelvm,
cvEnoden1,
cvEnodenet,
cvEnodeoobpath,
cvEnodeorphaninstance,
cvEnodeorphanlv,
cvEnodeos,
cvEnoderpc,
cvEnodesetup,
cvEnodesharedfilestoragepathunusable,
cvEnodeglusterstoragepathunusable,
cvEnodessh,
cvEnodetime,
cvEnodeuserscripts,
cvEnodeversion] | 969 | cvAllEcodes :: FrozenSet (String, String, String)
cvAllEcodes =
ConstantUtils.mkSet
[cvEclustercert,
cvEclustercfg,
cvEclusterdanglinginst,
cvEclusterdanglingnodes,
cvEclusterfilecheck,
cvEgroupdifferentpvsize,
cvEinstancebadnode,
cvEinstancedown,
cvEinstancefaultydisk,
cvEinstancelayout,
cvEinstancemissingcfgparameter,
cvEinstancemissingdisk,
cvEinstancepolicy,
cvEinstancesplitgroups,
cvEinstanceunsuitablenode,
cvEinstancewrongnode,
cvEnodedrbd,
cvEnodedrbdhelper,
cvEnodedrbdversion,
cvEnodefilecheck,
cvEnodefilestoragepaths,
cvEnodefilestoragepathunusable,
cvEnodehooks,
cvEnodehv,
cvEnodelvm,
cvEnoden1,
cvEnodenet,
cvEnodeoobpath,
cvEnodeorphaninstance,
cvEnodeorphanlv,
cvEnodeos,
cvEnoderpc,
cvEnodesetup,
cvEnodesharedfilestoragepathunusable,
cvEnodeglusterstoragepathunusable,
cvEnodessh,
cvEnodetime,
cvEnodeuserscripts,
cvEnodeversion] | 969 | cvAllEcodes =
ConstantUtils.mkSet
[cvEclustercert,
cvEclustercfg,
cvEclusterdanglinginst,
cvEclusterdanglingnodes,
cvEclusterfilecheck,
cvEgroupdifferentpvsize,
cvEinstancebadnode,
cvEinstancedown,
cvEinstancefaultydisk,
cvEinstancelayout,
cvEinstancemissingcfgparameter,
cvEinstancemissingdisk,
cvEinstancepolicy,
cvEinstancesplitgroups,
cvEinstanceunsuitablenode,
cvEinstancewrongnode,
cvEnodedrbd,
cvEnodedrbdhelper,
cvEnodedrbdversion,
cvEnodefilecheck,
cvEnodefilestoragepaths,
cvEnodefilestoragepathunusable,
cvEnodehooks,
cvEnodehv,
cvEnodelvm,
cvEnoden1,
cvEnodenet,
cvEnodeoobpath,
cvEnodeorphaninstance,
cvEnodeorphanlv,
cvEnodeos,
cvEnoderpc,
cvEnodesetup,
cvEnodesharedfilestoragepathunusable,
cvEnodeglusterstoragepathunusable,
cvEnodessh,
cvEnodetime,
cvEnodeuserscripts,
cvEnodeversion] | 919 | false | true | 0 | 6 | 165 | 145 | 93 | 52 | null | null |
valderman/selda | selda/src/Database/Selda/Column.hs | mit | liftC :: (Exp SQL a -> Exp SQL b) -> Col s a -> Col s b
liftC f (One x) = One (f x) | 83 | liftC :: (Exp SQL a -> Exp SQL b) -> Col s a -> Col s b
liftC f (One x) = One (f x) | 83 | liftC f (One x) = One (f x) | 27 | false | true | 0 | 8 | 24 | 66 | 31 | 35 | null | null |
futurice/pulmurice-client | src/Options.hs | mit | simpleTextArgument :: String -> Parser Text
simpleTextArgument mv = T.pack <$> simpleStrArgument mv | 99 | simpleTextArgument :: String -> Parser Text
simpleTextArgument mv = T.pack <$> simpleStrArgument mv | 99 | simpleTextArgument mv = T.pack <$> simpleStrArgument mv | 55 | false | true | 0 | 6 | 12 | 30 | 14 | 16 | null | null |
phaazon/GLFW-b | Graphics/UI/GLFW.hs | bsd-2-clause | setMonitorCallback :: Maybe MonitorCallback -> IO ()
setMonitorCallback = setCallback
mk'GLFWmonitorfun
(\cb a0 a1 -> schedule $ cb (fromC a0) (fromC a1))
c'glfwSetMonitorCallback
storedMonitorFun | 212 | setMonitorCallback :: Maybe MonitorCallback -> IO ()
setMonitorCallback = setCallback
mk'GLFWmonitorfun
(\cb a0 a1 -> schedule $ cb (fromC a0) (fromC a1))
c'glfwSetMonitorCallback
storedMonitorFun | 212 | setMonitorCallback = setCallback
mk'GLFWmonitorfun
(\cb a0 a1 -> schedule $ cb (fromC a0) (fromC a1))
c'glfwSetMonitorCallback
storedMonitorFun | 159 | false | true | 0 | 10 | 39 | 68 | 32 | 36 | null | null |
saep/neil | src/Darcs.hs | bsd-3-clause | darcsSend :: FilePath -> Maybe FilePath -> IO (Maybe Int)
darcsSend repo outfile = do
(code,out,err) <- cmdCodeOutErr $ "darcs send --all --summary --repo=" ++ repo ++ " " ++
maybe "--dry-run" (" --output=" ++) outfile
return $ case code of
ExitSuccess -> Just $ max 0 $ realLines out - (if isNothing outfile then 3 else 2)
_ -> Nothing
---------------------------------------------------------------------
-- COMMANDS | 452 | darcsSend :: FilePath -> Maybe FilePath -> IO (Maybe Int)
darcsSend repo outfile = do
(code,out,err) <- cmdCodeOutErr $ "darcs send --all --summary --repo=" ++ repo ++ " " ++
maybe "--dry-run" (" --output=" ++) outfile
return $ case code of
ExitSuccess -> Just $ max 0 $ realLines out - (if isNothing outfile then 3 else 2)
_ -> Nothing
---------------------------------------------------------------------
-- COMMANDS | 452 | darcsSend repo outfile = do
(code,out,err) <- cmdCodeOutErr $ "darcs send --all --summary --repo=" ++ repo ++ " " ++
maybe "--dry-run" (" --output=" ++) outfile
return $ case code of
ExitSuccess -> Just $ max 0 $ realLines out - (if isNothing outfile then 3 else 2)
_ -> Nothing
---------------------------------------------------------------------
-- COMMANDS | 394 | false | true | 0 | 14 | 97 | 136 | 69 | 67 | null | null |
bitemyapp/hoq | src/TypeChecking/Expressions/Telescopes.hs | gpl-2.0 | extendCtx (x:xs) ctx t = extendCtx xs (Snoc ctx x t) (fmap Free t) | 66 | extendCtx (x:xs) ctx t = extendCtx xs (Snoc ctx x t) (fmap Free t) | 66 | extendCtx (x:xs) ctx t = extendCtx xs (Snoc ctx x t) (fmap Free t) | 66 | false | false | 0 | 7 | 13 | 45 | 22 | 23 | null | null |
rahulmutt/ghcvm | compiler/Eta/TypeCheck/TcGenDeriv.hs | bsd-3-clause | eqInt_RDR = varQual_RDR gHC_PRIM (fsLit "==#") | 52 | eqInt_RDR = varQual_RDR gHC_PRIM (fsLit "==#") | 52 | eqInt_RDR = varQual_RDR gHC_PRIM (fsLit "==#") | 52 | false | false | 1 | 7 | 11 | 20 | 8 | 12 | null | null |
mainland/nikola | examples/mandelbrot/Mandelbrot/NikolaV2.hs | bsd-3-clause | step :: ComplexPlane CUF -> MStepPlane CUF -> IO ()
step = $(compile I.step) | 76 | step :: ComplexPlane CUF -> MStepPlane CUF -> IO ()
step = $(compile I.step) | 76 | step = $(compile I.step) | 24 | false | true | 0 | 9 | 13 | 45 | 19 | 26 | null | null |
luispedro/alist | Data/AList.hs | mit | length :: AList a -> Int
length ALEmpty = 0 | 43 | length :: AList a -> Int
length ALEmpty = 0 | 43 | length ALEmpty = 0 | 18 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
fpco/fay | tests/recursive.hs | bsd-3-clause | threes = ones where
ones = 1 : ones | 37 | threes = ones where
ones = 1 : ones | 37 | threes = ones where
ones = 1 : ones | 37 | false | false | 0 | 5 | 10 | 16 | 9 | 7 | null | null |
Cahu/krpc-hs | src/KRPCHS/KerbalAlarmClock.hs | gpl-3.0 | alarmsWithTypeStream :: KRPCHS.KerbalAlarmClock.AlarmType -> RPCContext (KRPCStream ([KRPCHS.KerbalAlarmClock.Alarm]))
alarmsWithTypeStream typeArg = requestStream $ alarmsWithTypeStreamReq typeArg | 197 | alarmsWithTypeStream :: KRPCHS.KerbalAlarmClock.AlarmType -> RPCContext (KRPCStream ([KRPCHS.KerbalAlarmClock.Alarm]))
alarmsWithTypeStream typeArg = requestStream $ alarmsWithTypeStreamReq typeArg | 197 | alarmsWithTypeStream typeArg = requestStream $ alarmsWithTypeStreamReq typeArg | 78 | false | true | 0 | 11 | 13 | 49 | 25 | 24 | null | null |
shimazing/haskell-study-fall2016 | HW01/HW01.hs | bsd-3-clause | -- Exercise 1 -----------------------------------------
-- Get the last digit from a number
lastDigit :: Integer -> Integer
lastDigit num = mod num 10 | 151 | lastDigit :: Integer -> Integer
lastDigit num = mod num 10 | 58 | lastDigit num = mod num 10 | 26 | true | true | 0 | 5 | 23 | 25 | 13 | 12 | null | null |
np/ling | Ling/Subst.hs | bsd-3-clause | -- Reduce the argument and substitute away the left-over
-- definitions using `subst`.
reduceS :: (HasReduce a b, Subst b) => Scoped a -> b
reduceS = substScoped . view reduced . reduce | 185 | reduceS :: (HasReduce a b, Subst b) => Scoped a -> b
reduceS = substScoped . view reduced . reduce | 98 | reduceS = substScoped . view reduced . reduce | 45 | true | true | 0 | 8 | 32 | 55 | 26 | 29 | null | null |
GaloisInc/halvm-ghc | utils/hpc/HpcCombine.hs | bsd-3-clause | combine_main :: Flags -> [String] -> IO ()
combine_main flags [first_file,second_file] = do
let f = theCombineFun (combineFun flags)
Just tix1 <- readTix first_file
Just tix2 <- readTix second_file
let tix = mergeTix (mergeModule flags)
f
(filterTix flags tix1)
(filterTix flags tix2)
case outputFile flags of
"-" -> putStrLn (show tix)
out -> writeTix out tix | 444 | combine_main :: Flags -> [String] -> IO ()
combine_main flags [first_file,second_file] = do
let f = theCombineFun (combineFun flags)
Just tix1 <- readTix first_file
Just tix2 <- readTix second_file
let tix = mergeTix (mergeModule flags)
f
(filterTix flags tix1)
(filterTix flags tix2)
case outputFile flags of
"-" -> putStrLn (show tix)
out -> writeTix out tix | 444 | combine_main flags [first_file,second_file] = do
let f = theCombineFun (combineFun flags)
Just tix1 <- readTix first_file
Just tix2 <- readTix second_file
let tix = mergeTix (mergeModule flags)
f
(filterTix flags tix1)
(filterTix flags tix2)
case outputFile flags of
"-" -> putStrLn (show tix)
out -> writeTix out tix | 401 | false | true | 0 | 13 | 139 | 163 | 74 | 89 | null | null |
z0isch/advent-of-code | src/Day14.hs | bsd-3-clause | histogram :: Ord a => [a] -> [(a,Int)]
histogram xs = [ (head l, length l) | l <- group (sort xs) ] | 99 | histogram :: Ord a => [a] -> [(a,Int)]
histogram xs = [ (head l, length l) | l <- group (sort xs) ] | 99 | histogram xs = [ (head l, length l) | l <- group (sort xs) ] | 60 | false | true | 0 | 10 | 22 | 69 | 36 | 33 | null | null |
pseudonom/persistent | persistent-template/Database/Persist/TH/Internal.hs | mit | keyText :: EntityDef -> Text
keyText t = unHaskellName (entityHaskell t) ++ "Key" | 81 | keyText :: EntityDef -> Text
keyText t = unHaskellName (entityHaskell t) ++ "Key" | 81 | keyText t = unHaskellName (entityHaskell t) ++ "Key" | 52 | false | true | 0 | 8 | 12 | 31 | 15 | 16 | null | null |
kawu/ltag | src/NLP/LTAG/Rule.hs | bsd-2-clause | -- | Retrieve identifiers in a forest.
idsInFor :: Ord i => [G.Tree n l i f a] -> M.Map i (Spec f)
idsInFor
= M.unions
. map addStep'
. zip [0..]
. map idsInTree
where
addStep' (i, ms) = fmap (addStep i) ms
-- | Add specifc ID features to an FS. | 271 | idsInFor :: Ord i => [G.Tree n l i f a] -> M.Map i (Spec f)
idsInFor
= M.unions
. map addStep'
. zip [0..]
. map idsInTree
where
addStep' (i, ms) = fmap (addStep i) ms
-- | Add specifc ID features to an FS. | 232 | idsInFor
= M.unions
. map addStep'
. zip [0..]
. map idsInTree
where
addStep' (i, ms) = fmap (addStep i) ms
-- | Add specifc ID features to an FS. | 171 | true | true | 3 | 10 | 78 | 118 | 54 | 64 | null | null |
benmos/pathtype | Test.hs | bsd-3-clause | srcfiles = ["System/Path/Internal.hs","System/Path/Directory.hs","System/Path/IO.hs"] | 87 | srcfiles = ["System/Path/Internal.hs","System/Path/Directory.hs","System/Path/IO.hs"] | 87 | srcfiles = ["System/Path/Internal.hs","System/Path/Directory.hs","System/Path/IO.hs"] | 87 | false | false | 0 | 5 | 4 | 15 | 9 | 6 | null | null |
jxwr/hdep | src/Evaluate.hs | bsd-3-clause | quote env (HV i) = V i | 22 | quote env (HV i) = V i | 22 | quote env (HV i) = V i | 22 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
adnelson/nixfromnpm | src/NixFromNpm/Merge.hs | mit | -- | Merges one folder containing expressions into another. After the merge,
-- generates a new nodePackages/default.nix in the target directory.
mergeInto ::
#if MIN_VERSION_hnix(0,6,0)
(MonadIO io, MonadBaseControl IO io, MonadFile io)
#else
(MonadIO io, MonadBaseControl IO io)
#endif
=> MergeType -- ^ If DryRun, it will just report what it would have
-- otherwise done.
-> Source -- ^ Source path, containing store objects
-> Dest -- ^ Target path, also containing store objects
-> io ()
mergeInto mergeType (Source source) (Dest target) = do
let dryRun = mergeType == DryRun
whenM (not <$> doesDirectoryExist (source </> nodePackagesDir)) $ do
failC ["No node packages folder in source ", pathToText source]
whenM (not <$> doesDirectoryExist (target </> nodePackagesDir)) $ do
failC ["No node packages folder in target ", pathToText target]
-- Go through all of the packages in the source directory.
forItemsInDir_ (source </> nodePackagesDir) $ \srcDir -> do
let targetDir = target </> nodePackagesDir </> filename srcDir
-- Create a directory for that package, if it doesn't exist.
whenM (not <$> doesDirectoryExist targetDir) $ do
putStrsLn ["Creating directory ", pathToText targetDir]
if dryRun then putStrLn " (Skipped due to dry run)" else
createDirectory targetDir
-- Copy every version file found in that directory as well.
dotNixFiles <- filter (hasExt "nix") <$> listDirFullPaths srcDir
forM_ dotNixFiles $ \versionFile -> do
let targetVersionFile = targetDir </> filename versionFile
whenM (not <$> doesFileExist targetVersionFile) $ do
putStrsLn ["Copying ", pathToText versionFile, " to ",
pathToText targetVersionFile]
if dryRun then putStrLn " (Skipped due to dry run)" else
copyFile versionFile targetVersionFile
writeNodePackagesNix True target | 1,980 | mergeInto ::
#if MIN_VERSION_hnix(0,6,0)
(MonadIO io, MonadBaseControl IO io, MonadFile io)
#else
(MonadIO io, MonadBaseControl IO io)
#endif
=> MergeType -- ^ If DryRun, it will just report what it would have
-- otherwise done.
-> Source -- ^ Source path, containing store objects
-> Dest -- ^ Target path, also containing store objects
-> io ()
mergeInto mergeType (Source source) (Dest target) = do
let dryRun = mergeType == DryRun
whenM (not <$> doesDirectoryExist (source </> nodePackagesDir)) $ do
failC ["No node packages folder in source ", pathToText source]
whenM (not <$> doesDirectoryExist (target </> nodePackagesDir)) $ do
failC ["No node packages folder in target ", pathToText target]
-- Go through all of the packages in the source directory.
forItemsInDir_ (source </> nodePackagesDir) $ \srcDir -> do
let targetDir = target </> nodePackagesDir </> filename srcDir
-- Create a directory for that package, if it doesn't exist.
whenM (not <$> doesDirectoryExist targetDir) $ do
putStrsLn ["Creating directory ", pathToText targetDir]
if dryRun then putStrLn " (Skipped due to dry run)" else
createDirectory targetDir
-- Copy every version file found in that directory as well.
dotNixFiles <- filter (hasExt "nix") <$> listDirFullPaths srcDir
forM_ dotNixFiles $ \versionFile -> do
let targetVersionFile = targetDir </> filename versionFile
whenM (not <$> doesFileExist targetVersionFile) $ do
putStrsLn ["Copying ", pathToText versionFile, " to ",
pathToText targetVersionFile]
if dryRun then putStrLn " (Skipped due to dry run)" else
copyFile versionFile targetVersionFile
writeNodePackagesNix True target | 1,834 | mergeInto mergeType (Source source) (Dest target) = do
let dryRun = mergeType == DryRun
whenM (not <$> doesDirectoryExist (source </> nodePackagesDir)) $ do
failC ["No node packages folder in source ", pathToText source]
whenM (not <$> doesDirectoryExist (target </> nodePackagesDir)) $ do
failC ["No node packages folder in target ", pathToText target]
-- Go through all of the packages in the source directory.
forItemsInDir_ (source </> nodePackagesDir) $ \srcDir -> do
let targetDir = target </> nodePackagesDir </> filename srcDir
-- Create a directory for that package, if it doesn't exist.
whenM (not <$> doesDirectoryExist targetDir) $ do
putStrsLn ["Creating directory ", pathToText targetDir]
if dryRun then putStrLn " (Skipped due to dry run)" else
createDirectory targetDir
-- Copy every version file found in that directory as well.
dotNixFiles <- filter (hasExt "nix") <$> listDirFullPaths srcDir
forM_ dotNixFiles $ \versionFile -> do
let targetVersionFile = targetDir </> filename versionFile
whenM (not <$> doesFileExist targetVersionFile) $ do
putStrsLn ["Copying ", pathToText versionFile, " to ",
pathToText targetVersionFile]
if dryRun then putStrLn " (Skipped due to dry run)" else
copyFile versionFile targetVersionFile
writeNodePackagesNix True target | 1,398 | true | true | 0 | 21 | 472 | 399 | 194 | 205 | null | null |
Teaspot-Studio/GPipe-Core | src/Graphics/GPipe/Internal/Format.hs | mit | getGlInternalFormat RGBA16S = GL_RGBA16_SNORM | 45 | getGlInternalFormat RGBA16S = GL_RGBA16_SNORM | 45 | getGlInternalFormat RGBA16S = GL_RGBA16_SNORM | 45 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
brianshourd/adventOfCode2016 | src/Day11.hs | mit | -- |This is the main implementation requirement, calculating all possible
-- (valid) states that can be reached in a single elevator ride from a given
-- state.
adjacentStates :: State -> Set State
adjacentStates s@(State f ps) = Set.fromList . filter (not . destroysChips) $
[move1 d x s | d <- directions, x <- items] ++
[move2 d x y s | d <- directions, x <- items, y <- items, x < y, allowedTogether x y]
where
directions = (if f < 3 then [(+1)] else []) ++ (if f > 0 then [(subtract 1)] else [])
items = generators ++ microchips
generators = map (\(Pair e _ _) -> Generator e) . filter (\(Pair _ _ g) -> g == f) $ ps
microchips = map (\(Pair e _ _) -> Microchip e) . filter (\(Pair _ m _) -> m == f) $ ps
allowedTogether :: Item -> Item -> Bool
-- We cannot put a microchip and a generator into the elevator together
-- unless they are a matched pair (otherwise, the generator will fry the
-- microchip)
allowedTogether (Microchip e) (Generator e') = e == e'
allowedTogether (Generator e) (Microchip e') = e == e'
allowedTogether _ _ = True
-- The following are all of the helper functions for 'adjacentStates' | 1,172 | adjacentStates :: State -> Set State
adjacentStates s@(State f ps) = Set.fromList . filter (not . destroysChips) $
[move1 d x s | d <- directions, x <- items] ++
[move2 d x y s | d <- directions, x <- items, y <- items, x < y, allowedTogether x y]
where
directions = (if f < 3 then [(+1)] else []) ++ (if f > 0 then [(subtract 1)] else [])
items = generators ++ microchips
generators = map (\(Pair e _ _) -> Generator e) . filter (\(Pair _ _ g) -> g == f) $ ps
microchips = map (\(Pair e _ _) -> Microchip e) . filter (\(Pair _ m _) -> m == f) $ ps
allowedTogether :: Item -> Item -> Bool
-- We cannot put a microchip and a generator into the elevator together
-- unless they are a matched pair (otherwise, the generator will fry the
-- microchip)
allowedTogether (Microchip e) (Generator e') = e == e'
allowedTogether (Generator e) (Microchip e') = e == e'
allowedTogether _ _ = True
-- The following are all of the helper functions for 'adjacentStates' | 1,011 | adjacentStates s@(State f ps) = Set.fromList . filter (not . destroysChips) $
[move1 d x s | d <- directions, x <- items] ++
[move2 d x y s | d <- directions, x <- items, y <- items, x < y, allowedTogether x y]
where
directions = (if f < 3 then [(+1)] else []) ++ (if f > 0 then [(subtract 1)] else [])
items = generators ++ microchips
generators = map (\(Pair e _ _) -> Generator e) . filter (\(Pair _ _ g) -> g == f) $ ps
microchips = map (\(Pair e _ _) -> Microchip e) . filter (\(Pair _ m _) -> m == f) $ ps
allowedTogether :: Item -> Item -> Bool
-- We cannot put a microchip and a generator into the elevator together
-- unless they are a matched pair (otherwise, the generator will fry the
-- microchip)
allowedTogether (Microchip e) (Generator e') = e == e'
allowedTogether (Generator e) (Microchip e') = e == e'
allowedTogether _ _ = True
-- The following are all of the helper functions for 'adjacentStates' | 974 | true | true | 54 | 10 | 273 | 418 | 219 | 199 | null | null |
chreekat/snowdrift | SnowdriftEmailDaemon.hs | agpl-3.0 | deleteFromUserNotificationEmail :: MonadIO m => UTCTime -> UserNotificationType
-> UserId -> Markdown -> SqlPersistT m ()
deleteFromUserNotificationEmail ts notif_type to content =
delete $ fromUserNotificationEmail ts notif_type to content | 276 | deleteFromUserNotificationEmail :: MonadIO m => UTCTime -> UserNotificationType
-> UserId -> Markdown -> SqlPersistT m ()
deleteFromUserNotificationEmail ts notif_type to content =
delete $ fromUserNotificationEmail ts notif_type to content | 276 | deleteFromUserNotificationEmail ts notif_type to content =
delete $ fromUserNotificationEmail ts notif_type to content | 122 | false | true | 0 | 11 | 64 | 63 | 30 | 33 | null | null |
literate-unitb/literate-unitb | src/Document/Tests/Puzzle.hs | mit | result0 :: String
result0 = unlines
[ " o m0/LIVE/prog0/ensure/TR/term/NEG"
, "passed 1 / 1"
] | 108 | result0 :: String
result0 = unlines
[ " o m0/LIVE/prog0/ensure/TR/term/NEG"
, "passed 1 / 1"
] | 108 | result0 = unlines
[ " o m0/LIVE/prog0/ensure/TR/term/NEG"
, "passed 1 / 1"
] | 90 | false | true | 0 | 5 | 29 | 20 | 11 | 9 | null | null |
rueshyna/gogol | gogol-monitoring/gen/Network/Google/Resource/Monitoring/Projects/Groups/List.hs | mpl-2.0 | -- | Creates a value of 'ProjectsGroupsList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pglXgafv'
--
-- * 'pglUploadProtocol'
--
-- * 'pglChildrenOfGroup'
--
-- * 'pglPp'
--
-- * 'pglDescendantsOfGroup'
--
-- * 'pglAccessToken'
--
-- * 'pglUploadType'
--
-- * 'pglBearerToken'
--
-- * 'pglName'
--
-- * 'pglPageToken'
--
-- * 'pglPageSize'
--
-- * 'pglAncestorsOfGroup'
--
-- * 'pglCallback'
projectsGroupsList
:: Text -- ^ 'pglName'
-> ProjectsGroupsList
projectsGroupsList pPglName_ =
ProjectsGroupsList'
{ _pglXgafv = Nothing
, _pglUploadProtocol = Nothing
, _pglChildrenOfGroup = Nothing
, _pglPp = True
, _pglDescendantsOfGroup = Nothing
, _pglAccessToken = Nothing
, _pglUploadType = Nothing
, _pglBearerToken = Nothing
, _pglName = pPglName_
, _pglPageToken = Nothing
, _pglPageSize = Nothing
, _pglAncestorsOfGroup = Nothing
, _pglCallback = Nothing
} | 1,018 | projectsGroupsList
:: Text -- ^ 'pglName'
-> ProjectsGroupsList
projectsGroupsList pPglName_ =
ProjectsGroupsList'
{ _pglXgafv = Nothing
, _pglUploadProtocol = Nothing
, _pglChildrenOfGroup = Nothing
, _pglPp = True
, _pglDescendantsOfGroup = Nothing
, _pglAccessToken = Nothing
, _pglUploadType = Nothing
, _pglBearerToken = Nothing
, _pglName = pPglName_
, _pglPageToken = Nothing
, _pglPageSize = Nothing
, _pglAncestorsOfGroup = Nothing
, _pglCallback = Nothing
} | 535 | projectsGroupsList pPglName_ =
ProjectsGroupsList'
{ _pglXgafv = Nothing
, _pglUploadProtocol = Nothing
, _pglChildrenOfGroup = Nothing
, _pglPp = True
, _pglDescendantsOfGroup = Nothing
, _pglAccessToken = Nothing
, _pglUploadType = Nothing
, _pglBearerToken = Nothing
, _pglName = pPglName_
, _pglPageToken = Nothing
, _pglPageSize = Nothing
, _pglAncestorsOfGroup = Nothing
, _pglCallback = Nothing
} | 463 | true | true | 0 | 7 | 214 | 137 | 94 | 43 | null | null |
abrim/yesod-dsl | YesodDsl/Generator/GetHandler.hs | bsd-2-clause | getStmt (IfFilter (pn,_,_,useFlag)) = T.unpack $(codegenFile "codegen/get-filter-param.cg")
where forceType = if useFlag == True then (""::String) else " :: Maybe Text" | 172 | getStmt (IfFilter (pn,_,_,useFlag)) = T.unpack $(codegenFile "codegen/get-filter-param.cg")
where forceType = if useFlag == True then (""::String) else " :: Maybe Text" | 172 | getStmt (IfFilter (pn,_,_,useFlag)) = T.unpack $(codegenFile "codegen/get-filter-param.cg")
where forceType = if useFlag == True then (""::String) else " :: Maybe Text" | 172 | false | false | 0 | 8 | 24 | 65 | 35 | 30 | null | null |
allanderek/ipclib | Language/Pepa/Probes/Translate.hs | gpl-2.0 | isUnguarded :: ProbeMove -> Bool
isUnguarded = (Nothing ==) . guardOfMove | 73 | isUnguarded :: ProbeMove -> Bool
isUnguarded = (Nothing ==) . guardOfMove | 73 | isUnguarded = (Nothing ==) . guardOfMove | 40 | false | true | 0 | 6 | 10 | 23 | 13 | 10 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/THNames.hs | bsd-3-clause | varTName = libFun (fsLit "varT") varTIdKey | 63 | varTName = libFun (fsLit "varT") varTIdKey | 63 | varTName = libFun (fsLit "varT") varTIdKey | 63 | false | false | 0 | 7 | 26 | 17 | 8 | 9 | null | null |
christiaanb/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isTauTy (AppTy a b) = isTauTy a && isTauTy b | 50 | isTauTy (AppTy a b) = isTauTy a && isTauTy b | 50 | isTauTy (AppTy a b) = isTauTy a && isTauTy b | 50 | false | false | 0 | 7 | 15 | 27 | 12 | 15 | null | null |
mightybyte/reflex-dom-stubs | GenCode.hs | bsd-3-clause | mkFile :: Module -> IO ()
mkFile m = do
let path = "src" </> moduleToPath m
createDirectoryIfMissing True $ dropFileName path
copyFile (origFile m) path
--writeFile path $ unlines $ moduleBlock m
--symbols <- getTopLevelSymbols m
--let contents = unlines $
-- map mkStub symbols
--appendFile path contents | 342 | mkFile :: Module -> IO ()
mkFile m = do
let path = "src" </> moduleToPath m
createDirectoryIfMissing True $ dropFileName path
copyFile (origFile m) path
--writeFile path $ unlines $ moduleBlock m
--symbols <- getTopLevelSymbols m
--let contents = unlines $
-- map mkStub symbols
--appendFile path contents | 342 | mkFile m = do
let path = "src" </> moduleToPath m
createDirectoryIfMissing True $ dropFileName path
copyFile (origFile m) path
--writeFile path $ unlines $ moduleBlock m
--symbols <- getTopLevelSymbols m
--let contents = unlines $
-- map mkStub symbols
--appendFile path contents | 316 | false | true | 0 | 11 | 85 | 71 | 34 | 37 | null | null |
uwap/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | declared (PClass _ _ _ _ n _ _ _ _ ms cn cd) = n : (map fst (maybeToList cn) ++ concatMap declared ms) | 102 | declared (PClass _ _ _ _ n _ _ _ _ ms cn cd) = n : (map fst (maybeToList cn) ++ concatMap declared ms) | 102 | declared (PClass _ _ _ _ n _ _ _ _ ms cn cd) = n : (map fst (maybeToList cn) ++ concatMap declared ms) | 102 | false | false | 0 | 10 | 24 | 64 | 31 | 33 | null | null |
vincenthz/hs-foundation | basement/Basement/UArray.hs | bsd-3-clause | cons :: PrimType ty => ty -> UArray ty -> UArray ty
cons e vec
| len == CountOf 0 = singleton e
| otherwise = runST $ do
muv <- new (len + 1)
unsafeCopyAtRO muv 1 vec 0 len
unsafeWrite muv 0 e
unsafeFreeze muv
where
!len = length vec | 283 | cons :: PrimType ty => ty -> UArray ty -> UArray ty
cons e vec
| len == CountOf 0 = singleton e
| otherwise = runST $ do
muv <- new (len + 1)
unsafeCopyAtRO muv 1 vec 0 len
unsafeWrite muv 0 e
unsafeFreeze muv
where
!len = length vec | 283 | cons e vec
| len == CountOf 0 = singleton e
| otherwise = runST $ do
muv <- new (len + 1)
unsafeCopyAtRO muv 1 vec 0 len
unsafeWrite muv 0 e
unsafeFreeze muv
where
!len = length vec | 231 | false | true | 1 | 11 | 101 | 124 | 54 | 70 | null | null |
green-haskell/ghc | compiler/basicTypes/OccName.hs | bsd-3-clause | pprNameSpace TvName = ptext (sLit "type variable") | 53 | pprNameSpace TvName = ptext (sLit "type variable") | 53 | pprNameSpace TvName = ptext (sLit "type variable") | 53 | false | false | 0 | 7 | 9 | 18 | 8 | 10 | null | null |
kadena-io/pact | src/Pact/Types/Typecheck.hs | bsd-3-clause | -- | Run monad providing supply seed and debug.
runTC :: Int -> Bool -> TC a -> IO (a, TcState)
runTC sup dbg a = runTCState (mkTcState sup dbg def) a | 150 | runTC :: Int -> Bool -> TC a -> IO (a, TcState)
runTC sup dbg a = runTCState (mkTcState sup dbg def) a | 102 | runTC sup dbg a = runTCState (mkTcState sup dbg def) a | 54 | true | true | 0 | 10 | 31 | 62 | 30 | 32 | null | null |
np/lens | src/Control/Lens/Iso.hs | bsd-3-clause | ----------------------------------------------------------------------------
-- Consuming Isomorphisms
-----------------------------------------------------------------------------
-- | Invert an isomorphism.
--
-- @'from' ('from' l) ≡ l@
from :: AnIso s t a b -> Iso b a t s
from = withIso (flip iso) | 302 | from :: AnIso s t a b -> Iso b a t s
from = withIso (flip iso) | 62 | from = withIso (flip iso) | 25 | true | true | 0 | 7 | 35 | 48 | 26 | 22 | null | null |
djudd/blokus | Placement.hs | gpl-3.0 | placementVector =
let sameKey (Placement p1 c1 _ _ _) (Placement p2 c2 _ _ _) = getKey p1 c1 == getKey p2 c2
compareKeys (Placement p1 c1 _ _ _) (Placement p2 c2 _ _ _) = compare (getKey p1 c1) (getKey p2 c2)
sorted = sortBy compareKeys placementList
grouped = groupBy sameKey sorted
in Vector.fromList grouped | 344 | placementVector =
let sameKey (Placement p1 c1 _ _ _) (Placement p2 c2 _ _ _) = getKey p1 c1 == getKey p2 c2
compareKeys (Placement p1 c1 _ _ _) (Placement p2 c2 _ _ _) = compare (getKey p1 c1) (getKey p2 c2)
sorted = sortBy compareKeys placementList
grouped = groupBy sameKey sorted
in Vector.fromList grouped | 344 | placementVector =
let sameKey (Placement p1 c1 _ _ _) (Placement p2 c2 _ _ _) = getKey p1 c1 == getKey p2 c2
compareKeys (Placement p1 c1 _ _ _) (Placement p2 c2 _ _ _) = compare (getKey p1 c1) (getKey p2 c2)
sorted = sortBy compareKeys placementList
grouped = groupBy sameKey sorted
in Vector.fromList grouped | 344 | false | false | 0 | 11 | 91 | 148 | 71 | 77 | null | null |
fqj1994/dotfiles | home/xmonad/xmonad/xmonad.hs | apache-2.0 | myTopicConfig = defaultTopicConfig | 34 | myTopicConfig = defaultTopicConfig | 34 | myTopicConfig = defaultTopicConfig | 34 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
tensorflow/haskell | tensorflow-ops/src/TensorFlow/Gradient.hs | apache-2.0 | opGrad "SparseSegmentSum" _ [toT -> x, toT -> y, toT -> t] [dz] =
[ Just $ CoreOps.unsortedSegmentSum
(CoreOps.gather dz (t :: Tensor Build Int32))
(y :: Tensor Build Int32) inputRows
, Nothing
, Nothing
]
where inputRows = flatSlice (shape (x :: Tensor Build a)) 0 1 | 311 | opGrad "SparseSegmentSum" _ [toT -> x, toT -> y, toT -> t] [dz] =
[ Just $ CoreOps.unsortedSegmentSum
(CoreOps.gather dz (t :: Tensor Build Int32))
(y :: Tensor Build Int32) inputRows
, Nothing
, Nothing
]
where inputRows = flatSlice (shape (x :: Tensor Build a)) 0 1 | 311 | opGrad "SparseSegmentSum" _ [toT -> x, toT -> y, toT -> t] [dz] =
[ Just $ CoreOps.unsortedSegmentSum
(CoreOps.gather dz (t :: Tensor Build Int32))
(y :: Tensor Build Int32) inputRows
, Nothing
, Nothing
]
where inputRows = flatSlice (shape (x :: Tensor Build a)) 0 1 | 311 | false | false | 4 | 11 | 91 | 128 | 65 | 63 | null | null |
adarqui/Abstract-Interfaces | src/Abstract/Interfaces/Lock.hs | bsd-3-clause | locked :: Lock m -> m Bool
locked Lock {..} = _locked | 53 | locked :: Lock m -> m Bool
locked Lock {..} = _locked | 53 | locked Lock {..} = _locked | 26 | false | true | 2 | 5 | 11 | 30 | 15 | 15 | null | null |
Copilot-Language/sbv-for-copilot | SBVUnitTest/Examples/Basics/BasicTests.hs | bsd-3-clause | f2 x y = (x*x)-(y*y) | 20 | f2 x y = (x*x)-(y*y) | 20 | f2 x y = (x*x)-(y*y) | 20 | false | false | 0 | 7 | 4 | 29 | 15 | 14 | null | null |
uuhan/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | irts_c FFunction x = wrapped x | 30 | irts_c FFunction x = wrapped x | 30 | irts_c FFunction x = wrapped x | 30 | false | false | 0 | 5 | 5 | 16 | 6 | 10 | null | null |
cauterize-tools/cauterize | src/Cauterize/Dynamic/Common.hs | bsd-3-clause | isNameOf "s8" (PDs8 _) = True | 31 | isNameOf "s8" (PDs8 _) = True | 31 | isNameOf "s8" (PDs8 _) = True | 31 | false | false | 0 | 7 | 7 | 17 | 8 | 9 | null | null |
ItsLastDay/academic_university_2016-2018 | subjects/Haskell/10/classwork.hs | gpl-3.0 | test = do
x <- logIt 3
y <- logIt 5
let res = x + y
write2log $ "sum = " ++ show res ++ "; "
return res | 123 | test = do
x <- logIt 3
y <- logIt 5
let res = x + y
write2log $ "sum = " ++ show res ++ "; "
return res | 123 | test = do
x <- logIt 3
y <- logIt 5
let res = x + y
write2log $ "sum = " ++ show res ++ "; "
return res | 123 | false | false | 0 | 10 | 49 | 63 | 27 | 36 | null | null |
MnO2/hopencc | src/Language/OpenCc/Internal/C2HS.hs | bsd-3-clause | castMaybeStablePtrToPtr :: Maybe (StablePtr a) -> Ptr ()
castMaybeStablePtrToPtr Nothing = nullPtr | 98 | castMaybeStablePtrToPtr :: Maybe (StablePtr a) -> Ptr ()
castMaybeStablePtrToPtr Nothing = nullPtr | 98 | castMaybeStablePtrToPtr Nothing = nullPtr | 41 | false | true | 0 | 8 | 11 | 36 | 16 | 20 | null | null |
andorp/grin | grin/src/AbstractInterpretation/OptimiseAbstractProgram.hs | bsd-3-clause | edges :: Instruction -> [(Node, Node)]
edges = \case
If{..} -> concatMap edges instructions
ins -> maybeToList $ fmap ((,) (src ins)) $ dst ins | 150 | edges :: Instruction -> [(Node, Node)]
edges = \case
If{..} -> concatMap edges instructions
ins -> maybeToList $ fmap ((,) (src ins)) $ dst ins | 150 | edges = \case
If{..} -> concatMap edges instructions
ins -> maybeToList $ fmap ((,) (src ins)) $ dst ins | 111 | false | true | 0 | 15 | 31 | 85 | 41 | 44 | null | null |
iu-parfunc/containers | tests/set-properties.hs | bsd-3-clause | -- Check that Set Int.isProperSubsetOf is the same as Set.isProperSubsetOf.
prop_isProperSubsetOf :: Set Int -> Set Int -> Bool
prop_isProperSubsetOf a b = isProperSubsetOf a b == IntSet.isProperSubsetOf (toIntSet a) (toIntSet b) | 229 | prop_isProperSubsetOf :: Set Int -> Set Int -> Bool
prop_isProperSubsetOf a b = isProperSubsetOf a b == IntSet.isProperSubsetOf (toIntSet a) (toIntSet b) | 153 | prop_isProperSubsetOf a b = isProperSubsetOf a b == IntSet.isProperSubsetOf (toIntSet a) (toIntSet b) | 101 | true | true | 0 | 8 | 31 | 59 | 28 | 31 | null | null |
mzini/hosa | src/HoSA/Data/Program/DMInfer.hs | mit | inferTypes :: (Ord v, Ord f, IsSymbol f) => [f] -> Signature f -> [UntypedEquation f v] -> Either (TypingError f v) (Program f v)
inferTypes mainFns initialSig eqns = walk (callSCCs eqns) [] initialSig where
walk [] teqs sig = return (Program teqs mainFns sig)
walk (scc:sccs) teqs sig = do
(teqs', sig') <- inferSCC sig scc
walk sccs (teqs' ++ teqs) sig' | 379 | inferTypes :: (Ord v, Ord f, IsSymbol f) => [f] -> Signature f -> [UntypedEquation f v] -> Either (TypingError f v) (Program f v)
inferTypes mainFns initialSig eqns = walk (callSCCs eqns) [] initialSig where
walk [] teqs sig = return (Program teqs mainFns sig)
walk (scc:sccs) teqs sig = do
(teqs', sig') <- inferSCC sig scc
walk sccs (teqs' ++ teqs) sig' | 375 | inferTypes mainFns initialSig eqns = walk (callSCCs eqns) [] initialSig where
walk [] teqs sig = return (Program teqs mainFns sig)
walk (scc:sccs) teqs sig = do
(teqs', sig') <- inferSCC sig scc
walk sccs (teqs' ++ teqs) sig' | 245 | false | true | 0 | 11 | 87 | 184 | 91 | 93 | null | null |
ml9951/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | trivialFCode_sse2 :: Width -> (Format -> Operand -> Operand -> Instr)
-> CmmExpr -> CmmExpr -> NatM Register
trivialFCode_sse2 pk instr x y
= genTrivialCode format (instr format) x y
where format = floatFormat pk | 238 | trivialFCode_sse2 :: Width -> (Format -> Operand -> Operand -> Instr)
-> CmmExpr -> CmmExpr -> NatM Register
trivialFCode_sse2 pk instr x y
= genTrivialCode format (instr format) x y
where format = floatFormat pk | 238 | trivialFCode_sse2 pk instr x y
= genTrivialCode format (instr format) x y
where format = floatFormat pk | 111 | false | true | 0 | 10 | 60 | 80 | 39 | 41 | null | null |
exercism/xhaskell | exercises/practice/bowling/.meta/examples/success-standard/src/Bowling.hs | mit | scoreRoll' f@(Frame 10 (fr:_)) ri totalScore (r:_)
| throws f < 2 = Right (addRoll f r, succ ri, totalScore + fr + r)
| throws f == 2 && (fr == 10 || spare f) = addFillBall
| otherwise = Left $ InvalidRoll ri r -- no more rolls possible
where
addFillBall :: ScoreState
addFillBall
| firstRoll == 10 && secondRoll /= 10 && secondRoll + r > 10 = Left $ InvalidRoll ri r
| otherwise = Right (addRoll f r, succ ri, totalScore + r)
where [firstRoll, secondRoll] = rolls f | 500 | scoreRoll' f@(Frame 10 (fr:_)) ri totalScore (r:_)
| throws f < 2 = Right (addRoll f r, succ ri, totalScore + fr + r)
| throws f == 2 && (fr == 10 || spare f) = addFillBall
| otherwise = Left $ InvalidRoll ri r -- no more rolls possible
where
addFillBall :: ScoreState
addFillBall
| firstRoll == 10 && secondRoll /= 10 && secondRoll + r > 10 = Left $ InvalidRoll ri r
| otherwise = Right (addRoll f r, succ ri, totalScore + r)
where [firstRoll, secondRoll] = rolls f | 500 | scoreRoll' f@(Frame 10 (fr:_)) ri totalScore (r:_)
| throws f < 2 = Right (addRoll f r, succ ri, totalScore + fr + r)
| throws f == 2 && (fr == 10 || spare f) = addFillBall
| otherwise = Left $ InvalidRoll ri r -- no more rolls possible
where
addFillBall :: ScoreState
addFillBall
| firstRoll == 10 && secondRoll /= 10 && secondRoll + r > 10 = Left $ InvalidRoll ri r
| otherwise = Right (addRoll f r, succ ri, totalScore + r)
where [firstRoll, secondRoll] = rolls f | 500 | false | false | 2 | 13 | 127 | 237 | 116 | 121 | null | null |
alosich/language-java | Language/Java/Parser.hs | bsd-3-clause | instanceCreation :: P Exp
instanceCreation = try instanceCreationNPS <|> do
p <- primaryNPS
ss <- list primarySuffix
let icp = foldl (\a s -> s a) p ss
case icp of
QualInstanceCreation {} -> return icp
_ -> fail "" | 240 | instanceCreation :: P Exp
instanceCreation = try instanceCreationNPS <|> do
p <- primaryNPS
ss <- list primarySuffix
let icp = foldl (\a s -> s a) p ss
case icp of
QualInstanceCreation {} -> return icp
_ -> fail "" | 240 | instanceCreation = try instanceCreationNPS <|> do
p <- primaryNPS
ss <- list primarySuffix
let icp = foldl (\a s -> s a) p ss
case icp of
QualInstanceCreation {} -> return icp
_ -> fail "" | 214 | false | true | 1 | 15 | 65 | 96 | 44 | 52 | null | null |
brendanhay/gogol | gogol-vision/gen/Network/Google/Vision/Types/Product.hs | mpl-2.0 | -- | If the file was a PDF or TIFF, this field gives the page number within
-- the file used to produce the image.
iacPageNumber :: Lens' ImageAnnotationContext (Maybe Int32)
iacPageNumber
= lens _iacPageNumber
(\ s a -> s{_iacPageNumber = a})
. mapping _Coerce | 275 | iacPageNumber :: Lens' ImageAnnotationContext (Maybe Int32)
iacPageNumber
= lens _iacPageNumber
(\ s a -> s{_iacPageNumber = a})
. mapping _Coerce | 160 | iacPageNumber
= lens _iacPageNumber
(\ s a -> s{_iacPageNumber = a})
. mapping _Coerce | 100 | true | true | 2 | 8 | 58 | 60 | 29 | 31 | null | null |
GaloisInc/halvm-ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | lkList :: TrieMap m => (forall b. k -> m b -> Maybe b)
-> [k] -> ListMap m a -> Maybe a
lkList _ [] = lm_nil | 121 | lkList :: TrieMap m => (forall b. k -> m b -> Maybe b)
-> [k] -> ListMap m a -> Maybe a
lkList _ [] = lm_nil | 121 | lkList _ [] = lm_nil | 25 | false | true | 0 | 11 | 40 | 70 | 34 | 36 | null | null |
deepfire/mood | src/Graphics/FlatDraw.hs | agpl-3.0 | -- * Colors
coSetSourceColor ∷ Co Double → GRCI.Render ()
coSetSourceColor !(Co (V4 r g b a))
= GRC.setSourceRGBA r g b a | 123 | coSetSourceColor ∷ Co Double → GRCI.Render ()
coSetSourceColor !(Co (V4 r g b a))
= GRC.setSourceRGBA r g b a | 111 | coSetSourceColor !(Co (V4 r g b a))
= GRC.setSourceRGBA r g b a | 65 | true | true | 0 | 10 | 24 | 59 | 28 | 31 | null | null |
loganbraga/hunch | app/Hunch/Language/Parser.hs | mit | -- Parses a non-deterministic name that will be drawn from external sources.
-- Exemple: _?source
extName :: Parser (FName, Bool)
extName = do
skip $ string "_?"
idn <- identifier
<|> identifierDir
let (idn', isDir) = decomposeName idn
return (ExtName idn', isDir)
-- Parses a standard, given name, inside single or double quotes.
-- If the name is not comprised of reserved characters, it can be expressed
-- without quotes. | 439 | extName :: Parser (FName, Bool)
extName = do
skip $ string "_?"
idn <- identifier
<|> identifierDir
let (idn', isDir) = decomposeName idn
return (ExtName idn', isDir)
-- Parses a standard, given name, inside single or double quotes.
-- If the name is not comprised of reserved characters, it can be expressed
-- without quotes. | 341 | extName = do
skip $ string "_?"
idn <- identifier
<|> identifierDir
let (idn', isDir) = decomposeName idn
return (ExtName idn', isDir)
-- Parses a standard, given name, inside single or double quotes.
-- If the name is not comprised of reserved characters, it can be expressed
-- without quotes. | 309 | true | true | 0 | 11 | 83 | 86 | 42 | 44 | null | null |
vTurbine/ghc | libraries/base/Control/Exception.hs | bsd-3-clause | allowInterrupt :: IO ()
allowInterrupt = interruptible $ return () | 66 | allowInterrupt :: IO ()
allowInterrupt = interruptible $ return () | 66 | allowInterrupt = interruptible $ return () | 42 | false | true | 0 | 7 | 9 | 25 | 12 | 13 | null | null |
HaskellCNOrg/snap-web | src/Views/Utils.hs | bsd-3-clause | addSplices :: [(T.Text, I.Splice AppHandler)]
-> Initializer App v ()
addSplices = modifyHeistState . I.bindSplices . foldSplices | 143 | addSplices :: [(T.Text, I.Splice AppHandler)]
-> Initializer App v ()
addSplices = modifyHeistState . I.bindSplices . foldSplices | 143 | addSplices = modifyHeistState . I.bindSplices . foldSplices | 59 | false | true | 0 | 9 | 30 | 50 | 26 | 24 | null | null |
hausdorff/pyli | src/Lexer.hs | mit | concatStrLits [] [] = [] | 27 | concatStrLits [] [] = [] | 27 | concatStrLits [] [] = [] | 27 | false | false | 0 | 5 | 7 | 19 | 8 | 11 | null | null |
bitemyapp/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | pprUserTypeCtxt (ClassSCCtxt c) = ptext (sLit "the super-classes of class") <+> quotes (ppr c) | 96 | pprUserTypeCtxt (ClassSCCtxt c) = ptext (sLit "the super-classes of class") <+> quotes (ppr c) | 96 | pprUserTypeCtxt (ClassSCCtxt c) = ptext (sLit "the super-classes of class") <+> quotes (ppr c) | 96 | false | false | 0 | 8 | 15 | 38 | 17 | 21 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 2836 = 2835 | 11 | 2836 = 2835 | 11 | 2836 = 2835 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
graninas/Andromeda | src/Andromeda/Language/LogicControl/Translator.hs | bsd-3-clause | constructorArity (ContrScriptConstr _ arity _) = arity | 54 | constructorArity (ContrScriptConstr _ arity _) = arity | 54 | constructorArity (ContrScriptConstr _ arity _) = arity | 54 | false | false | 0 | 7 | 6 | 19 | 9 | 10 | null | null |
tamarin-prover/tamarin-prover | lib/theory/src/Theory/Sapic.hs | gpl-3.0 | applyProcess subst (ProcessComb c ann pl pr) = do
c' <- applyProcessCombinatorError subst c
pl' <- applyProcess subst pl
pr' <- applyProcess subst pr
return $ ProcessComb c' ann pl' pr' | 249 | applyProcess subst (ProcessComb c ann pl pr) = do
c' <- applyProcessCombinatorError subst c
pl' <- applyProcess subst pl
pr' <- applyProcess subst pr
return $ ProcessComb c' ann pl' pr' | 249 | applyProcess subst (ProcessComb c ann pl pr) = do
c' <- applyProcessCombinatorError subst c
pl' <- applyProcess subst pl
pr' <- applyProcess subst pr
return $ ProcessComb c' ann pl' pr' | 249 | false | false | 0 | 8 | 94 | 75 | 33 | 42 | null | null |
yjwen/hada | src/Data/FixedWidth.hs | lgpl-3.0 | extendUnsigned :: (Bits a) => a -> Int -> a
extendUnsigned v width = v .&. (complement $ shiftL (complement zeroBits) width) | 124 | extendUnsigned :: (Bits a) => a -> Int -> a
extendUnsigned v width = v .&. (complement $ shiftL (complement zeroBits) width) | 124 | extendUnsigned v width = v .&. (complement $ shiftL (complement zeroBits) width) | 80 | false | true | 2 | 10 | 21 | 63 | 30 | 33 | null | null |
steve-chavez/postgrest | test/Feature/RangeSpec.hs | mit | defaultRange :: BL.ByteString
defaultRange = [json| { "min": 0, "max": 15 } |] | 78 | defaultRange :: BL.ByteString
defaultRange = [json| { "min": 0, "max": 15 } |] | 78 | defaultRange = [json| { "min": 0, "max": 15 } |] | 48 | false | true | 0 | 7 | 12 | 24 | 12 | 12 | null | null |
crogers1/manager | xec/Show.hs | gpl-2.0 | showDBus (DBusStruct _ xs) = intercalate "\n" . map showDBus $ xs | 65 | showDBus (DBusStruct _ xs) = intercalate "\n" . map showDBus $ xs | 65 | showDBus (DBusStruct _ xs) = intercalate "\n" . map showDBus $ xs | 65 | false | false | 0 | 7 | 11 | 31 | 14 | 17 | null | null |
egison/egison | hs-src/Language/Egison/PrettyMath/AST.hs | mit | parseTuple :: Parser MathExpr
parseTuple = char '[' >> Tuple <$> parseList <* char ']' | 86 | parseTuple :: Parser MathExpr
parseTuple = char '[' >> Tuple <$> parseList <* char ']' | 86 | parseTuple = char '[' >> Tuple <$> parseList <* char ']' | 56 | false | true | 1 | 8 | 14 | 35 | 15 | 20 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.