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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dmjio/miso | examples/sse/server/Main.hs | bsd-3-clause | sseApp :: Chan ServerEvent -> Application
sseApp chan = eventSourceAppChan chan | 79 | sseApp :: Chan ServerEvent -> Application
sseApp chan = eventSourceAppChan chan | 79 | sseApp chan = eventSourceAppChan chan | 37 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
danchoi/ngrender | Ng/Expressions.hs | mit | -- CHANGE TO PARSEC
toJSKey :: Text -> JSKey
toJSKey "length" = Method "length" [] | 82 | toJSKey :: Text -> JSKey
toJSKey "length" = Method "length" [] | 62 | toJSKey "length" = Method "length" [] | 37 | true | true | 0 | 6 | 14 | 30 | 14 | 16 | null | null |
bos/critbit | Data/CritBit/Tree.hs | bsd-2-clause | -- | /O(n)/. Fold the values in the map using the given
-- right-associative function, such that
-- @'foldr' f z == 'Prelude.foldr' f z . 'elems'@.
--
-- Example:
--
-- > elems map = foldr (:) [] map
foldr :: (v -> a -> a) -> a -> CritBit k v -> a
foldr f z m = Foldable.foldr f z m | 282 | foldr :: (v -> a -> a) -> a -> CritBit k v -> a
foldr f z m = Foldable.foldr f z m | 82 | foldr f z m = Foldable.foldr f z m | 34 | true | true | 0 | 8 | 63 | 62 | 34 | 28 | null | null |
trenttobler/hs-asteroids | src/Pt2.hs | bsd-3-clause | midPt2 :: Fractional a => Pt2 a -> Pt2 a -> Pt2 a
midPt2 a b = divPt2 (a + b) 2 | 84 | midPt2 :: Fractional a => Pt2 a -> Pt2 a -> Pt2 a
midPt2 a b = divPt2 (a + b) 2 | 83 | midPt2 a b = divPt2 (a + b) 2 | 33 | false | true | 0 | 9 | 26 | 57 | 25 | 32 | null | null |
snape/LooplessFunctionalAlgorithms | Li.hs | apache-2.0 | treeStart = third . foldTree treeConfigs
where treeConfigs n = foldr mkWBconfigs (True,True,[],[],[]) | 119 | treeStart = third . foldTree treeConfigs
where treeConfigs n = foldr mkWBconfigs (True,True,[],[],[]) | 119 | treeStart = third . foldTree treeConfigs
where treeConfigs n = foldr mkWBconfigs (True,True,[],[],[]) | 119 | false | false | 0 | 9 | 30 | 49 | 26 | 23 | null | null |
Sgoettschkes/learning | haskell/LearnYouAHaskell/06.hs | mit | zipWith' f (x:xs) (y:ys) = (f x y) : zipWith' f xs ys | 53 | zipWith' f (x:xs) (y:ys) = (f x y) : zipWith' f xs ys | 53 | zipWith' f (x:xs) (y:ys) = (f x y) : zipWith' f xs ys | 53 | false | false | 0 | 7 | 12 | 49 | 23 | 26 | null | null |
ehird/mchost | MC/Protocol/Fields.hs | bsd-3-clause | point :: String -> FieldInfo
point = simpleField [t| Point |] | 61 | point :: String -> FieldInfo
point = simpleField [t| Point |] | 61 | point = simpleField [t| Point |] | 32 | false | true | 0 | 5 | 10 | 22 | 13 | 9 | null | null |
8l/barrelfish | hake/X86_64.hs | mit | linker = ArchDefaults.linker arch compiler | 42 | linker = ArchDefaults.linker arch compiler | 42 | linker = ArchDefaults.linker arch compiler | 42 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
Athas/afterburner-pascal | src/Afterburner/Parser.hs | mit | direction :: Parser Direction
direction = reserved "to" *> pure UpTo <|>
reserved "downto" *> pure DownTo | 117 | direction :: Parser Direction
direction = reserved "to" *> pure UpTo <|>
reserved "downto" *> pure DownTo | 117 | direction = reserved "to" *> pure UpTo <|>
reserved "downto" *> pure DownTo | 87 | false | true | 0 | 7 | 28 | 43 | 18 | 25 | null | null |
spacekitteh/smcghc | libraries/base/GHC/Conc/Signal.hs | bsd-3-clause | sharedCAF :: a -> (Ptr a -> IO (Ptr a)) -> IO a
sharedCAF a get_or_set =
mask_ $ do
stable_ref <- newStablePtr a
let ref = castPtr (castStablePtrToPtr stable_ref)
ref2 <- get_or_set ref
if ref == ref2
then return a
else do freeStablePtr stable_ref
deRefStablePtr (castPtrToSta... | 342 | sharedCAF :: a -> (Ptr a -> IO (Ptr a)) -> IO a
sharedCAF a get_or_set =
mask_ $ do
stable_ref <- newStablePtr a
let ref = castPtr (castStablePtrToPtr stable_ref)
ref2 <- get_or_set ref
if ref == ref2
then return a
else do freeStablePtr stable_ref
deRefStablePtr (castPtrToSta... | 342 | sharedCAF a get_or_set =
mask_ $ do
stable_ref <- newStablePtr a
let ref = castPtr (castStablePtrToPtr stable_ref)
ref2 <- get_or_set ref
if ref == ref2
then return a
else do freeStablePtr stable_ref
deRefStablePtr (castPtrToStablePtr (castPtr ref2)) | 294 | false | true | 0 | 15 | 92 | 130 | 59 | 71 | null | null |
chrisjpn/CPIB_ILMCompiler | src/VM/VirtualMachineIO.hs | bsd-3-clause | execInstr Store (pc, fp, val : IntVmVal addr : stack) =
return2 (pc + 1, fp, updateS stack (addr, val)) | 105 | execInstr Store (pc, fp, val : IntVmVal addr : stack) =
return2 (pc + 1, fp, updateS stack (addr, val)) | 105 | execInstr Store (pc, fp, val : IntVmVal addr : stack) =
return2 (pc + 1, fp, updateS stack (addr, val)) | 105 | false | false | 0 | 9 | 21 | 58 | 31 | 27 | null | null |
travitch/llvm-base-types | src/Data/LLVM/Internal/Printers.hs | bsd-3-clause | maybeShowMDName (Just m) = showMDName m | 39 | maybeShowMDName (Just m) = showMDName m | 39 | maybeShowMDName (Just m) = showMDName m | 39 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
kirhgoff/haskell-sandbox | euler28/Spiral.hs | mit | spiralPrepend n (r : rs) = (n : r) : spiralPrepend (n - 1) rs | 61 | spiralPrepend n (r : rs) = (n : r) : spiralPrepend (n - 1) rs | 61 | spiralPrepend n (r : rs) = (n : r) : spiralPrepend (n - 1) rs | 61 | false | false | 0 | 8 | 14 | 41 | 21 | 20 | null | null |
HackerFoo/peg | Peg/Constraints.hs | gpl-3.0 | addConstraint :: ([Value], [Value]) -> Peg Bool
addConstraint (y, W w:x) | Just f <- w `M.lookup` wordConstraints =
do b <- f x y
when (not b) $ addConstraint' (y, W w:x)
return True | 194 | addConstraint :: ([Value], [Value]) -> Peg Bool
addConstraint (y, W w:x) | Just f <- w `M.lookup` wordConstraints =
do b <- f x y
when (not b) $ addConstraint' (y, W w:x)
return True | 194 | addConstraint (y, W w:x) | Just f <- w `M.lookup` wordConstraints =
do b <- f x y
when (not b) $ addConstraint' (y, W w:x)
return True | 146 | false | true | 0 | 12 | 46 | 121 | 58 | 63 | null | null |
phaazon/quaazar | sdk/qzr/src/Qzr/Init.hs | bsd-3-clause | mainHS :: String
mainHS = unlines
[
replicate 79 '-'
, "-- generated by: qzr init"
, replicate 79 '-'
, ""
, "import Control.Monad ( unless, void)"
, "import Control.Monad.Trans.Either ( runEitherT )"
, "import Control.Monad.Trans.Journal ( runJournalT )"
, "import Data.Traversable ( traverse_ )"
... | 1,411 | mainHS :: String
mainHS = unlines
[
replicate 79 '-'
, "-- generated by: qzr init"
, replicate 79 '-'
, ""
, "import Control.Monad ( unless, void)"
, "import Control.Monad.Trans.Either ( runEitherT )"
, "import Control.Monad.Trans.Journal ( runJournalT )"
, "import Data.Traversable ( traverse_ )"
... | 1,411 | mainHS = unlines
[
replicate 79 '-'
, "-- generated by: qzr init"
, replicate 79 '-'
, ""
, "import Control.Monad ( unless, void)"
, "import Control.Monad.Trans.Either ( runEitherT )"
, "import Control.Monad.Trans.Journal ( runJournalT )"
, "import Data.Traversable ( traverse_ )"
, "import Numeric... | 1,394 | false | true | 0 | 7 | 355 | 157 | 96 | 61 | null | null |
bos/criterion | criterion-measurement/src/Criterion/Measurement.hs | bsd-2-clause | applyGCStatistics :: Maybe GCStatistics
-- ^ Statistics gathered at the __end__ of a run, post-GC.
-> Maybe GCStatistics
-- ^ Statistics gathered at the __end__ of a run, pre-GC.
-> Maybe GCStatistics
-- ^ Statistics gathered at t... | 1,356 | applyGCStatistics :: Maybe GCStatistics
-- ^ Statistics gathered at the __end__ of a run, post-GC.
-> Maybe GCStatistics
-- ^ Statistics gathered at the __end__ of a run, pre-GC.
-> Maybe GCStatistics
-- ^ Statistics gathered at t... | 1,356 | applyGCStatistics (Just endPostGC) (Just endPreGC) (Just start) m = m {
-- The choice of endPostGC or endPreGC is important.
-- For bytes allocated/copied, and mutator statistics, we use
-- endPostGC, because the intermediate performGC ensures they're up-to-date.
-- The others (num GCs and GC cpu/wall s... | 905 | false | true | 0 | 8 | 389 | 173 | 92 | 81 | null | null |
bitemyapp/chip-8 | src/CPU/Emulate.hs | bsd-3-clause | arrangePixels :: Int -> Int -> Int -> Int -> CPU.CPU -> (Bool, V.Vector (Int, Bool))
arrangePixels x y index times cpu =
unmergePixels $
V.zipWith3 mergePixels
(indicesVector x y times)
(V.backpermute
(Lens.view CPU.gfx cpu)
(indicesVector x y times))
(V.concatMap byteVector $
... | 373 | arrangePixels :: Int -> Int -> Int -> Int -> CPU.CPU -> (Bool, V.Vector (Int, Bool))
arrangePixels x y index times cpu =
unmergePixels $
V.zipWith3 mergePixels
(indicesVector x y times)
(V.backpermute
(Lens.view CPU.gfx cpu)
(indicesVector x y times))
(V.concatMap byteVector $
... | 373 | arrangePixels x y index times cpu =
unmergePixels $
V.zipWith3 mergePixels
(indicesVector x y times)
(V.backpermute
(Lens.view CPU.gfx cpu)
(indicesVector x y times))
(V.concatMap byteVector $
V.slice index times (Lens.view CPU.memory cpu)) | 288 | false | true | 0 | 12 | 95 | 151 | 76 | 75 | null | null |
kolmodin/cabal | Cabal/Distribution/Simple/LHC.hs | bsd-3-clause | installLib :: Verbosity
-> LocalBuildInfo
-> FilePath -- ^install location
-> FilePath -- ^install location for dynamic libraries
-> FilePath -- ^Build location
-> PackageDescription
-> Library
-> ComponentLocalBuild... | 2,048 | installLib :: Verbosity
-> LocalBuildInfo
-> FilePath -- ^install location
-> FilePath -- ^install location for dynamic libraries
-> FilePath -- ^Build location
-> PackageDescription
-> Library
-> ComponentLocalBuild... | 2,048 | installLib verbosity lbi targetDir dynlibTargetDir builtDir _pkg lib clbi = do
-- copy .hi files over:
let copy src dst n = do
createDirectoryIfMissingVerbose verbosity True dst
installOrdinaryFile verbosity (src </> n) (dst </> n)
copyModuleFiles ext =
findModuleFiles [builtDir] [ext]... | 1,700 | false | true | 13 | 15 | 546 | 527 | 243 | 284 | null | null |
apyrgio/snf-ganeti | src/Ganeti/Constants.hs | bsd-2-clause | maxNics :: Int
maxNics = Types.maxNics | 38 | maxNics :: Int
maxNics = Types.maxNics | 38 | maxNics = Types.maxNics | 23 | false | true | 0 | 5 | 5 | 13 | 7 | 6 | null | null |
JamieBeverley/InnerEar | src/InnerEarServer.hs | gpl-3.0 | closeDatabaseOnException :: MVar Server -> SomeException -> IO ()
closeDatabaseOnException s e = do
s' <- takeMVar s
putStrLn $ "quitting and closing database due to unhandled exception (" ++ (show e) ++ ")..."
DB.closeDatabase $ database s'
putStrLn "database connection closed." | 293 | closeDatabaseOnException :: MVar Server -> SomeException -> IO ()
closeDatabaseOnException s e = do
s' <- takeMVar s
putStrLn $ "quitting and closing database due to unhandled exception (" ++ (show e) ++ ")..."
DB.closeDatabase $ database s'
putStrLn "database connection closed." | 292 | closeDatabaseOnException s e = do
s' <- takeMVar s
putStrLn $ "quitting and closing database due to unhandled exception (" ++ (show e) ++ ")..."
DB.closeDatabase $ database s'
putStrLn "database connection closed." | 226 | false | true | 0 | 10 | 54 | 81 | 36 | 45 | null | null |
Laar/OpenGLRawgen | src/Code/ModuleCode.hs | bsd-3-clause | toImport :: ModulePart -> Imports
toImport mp = case mp of
DefineEnum{} -> mempty
ReDefineLEnum{} -> mempty
ReDefineIEnum _ _ _ i -> singletonImport i
ReExport i _ -> singletonImport i
DefineFunc{} -> mempty
ReExportModule mn -> importMod mn
----------------... | 713 | toImport :: ModulePart -> Imports
toImport mp = case mp of
DefineEnum{} -> mempty
ReDefineLEnum{} -> mempty
ReDefineIEnum _ _ _ i -> singletonImport i
ReExport i _ -> singletonImport i
DefineFunc{} -> mempty
ReExportModule mn -> importMod mn
----------------... | 713 | toImport mp = case mp of
DefineEnum{} -> mempty
ReDefineLEnum{} -> mempty
ReDefineIEnum _ _ _ i -> singletonImport i
ReExport i _ -> singletonImport i
DefineFunc{} -> mempty
ReExportModule mn -> importMod mn
--------------------------------------------------... | 679 | false | true | 0 | 8 | 157 | 102 | 51 | 51 | null | null |
Yuras/mongodb | Database/MongoDB/Internal/Util.hs | apache-2.0 | mergesortM' :: Monad m => (a -> a -> m Ordering) -> [[a]] -> m [a]
mergesortM' _ [] = return [] | 96 | mergesortM' :: Monad m => (a -> a -> m Ordering) -> [[a]] -> m [a]
mergesortM' _ [] = return [] | 96 | mergesortM' _ [] = return [] | 29 | false | true | 0 | 10 | 22 | 64 | 32 | 32 | null | null |
adarqui/ArtGallery | Haskell/src/ArtGallery/Sort/PrefixTree/AlexandersGreen.hs | bsd-3-clause | initialTree :: PFTree a b
initialTree = Node Nothing (\_ -> Nothing) | 68 | initialTree :: PFTree a b
initialTree = Node Nothing (\_ -> Nothing) | 68 | initialTree = Node Nothing (\_ -> Nothing) | 42 | false | true | 1 | 7 | 11 | 32 | 15 | 17 | null | null |
DigitalBrains1/clash-lt24 | UnitTest/LT24/LT24/LT24Top.hs | bsd-2-clause | splitInput :: Vec 35 Bit
-> (LT24.Action, Unsigned 16, Unsigned 16)
splitInput i = (action, din, ltdin)
where
actionN = fromBV (vtakeI i) :: Unsigned 3
din = fromBV (vselect d3 d1 d16 i) :: Unsigned 16
ltdin = fromBV (vdropI i) :: Unsigned 16
action = case actionN of
... | 528 | splitInput :: Vec 35 Bit
-> (LT24.Action, Unsigned 16, Unsigned 16)
splitInput i = (action, din, ltdin)
where
actionN = fromBV (vtakeI i) :: Unsigned 3
din = fromBV (vselect d3 d1 d16 i) :: Unsigned 16
ltdin = fromBV (vdropI i) :: Unsigned 16
action = case actionN of
... | 527 | splitInput i = (action, din, ltdin)
where
actionN = fromBV (vtakeI i) :: Unsigned 3
din = fromBV (vselect d3 d1 d16 i) :: Unsigned 16
ltdin = fromBV (vdropI i) :: Unsigned 16
action = case actionN of
1 -> LT24.Reset
2 -> LT24.Command
... | 448 | false | true | 0 | 8 | 230 | 175 | 89 | 86 | null | null |
hvr/unordered-containers | Data/HashMap/Strict.hs | bsd-3-clause | ------------------------------------------------------------------------
-- Array operations
updateWith :: Eq k => (v -> v) -> k -> A.Array (Leaf k v) -> A.Array (Leaf k v)
updateWith f k0 ary0 = go k0 ary0 0 (A.length ary0)
where
go !k !ary !i !n
| i >= n = ary
| otherwise = case A.index ary ... | 486 | updateWith :: Eq k => (v -> v) -> k -> A.Array (Leaf k v) -> A.Array (Leaf k v)
updateWith f k0 ary0 = go k0 ary0 0 (A.length ary0)
where
go !k !ary !i !n
| i >= n = ary
| otherwise = case A.index ary i of
(L kx y) | k == kx -> let !v' = f y in A.update ary i (L k v')
... | 392 | updateWith f k0 ary0 = go k0 ary0 0 (A.length ary0)
where
go !k !ary !i !n
| i >= n = ary
| otherwise = case A.index ary i of
(L kx y) | k == kx -> let !v' = f y in A.update ary i (L k v')
| otherwise -> go k ary (i+1) n
#if __GLASGOW_HASKELL__ >= 700
| 312 | true | true | 3 | 14 | 148 | 229 | 106 | 123 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/Typecheck/Environment.hs | bsd-3-clause | initClassCtorEnv :: Unif r => TypeSigQ AK r -> TCEnv r -> TCEnv r
--------------------------------------------------------------------------------
initClassCtorEnv (TS _ (BGen nm bs) _) γ = tcEnvAdd eThis γ'
where
γ' = γ { tce_mut = Just tUQ
, tce_this = Just tThis
, tce_bounds... | 687 | initClassCtorEnv :: Unif r => TypeSigQ AK r -> TCEnv r -> TCEnv r
initClassCtorEnv (TS _ (BGen nm bs) _) γ = tcEnvAdd eThis γ'
where
γ' = γ { tce_mut = Just tUQ
, tce_this = Just tThis
, tce_bounds = envAdds bts (tce_bounds γ)
}
bts = [(s,t) | BTV s _ (Just ... | 606 | initClassCtorEnv (TS _ (BGen nm bs) _) γ = tcEnvAdd eThis γ'
where
γ' = γ { tce_mut = Just tUQ
, tce_this = Just tThis
, tce_bounds = envAdds bts (tce_bounds γ)
}
bts = [(s,t) | BTV s _ (Just t) <- bs]
tThis = adjUQ (TRef (Gen nm (map btVar bs)) fTop)
... | 540 | true | true | 5 | 11 | 195 | 253 | 128 | 125 | null | null |
CRogers/stack | src/main/Plugins.hs | bsd-3-clause | -- | Describes how to create a process out of a plugin and arguments.
-- You may use Data.Process and Data.Conduit.Process
-- to manage the process's stdin, stdout, and stderr in various ways.
pluginProc :: Plugin -> [String] -> CreateProcess
pluginProc = proc . pluginProcessName | 280 | pluginProc :: Plugin -> [String] -> CreateProcess
pluginProc = proc . pluginProcessName | 87 | pluginProc = proc . pluginProcessName | 37 | true | true | 0 | 7 | 44 | 29 | 17 | 12 | null | null |
Numberartificial/workflow | haskell-first-principles/src/RW/CH8/Regexp.hs | mit | pat = "(foo[a-z]*bar|quux)" | 27 | pat = "(foo[a-z]*bar|quux)" | 27 | pat = "(foo[a-z]*bar|quux)" | 27 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
sdiehl/ghc | compiler/main/DriverPipeline.hs | bsd-3-clause | llvmOptions :: DynFlags
-> [(String, String)] -- ^ pairs of (opt, llc) arguments
llvmOptions dflags =
[("-enable-tbaa -tbaa", "-enable-tbaa") | gopt Opt_LlvmTBAA dflags ]
++ [("-relocation-model=" ++ rmodel
,"-relocation-model=" ++ rmodel) | not (null rmodel)]
++ [("-stack-alignment... | 2,539 | llvmOptions :: DynFlags
-> [(String, String)]
llvmOptions dflags =
[("-enable-tbaa -tbaa", "-enable-tbaa") | gopt Opt_LlvmTBAA dflags ]
++ [("-relocation-model=" ++ rmodel
,"-relocation-model=" ++ rmodel) | not (null rmodel)]
++ [("-stack-alignment=" ++ (show align)
,"-stack-... | 2,503 | llvmOptions dflags =
[("-enable-tbaa -tbaa", "-enable-tbaa") | gopt Opt_LlvmTBAA dflags ]
++ [("-relocation-model=" ++ rmodel
,"-relocation-model=" ++ rmodel) | not (null rmodel)]
++ [("-stack-alignment=" ++ (show align)
,"-stack-alignment=" ++ (show align)) | align > 0 ]
++ [("", "-... | 2,445 | true | true | 51 | 14 | 820 | 552 | 290 | 262 | null | null |
atodorov/bdcs | src/tools/inspect/Utils/KeyVal.hs | lgpl-2.1 | formatKeyValList :: [KeyVal] -> String
formatKeyValList [] = "" | 64 | formatKeyValList :: [KeyVal] -> String
formatKeyValList [] = "" | 64 | formatKeyValList [] = "" | 25 | false | true | 0 | 6 | 9 | 23 | 12 | 11 | null | null |
forste/haReFork | refactorer/PwPf/PwPfConversion.hs | bsd-3-clause | getVars (Fst t) = getVars t | 29 | getVars (Fst t) = getVars t | 29 | getVars (Fst t) = getVars t | 29 | false | false | 0 | 7 | 7 | 18 | 8 | 10 | null | null |
ibabushkin/wormbot | src/Defaults.hs | gpl-3.0 | -- nickserv password to use
password :: Text
password = "wormsmakegreatpasswords" | 81 | password :: Text
password = "wormsmakegreatpasswords" | 53 | password = "wormsmakegreatpasswords" | 36 | true | true | 0 | 4 | 10 | 12 | 7 | 5 | null | null |
jotrk/xhb-ewmh | src/Graphics/XHB/Ewmh/Error.hs | bsd-2-clause | -----------------------------------
-- Application Window Properties --
-----------------------------------
getNetWmName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]
getNetWmName c w = E.getNetWmName c w >>= eitherToError | 233 | getNetWmName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]
getNetWmName c w = E.getNetWmName c w >>= eitherToError | 124 | getNetWmName c w = E.getNetWmName c w >>= eitherToError | 55 | true | true | 0 | 9 | 27 | 51 | 26 | 25 | null | null |
jmct/IterativeCompiler | frontend/LambdaLift.hs | mit | --Take all lambda abstractions and make them into let-bindings
abstract :: AnProgram -> CoreProgram
abstract prog = [ (name, args, abstractExpr rhs) | (name, args, rhs) <- prog ] | 179 | abstract :: AnProgram -> CoreProgram
abstract prog = [ (name, args, abstractExpr rhs) | (name, args, rhs) <- prog ] | 115 | abstract prog = [ (name, args, abstractExpr rhs) | (name, args, rhs) <- prog ] | 78 | true | true | 0 | 8 | 29 | 51 | 29 | 22 | null | null |
lukexi/text-gl | test/TestBufferScroll.hs | bsd-2-clause | handleEvents :: (MonadState TextRenderer m, MonadIO m) => Window -> [Event] -> M44 GLfloat -> M44 GLfloat -> m ()
handleEvents win events projM44 modelM44 = do
-- Update the text renderer if needed from file changes
refreshTextRendererFromFile id
-- Get mouse/keyboard/OS events from GLFW
forM_ events $... | 465 | handleEvents :: (MonadState TextRenderer m, MonadIO m) => Window -> [Event] -> M44 GLfloat -> M44 GLfloat -> m ()
handleEvents win events projM44 modelM44 = do
-- Update the text renderer if needed from file changes
refreshTextRendererFromFile id
-- Get mouse/keyboard/OS events from GLFW
forM_ events $... | 465 | handleEvents win events projM44 modelM44 = do
-- Update the text renderer if needed from file changes
refreshTextRendererFromFile id
-- Get mouse/keyboard/OS events from GLFW
forM_ events $ \e -> do
_ <- handleTextBufferEvent win e id
_ <- handleTextBufferMouseEvent win e id projM44 mod... | 351 | false | true | 0 | 12 | 108 | 132 | 62 | 70 | null | null |
tsuraan/optimal-blocks | src/Main.hs | bsd-3-clause | main :: IO ()
main = do
(args, paths) <- parseArgs `fmap` getArgs
results <- doFiles args paths
case argOutHtml args of
Nothing -> prtText args results
Just output -> prtHtml output args results | 208 | main :: IO ()
main = do
(args, paths) <- parseArgs `fmap` getArgs
results <- doFiles args paths
case argOutHtml args of
Nothing -> prtText args results
Just output -> prtHtml output args results | 208 | main = do
(args, paths) <- parseArgs `fmap` getArgs
results <- doFiles args paths
case argOutHtml args of
Nothing -> prtText args results
Just output -> prtHtml output args results | 194 | false | true | 0 | 10 | 47 | 84 | 40 | 44 | null | null |
donatello/minio-hs | src/Network/Minio/PutObject.hs | apache-2.0 | -- ^ Pass size in bytes as maybe if known.
-- | Put an object from ObjectData. This high-level API handles
-- objects of all sizes, and even if the object size is unknown.
putObjectInternal :: Bucket -> Object -> ObjectData Minio -> Minio ETag
putObjectInternal b o (ODStream src sizeMay) = sequentialMultipartUpload b ... | 333 | putObjectInternal :: Bucket -> Object -> ObjectData Minio -> Minio ETag
putObjectInternal b o (ODStream src sizeMay) = sequentialMultipartUpload b o sizeMay src | 160 | putObjectInternal b o (ODStream src sizeMay) = sequentialMultipartUpload b o sizeMay src | 88 | true | true | 0 | 8 | 57 | 56 | 28 | 28 | null | null |
beni55/text | Data/Text/Lazy.hs | bsd-2-clause | -- | /O(n)/ Breaks a 'Text' up into a list of 'Text's at
-- newline 'Char's. The resulting strings do not contain newlines.
lines :: Text -> [Text]
lines Empty = [] | 164 | lines :: Text -> [Text]
lines Empty = [] | 40 | lines Empty = [] | 16 | true | true | 0 | 6 | 31 | 29 | 15 | 14 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |'VU.enumFromStepN'
vu_enumFromStepN = VU.enumFromStepN | 58 | vu_enumFromStepN = VU.enumFromStepN | 35 | vu_enumFromStepN = VU.enumFromStepN | 35 | true | false | 0 | 5 | 4 | 9 | 5 | 4 | null | null |
haasn/vimus | src/Vimus/Command.hs | mit | commandNames :: [String]
commandNames = Map.keys commandMap | 59 | commandNames :: [String]
commandNames = Map.keys commandMap | 59 | commandNames = Map.keys commandMap | 34 | false | true | 0 | 6 | 6 | 19 | 10 | 9 | null | null |
rmcmaho/Haskell_OpenGL_Examples | TriSelect/TriSelect_Display.hs | gpl-3.0 | getHeadRecord (Just []) = -1 | 28 | getHeadRecord (Just []) = -1 | 28 | getHeadRecord (Just []) = -1 | 28 | false | false | 0 | 8 | 4 | 19 | 9 | 10 | null | null |
dylex/hsaml2 | SAML2/XML/Canonical.hs | apache-2.0 | canonicalize :: CanonicalizationAlgorithm -> Maybe InclusiveNamespaces -> Maybe String -> HXT.XmlTree -> IO BS.ByteString
canonicalize a i s =
LibXML2.c14n (cm a) (inclusiveNamespacesPrefixList <$> i) (canonicalWithComments a) s
<=< LibXML2.fromXmlTrees . getChildren where
cm CanonicalXML10{} = LibXML2.C14N_1_0... | 416 | canonicalize :: CanonicalizationAlgorithm -> Maybe InclusiveNamespaces -> Maybe String -> HXT.XmlTree -> IO BS.ByteString
canonicalize a i s =
LibXML2.c14n (cm a) (inclusiveNamespacesPrefixList <$> i) (canonicalWithComments a) s
<=< LibXML2.fromXmlTrees . getChildren where
cm CanonicalXML10{} = LibXML2.C14N_1_0... | 416 | canonicalize a i s =
LibXML2.c14n (cm a) (inclusiveNamespacesPrefixList <$> i) (canonicalWithComments a) s
<=< LibXML2.fromXmlTrees . getChildren where
cm CanonicalXML10{} = LibXML2.C14N_1_0
cm CanonicalXML11{} = LibXML2.C14N_1_1
cm CanonicalXMLExcl10{} = LibXML2.C14N_EXCLUSIVE_1_0 | 294 | false | true | 3 | 10 | 56 | 136 | 66 | 70 | null | null |
facebookincubator/duckling | Duckling/Numeral/SK/Rules.hs | bsd-3-clause | ruleInteger2 :: Rule
ruleInteger2 = Rule
{ name = "integer (20..90)"
, pattern =
[ regex "((dva|tri|štyri)dsať|(päť|šesť|sedem|osem|devät)desiat)"
]
, prod = \case
(Token RegexMatch (GroupMatch (match:_)):_) ->
HashMap.lookup (Text.toLower match) dozenMap >>= integer
_ -> Nothing
} | 318 | ruleInteger2 :: Rule
ruleInteger2 = Rule
{ name = "integer (20..90)"
, pattern =
[ regex "((dva|tri|štyri)dsať|(päť|šesť|sedem|osem|devät)desiat)"
]
, prod = \case
(Token RegexMatch (GroupMatch (match:_)):_) ->
HashMap.lookup (Text.toLower match) dozenMap >>= integer
_ -> Nothing
} | 318 | ruleInteger2 = Rule
{ name = "integer (20..90)"
, pattern =
[ regex "((dva|tri|štyri)dsať|(päť|šesť|sedem|osem|devät)desiat)"
]
, prod = \case
(Token RegexMatch (GroupMatch (match:_)):_) ->
HashMap.lookup (Text.toLower match) dozenMap >>= integer
_ -> Nothing
} | 297 | false | true | 0 | 17 | 72 | 99 | 52 | 47 | null | null |
shockkolate/containers | Data/IntSet/Base.hs | bsd-3-clause | -- | /O(n)/. A strict version of 'foldr'. Each application of the operator is
-- evaluated before using the result in the next application. This
-- function is strict in the starting value.
foldr' :: (Key -> b -> b) -> b -> IntSet -> b
foldr' f z = \t -> -- Use lambda t to be inlinable with two arguments only.
c... | 622 | foldr' :: (Key -> b -> b) -> b -> IntSet -> b
foldr' f z = \t -> -- Use lambda t to be inlinable with two arguments only.
case t of Bin _ m l r | m < 0 -> go (go z l) r -- put negative numbers before
| otherwise -> go (go z r) l
_ -> go z t
where
STRICT_1_OF_2(go)
go... | 432 | foldr' f z = \t -> -- Use lambda t to be inlinable with two arguments only.
case t of Bin _ m l r | m < 0 -> go (go z l) r -- put negative numbers before
| otherwise -> go (go z r) l
_ -> go z t
where
STRICT_1_OF_2(go)
go z' Nil = z'
go z' (Tip kx bm) ... | 386 | true | true | 2 | 12 | 203 | 204 | 102 | 102 | null | null |
adolenc/AlexanderTheGreat | src/Artist.hs | mit | generateTangle' (i:is) = case i of Twist -> (twist currentTangle orientation, orientation)
Antitwist -> (antitwist currentTangle orientation, orientation)
Rotate -> (currentTangle, rotate orientation)
... | 787 | generateTangle' (i:is) = case i of Twist -> (twist currentTangle orientation, orientation)
Antitwist -> (antitwist currentTangle orientation, orientation)
Rotate -> (currentTangle, rotate orientation)
... | 787 | generateTangle' (i:is) = case i of Twist -> (twist currentTangle orientation, orientation)
Antitwist -> (antitwist currentTangle orientation, orientation)
Rotate -> (currentTangle, rotate orientation)
... | 787 | false | false | 0 | 9 | 308 | 112 | 58 | 54 | null | null |
SteffenMichels/IHPMC | src/Parser.hs | mit | term = AST.ConstantExpr <$> constantExpression
<|> uncurry AST.PFunc <$> pFunc expression
<|> AST.Variable . AST.VarName . T.pack <$> variable | 197 | term = AST.ConstantExpr <$> constantExpression
<|> uncurry AST.PFunc <$> pFunc expression
<|> AST.Variable . AST.VarName . T.pack <$> variable | 197 | term = AST.ConstantExpr <$> constantExpression
<|> uncurry AST.PFunc <$> pFunc expression
<|> AST.Variable . AST.VarName . T.pack <$> variable | 197 | false | false | 7 | 8 | 73 | 60 | 28 | 32 | null | null |
krakrjak/ImplicitCAD | Graphics/Implicit/Export/Symbolic/CoerceSymbolic2.hs | agpl-3.0 | coerceSymbolic2 (PolygonR r points) = polygonR r points | 55 | coerceSymbolic2 (PolygonR r points) = polygonR r points | 55 | coerceSymbolic2 (PolygonR r points) = polygonR r points | 55 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
rvion/ride | jetpack/src/Codec/Archive/Tar/AsTar.hs | bsd-3-clause | -- constructor :: HeaderBadNumericEncoding
tar_mk'HeaderBadNumericEncoding = I.HeaderBadNumericEncoding | 104 | tar_mk'HeaderBadNumericEncoding = I.HeaderBadNumericEncoding | 61 | tar_mk'HeaderBadNumericEncoding = I.HeaderBadNumericEncoding | 61 | true | false | 0 | 5 | 7 | 9 | 5 | 4 | null | null |
meiersi/psqueues-old | examples/LRUCache.hs | bsd-3-clause | size :: LRUCache v -> Int
size = IntPSQ.size . lrucPsq | 54 | size :: LRUCache v -> Int
size = IntPSQ.size . lrucPsq | 54 | size = IntPSQ.size . lrucPsq | 28 | false | true | 1 | 7 | 10 | 32 | 13 | 19 | null | null |
alanz/hroq | src/Data/Concurrent/Queue/Roq/StatsGatherer.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- API --
--------------------------------------------------------------------------------
-- -------------------------------------
{-
publish_queue_stats(QueueName, S... | 779 | publish_queue_stats :: ProcessId -> QName -> QStats -> Process ()
publish_queue_stats pid qname stats = do
-- pid <- getServerPid
sid <- getSelfPid
cast pid (PublishQueueStats qname stats sid)
-- -------------------------------------
{-
publish_consumer_stats(ConsName, Stats)->
gen_server:cast(?MODULE, {publ... | 369 | publish_queue_stats pid qname stats = do
-- pid <- getServerPid
sid <- getSelfPid
cast pid (PublishQueueStats qname stats sid)
-- -------------------------------------
{-
publish_consumer_stats(ConsName, Stats)->
gen_server:cast(?MODULE, {publish_consumer_stats, ConsName, self(), Stats}).
-} | 303 | true | true | 0 | 10 | 142 | 73 | 37 | 36 | null | null |
valderman/dpress | DissociatedPress/Core.hs | mit | isKeyIn :: Hashable a => [a] -> Dictionary a -> Bool
k `isKeyIn` d = case N.lookup k' (dict d) of
Nothing -> N.lookup k' (dict2 d) /= Nothing
_ -> True
where
k' = map hash k
-- | Generates text using a randomly selected key | 245 | isKeyIn :: Hashable a => [a] -> Dictionary a -> Bool
k `isKeyIn` d = case N.lookup k' (dict d) of
Nothing -> N.lookup k' (dict2 d) /= Nothing
_ -> True
where
k' = map hash k
-- | Generates text using a randomly selected key | 245 | k `isKeyIn` d = case N.lookup k' (dict d) of
Nothing -> N.lookup k' (dict2 d) /= Nothing
_ -> True
where
k' = map hash k
-- | Generates text using a randomly selected key | 192 | false | true | 1 | 11 | 68 | 110 | 51 | 59 | null | null |
lukaramu/yarn | src/Main.hs | mit | fromLookupError (OptionError c) = c | 37 | fromLookupError (OptionError c) = c | 37 | fromLookupError (OptionError c) = c | 37 | false | false | 0 | 7 | 6 | 15 | 7 | 8 | null | null |
grnet/snf-ganeti | src/Ganeti/JQueue.hs | bsd-2-clause | archiveJobs :: ConfigData -- ^ cluster configuration
-> Int -- ^ time the job has to be in the past in order
-- to be archived
-> Int -- ^ timeout
-> [JobId] -- ^ jobs to consider
-> IO (Int, Int)
archiveJobs cfg age timeout jids = do
... | 873 | archiveJobs :: ConfigData -- ^ cluster configuration
-> Int -- ^ time the job has to be in the past in order
-- to be archived
-> Int -- ^ timeout
-> [JobId] -- ^ jobs to consider
-> IO (Int, Int)
archiveJobs cfg age timeout jids = do
... | 873 | archiveJobs cfg age timeout jids = do
now <- getClockTime
qDir <- queueDir
let endtime = addToClockTime (noTimeDiff { tdSec = timeout }) now
cuttime = if age < 0 then noTimestamp
else advanceTimestamp (- age) (fromClockTime now)
mcs = Config.getMasterCandidates cfg
rep... | 592 | false | true | 0 | 17 | 293 | 230 | 115 | 115 | null | null |
begriffs/optparse-applicative | Options/Applicative/Help/Types.hs | bsd-3-clause | -- | Convert a help text to 'String'.
renderHelp :: Int -> ParserHelp -> String
renderHelp cols
= (`displayS` "")
. renderPretty 1.0 cols
. helpText | 154 | renderHelp :: Int -> ParserHelp -> String
renderHelp cols
= (`displayS` "")
. renderPretty 1.0 cols
. helpText | 116 | renderHelp cols
= (`displayS` "")
. renderPretty 1.0 cols
. helpText | 74 | true | true | 2 | 6 | 31 | 45 | 23 | 22 | null | null |
tpsinnem/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | highestFC (PElabError _) = Nothing | 43 | highestFC (PElabError _) = Nothing | 43 | highestFC (PElabError _) = Nothing | 43 | false | false | 0 | 7 | 13 | 15 | 7 | 8 | null | null |
arianvp/ghcjs-hom | src/Hom/App.hs | mit | external :: a -> IO (IO a, a -> IO ())
external action = do
ref <- newMVar action
return (takeMVar ref, putMVar ref) | 120 | external :: a -> IO (IO a, a -> IO ())
external action = do
ref <- newMVar action
return (takeMVar ref, putMVar ref) | 120 | external action = do
ref <- newMVar action
return (takeMVar ref, putMVar ref) | 81 | false | true | 0 | 10 | 27 | 67 | 31 | 36 | null | null |
reinh/Hask8080 | src/Hask8080/Instructions.hs | mit | rlc = error "fatal: rlc not yet implemented" | 52 | rlc = error "fatal: rlc not yet implemented" | 52 | rlc = error "fatal: rlc not yet implemented" | 52 | false | false | 0 | 5 | 15 | 9 | 4 | 5 | null | null |
diagrams/diagrams-contrib | src/Diagrams/Color/XKCD.hs | bsd-3-clause | purpleGrey = fromJust $ readHexColor "#866f85" | 57 | purpleGrey = fromJust $ readHexColor "#866f85" | 57 | purpleGrey = fromJust $ readHexColor "#866f85" | 57 | false | false | 0 | 6 | 16 | 13 | 6 | 7 | null | null |
ocramz/sparse-linear-algebra | src/Control/Iterative/Internal.hs | gpl-3.0 | liftIterativeT :: Monad m => m a -> IterativeT c msg s m a
liftIterativeT m = IterativeT . lift . lift $ LoggingT mlog
where mlog = ReaderT (const m) | 151 | liftIterativeT :: Monad m => m a -> IterativeT c msg s m a
liftIterativeT m = IterativeT . lift . lift $ LoggingT mlog
where mlog = ReaderT (const m) | 151 | liftIterativeT m = IterativeT . lift . lift $ LoggingT mlog
where mlog = ReaderT (const m) | 92 | false | true | 0 | 7 | 32 | 71 | 33 | 38 | null | null |
bch29/robo-monad | demo/WallHugger.hs | gpl-3.0 | myScan ∷ ScanData → WallHugger ()
myScan (ScanData dist ang) = do
pos <- getPosition
enemyPos .= (Just $ vec (dist * cos ang) (dist * sin ang) + pos)
return () | 165 | myScan ∷ ScanData → WallHugger ()
myScan (ScanData dist ang) = do
pos <- getPosition
enemyPos .= (Just $ vec (dist * cos ang) (dist * sin ang) + pos)
return () | 165 | myScan (ScanData dist ang) = do
pos <- getPosition
enemyPos .= (Just $ vec (dist * cos ang) (dist * sin ang) + pos)
return () | 131 | false | true | 0 | 14 | 37 | 89 | 42 | 47 | null | null |
santolucito/haste-compiler | src/Haste/Environment.hs | bsd-3-clause | -- | Was Haste built in portable mode or not?
portableHaste :: Bool
portableHaste = True | 88 | portableHaste :: Bool
portableHaste = True | 42 | portableHaste = True | 20 | true | true | 0 | 4 | 15 | 12 | 7 | 5 | null | null |
randen/cabal | Cabal/Distribution/Simple/BuildTarget.hs | bsd-3-clause | tryEach :: [a] -> Match a
tryEach = exactMatches | 48 | tryEach :: [a] -> Match a
tryEach = exactMatches | 48 | tryEach = exactMatches | 22 | false | true | 0 | 6 | 8 | 21 | 11 | 10 | null | null |
luebbers/reconos | tools/fsmLanguage/kurm/assembler/Ast.hs | gpl-3.0 | subc s t d = Subc s t d | 25 | subc s t d = Subc s t d | 25 | subc s t d = Subc s t d | 25 | false | false | 0 | 5 | 10 | 20 | 9 | 11 | null | null |
anton-dessiatov/stack | src/Stack/Types/Version.hs | bsd-3-clause | -- | Get a string representation of a package version.
versionText :: Version -> Text
versionText (Version v) =
T.intercalate
"."
(map (T.pack . show)
(V.toList v)) | 183 | versionText :: Version -> Text
versionText (Version v) =
T.intercalate
"."
(map (T.pack . show)
(V.toList v)) | 128 | versionText (Version v) =
T.intercalate
"."
(map (T.pack . show)
(V.toList v)) | 97 | true | true | 0 | 10 | 45 | 57 | 29 | 28 | null | null |
gibiansky/jupyter-haskell | src/Jupyter/UUID.hs | mit | -- | Generate a list of random UUIDs.
randoms :: Int -- ^ Number of UUIDs to generate.
-> IO [UUID]
randoms n = replicateM n random | 144 | randoms :: Int -- ^ Number of UUIDs to generate.
-> IO [UUID]
randoms n = replicateM n random | 106 | randoms n = replicateM n random | 31 | true | true | 0 | 8 | 39 | 37 | 17 | 20 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | threateningly = id | 18 | threateningly = id | 18 | threateningly = id | 18 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
chreekat/snowdrift | SnowdriftEmailDaemon.hs | agpl-3.0 | sendUserNotification :: (MonadBaseControl IO m, MonadIO m, MonadLogger m)
=> FileName -> FileName -> PostgresConf
-> PersistConfigPool PostgresConf -> Email -> Email
-> UTCTime -> UserNotificationType -> UserId -> Markdown
-> m ()
sendU... | 875 | sendUserNotification :: (MonadBaseControl IO m, MonadIO m, MonadLogger m)
=> FileName -> FileName -> PostgresConf
-> PersistConfigPool PostgresConf -> Email -> Email
-> UTCTime -> UserNotificationType -> UserId -> Markdown
-> m ()
sendU... | 875 | sendUserNotification sendmail_exec sendmail_file dbConf poolConf notif_email
user_email ts notif_type to content = do
let content' = unMarkdown content
handleSendmail sendmail_exec sendmail_file dbConf poolConf
("sending a user notification to " <> user_email <> "\n" <> content')
... | 560 | false | true | 0 | 17 | 244 | 183 | 90 | 93 | null | null |
BartAdv/clientsession | src/Web/ClientSession.hs | bsd-2-clause | threshold :: Int
threshold = 100000 | 35 | threshold :: Int
threshold = 100000 | 35 | threshold = 100000 | 18 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
cbrghostrider/Hacking | HackerRank/Mathematics/Probability/bdayGift.hs | mit | main :: IO ()
main = do
nstr <- getContents
let ns = map read . tail . lines $ nstr
putStrLn . printf "%.1f\n" $ computeExpectedValue ns | 142 | main :: IO ()
main = do
nstr <- getContents
let ns = map read . tail . lines $ nstr
putStrLn . printf "%.1f\n" $ computeExpectedValue ns | 142 | main = do
nstr <- getContents
let ns = map read . tail . lines $ nstr
putStrLn . printf "%.1f\n" $ computeExpectedValue ns | 128 | false | true | 0 | 14 | 33 | 70 | 30 | 40 | null | null |
oldmanmike/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | nlHsOpApp :: LHsExpr id -> id -> LHsExpr id -> LHsExpr id
nlHsOpApp e1 op e2 = noLoc (mkHsOpApp e1 op e2) | 105 | nlHsOpApp :: LHsExpr id -> id -> LHsExpr id -> LHsExpr id
nlHsOpApp e1 op e2 = noLoc (mkHsOpApp e1 op e2) | 105 | nlHsOpApp e1 op e2 = noLoc (mkHsOpApp e1 op e2) | 47 | false | true | 0 | 8 | 21 | 57 | 25 | 32 | null | null |
recursion-ninja/megaparsec | tests/Text/Megaparsec/StreamSpec.hs | bsd-2-clause | bproxy :: Proxy B.ByteString
bproxy = Proxy | 43 | bproxy :: Proxy B.ByteString
bproxy = Proxy | 43 | bproxy = Proxy | 14 | false | true | 1 | 6 | 6 | 20 | 8 | 12 | null | null |
verement/etamoo | src/MOO/Unparser.hs | bsd-3-clause | unparseNameExpr :: Expr -> Unparser Builder
unparseNameExpr (Literal (Str name))
| isIdentifier name = return (Str.toBuilder name) | 132 | unparseNameExpr :: Expr -> Unparser Builder
unparseNameExpr (Literal (Str name))
| isIdentifier name = return (Str.toBuilder name) | 132 | unparseNameExpr (Literal (Str name))
| isIdentifier name = return (Str.toBuilder name) | 88 | false | true | 0 | 9 | 18 | 53 | 24 | 29 | null | null |
bitemyapp/wreq | Network/Wreq/Cache.hs | bsd-3-clause | parseCacheResponse :: A.Parser [CacheResponse Seconds]
parseCacheResponse = commaSep1 body
where
body = "public" *> pure Public
<|> "private" *> (Private <$> (eq headerNames <|> pure []))
<|> "no-cache" *> (NoCache <$> (eq headerNames <|> pure []))
<|> "no-store" *> pure NoStore
<|> "n... | 793 | parseCacheResponse :: A.Parser [CacheResponse Seconds]
parseCacheResponse = commaSep1 body
where
body = "public" *> pure Public
<|> "private" *> (Private <$> (eq headerNames <|> pure []))
<|> "no-cache" *> (NoCache <$> (eq headerNames <|> pure []))
<|> "no-store" *> pure NoStore
<|> "n... | 793 | parseCacheResponse = commaSep1 body
where
body = "public" *> pure Public
<|> "private" *> (Private <$> (eq headerNames <|> pure []))
<|> "no-cache" *> (NoCache <$> (eq headerNames <|> pure []))
<|> "no-store" *> pure NoStore
<|> "no-transform" *> pure NoTransform
<|> "must-reval... | 738 | false | true | 46 | 10 | 186 | 342 | 162 | 180 | null | null |
egaburov/funstuff | Haskell/BartoszBofH/8_Parser/parser.hs | apache-2.0 | accept :: [Token] -> [Token]
accept [] = error "Nothing to accept" | 66 | accept :: [Token] -> [Token]
accept [] = error "Nothing to accept" | 66 | accept [] = error "Nothing to accept" | 37 | false | true | 0 | 6 | 11 | 29 | 15 | 14 | null | null |
VinylRecords/Vinyl | Data/Vinyl/CoRec.hs | mit | firstField v@(x :& _) = coRecTraverse getCompose $ foldRec aux (CoRec x) v
where aux :: CoRec (Maybe :. f) (t ': ts)
-> CoRec (Maybe :. f) (t ': ts)
-> CoRec (Maybe :. f) (t ': ts)
aux c@(CoRec (Compose (Just _))) _ = c
aux _ c = c
-- | Similar to 'Data.Monoid.Last': find the... | 357 | firstField v@(x :& _) = coRecTraverse getCompose $ foldRec aux (CoRec x) v
where aux :: CoRec (Maybe :. f) (t ': ts)
-> CoRec (Maybe :. f) (t ': ts)
-> CoRec (Maybe :. f) (t ': ts)
aux c@(CoRec (Compose (Just _))) _ = c
aux _ c = c
-- | Similar to 'Data.Monoid.Last': find the... | 357 | firstField v@(x :& _) = coRecTraverse getCompose $ foldRec aux (CoRec x) v
where aux :: CoRec (Maybe :. f) (t ': ts)
-> CoRec (Maybe :. f) (t ': ts)
-> CoRec (Maybe :. f) (t ': ts)
aux c@(CoRec (Compose (Just _))) _ = c
aux _ c = c
-- | Similar to 'Data.Monoid.Last': find the... | 357 | false | false | 13 | 13 | 109 | 160 | 83 | 77 | null | null |
nvasilakis/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | pQ :: TagParser Inlines
pQ = do
context <- asks quoteContext
let quoteType = case context of
InDoubleQuote -> SingleQuote
_ -> DoubleQuote
let innerQuoteContext = if quoteType == SingleQuote
then InSingleQuote
... | 578 | pQ :: TagParser Inlines
pQ = do
context <- asks quoteContext
let quoteType = case context of
InDoubleQuote -> SingleQuote
_ -> DoubleQuote
let innerQuoteContext = if quoteType == SingleQuote
then InSingleQuote
... | 578 | pQ = do
context <- asks quoteContext
let quoteType = case context of
InDoubleQuote -> SingleQuote
_ -> DoubleQuote
let innerQuoteContext = if quoteType == SingleQuote
then InSingleQuote
else InDoubl... | 554 | false | true | 0 | 14 | 237 | 120 | 55 | 65 | null | null |
gridaphobe/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isRigidTy :: TcType -> Bool
isRigidTy ty
| Just (tc,_) <- tcSplitTyConApp_maybe ty = isGenerativeTyCon tc Nominal
| Just {} <- tcSplitAppTy_maybe ty = True
| isForAllTy ty = True
| otherwise = False | 269 | isRigidTy :: TcType -> Bool
isRigidTy ty
| Just (tc,_) <- tcSplitTyConApp_maybe ty = isGenerativeTyCon tc Nominal
| Just {} <- tcSplitAppTy_maybe ty = True
| isForAllTy ty = True
| otherwise = False | 269 | isRigidTy ty
| Just (tc,_) <- tcSplitTyConApp_maybe ty = isGenerativeTyCon tc Nominal
| Just {} <- tcSplitAppTy_maybe ty = True
| isForAllTy ty = True
| otherwise = False | 241 | false | true | 2 | 10 | 104 | 90 | 41 | 49 | null | null |
ralphmorton/Mimir | src/Mimir/Bitfinex.hs | bsd-3-clause | orderTypeSide MARKET_BUY = "buy" | 32 | orderTypeSide MARKET_BUY = "buy" | 32 | orderTypeSide MARKET_BUY = "buy" | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
DougBurke/swish | src/Swish/RDF/Graph.hs | lgpl-2.1 | toDayFormat :: T.Text -> Maybe Day
toDayFormat = toTimeFormat "%F" . T.unpack | 77 | toDayFormat :: T.Text -> Maybe Day
toDayFormat = toTimeFormat "%F" . T.unpack | 77 | toDayFormat = toTimeFormat "%F" . T.unpack | 42 | false | true | 0 | 7 | 11 | 35 | 15 | 20 | null | null |
jjst/euler-haskell | Euler.hs | mit | minus xs [] = xs | 16 | minus xs [] = xs | 16 | minus xs [] = xs | 16 | false | false | 0 | 6 | 4 | 14 | 6 | 8 | null | null |
energyflowanalysis/efa-2.1 | sandbox/makestub/Main.hs | bsd-3-clause | makeNodeDecls :: DotGraph String -> [Decl]
makeNodeDecls g = [typeDecl nodeStr ns, definitions nodeStr ns]
where ns = map (Ident . fst) (getNodes g) | 150 | makeNodeDecls :: DotGraph String -> [Decl]
makeNodeDecls g = [typeDecl nodeStr ns, definitions nodeStr ns]
where ns = map (Ident . fst) (getNodes g) | 150 | makeNodeDecls g = [typeDecl nodeStr ns, definitions nodeStr ns]
where ns = map (Ident . fst) (getNodes g) | 107 | false | true | 1 | 8 | 25 | 75 | 34 | 41 | null | null |
balajisivaraman/haskell-book-work | src/Ch7.hs | mit | g :: (a -> b) -> (a, c) -> (b, c)
g f2 (a, c) = (f2 a, c) | 57 | g :: (a -> b) -> (a, c) -> (b, c)
g f2 (a, c) = (f2 a, c) | 57 | g f2 (a, c) = (f2 a, c) | 23 | false | true | 0 | 9 | 18 | 64 | 34 | 30 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Doxygenlua.hs | gpl-2.0 | regex_'5c'5c'28'3c'7c'3e'29 = compileRegex True "\\\\(<|>)" | 59 | regex_'5c'5c'28'3c'7c'3e'29 = compileRegex True "\\\\(<|>)" | 59 | regex_'5c'5c'28'3c'7c'3e'29 = compileRegex True "\\\\(<|>)" | 59 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
airobert/yices_haskell | Math/SMT/Yices/Syntax.hs | bsd-3-clause | showStringsSepBy = showListSepByWith showString | 47 | showStringsSepBy = showListSepByWith showString | 47 | showStringsSepBy = showListSepByWith showString | 47 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
tomberek/rulestesting | src/Control/Arrow/CCA/AExp.hs | bsd-3-clause | lftE = appE [|lft|] | 19 | lftE = appE [|lft|] | 19 | lftE = appE [|lft|] | 19 | false | false | 1 | 5 | 3 | 16 | 7 | 9 | null | null |
bennofs/dynamic-cabal | src/Distribution/Client/Dynamic/PackageDescription.hs | bsd-3-clause | _cSources :: Functor f => ([String] -> f [String]) -> Target -> f Target
_cSources f t = f (cSources t) <&> \cs -> t { cSources = cs } | 134 | _cSources :: Functor f => ([String] -> f [String]) -> Target -> f Target
_cSources f t = f (cSources t) <&> \cs -> t { cSources = cs } | 134 | _cSources f t = f (cSources t) <&> \cs -> t { cSources = cs } | 61 | false | true | 0 | 10 | 29 | 76 | 39 | 37 | null | null |
crackleware/hscolour | Language/Haskell/HsColour/Classify.hs | gpl-2.0 | -- get rid of DOS newline stuff
chunk ('\n':s) = "\n": chunk s | 62 | chunk ('\n':s) = "\n": chunk s | 30 | chunk ('\n':s) = "\n": chunk s | 30 | true | false | 0 | 6 | 12 | 25 | 12 | 13 | null | null |
vito/atomo | src/Atomo/Parser/Expand.hs | bsd-3-clause | doPragmas (ETop {}) = return () | 31 | doPragmas (ETop {}) = return () | 31 | doPragmas (ETop {}) = return () | 31 | false | false | 0 | 7 | 5 | 21 | 10 | 11 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/TargetingTemplates/List.hs | mpl-2.0 | -- | Value of the nextPageToken from the previous result page.
ttlPageToken :: Lens' TargetingTemplatesList (Maybe Text)
ttlPageToken
= lens _ttlPageToken (\ s a -> s{_ttlPageToken = a}) | 188 | ttlPageToken :: Lens' TargetingTemplatesList (Maybe Text)
ttlPageToken
= lens _ttlPageToken (\ s a -> s{_ttlPageToken = a}) | 125 | ttlPageToken
= lens _ttlPageToken (\ s a -> s{_ttlPageToken = a}) | 67 | true | true | 1 | 9 | 29 | 50 | 25 | 25 | null | null |
plow-technologies/persistent | persistent-test/src/EmbedOrderTest.hs | mit | debug :: Show s => s -> s
debug x = trace (show x) x | 52 | debug :: Show s => s -> s
debug x = trace (show x) x | 52 | debug x = trace (show x) x | 26 | false | true | 0 | 8 | 14 | 42 | 18 | 24 | null | null |
sopvop/bytestring-flatmap | src/Data/ByteString/FlatSet.hs | bsd-3-clause | union :: FlatSet -> FlatSet -> FlatSet
union left right
| null left = right
| null right = left
| otherwise = unsafeFromAscVector mergeVec
where
lvec = toVector left
rvec = toVector right
sz = V.length lvec + V.length rvec
mergeVec = V.unfoldrN sz go (Left (lvec, rvec))
go (Left (l, r))
... | 825 | union :: FlatSet -> FlatSet -> FlatSet
union left right
| null left = right
| null right = left
| otherwise = unsafeFromAscVector mergeVec
where
lvec = toVector left
rvec = toVector right
sz = V.length lvec + V.length rvec
mergeVec = V.unfoldrN sz go (Left (lvec, rvec))
go (Left (l, r))
... | 825 | union left right
| null left = right
| null right = left
| otherwise = unsafeFromAscVector mergeVec
where
lvec = toVector left
rvec = toVector right
sz = V.length lvec + V.length rvec
mergeVec = V.unfoldrN sz go (Left (lvec, rvec))
go (Left (l, r))
| V.null l = go (Right r)
| V.n... | 786 | false | true | 3 | 16 | 300 | 396 | 185 | 211 | null | null |
mcschroeder/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | tickishPlace SourceNote{} = PlaceNonLam | 40 | tickishPlace SourceNote{} = PlaceNonLam | 40 | tickishPlace SourceNote{} = PlaceNonLam | 40 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M11/D28/Solution.hs | mit | main' _ = putStrLn (unlines ["","remover <srcId> <artId1> [artId2 ...]","",
"\tRemoves <artIds> associated to <srcId> from the recommendation table.",
""]) | 161 | main' _ = putStrLn (unlines ["","remover <srcId> <artId1> [artId2 ...]","",
"\tRemoves <artIds> associated to <srcId> from the recommendation table.",
""]) | 161 | main' _ = putStrLn (unlines ["","remover <srcId> <artId1> [artId2 ...]","",
"\tRemoves <artIds> associated to <srcId> from the recommendation table.",
""]) | 161 | false | false | 0 | 8 | 25 | 33 | 18 | 15 | null | null |
rodrigogribeiro/mptc | src/Tc/TcSubst.hs | bsd-3-clause | -- merging substitution for matching
merge :: Subst -> Subst -> Maybe Subst
merge s1 s2 = if ok then Just (s1 ++ s2) else Nothing
where
ok = all (\v -> apply s1 v == apply s2 v)
(map fst s1 `intersect` map fst s2)
-- build a subst... | 327 | merge :: Subst -> Subst -> Maybe Subst
merge s1 s2 = if ok then Just (s1 ++ s2) else Nothing
where
ok = all (\v -> apply s1 v == apply s2 v)
(map fst s1 `intersect` map fst s2)
-- build a substitution | 289 | merge s1 s2 = if ok then Just (s1 ++ s2) else Nothing
where
ok = all (\v -> apply s1 v == apply s2 v)
(map fst s1 `intersect` map fst s2)
-- build a substitution | 250 | true | true | 0 | 11 | 139 | 104 | 53 | 51 | null | null |
ekmett/ghc | compiler/main/DriverPhases.hs | bsd-3-clause | isCishSuffix s = s `elem` cish_suffixes | 49 | isCishSuffix s = s `elem` cish_suffixes | 49 | isCishSuffix s = s `elem` cish_suffixes | 49 | false | false | 0 | 5 | 15 | 15 | 8 | 7 | null | null |
EliuX/AdHocParser | src/Text/Parsec/String/Char.hs | bsd-3-clause | hexDigit :: Parser Char
hexDigit = C.hexDigit | 45 | hexDigit :: Parser Char
hexDigit = C.hexDigit | 45 | hexDigit = C.hexDigit | 21 | false | true | 0 | 5 | 6 | 16 | 8 | 8 | null | null |
mrjones/workouts | src/Workouts.hs | mit | headerBarHtml :: User -> User -> H.Html
headerBarHtml loggedInUser displayUser =
H.div ! A.class_ "header" $
-- TODO(mrjones): display special header if loggedIn != display
let name =
if (userId loggedInUser) == (userId displayUser)
then userName loggedInUser
else (userName logge... | 657 | headerBarHtml :: User -> User -> H.Html
headerBarHtml loggedInUser displayUser =
H.div ! A.class_ "header" $
-- TODO(mrjones): display special header if loggedIn != display
let name =
if (userId loggedInUser) == (userId displayUser)
then userName loggedInUser
else (userName logge... | 657 | headerBarHtml loggedInUser displayUser =
H.div ! A.class_ "header" $
-- TODO(mrjones): display special header if loggedIn != display
let name =
if (userId loggedInUser) == (userId displayUser)
then userName loggedInUser
else (userName loggedInUser) ++ " (" ++ (userName displayUse... | 617 | false | true | 0 | 15 | 193 | 217 | 102 | 115 | null | null |
nikki-and-the-robots/nikki | src/LevelServer/Client.hs | lgpl-3.0 | lookupDownloadedLevels :: IO [LevelFile]
lookupDownloadedLevels = do
path <- getDownloadedLevelsPath
mapM (mkUserLevel path . (path </>)) =<< getFiles path (Just ".nl") | 176 | lookupDownloadedLevels :: IO [LevelFile]
lookupDownloadedLevels = do
path <- getDownloadedLevelsPath
mapM (mkUserLevel path . (path </>)) =<< getFiles path (Just ".nl") | 176 | lookupDownloadedLevels = do
path <- getDownloadedLevelsPath
mapM (mkUserLevel path . (path </>)) =<< getFiles path (Just ".nl") | 135 | false | true | 0 | 11 | 28 | 59 | 29 | 30 | null | null |
ml9951/ghc | compiler/hsSyn/HsDecls.hs | bsd-3-clause | hsDeclHasCusk (SynDecl { tcdTyVars = tyvars, tcdRhs = rhs })
= hsTvbAllKinded tyvars && rhs_annotated rhs
where
rhs_annotated (L _ ty) = case ty of
HsParTy lty -> rhs_annotated lty
HsKindSig {} -> True
_ -> False | 250 | hsDeclHasCusk (SynDecl { tcdTyVars = tyvars, tcdRhs = rhs })
= hsTvbAllKinded tyvars && rhs_annotated rhs
where
rhs_annotated (L _ ty) = case ty of
HsParTy lty -> rhs_annotated lty
HsKindSig {} -> True
_ -> False | 250 | hsDeclHasCusk (SynDecl { tcdTyVars = tyvars, tcdRhs = rhs })
= hsTvbAllKinded tyvars && rhs_annotated rhs
where
rhs_annotated (L _ ty) = case ty of
HsParTy lty -> rhs_annotated lty
HsKindSig {} -> True
_ -> False | 250 | false | false | 0 | 9 | 74 | 88 | 43 | 45 | null | null |
laurencer/confluence-sync | vendor/http-streams/lib/Network/Http/Inconvenience.hs | bsd-3-clause | baselineContextSSL :: IO SSLContext
baselineContextSSL = do
ctx <- SSL.context
SSL.contextSetDefaultCiphers ctx
#if defined __MACOSX__
SSL.contextSetVerificationMode ctx SSL.VerifyNone
#elif defined __WINDOWS__
SSL.contextSetVerificationMode ctx SSL.VerifyNone
#else
fedora <- doesDirectoryExist "/et... | 603 | baselineContextSSL :: IO SSLContext
baselineContextSSL = do
ctx <- SSL.context
SSL.contextSetDefaultCiphers ctx
#if defined __MACOSX__
SSL.contextSetVerificationMode ctx SSL.VerifyNone
#elif defined __WINDOWS__
SSL.contextSetVerificationMode ctx SSL.VerifyNone
#else
fedora <- doesDirectoryExist "/et... | 603 | baselineContextSSL = do
ctx <- SSL.context
SSL.contextSetDefaultCiphers ctx
#if defined __MACOSX__
SSL.contextSetVerificationMode ctx SSL.VerifyNone
#elif defined __WINDOWS__
SSL.contextSetVerificationMode ctx SSL.VerifyNone
#else
fedora <- doesDirectoryExist "/etc/pki/tls"
if fedora
the... | 567 | false | true | 0 | 8 | 122 | 52 | 24 | 28 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.