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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DavidAlphaFox/darcs | harness/test.hs | gpl-2.0 | findNetwork :: FilePath -> Maybe FilePath -> [DiffAlgorithm] -> [Format] -> Sh [Test]
findNetwork dp tdir diffAlgorithmsDefault repoFormatsDefault =
do files <- sort <$> filter (".sh" `isSuffixOf`) <$> map (drop (length ("tests/network/"::String)) . toString) <$> ls "tests/network"
annotatedFiles <- Control.Mona... | 834 | findNetwork :: FilePath -> Maybe FilePath -> [DiffAlgorithm] -> [Format] -> Sh [Test]
findNetwork dp tdir diffAlgorithmsDefault repoFormatsDefault =
do files <- sort <$> filter (".sh" `isSuffixOf`) <$> map (drop (length ("tests/network/"::String)) . toString) <$> ls "tests/network"
annotatedFiles <- Control.Mona... | 834 | findNetwork dp tdir diffAlgorithmsDefault repoFormatsDefault =
do files <- sort <$> filter (".sh" `isSuffixOf`) <$> map (drop (length ("tests/network/"::String)) . toString) <$> ls "tests/network"
annotatedFiles <- Control.Monad.Trans.liftIO $ mapM (parsePragmas "tests/network") files
return [ shellTest dp ... | 748 | false | true | 0 | 17 | 130 | 218 | 111 | 107 | null | null |
MaxDaten/yage-rendering | src/Yage/Rendering/Backend/Renderer.hs | mit | ---------------------------------------------------------------------------------------------------
initRenderState :: Int -> RenderState
initRenderState = RenderState Nothing . initTextureUnits | 195 | initRenderState :: Int -> RenderState
initRenderState = RenderState Nothing . initTextureUnits | 94 | initRenderState = RenderState Nothing . initTextureUnits | 56 | true | true | 0 | 6 | 12 | 23 | 12 | 11 | null | null |
PipocaQuemada/ermine | src/Ermine/Interpreter.hs | bsd-2-clause | extendPayload :: (PrimMonad m, G.Vector v a) => v a -> G.Mutable v (PrimState m) a -> Int -> Int -> m (v a)
extendPayload d stk stp n = do
let m = G.length d
me <- GM.new (m + n)
G.copy (GM.slice 0 m me) d
GM.copy (GM.slice m n me) (GM.slice stp n stk)
G.unsafeFreeze me | 280 | extendPayload :: (PrimMonad m, G.Vector v a) => v a -> G.Mutable v (PrimState m) a -> Int -> Int -> m (v a)
extendPayload d stk stp n = do
let m = G.length d
me <- GM.new (m + n)
G.copy (GM.slice 0 m me) d
GM.copy (GM.slice m n me) (GM.slice stp n stk)
G.unsafeFreeze me | 280 | extendPayload d stk stp n = do
let m = G.length d
me <- GM.new (m + n)
G.copy (GM.slice 0 m me) d
GM.copy (GM.slice m n me) (GM.slice stp n stk)
G.unsafeFreeze me | 172 | false | true | 0 | 12 | 68 | 179 | 84 | 95 | null | null |
ambiata/mismi | mismi-core/src/Mismi/Control.hs | bsd-3-clause | setRetry :: Int -> AWS a -> AWS a
setRetry =
local . configureRetries | 71 | setRetry :: Int -> AWS a -> AWS a
setRetry =
local . configureRetries | 71 | setRetry =
local . configureRetries | 37 | false | true | 0 | 7 | 15 | 29 | 14 | 15 | null | null |
adolfosilva/granada | library/Granada/Parser.hs | gpl-3.0 | preconditions :: Parsec.Parsec String () (Map String Expr.Value)
preconditions = Parsec.string "pre" *> trimmed colon *> dict | 125 | preconditions :: Parsec.Parsec String () (Map String Expr.Value)
preconditions = Parsec.string "pre" *> trimmed colon *> dict | 125 | preconditions = Parsec.string "pre" *> trimmed colon *> dict | 60 | false | true | 0 | 8 | 16 | 48 | 23 | 25 | null | null |
sdiehl/ghc | compiler/llvmGen/LlvmCodeGen/Data.hs | bsd-3-clause | genLlvmData :: (Section, RawCmmStatics) -> LlvmM LlvmData
-- See note [emit-time elimination of static indirections] in CLabel.
genLlvmData (_, RawCmmStatics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
| lbl == mkIndStaticInfoLabel
, let labelInd (CmmLabelOff l _) = Just l
labelInd (CmmLabe... | 1,140 | genLlvmData :: (Section, RawCmmStatics) -> LlvmM LlvmData
genLlvmData (_, RawCmmStatics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
| lbl == mkIndStaticInfoLabel
, let labelInd (CmmLabelOff l _) = Just l
labelInd (CmmLabel l) = Just l
labelInd _ = Nothing
, Just ind' <- labelInd i... | 1,070 | genLlvmData (_, RawCmmStatics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
| lbl == mkIndStaticInfoLabel
, let labelInd (CmmLabelOff l _) = Just l
labelInd (CmmLabel l) = Just l
labelInd _ = Nothing
, Just ind' <- labelInd ind
, alias `mayRedirectTo` ind' = do
label <- strCLa... | 1,012 | true | true | 0 | 14 | 288 | 295 | 147 | 148 | null | null |
brendanhay/gogol | gogol-datastore/gen/Network/Google/Datastore/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'GoogleDatastoreAdminV1ImportEntitiesMetadata' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gProgressBytes'
--
-- * 'gProgressEntities'
--
-- * 'gEntityFilter'
--
-- * 'gInputURL'
--
-- * 'gCommon'
googleDat... | 658 | googleDatastoreAdminV1ImportEntitiesMetadata
:: GoogleDatastoreAdminV1ImportEntitiesMetadata
googleDatastoreAdminV1ImportEntitiesMetadata =
GoogleDatastoreAdminV1ImportEntitiesMetadata'
{ _gProgressBytes = Nothing
, _gProgressEntities = Nothing
, _gEntityFilter = Nothing
, _gInputURL = Nothing
... | 347 | googleDatastoreAdminV1ImportEntitiesMetadata =
GoogleDatastoreAdminV1ImportEntitiesMetadata'
{ _gProgressBytes = Nothing
, _gProgressEntities = Nothing
, _gEntityFilter = Nothing
, _gInputURL = Nothing
, _gCommon = Nothing
} | 250 | true | true | 0 | 6 | 106 | 56 | 40 | 16 | null | null |
acowley/ghc | compiler/typecheck/TcClassDcl.hs | bsd-3-clause | tcClassDecl2 :: LTyClDecl Name -- The class declaration
-> TcM (LHsBinds Id)
tcClassDecl2 (L loc (ClassDecl {tcdLName = class_name, tcdSigs = sigs,
tcdMeths = default_binds}))
= recoverM (return emptyLHsBinds) $
setSrcSpan loc $
d... | 2,132 | tcClassDecl2 :: LTyClDecl Name -- The class declaration
-> TcM (LHsBinds Id)
tcClassDecl2 (L loc (ClassDecl {tcdLName = class_name, tcdSigs = sigs,
tcdMeths = default_binds}))
= recoverM (return emptyLHsBinds) $
setSrcSpan loc $
do... | 2,131 | tcClassDecl2 (L loc (ClassDecl {tcdLName = class_name, tcdSigs = sigs,
tcdMeths = default_binds}))
= recoverM (return emptyLHsBinds) $
setSrcSpan loc $
do { clas <- tcLookupLocatedClass class_name
-- We make a separate binding for each default... | 2,032 | false | true | 0 | 20 | 859 | 346 | 177 | 169 | null | null |
dservgun/erp | src/common/Login.hs | gpl-3.0 | verify :: Login -> Login
verify aLogin = aLogin {verified = True} | 65 | verify :: Login -> Login
verify aLogin = aLogin {verified = True} | 65 | verify aLogin = aLogin {verified = True} | 40 | false | true | 0 | 7 | 11 | 30 | 15 | 15 | null | null |
quintenpalmer/fresh | haskell/src/Tools/Fresh.hs | mit | print_ast :: String -> AST.Environment -> String
print_ast command env =
"User Defined:\n" ++ (AST.print_env $ Map.difference (Parse.parse (Lexer.make_tokens command) env) env) ++
"\nBuiltin:\n" ++ AST.print_env env | 223 | print_ast :: String -> AST.Environment -> String
print_ast command env =
"User Defined:\n" ++ (AST.print_env $ Map.difference (Parse.parse (Lexer.make_tokens command) env) env) ++
"\nBuiltin:\n" ++ AST.print_env env | 223 | print_ast command env =
"User Defined:\n" ++ (AST.print_env $ Map.difference (Parse.parse (Lexer.make_tokens command) env) env) ++
"\nBuiltin:\n" ++ AST.print_env env | 174 | false | true | 0 | 15 | 34 | 77 | 38 | 39 | null | null |
aaronpr95/4_en_raya | 4enraya.hs | mit | columnalista t m n = if m>0 then [t!!m!!n]++columnalista t (m-1) n else [t!!0!!n] | 81 | columnalista t m n = if m>0 then [t!!m!!n]++columnalista t (m-1) n else [t!!0!!n] | 81 | columnalista t m n = if m>0 then [t!!m!!n]++columnalista t (m-1) n else [t!!0!!n] | 81 | false | false | 1 | 9 | 13 | 71 | 34 | 37 | null | null |
hvr/lens | src/Control/Lens/Review.hs | bsd-3-clause | -- | An infix alias for 'review'.
--
-- @
-- 'unto' f # x ≡ f x
-- l # x ≡ x '^.' 're' l
-- @
--
-- This is commonly used when using a 'Prism' as a smart constructor.
--
-- >>> _Left # 4
-- Left 4
--
-- But it can be used for any 'Prism'
--
-- >>> base 16 # 123
-- "7b"
--
-- @
-- (#) :: 'Iso'' s a -> a -> s
-- (#)... | 522 | ( # ) :: AReview s t a b -> b -> t
( # ) p = runIdentity #. unTagged #. p .# Tagged .# Identity | 95 | ( # ) p = runIdentity #. unTagged #. p .# Tagged .# Identity | 60 | true | true | 0 | 8 | 152 | 74 | 50 | 24 | null | null |
gnn/Hets | Driver/Options.hs | gpl-2.0 | omdocS = "omdoc" | 16 | omdocS = "omdoc" | 16 | omdocS = "omdoc" | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
herngyi/hmol | Geometry.hs | gpl-3.0 | basicAngle :: Angle -> Angle
basicAngle ang | ang < 0 = basicAngle (ang + tpi)
| ang > tpi = basicAngle (ang - tpi)
| otherwise = ang
where tpi = 2 * pi | 190 | basicAngle :: Angle -> Angle
basicAngle ang | ang < 0 = basicAngle (ang + tpi)
| ang > tpi = basicAngle (ang - tpi)
| otherwise = ang
where tpi = 2 * pi | 189 | basicAngle ang | ang < 0 = basicAngle (ang + tpi)
| ang > tpi = basicAngle (ang - tpi)
| otherwise = ang
where tpi = 2 * pi | 160 | false | true | 4 | 8 | 72 | 90 | 40 | 50 | null | null |
batterseapower/mini-ghc | Core/Parser.hs | bsd-3-clause | grabWrapper :: Ord a
=> (ParseState -> M.Map a Var) -> (ParseState -> M.Map a Var -> ParseState)
-> (a -> String) -- For building human readable names for the wrapper invocations only
-> a -> ParseM Var
grabWrapper get set describe what = do
mb_x <- ParseM $ \s -> (s, [], M.looku... | 498 | grabWrapper :: Ord a
=> (ParseState -> M.Map a Var) -> (ParseState -> M.Map a Var -> ParseState)
-> (a -> String) -- For building human readable names for the wrapper invocations only
-> a -> ParseM Var
grabWrapper get set describe what = do
mb_x <- ParseM $ \s -> (s, [], M.looku... | 498 | grabWrapper get set describe what = do
mb_x <- ParseM $ \s -> (s, [], M.lookup what (get s))
case mb_x of Just x -> return x
Nothing -> freshName ("w" ++ describe what) >>= \x -> ParseM $ \s -> (set s (M.insert what x (get s)), [], x) | 259 | false | true | 0 | 19 | 148 | 216 | 109 | 107 | null | null |
keizo042/quic-prototype | Network/QUIC/Error.hs | bsd-3-clause | err2int OverlappingStreamData = 0x57 | 53 | err2int OverlappingStreamData = 0x57 | 53 | err2int OverlappingStreamData = 0x57 | 53 | false | false | 0 | 5 | 20 | 9 | 4 | 5 | null | null |
flowbox-public/imagemagick | Graphics/ImageMagick/MagickWand/PixelWand.hs | apache-2.0 | getOpacityQuantum :: (MonadResource m) => PPixelWand -> m Quantum
getOpacityQuantum = liftIO . F.pixelGetOpacityQuantum | 120 | getOpacityQuantum :: (MonadResource m) => PPixelWand -> m Quantum
getOpacityQuantum = liftIO . F.pixelGetOpacityQuantum | 120 | getOpacityQuantum = liftIO . F.pixelGetOpacityQuantum | 54 | false | true | 0 | 8 | 14 | 39 | 18 | 21 | null | null |
jparyani/capnproto-boostpython | compiler/src/Main.hs | bsd-2-clause | splitPath = loop [] where
loop part ('/':text) = List.reverse part : loop [] text
loop part (c:text) = loop (c:part) text
loop part [] = [List.reverse part] | 168 | splitPath = loop [] where
loop part ('/':text) = List.reverse part : loop [] text
loop part (c:text) = loop (c:part) text
loop part [] = [List.reverse part] | 168 | splitPath = loop [] where
loop part ('/':text) = List.reverse part : loop [] text
loop part (c:text) = loop (c:part) text
loop part [] = [List.reverse part] | 168 | false | false | 0 | 9 | 39 | 95 | 47 | 48 | null | null |
tfausak/autoexporter | source/library/Autoexporter.hs | mit | renderExport :: Cabal.ModuleName -> String
renderExport moduleName = "module " <> Cabal.display moduleName <> "," | 113 | renderExport :: Cabal.ModuleName -> String
renderExport moduleName = "module " <> Cabal.display moduleName <> "," | 113 | renderExport moduleName = "module " <> Cabal.display moduleName <> "," | 70 | false | true | 0 | 8 | 14 | 33 | 16 | 17 | null | null |
urbanslug/yesod | yesod-core/Yesod/Core/Handler.hs | mit | get :: MonadHandler m => m GHState
get = liftHandlerT $ HandlerT $ I.readIORef . handlerState | 93 | get :: MonadHandler m => m GHState
get = liftHandlerT $ HandlerT $ I.readIORef . handlerState | 93 | get = liftHandlerT $ HandlerT $ I.readIORef . handlerState | 58 | false | true | 0 | 7 | 15 | 41 | 18 | 23 | null | null |
dbp/snaplet-wordpress | spec/Common.hs | bsd-3-clause | boolFieldFalse :: Value
boolFieldFalse = object [ "person" .= False ] | 69 | boolFieldFalse :: Value
boolFieldFalse = object [ "person" .= False ] | 69 | boolFieldFalse = object [ "person" .= False ] | 45 | false | true | 0 | 7 | 10 | 21 | 11 | 10 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Ada.hs | gpl-2.0 | regex_'5cbbegin'5cb = compileRegex True "\\bbegin\\b" | 53 | regex_'5cbbegin'5cb = compileRegex True "\\bbegin\\b" | 53 | regex_'5cbbegin'5cb = compileRegex True "\\bbegin\\b" | 53 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
adinapoli/xmonad | XMonad/Operations.hs | bsd-3-clause | -- | XXX comment me
applySizeHints' :: SizeHints -> D -> D
applySizeHints' sh =
maybe id applyMaxSizeHint (sh_max_size sh)
. maybe id (\(bw, bh) (w, h) -> (w+bw, h+bh)) (sh_base_size sh)
. maybe id applyResizeIncHint (sh_resize_inc sh)
. maybe id applyAspectHint ... | 424 | applySizeHints' :: SizeHints -> D -> D
applySizeHints' sh =
maybe id applyMaxSizeHint (sh_max_size sh)
. maybe id (\(bw, bh) (w, h) -> (w+bw, h+bh)) (sh_base_size sh)
. maybe id applyResizeIncHint (sh_resize_inc sh)
. maybe id applyAspectHint (sh... | 404 | applySizeHints' sh =
maybe id applyMaxSizeHint (sh_max_size sh)
. maybe id (\(bw, bh) (w, h) -> (w+bw, h+bh)) (sh_base_size sh)
. maybe id applyResizeIncHint (sh_resize_inc sh)
. maybe id applyAspectHint (sh_aspect sh)
. maybe id (\(bw,bh... | 365 | true | true | 4 | 9 | 138 | 180 | 94 | 86 | null | null |
elfeck/elfeckcom | src/Web/BetterMdParser.hs | mit | startNormal _ = False | 21 | startNormal _ = False | 21 | startNormal _ = False | 21 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
AndreasPK/stack | src/System/Process/Run.hs | bsd-3-clause | -- | Like 'System.Process.callProcess', but takes an optional working directory and
-- environment override, and throws 'ProcessExitedUnsuccessfully' if the
-- process exits unsuccessfully and a 'ReadProcessException' if the executable is not found.
--
-- Inherits stdout and stderr.
callProcess' :: (MonadIO m, MonadLog... | 741 | callProcess' :: (MonadIO m, MonadLogger m)
=> (CreateProcess -> CreateProcess) -> Cmd -> m ()
callProcess' modCP cmd = do
c <- liftM modCP (cmdToCreateProcess cmd)
$logCreateProcess c
liftIO $ do
(_, _, _, p) <- System.Process.createProcess c
exit_code <- waitForProcess p
... | 457 | callProcess' modCP cmd = do
c <- liftM modCP (cmdToCreateProcess cmd)
$logCreateProcess c
liftIO $ do
(_, _, _, p) <- System.Process.createProcess c
exit_code <- waitForProcess p
case exit_code of
ExitSuccess -> return ()
ExitFailure _ -> throwIO (ProcessExi... | 350 | true | true | 0 | 15 | 168 | 161 | 79 | 82 | null | null |
lukexi/ghc | compiler/nativeGen/X86/Instr.hs | bsd-3-clause | allocMoreStack
:: Platform
-> Int
-> NatCmmDecl statics X86.Instr.Instr
-> UniqSM (NatCmmDecl statics X86.Instr.Instr)
allocMoreStack _ _ top@(CmmData _ _) = return top | 177 | allocMoreStack
:: Platform
-> Int
-> NatCmmDecl statics X86.Instr.Instr
-> UniqSM (NatCmmDecl statics X86.Instr.Instr)
allocMoreStack _ _ top@(CmmData _ _) = return top | 176 | allocMoreStack _ _ top@(CmmData _ _) = return top | 49 | false | true | 3 | 8 | 31 | 67 | 34 | 33 | null | null |
strager/b | B/Log.hs | bsd-3-clause | isError :: LogMessage -> Bool
isError (Exception _) = True | 58 | isError :: LogMessage -> Bool
isError (Exception _) = True | 58 | isError (Exception _) = True | 28 | false | true | 0 | 9 | 9 | 30 | 13 | 17 | null | null |
kmate/HaRe | old/testing/merging/Recursive9_TokOut.hs | bsd-3-clause | f1 n (x:xs) = (x:ls)
where
ls = f1 (n - 1) xs | 72 | f1 n (x:xs) = (x:ls)
where
ls = f1 (n - 1) xs | 72 | f1 n (x:xs) = (x:ls)
where
ls = f1 (n - 1) xs | 72 | false | false | 1 | 6 | 39 | 52 | 23 | 29 | null | null |
kaizhang/HMM | src/AI/HMM/Type.hs | bsd-3-clause | -- constant: log (2*pi)
m_log_2_pi :: Double
m_log_2_pi = 1.8378770664093453 | 76 | m_log_2_pi :: Double
m_log_2_pi = 1.8378770664093453 | 52 | m_log_2_pi = 1.8378770664093453 | 31 | true | true | 0 | 4 | 9 | 12 | 7 | 5 | null | null |
anttisalonen/cgen | src/HaskellGen.hs | bsd-3-clause | cTypeToHs' "int8_t" = Just "CChar" | 34 | cTypeToHs' "int8_t" = Just "CChar" | 34 | cTypeToHs' "int8_t" = Just "CChar" | 34 | false | false | 1 | 5 | 4 | 15 | 5 | 10 | null | null |
sdiehl/ghc | libraries/base/GHC/IO/Buffer.hs | bsd-3-clause | isFullBuffer :: Buffer e -> Bool
isFullBuffer Buffer{ bufR=w, bufSize=s } = s == w | 82 | isFullBuffer :: Buffer e -> Bool
isFullBuffer Buffer{ bufR=w, bufSize=s } = s == w | 82 | isFullBuffer Buffer{ bufR=w, bufSize=s } = s == w | 49 | false | true | 0 | 8 | 14 | 40 | 21 | 19 | null | null |
rueshyna/gogol | gogol-admin-directory/gen/Network/Google/Directory/Types/Product.hs | mpl-2.0 | -- | Event that triggered this response (only used in case of Push Response)
uTriggerEvent :: Lens' Users (Maybe Text)
uTriggerEvent
= lens _uTriggerEvent
(\ s a -> s{_uTriggerEvent = a}) | 195 | uTriggerEvent :: Lens' Users (Maybe Text)
uTriggerEvent
= lens _uTriggerEvent
(\ s a -> s{_uTriggerEvent = a}) | 118 | uTriggerEvent
= lens _uTriggerEvent
(\ s a -> s{_uTriggerEvent = a}) | 76 | true | true | 0 | 9 | 38 | 48 | 25 | 23 | null | null |
lukexi/ghc-7.8-arm64 | compiler/llvmGen/Llvm/PpLlvm.hs | bsd-3-clause | -- | Print out a function definition.
ppLlvmFunction :: LlvmFunction -> SDoc
ppLlvmFunction (LlvmFunction dec args attrs sec body) =
let attrDoc = ppSpaceJoin attrs
secDoc = case sec of
Just s' -> text "section" <+> (doubleQuotes $ ftext s')
Nothing -> empty
i... | 508 | ppLlvmFunction :: LlvmFunction -> SDoc
ppLlvmFunction (LlvmFunction dec args attrs sec body) =
let attrDoc = ppSpaceJoin attrs
secDoc = case sec of
Just s' -> text "section" <+> (doubleQuotes $ ftext s')
Nothing -> empty
in text "define" <+> ppLlvmFunctionHead... | 470 | ppLlvmFunction (LlvmFunction dec args attrs sec body) =
let attrDoc = ppSpaceJoin attrs
secDoc = case sec of
Just s' -> text "section" <+> (doubleQuotes $ ftext s')
Nothing -> empty
in text "define" <+> ppLlvmFunctionHeader dec args
<+> attrDoc <+> sec... | 431 | true | true | 0 | 15 | 172 | 131 | 63 | 68 | null | null |
sinelaw/lamdu | Lamdu/Data/Ops.hs | gpl-3.0 | newHole :: MonadA m => T m (ExprIRef.ExpressionI (Tag m))
newHole = ExprIRef.newExprBody $ Expr.BodyLeaf Expr.Hole | 114 | newHole :: MonadA m => T m (ExprIRef.ExpressionI (Tag m))
newHole = ExprIRef.newExprBody $ Expr.BodyLeaf Expr.Hole | 114 | newHole = ExprIRef.newExprBody $ Expr.BodyLeaf Expr.Hole | 56 | false | true | 2 | 11 | 15 | 56 | 25 | 31 | null | null |
spechub/Hets | CASL/CompositionTable/ParseSparQ.hs | gpl-2.0 | inParens :: Parser a -> Parser a
inParens p = oParenT >> p << cParenT | 69 | inParens :: Parser a -> Parser a
inParens p = oParenT >> p << cParenT | 69 | inParens p = oParenT >> p << cParenT | 36 | false | true | 4 | 7 | 14 | 39 | 16 | 23 | null | null |
jdnavarro/slingshot | src/Network/Waisp/Handler/Slingshot/Request.hs | bsd-3-clause | mkHeaderParser :: Buildable h => h -> Parser (h, ByteString)
mkHeaderParser h = do
fbs <- takeWhile1 (/= ':') <* char ':'
-- TODO: Ignore uppercase
if fbs /= toByteString h
then empty
else skipSpaces *> ((h,) <$> takeTill isEndOfLine <* endOfLine)
-- * Common helpers | 288 | mkHeaderParser :: Buildable h => h -> Parser (h, ByteString)
mkHeaderParser h = do
fbs <- takeWhile1 (/= ':') <* char ':'
-- TODO: Ignore uppercase
if fbs /= toByteString h
then empty
else skipSpaces *> ((h,) <$> takeTill isEndOfLine <* endOfLine)
-- * Common helpers | 288 | mkHeaderParser h = do
fbs <- takeWhile1 (/= ':') <* char ':'
-- TODO: Ignore uppercase
if fbs /= toByteString h
then empty
else skipSpaces *> ((h,) <$> takeTill isEndOfLine <* endOfLine)
-- * Common helpers | 227 | false | true | 0 | 13 | 66 | 102 | 51 | 51 | null | null |
yaxu/smooth | Pattern.hs | gpl-3.0 | slowcat :: (Pattern p) => [p b] -> p b
slowcat ps = slow (fromIntegral $ length ps) $ cat ps | 92 | slowcat :: (Pattern p) => [p b] -> p b
slowcat ps = slow (fromIntegral $ length ps) $ cat ps | 92 | slowcat ps = slow (fromIntegral $ length ps) $ cat ps | 53 | false | true | 0 | 9 | 20 | 56 | 27 | 29 | null | null |
ezyang/ghc | compiler/main/FileCleanup.hs | bsd-3-clause | addFilesToClean :: DynFlags -> TempFileLifetime -> [FilePath] -> IO ()
addFilesToClean dflags lifetime new_files = modifyIORef' (filesToClean dflags) $
\FilesToClean
{ ftcCurrentModule = cm_files
, ftcGhcSession = gs_files
} -> case lifetime of
TFL_CurrentModule -> FilesToClean
{ ftcCurrentM... | 786 | addFilesToClean :: DynFlags -> TempFileLifetime -> [FilePath] -> IO ()
addFilesToClean dflags lifetime new_files = modifyIORef' (filesToClean dflags) $
\FilesToClean
{ ftcCurrentModule = cm_files
, ftcGhcSession = gs_files
} -> case lifetime of
TFL_CurrentModule -> FilesToClean
{ ftcCurrentM... | 786 | addFilesToClean dflags lifetime new_files = modifyIORef' (filesToClean dflags) $
\FilesToClean
{ ftcCurrentModule = cm_files
, ftcGhcSession = gs_files
} -> case lifetime of
TFL_CurrentModule -> FilesToClean
{ ftcCurrentModule = cm_files `Set.union` new_files_set
, ftcGhcSession = gs... | 715 | false | true | 0 | 12 | 172 | 162 | 91 | 71 | null | null |
rrnewton/hgdata | src/Network/Google/FusionTables.hs | mit | parseTable oth = Error$ "parseTable: Expected JSObject, got "++show oth | 71 | parseTable oth = Error$ "parseTable: Expected JSObject, got "++show oth | 71 | parseTable oth = Error$ "parseTable: Expected JSObject, got "++show oth | 71 | false | false | 3 | 6 | 9 | 25 | 9 | 16 | null | null |
meiersi/bytestring-builder | Data/ByteString/Lazy/Builder/Extras.hs | bsd-3-clause | word16Base128LE :: Word16 -> Builder
word16Base128LE = E.encodeWithB E.word16Base128LE | 86 | word16Base128LE :: Word16 -> Builder
word16Base128LE = E.encodeWithB E.word16Base128LE | 86 | word16Base128LE = E.encodeWithB E.word16Base128LE | 49 | false | true | 0 | 7 | 8 | 29 | 12 | 17 | null | null |
mathologist/hTestMaker | testmaker/src/TestMaker/SageTex.hs | gpl-3.0 | sagecmd :: Parser ()
sagecmd = do _ <- try (string "\\sagestr") <|> string "\\sage"
_ <- lookAhead $ char '{'
_ <- braces
return ()
-- | Split by "\\sage" | 195 | sagecmd :: Parser ()
sagecmd = do _ <- try (string "\\sagestr") <|> string "\\sage"
_ <- lookAhead $ char '{'
_ <- braces
return ()
-- | Split by "\\sage" | 195 | sagecmd = do _ <- try (string "\\sagestr") <|> string "\\sage"
_ <- lookAhead $ char '{'
_ <- braces
return ()
-- | Split by "\\sage" | 174 | false | true | 0 | 12 | 71 | 75 | 32 | 43 | null | null |
andersjel/haskell-text-and-plots | src/Text/DocL.hs | mit | -- | Converts a string in
-- <http://en.wikipedia.org/wiki/Markdown markdown syntax> to a 'Doc'.
markdown :: String -> Doc
markdown = html . Markdown.markdown Markdown.def . fromString | 184 | markdown :: String -> Doc
markdown = html . Markdown.markdown Markdown.def . fromString | 87 | markdown = html . Markdown.markdown Markdown.def . fromString | 61 | true | true | 1 | 7 | 25 | 40 | 18 | 22 | null | null |
edofic/core.js | src/Immediate/Dependencies.hs | mit | usedModuleVds :: [Vdefg] -> S.Set AnMname
usedModuleVds = some usedModuleVdefg | 78 | usedModuleVds :: [Vdefg] -> S.Set AnMname
usedModuleVds = some usedModuleVdefg | 78 | usedModuleVds = some usedModuleVdefg | 36 | false | true | 0 | 8 | 9 | 32 | 14 | 18 | null | null |
tonyfloatersu/solution-haskell-craft-of-FP | Chapter_4_my_note.hs | mit | testf :: Integer -> Integer
testf 0 = 0 | 39 | testf :: Integer -> Integer
testf 0 = 0 | 39 | testf 0 = 0 | 11 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
ocramz/petsc-hs | examples/Test2.hs | gpl-3.0 | matAssemblyEnd a = [C.exp|int{MatAssemblyEnd($(Mat a), MAT_FINAL_ASSEMBLY )}|] >>= handleErr | 92 | matAssemblyEnd a = [C.exp|int{MatAssemblyEnd($(Mat a), MAT_FINAL_ASSEMBLY )}|] >>= handleErr | 92 | matAssemblyEnd a = [C.exp|int{MatAssemblyEnd($(Mat a), MAT_FINAL_ASSEMBLY )}|] >>= handleErr | 92 | false | false | 0 | 6 | 8 | 19 | 11 | 8 | null | null |
olorin/amazonka | gen/src/Gen/Text.hs | mpl-2.0 | stripSuffix :: Text -> Text -> Text
stripSuffix s t = Text.strip . fromMaybe t $ s `Text.stripSuffix` t | 103 | stripSuffix :: Text -> Text -> Text
stripSuffix s t = Text.strip . fromMaybe t $ s `Text.stripSuffix` t | 103 | stripSuffix s t = Text.strip . fromMaybe t $ s `Text.stripSuffix` t | 67 | false | true | 0 | 8 | 18 | 45 | 23 | 22 | null | null |
rrnewton/stack | src/Stack/Package.hs | bsd-3-clause | matchDirFileGlob_ :: String -> String -> IO [String]
matchDirFileGlob_ dir filepath = case parseFileGlob filepath of
Nothing -> die $ "invalid file glob '" ++ filepath
++ "'. Wildcards '*' are only allowed in place of the file"
++ " name, not in the directory name or file extension."
... | 900 | matchDirFileGlob_ :: String -> String -> IO [String]
matchDirFileGlob_ dir filepath = case parseFileGlob filepath of
Nothing -> die $ "invalid file glob '" ++ filepath
++ "'. Wildcards '*' are only allowed in place of the file"
++ " name, not in the directory name or file extension."
... | 900 | matchDirFileGlob_ dir filepath = case parseFileGlob filepath of
Nothing -> die $ "invalid file glob '" ++ filepath
++ "'. Wildcards '*' are only allowed in place of the file"
++ " name, not in the directory name or file extension."
++ " If a wildcard is used it must be ... | 847 | false | true | 0 | 16 | 270 | 216 | 105 | 111 | null | null |
Martoon-00/toy-compiler | src/Toy/Lang/Data.hs | bsd-3-clause | -- | @repeat@ loop in terms of `Stmt`.
forS :: (Stmt, Exp, Stmt) -> Stmt -> Stmt
forS (s1, cond, sr) body = s1 <> whileS cond (body <> sr) | 138 | forS :: (Stmt, Exp, Stmt) -> Stmt -> Stmt
forS (s1, cond, sr) body = s1 <> whileS cond (body <> sr) | 99 | forS (s1, cond, sr) body = s1 <> whileS cond (body <> sr) | 57 | true | true | 0 | 9 | 29 | 64 | 34 | 30 | null | null |
nevrenato/Hets_Fork | HasCASL/AsUtils.hs | gpl-2.0 | -- | construct a tuple from non-singleton lists
mkTupleTerm :: [Term] -> Range -> Term
mkTupleTerm ts ps = if isSingle ts then head ts else TupleTerm ts ps | 155 | mkTupleTerm :: [Term] -> Range -> Term
mkTupleTerm ts ps = if isSingle ts then head ts else TupleTerm ts ps | 107 | mkTupleTerm ts ps = if isSingle ts then head ts else TupleTerm ts ps | 68 | true | true | 0 | 8 | 28 | 52 | 25 | 27 | null | null |
eryx67/haskell-libtorrent | src/Network/Libtorrent/TorrentInfo/AnnounceEntry.hs | bsd-3-clause | getScrapeIncomplete :: MonadIO m => AnnounceEntry -> m CInt
getScrapeIncomplete ho =
liftIO . withPtr ho $ \hoPtr ->
[CU.exp| int { $(announce_entry * hoPtr)->scrape_incomplete } |] | 186 | getScrapeIncomplete :: MonadIO m => AnnounceEntry -> m CInt
getScrapeIncomplete ho =
liftIO . withPtr ho $ \hoPtr ->
[CU.exp| int { $(announce_entry * hoPtr)->scrape_incomplete } |] | 186 | getScrapeIncomplete ho =
liftIO . withPtr ho $ \hoPtr ->
[CU.exp| int { $(announce_entry * hoPtr)->scrape_incomplete } |] | 125 | false | true | 3 | 8 | 31 | 57 | 27 | 30 | null | null |
bitemyapp/ghc | compiler/main/DynFlags.hs | bsd-3-clause | impliedGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)]
impliedGFlags = [(Opt_DeferTypeErrors, turnOn, Opt_DeferTypedHoles)] | 126 | impliedGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)]
impliedGFlags = [(Opt_DeferTypeErrors, turnOn, Opt_DeferTypedHoles)] | 126 | impliedGFlags = [(Opt_DeferTypeErrors, turnOn, Opt_DeferTypedHoles)] | 68 | false | true | 0 | 6 | 9 | 35 | 22 | 13 | null | null |
vTurbine/ghc | compiler/stranal/DmdAnal.hs | bsd-3-clause | set_idStrictness :: AnalEnv -> Id -> StrictSig -> Id
set_idStrictness env id sig
= setIdStrictness id (killUsageSig (ae_dflags env) sig) | 138 | set_idStrictness :: AnalEnv -> Id -> StrictSig -> Id
set_idStrictness env id sig
= setIdStrictness id (killUsageSig (ae_dflags env) sig) | 138 | set_idStrictness env id sig
= setIdStrictness id (killUsageSig (ae_dflags env) sig) | 85 | false | true | 0 | 9 | 21 | 49 | 24 | 25 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/SpeechSynthesisUtterance.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance.lang Mozilla SpeechSynthesisUtterance.lang documentation>
getLang ::
(MonadDOM m, FromJSString result) =>
SpeechSynthesisUtterance -> m result
getLang self = liftDOM ((self ^. js "lang") >>= fromJSValUnchecked) | 309 | getLang ::
(MonadDOM m, FromJSString result) =>
SpeechSynthesisUtterance -> m result
getLang self = liftDOM ((self ^. js "lang") >>= fromJSValUnchecked) | 170 | getLang self = liftDOM ((self ^. js "lang") >>= fromJSValUnchecked) | 67 | true | true | 0 | 10 | 45 | 57 | 29 | 28 | null | null |
brendanhay/gogol | gogol-slides/gen/Network/Google/Slides/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'PageElement' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'peTransform'
--
-- * 'peImage'
--
-- * 'peSize'
--
-- * 'peSheetsChart'
--
-- * 'peObjectId'
--
-- * 'peLine'
--
-- * 'peElementGroup'
--
-- * 'peVi... | 839 | pageElement
:: PageElement
pageElement =
PageElement'
{ _peTransform = Nothing
, _peImage = Nothing
, _peSize = Nothing
, _peSheetsChart = Nothing
, _peObjectId = Nothing
, _peLine = Nothing
, _peElementGroup = Nothing
, _peVideo = Nothing
, _peWordArt = Nothing
, _peShape ... | 416 | pageElement =
PageElement'
{ _peTransform = Nothing
, _peImage = Nothing
, _peSize = Nothing
, _peSheetsChart = Nothing
, _peObjectId = Nothing
, _peLine = Nothing
, _peElementGroup = Nothing
, _peVideo = Nothing
, _peWordArt = Nothing
, _peShape = Nothing
, _peTitle = Noth... | 385 | true | true | 0 | 6 | 202 | 120 | 88 | 32 | null | null |
stevedonnelly/haskell | code/Data/Dequeue/Extensions.hs | mit | insertFirst :: a -> Dequeue a -> Dequeue a
insertFirst = (flip Dequeue.pushFront) | 81 | insertFirst :: a -> Dequeue a -> Dequeue a
insertFirst = (flip Dequeue.pushFront) | 81 | insertFirst = (flip Dequeue.pushFront) | 38 | false | true | 0 | 7 | 12 | 33 | 16 | 17 | null | null |
plaprade/haskoin | haskoin-core/src/Network/Haskoin/Script/Parser.hs | unlicense | isDataCarrier _ = False | 37 | isDataCarrier _ = False | 37 | isDataCarrier _ = False | 37 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxTEXT_ATTR_PARA_SPACING_BEFORE :: Int
wxTEXT_ATTR_PARA_SPACING_BEFORE = 0x00001000 | 85 | wxTEXT_ATTR_PARA_SPACING_BEFORE :: Int
wxTEXT_ATTR_PARA_SPACING_BEFORE = 0x00001000 | 85 | wxTEXT_ATTR_PARA_SPACING_BEFORE = 0x00001000 | 45 | false | true | 0 | 4 | 7 | 11 | 6 | 5 | null | null |
elordin/haskell-tetris | game.hs | mit | holdBlock game@(Game w ls s p (h,ch) n (a,_) (rnd:rnds))
| p || not ch = game
| otherwise = case h of
Nothing -> let newPos = pushToTop $ coords n
in if freeForBlock w newPos
then Game w ls s p (Just a, False) (get rnd) (n, newPos) rnds
else... | 547 | holdBlock game@(Game w ls s p (h,ch) n (a,_) (rnd:rnds))
| p || not ch = game
| otherwise = case h of
Nothing -> let newPos = pushToTop $ coords n
in if freeForBlock w newPos
then Game w ls s p (Just a, False) (get rnd) (n, newPos) rnds
else... | 547 | holdBlock game@(Game w ls s p (h,ch) n (a,_) (rnd:rnds))
| p || not ch = game
| otherwise = case h of
Nothing -> let newPos = pushToTop $ coords n
in if freeForBlock w newPos
then Game w ls s p (Just a, False) (get rnd) (n, newPos) rnds
else... | 547 | false | false | 1 | 13 | 234 | 228 | 115 | 113 | null | null |
pxqr/intset | src/Data/IntervalSet/Internal.hs | bsd-3-clause | --
difference t1@(Tip _ _) Nil = t1 | 55 | difference t1@(Tip _ _) Nil = t1 | 51 | difference t1@(Tip _ _) Nil = t1 | 51 | true | false | 0 | 8 | 27 | 23 | 12 | 11 | null | null |
dbp/positionsites | src/Handler/Site.hs | bsd-3-clause | newBlobHandler :: Site -> AppHandler ()
newBlobHandler site = newGenHandler site (blobForm site Nothing) "blob/new" (void . newBlob) | 132 | newBlobHandler :: Site -> AppHandler ()
newBlobHandler site = newGenHandler site (blobForm site Nothing) "blob/new" (void . newBlob) | 132 | newBlobHandler site = newGenHandler site (blobForm site Nothing) "blob/new" (void . newBlob) | 92 | false | true | 0 | 7 | 17 | 47 | 23 | 24 | null | null |
eklinkhammer/haskell-vision | src/FeatureDetection/HarrisCorners.hs | mit | test = id | 9 | test = id | 9 | test = id | 9 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
bgamari/unordered-containers | tests/HashMapProperties.hs | bsd-3-clause | pInsertWith :: Key -> [(Key, Int)] -> Bool
pInsertWith k = M.insertWith (+) k 1 `eq_` HM.insertWith (+) k 1 | 107 | pInsertWith :: Key -> [(Key, Int)] -> Bool
pInsertWith k = M.insertWith (+) k 1 `eq_` HM.insertWith (+) k 1 | 107 | pInsertWith k = M.insertWith (+) k 1 `eq_` HM.insertWith (+) k 1 | 64 | false | true | 0 | 8 | 19 | 59 | 33 | 26 | null | null |
tewe/uroboro | test/Uroboro/CheckerSpec.hs | mit | prelude :: IO Program
prelude = do
fname <- getDataFileName "samples/prelude.uro"
input <- readFile fname
case parse parseDef fname input of
Left _ -> fail "Parser"
Right defs -> case foldM checkDef emptyProgram defs of
Left _ -> fail "Checker"
Right p -> return p
--... | 343 | prelude :: IO Program
prelude = do
fname <- getDataFileName "samples/prelude.uro"
input <- readFile fname
case parse parseDef fname input of
Left _ -> fail "Parser"
Right defs -> case foldM checkDef emptyProgram defs of
Left _ -> fail "Checker"
Right p -> return p
--... | 343 | prelude = do
fname <- getDataFileName "samples/prelude.uro"
input <- readFile fname
case parse parseDef fname input of
Left _ -> fail "Parser"
Right defs -> case foldM checkDef emptyProgram defs of
Left _ -> fail "Checker"
Right p -> return p
-- |Context using prelud... | 321 | false | true | 0 | 14 | 101 | 111 | 47 | 64 | null | null |
haskell-streaming/streaming | src/Streaming/Internal.hs | bsd-3-clause | {-| 'streamFold' reorders the arguments of 'destroy' to be more akin
to @foldr@ It is more convenient to query in ghci to figure out
what kind of \'algebra\' you need to write.
>>> :t streamFold return join
(Monad m, Functor f) =>
(f (m a) -> m a) -> Stream f m a -> m a -- iterT
>>> :t streamFold... | 1,291 | streamFold
:: (Functor f, Monad m) =>
(r -> b) -> (m b -> b) -> (f b -> b) -> Stream f m r -> b
streamFold done theEffect construct stream = destroy stream construct theEffect done | 189 | streamFold done theEffect construct stream = destroy stream construct theEffect done | 85 | true | true | 0 | 12 | 377 | 100 | 49 | 51 | null | null |
dbp/positionsites | src/Handler/Site.hs | bsd-3-clause | newHeaderHandler :: Site -> AppHandler ()
newHeaderHandler site = newGenHandler site (headerForm site Nothing) "header/new" (void . newHeader) | 142 | newHeaderHandler :: Site -> AppHandler ()
newHeaderHandler site = newGenHandler site (headerForm site Nothing) "header/new" (void . newHeader) | 142 | newHeaderHandler site = newGenHandler site (headerForm site Nothing) "header/new" (void . newHeader) | 100 | false | true | 0 | 7 | 17 | 47 | 23 | 24 | null | null |
mboes/hs-asn1 | encoding/Data/ASN1/Get.hs | bsd-3-clause | failDesc :: String -> Get a
failDesc err = Get (\s0 b0 m0 p0 kf _ -> kf s0 b0 m0 p0 ("Failed reading: " ++ err)) | 112 | failDesc :: String -> Get a
failDesc err = Get (\s0 b0 m0 p0 kf _ -> kf s0 b0 m0 p0 ("Failed reading: " ++ err)) | 112 | failDesc err = Get (\s0 b0 m0 p0 kf _ -> kf s0 b0 m0 p0 ("Failed reading: " ++ err)) | 84 | false | true | 0 | 10 | 26 | 60 | 30 | 30 | null | null |
korczis/skull-haskell | src/Lib/Net/WebServer.hs | mit | main = scotty 3000 $ do
get "/:word" $ do
beam <- param "word"
html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"] | 126 | main = scotty 3000 $ do
get "/:word" $ do
beam <- param "word"
html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"] | 126 | main = scotty 3000 $ do
get "/:word" $ do
beam <- param "word"
html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"] | 126 | false | false | 3 | 13 | 32 | 57 | 24 | 33 | null | null |
forked-upstream-packages-for-ghcjs/ghcjs | ghcjs/src/Compiler/GhcjsProgram.hs | mit | ghcjsCleanupHandler :: (ExceptionMonad m, MonadIO m)
=> DynFlags -> GhcjsEnv -> m a -> m a
ghcjsCleanupHandler dflags env inner =
defaultCleanupHandler dflags inner `gfinally`
(liftIO $ do
runners <- readMVar (thRunners env)
forM_ (M.assocs runners) $ \(m,... | 743 | ghcjsCleanupHandler :: (ExceptionMonad m, MonadIO m)
=> DynFlags -> GhcjsEnv -> m a -> m a
ghcjsCleanupHandler dflags env inner =
defaultCleanupHandler dflags inner `gfinally`
(liftIO $ do
runners <- readMVar (thRunners env)
forM_ (M.assocs runners) $ \(m,... | 743 | ghcjsCleanupHandler dflags env inner =
defaultCleanupHandler dflags inner `gfinally`
(liftIO $ do
runners <- readMVar (thRunners env)
forM_ (M.assocs runners) $ \(m,r) ->
getProcessExitCode (thrProcess r) >>= \case
Just _ -> return ()
... | 632 | false | true | 0 | 22 | 275 | 247 | 124 | 123 | null | null |
diminishedprime/.org | reading-list/learn_you_a_haskell/syntax_in_functions.hs | mit | tell (x:y:_) = "The list has a whole bunch of elements." | 56 | tell (x:y:_) = "The list has a whole bunch of elements." | 56 | tell (x:y:_) = "The list has a whole bunch of elements." | 56 | false | false | 0 | 7 | 10 | 21 | 10 | 11 | null | null |
edom/sound | src/Sound/Midi.hs | bsd-3-clause | pvarint :: A.Parser Int
pvarint = do
pref <- A.takeWhile (flip B.testBit 7)
end <- anyWord8
return . read_ $ Bs.snoc pref end
where
read_ = Bs.foldl (\ v b -> B.shiftL v 7 B..|. fromIntegral (B.clearBit b 7)) 0 | 234 | pvarint :: A.Parser Int
pvarint = do
pref <- A.takeWhile (flip B.testBit 7)
end <- anyWord8
return . read_ $ Bs.snoc pref end
where
read_ = Bs.foldl (\ v b -> B.shiftL v 7 B..|. fromIntegral (B.clearBit b 7)) 0 | 234 | pvarint = do
pref <- A.takeWhile (flip B.testBit 7)
end <- anyWord8
return . read_ $ Bs.snoc pref end
where
read_ = Bs.foldl (\ v b -> B.shiftL v 7 B..|. fromIntegral (B.clearBit b 7)) 0 | 210 | false | true | 1 | 12 | 63 | 123 | 55 | 68 | null | null |
erikd/hs-tls | core/Network/TLS/Extra/Cipher.hs | bsd-3-clause | bulk_aes256 = Bulk
{ bulkName = "AES256"
, bulkKeySize = 32
, bulkIVSize = 16
, bulkExplicitIV = 0
, bulkAuthTagLen = 0
, bulkBlockSize = 16
, bulkF = BulkBlockF aes256cbc
} | 242 | bulk_aes256 = Bulk
{ bulkName = "AES256"
, bulkKeySize = 32
, bulkIVSize = 16
, bulkExplicitIV = 0
, bulkAuthTagLen = 0
, bulkBlockSize = 16
, bulkF = BulkBlockF aes256cbc
} | 242 | bulk_aes256 = Bulk
{ bulkName = "AES256"
, bulkKeySize = 32
, bulkIVSize = 16
, bulkExplicitIV = 0
, bulkAuthTagLen = 0
, bulkBlockSize = 16
, bulkF = BulkBlockF aes256cbc
} | 242 | false | false | 0 | 8 | 101 | 57 | 34 | 23 | null | null |
brunjlar/neural | src/Data/Utils/Analytic.hs | mit | gradWith' :: Traversable t
=> (Double -> Double -> a) -- ^ how to combine argument and gradient
-> Diff t Identity -- ^ differentiable function
-> t Double -- ^ function argument
-> (Double, t a) -- ^ function value and combination of ... | 398 | gradWith' :: Traversable t
=> (Double -> Double -> a) -- ^ how to combine argument and gradient
-> Diff t Identity -- ^ differentiable function
-> t Double -- ^ function argument
-> (Double, t a)
gradWith' c f = AD.gradWith' c (runIdentity . run... | 327 | gradWith' c f = AD.gradWith' c (runIdentity . runDiff f) | 56 | true | true | 0 | 10 | 141 | 88 | 44 | 44 | null | null |
uuhan/Idris-dev | src/IRTS/JavaScript/AST.hs | bsd-3-clause | jsExpr2Stmt :: JsExpr -> JsStmt
jsExpr2Stmt = JsExprStmt | 56 | jsExpr2Stmt :: JsExpr -> JsStmt
jsExpr2Stmt = JsExprStmt | 56 | jsExpr2Stmt = JsExprStmt | 24 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
naushadh/persistent | persistent-mysql/Database/Persist/MySQL.hs | mit | execute' :: MySQL.Connection -> MySQL.Query -> [PersistValue] -> IO Int64
execute' conn query vals = MySQL.execute conn query (map P vals) | 138 | execute' :: MySQL.Connection -> MySQL.Query -> [PersistValue] -> IO Int64
execute' conn query vals = MySQL.execute conn query (map P vals) | 138 | execute' conn query vals = MySQL.execute conn query (map P vals) | 64 | false | true | 0 | 8 | 20 | 62 | 29 | 33 | null | null |
thoughtpolice/hs-asai | src/Control/Indexed/Monad.hs | mit | -- | This is @'Control.Monad.liftM'@ for indexed @'Monad'@s.
liftIxM :: IxMonad m => (a -> b) -> m s t a -> m s t b
liftIxM f e = e !>>= returnI . f | 148 | liftIxM :: IxMonad m => (a -> b) -> m s t a -> m s t b
liftIxM f e = e !>>= returnI . f | 87 | liftIxM f e = e !>>= returnI . f | 32 | true | true | 0 | 8 | 34 | 61 | 30 | 31 | null | null |
carlochess/uchuva | vagrant/htcondor/sola/Recursos/tmp/Main.hs | gpl-3.0 | run :: Exp -> Int
run e = eval e emptyEnv | 42 | run :: Exp -> Int
run e = eval e emptyEnv | 41 | run e = eval e emptyEnv | 23 | false | true | 0 | 7 | 11 | 30 | 12 | 18 | null | null |
TransformingMusicology/libaudioDB-haskell | src/Sound/Audio/Database/Query.hs | gpl-3.0 | peekDatum :: ADBDatumPtr -> IO ADBDatum
peekDatum datumPtr = do
d <- peek datumPtr
return d | 95 | peekDatum :: ADBDatumPtr -> IO ADBDatum
peekDatum datumPtr = do
d <- peek datumPtr
return d | 95 | peekDatum datumPtr = do
d <- peek datumPtr
return d | 55 | false | true | 0 | 9 | 19 | 41 | 17 | 24 | null | null |
sdiehl/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- The "standard classes" are used in defaulting (Haskell 98 report 4.3.4),
-- and are: "classes defined in the Prelude or a standard library"
standardClassKeys :: [Unique]
standardClassKeys = derivableClassKeys ++ numericClassKeys
++ [randomClassKey, randomGenClassKey,
functorCl... | 646 | standardClassKeys :: [Unique]
standardClassKeys = derivableClassKeys ++ numericClassKeys
++ [randomClassKey, randomGenClassKey,
functorClassKey,
monadClassKey, monadPlusClassKey, monadFailClassKey,
semigroupClassKey, monoidClassKey,
... | 503 | standardClassKeys = derivableClassKeys ++ numericClassKeys
++ [randomClassKey, randomGenClassKey,
functorClassKey,
monadClassKey, monadPlusClassKey, monadFailClassKey,
semigroupClassKey, monoidClassKey,
isStringCla... | 473 | true | true | 0 | 6 | 217 | 63 | 40 | 23 | null | null |
henrytill/deviser | tests/Deviser/Parser/Tests.hs | bsd-3-clause | parserTests :: [Test]
parserTests =
[ parseSingleAtom
, parseQuotedSymbol
, parseListOfSingleAtom
, parseFunctionApplication
, parseListOfNumbers
, parseVectorOfNumbers
, parseBadVector
, parseQuotedList
-- , parseQuotedList2
-- , parseDottedList
-- , parseDottedList2
, parseNumber
, parseFloa... | 341 | parserTests :: [Test]
parserTests =
[ parseSingleAtom
, parseQuotedSymbol
, parseListOfSingleAtom
, parseFunctionApplication
, parseListOfNumbers
, parseVectorOfNumbers
, parseBadVector
, parseQuotedList
-- , parseQuotedList2
-- , parseDottedList
-- , parseDottedList2
, parseNumber
, parseFloa... | 341 | parserTests =
[ parseSingleAtom
, parseQuotedSymbol
, parseListOfSingleAtom
, parseFunctionApplication
, parseListOfNumbers
, parseVectorOfNumbers
, parseBadVector
, parseQuotedList
-- , parseQuotedList2
-- , parseDottedList
-- , parseDottedList2
, parseNumber
, parseFloat
, parseString
] | 319 | false | true | 0 | 5 | 66 | 50 | 33 | 17 | null | null |
ARCCN/hcprobe | src/HCProbe/EDSL/PacketGeneration.hs | bsd-3-clause | putPacketInBufferId :: Word32 -> Writer (Endo OfpPacketIn) ()
putPacketInBufferId i = tell . Endo $ \m -> m{ofp_pkt_in_buffer_id = i} | 133 | putPacketInBufferId :: Word32 -> Writer (Endo OfpPacketIn) ()
putPacketInBufferId i = tell . Endo $ \m -> m{ofp_pkt_in_buffer_id = i} | 133 | putPacketInBufferId i = tell . Endo $ \m -> m{ofp_pkt_in_buffer_id = i} | 71 | false | true | 3 | 9 | 19 | 63 | 29 | 34 | null | null |
cchalmers/optical | src/Optical/Containers.hs | bsd-3-clause | itoSeq :: FoldableWithIndex i f => f a -> Seq.Seq (i,a)
itoSeq = itoSeqOf ifolded | 81 | itoSeq :: FoldableWithIndex i f => f a -> Seq.Seq (i,a)
itoSeq = itoSeqOf ifolded | 81 | itoSeq = itoSeqOf ifolded | 25 | false | true | 0 | 9 | 14 | 47 | 21 | 26 | null | null |
leksah/yi | src/library/Yi/Keymap/Vim/Utils.hs | gpl-2.0 | mkStringBindingY :: VimMode
-> (EventString, YiM (), VimState -> VimState) -> VimBinding
mkStringBindingY mode (eventString, action, mutate) = VimBindingY f
where f _ vs | vsMode vs /= mode = NoMatch
f evs _ = combineAction action mutate Drop <$
evs `matchesString` eventString | 315 | mkStringBindingY :: VimMode
-> (EventString, YiM (), VimState -> VimState) -> VimBinding
mkStringBindingY mode (eventString, action, mutate) = VimBindingY f
where f _ vs | vsMode vs /= mode = NoMatch
f evs _ = combineAction action mutate Drop <$
evs `matchesString` eventString | 315 | mkStringBindingY mode (eventString, action, mutate) = VimBindingY f
where f _ vs | vsMode vs /= mode = NoMatch
f evs _ = combineAction action mutate Drop <$
evs `matchesString` eventString | 222 | false | true | 1 | 10 | 80 | 109 | 54 | 55 | null | null |
gafiatulin/codewars | src/Beta/Sameprimefactors.hs | mit | factor 1 = [] | 13 | factor 1 = [] | 13 | factor 1 = [] | 13 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
carabolic/huring | src/Data/Tape.hs | gpl-2.0 | empty :: Tape a
empty = Tape (repeat Blank) Blank (repeat Blank) | 64 | empty :: Tape a
empty = Tape (repeat Blank) Blank (repeat Blank) | 64 | empty = Tape (repeat Blank) Blank (repeat Blank) | 48 | false | true | 0 | 7 | 11 | 39 | 17 | 22 | null | null |
ml9951/ghc | compiler/cmm/PprCmm.hs | bsd-3-clause | pprConvention Slow = text "<slow-convention>" | 62 | pprConvention Slow = text "<slow-convention>" | 62 | pprConvention Slow = text "<slow-convention>" | 62 | false | false | 0 | 5 | 21 | 13 | 5 | 8 | null | null |
relrod/ba | src/Bio/Algorithm/Types.hs | bsd-2-clause | lazyTextRNA :: Prism' TL.Text RNA
lazyTextRNA = prism' (\(RNA tl) -> tl) toRNA
where
toRNA s =
if TL.length (TL.filter isRNAChar s) == TL.length s
then Just (RNA s)
else Nothing | 201 | lazyTextRNA :: Prism' TL.Text RNA
lazyTextRNA = prism' (\(RNA tl) -> tl) toRNA
where
toRNA s =
if TL.length (TL.filter isRNAChar s) == TL.length s
then Just (RNA s)
else Nothing | 201 | lazyTextRNA = prism' (\(RNA tl) -> tl) toRNA
where
toRNA s =
if TL.length (TL.filter isRNAChar s) == TL.length s
then Just (RNA s)
else Nothing | 167 | false | true | 2 | 10 | 54 | 98 | 44 | 54 | null | null |
srijs/haskell-resource-pool-monad | src/Control/Monad/Trans/Pool.hs | mit | runPooled :: MonadBaseControl IO m => WithResourceT r m a -> Pool r -> m a
runPooled (WithResourceT m) pool = iterT (runPooledF pool) m | 135 | runPooled :: MonadBaseControl IO m => WithResourceT r m a -> Pool r -> m a
runPooled (WithResourceT m) pool = iterT (runPooledF pool) m | 135 | runPooled (WithResourceT m) pool = iterT (runPooledF pool) m | 60 | false | true | 0 | 11 | 24 | 67 | 30 | 37 | null | null |
m-schmidt/fuzzer | src/Commandline.hs | bsd-3-clause | -- |Default values for command line options
defaultOptions :: Options
defaultOptions = Options
{ optMode = EXPR
, optExprType = UINT64
, optNumTests = 100
, optChunkSize = 1
, optComplexity = 30
, optShowHelp = False
, optEnableShrink = True
, optPointer64 ... | 367 | defaultOptions :: Options
defaultOptions = Options
{ optMode = EXPR
, optExprType = UINT64
, optNumTests = 100
, optChunkSize = 1
, optComplexity = 30
, optShowHelp = False
, optEnableShrink = True
, optPointer64 = False
, optFlowConstraints = False
... | 323 | defaultOptions = Options
{ optMode = EXPR
, optExprType = UINT64
, optNumTests = 100
, optChunkSize = 1
, optComplexity = 30
, optShowHelp = False
, optEnableShrink = True
, optPointer64 = False
, optFlowConstraints = False
} | 297 | true | true | 0 | 7 | 121 | 72 | 45 | 27 | null | null |
tjakway/ghcjvm | compiler/main/Plugins.hs | bsd-3-clause | defaultFrontendPlugin :: FrontendPlugin
defaultFrontendPlugin = FrontendPlugin { frontend = \_ _ -> return () } | 111 | defaultFrontendPlugin :: FrontendPlugin
defaultFrontendPlugin = FrontendPlugin { frontend = \_ _ -> return () } | 111 | defaultFrontendPlugin = FrontendPlugin { frontend = \_ _ -> return () } | 71 | false | true | 0 | 9 | 14 | 31 | 17 | 14 | null | null |
quchen/stg | app/CmdLineArgs.hs | bsd-3-clause | parseCmdArgs :: [String] -> IO Options
parseCmdArgs argv = case getOpt Permute options argv of
(o,_,[]) -> pure (foldr id defOptions o)
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options))
where
header = "Usage: $0 [OPTION...]" | 264 | parseCmdArgs :: [String] -> IO Options
parseCmdArgs argv = case getOpt Permute options argv of
(o,_,[]) -> pure (foldr id defOptions o)
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options))
where
header = "Usage: $0 [OPTION...]" | 264 | parseCmdArgs argv = case getOpt Permute options argv of
(o,_,[]) -> pure (foldr id defOptions o)
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options))
where
header = "Usage: $0 [OPTION...]" | 225 | false | true | 0 | 13 | 51 | 112 | 57 | 55 | null | null |
MnO2/lazy-doc | src/Action/Server.hs | bsd-3-clause | userAPI :: Proxy UserAPI
userAPI = Proxy | 40 | userAPI :: Proxy UserAPI
userAPI = Proxy | 40 | userAPI = Proxy | 15 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
rdnetto/persistent | persistent/Database/Persist/Sql/Orphan/PersistQuery.hs | mit | filterClause :: (PersistEntity val, PersistEntityBackend val ~ SqlBackend)
=> Bool -- ^ include table name?
-> SqlBackend
-> [Filter val]
-> Text
filterClause b c = fst . filterClauseHelper b True c OrNullNo | 259 | filterClause :: (PersistEntity val, PersistEntityBackend val ~ SqlBackend)
=> Bool -- ^ include table name?
-> SqlBackend
-> [Filter val]
-> Text
filterClause b c = fst . filterClauseHelper b True c OrNullNo | 259 | filterClause b c = fst . filterClauseHelper b True c OrNullNo | 61 | false | true | 0 | 10 | 84 | 68 | 34 | 34 | null | null |
ekmett/reactive | src/FRP/Reactive/SImproving.hs | agpl-3.0 | -- | Extract an exact value from an improving value
exact :: Improving a -> a
exact = last . unImp | 98 | exact :: Improving a -> a
exact = last . unImp | 46 | exact = last . unImp | 20 | true | true | 0 | 6 | 20 | 23 | 12 | 11 | null | null |
tsoding/boids | src/Main.hs | mit | window = InWindow "Boids" (800, 600) (10, 10) | 45 | window = InWindow "Boids" (800, 600) (10, 10) | 45 | window = InWindow "Boids" (800, 600) (10, 10) | 45 | false | false | 0 | 6 | 7 | 25 | 14 | 11 | null | null |
walkie/CC-Minimal | src/CC/Parser.hs | bsd-3-clause | parens = Lex.parens lexer | 33 | parens = Lex.parens lexer | 33 | parens = Lex.parens lexer | 33 | false | false | 0 | 6 | 11 | 11 | 5 | 6 | null | null |
meoblast001/lexical-analyser-generator | src/Output/CPP.hs | mit | rulesToCpp :: [Rule] -> Integer -> String
rulesToCpp ((Class name charsAndRanges):rest) i = [r|
CharOrRange charclass_|] ++ name ++ [r|[] =
{|] ++ concat (intersperse ", " (map charOrRangeToCpp charsAndRanges)) ++ [r|,
CharOrRange()};
|] ++ rulesToCpp rest i | 259 | rulesToCpp :: [Rule] -> Integer -> String
rulesToCpp ((Class name charsAndRanges):rest) i = [r|
CharOrRange charclass_|] ++ name ++ [r|[] =
{|] ++ concat (intersperse ", " (map charOrRangeToCpp charsAndRanges)) ++ [r|,
CharOrRange()};
|] ++ rulesToCpp rest i | 259 | rulesToCpp ((Class name charsAndRanges):rest) i = [r|
CharOrRange charclass_|] ++ name ++ [r|[] =
{|] ++ concat (intersperse ", " (map charOrRangeToCpp charsAndRanges)) ++ [r|,
CharOrRange()};
|] ++ rulesToCpp rest i | 217 | false | true | 6 | 12 | 38 | 108 | 56 | 52 | null | null |
Autopawn/haskell-secureUDP | Auxiliars.hs | mit | char2word8 :: Char -> W.Word8
char2word8 ch = fromIntegral (fromEnum ch) | 72 | char2word8 :: Char -> W.Word8
char2word8 ch = fromIntegral (fromEnum ch) | 72 | char2word8 ch = fromIntegral (fromEnum ch) | 42 | false | true | 0 | 7 | 10 | 29 | 14 | 15 | null | null |
polux/snippets | AbstractInterpreter.hs | apache-2.0 | aEvalExpr (BoolLit b) _ = AVBool (if b then ATrue else AFalse) | 62 | aEvalExpr (BoolLit b) _ = AVBool (if b then ATrue else AFalse) | 62 | aEvalExpr (BoolLit b) _ = AVBool (if b then ATrue else AFalse) | 62 | false | false | 1 | 7 | 11 | 33 | 16 | 17 | null | null |
purebred-mua/purebred | src/Purebred/UI/Help/Main.hs | agpl-3.0 | ppKey KDel = "<Del>" | 20 | ppKey KDel = "<Del>" | 20 | ppKey KDel = "<Del>" | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
rsasse/tamarin-prover | src/Main/TheoryLoader.hs | gpl-3.0 | -- | Construct the BP intruder variants for the given maude signature.
mkBpIntruderVariants :: MaudeSig -> [IntrRuleAC]
mkBpIntruderVariants msig =
either (error . show) id -- report errors lazily through 'error'
$ parseIntruderRules msig bpIntruderVariantsFile
$(embedFile "data/intruder_variants... | 331 | mkBpIntruderVariants :: MaudeSig -> [IntrRuleAC]
mkBpIntruderVariants msig =
either (error . show) id -- report errors lazily through 'error'
$ parseIntruderRules msig bpIntruderVariantsFile
$(embedFile "data/intruder_variants_bp.spthy") | 260 | mkBpIntruderVariants msig =
either (error . show) id -- report errors lazily through 'error'
$ parseIntruderRules msig bpIntruderVariantsFile
$(embedFile "data/intruder_variants_bp.spthy") | 211 | true | true | 2 | 8 | 59 | 54 | 27 | 27 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.