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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TikhonJelvis/array-forth | test/Language/ArrayForth/Test.hs | gpl-3.0 | number = Number <$> arbitrary | 29 | number = Number <$> arbitrary | 29 | number = Number <$> arbitrary | 29 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
SebastianCallh/liu-courses | src/Db/Course.hs | mit | selectCourse :: [Filter Course] -> WithConfig (Maybe (Entity Course))
selectCourse filter = do
course <- runDb $ selectFirst filter []
return course | 152 | selectCourse :: [Filter Course] -> WithConfig (Maybe (Entity Course))
selectCourse filter = do
course <- runDb $ selectFirst filter []
return course | 152 | selectCourse filter = do
course <- runDb $ selectFirst filter []
return course | 82 | false | true | 0 | 11 | 25 | 68 | 30 | 38 | null | null |
nuttycom/haskoin | Network/Haskoin/Block/HeaderChain.hs | unlicense | lastSeenCheckpoint :: BlockHeaderStore m => m (Maybe (Int, BlockHash))
lastSeenCheckpoint =
foldM f Nothing $ reverse checkpointList
where
f res@(Just _) _ = return res
f Nothing (i,chk) = do
existsChk <- existsBlockHeaderNode chk
return $ if existsChk then Just (i,chk) else Nothing
-- ... | 445 | lastSeenCheckpoint :: BlockHeaderStore m => m (Maybe (Int, BlockHash))
lastSeenCheckpoint =
foldM f Nothing $ reverse checkpointList
where
f res@(Just _) _ = return res
f Nothing (i,chk) = do
existsChk <- existsBlockHeaderNode chk
return $ if existsChk then Just (i,chk) else Nothing
-- ... | 445 | lastSeenCheckpoint =
foldM f Nothing $ reverse checkpointList
where
f res@(Just _) _ = return res
f Nothing (i,chk) = do
existsChk <- existsBlockHeaderNode chk
return $ if existsChk then Just (i,chk) else Nothing
-- | Finds the parent of a BlockHeaderNode. Returns an error if a parent
-... | 374 | false | true | 0 | 10 | 98 | 122 | 62 | 60 | null | null |
jstolarek/ghc | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | bsd-3-clause | cmpEq _ = False | 16 | cmpEq _ = False | 16 | cmpEq _ = False | 16 | false | false | 0 | 4 | 4 | 10 | 4 | 6 | null | null |
AlexanderPankiv/ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | numTyLit :: Integer -> TyLitQ
numTyLit n = if n >= 0 then return (NumTyLit n)
else fail ("Negative type-level number: " ++ show n) | 153 | numTyLit :: Integer -> TyLitQ
numTyLit n = if n >= 0 then return (NumTyLit n)
else fail ("Negative type-level number: " ++ show n) | 153 | numTyLit n = if n >= 0 then return (NumTyLit n)
else fail ("Negative type-level number: " ++ show n) | 123 | false | true | 0 | 9 | 47 | 52 | 26 | 26 | null | null |
knrafto/bash-config | src/Bash/Config/Lexer.hs | bsd-3-clause | -- | All normal mode operators.
normalOps :: [String]
normalOps = redirOps ++ heredocOps ++ controlOps | 102 | normalOps :: [String]
normalOps = redirOps ++ heredocOps ++ controlOps | 70 | normalOps = redirOps ++ heredocOps ++ controlOps | 48 | true | true | 0 | 6 | 15 | 23 | 13 | 10 | null | null |
csabahruska/gpipe-quake3 | ShaderParser.hs | bsd-3-clause | int :: Parser Int
int = skipSpace' *> decimal | 45 | int :: Parser Int
int = skipSpace' *> decimal | 45 | int = skipSpace' *> decimal | 27 | false | true | 2 | 6 | 8 | 26 | 11 | 15 | null | null |
zhiyuanshi/fcore | frontend/SymbolicEvaluator.hs | bsd-2-clause | mergeList f (Fork e (Right ts) : xs) = Fork e $ Right [(c, ns, \es -> mergeList f (g es : xs)) | (c,ns,g) <- ts] | 112 | mergeList f (Fork e (Right ts) : xs) = Fork e $ Right [(c, ns, \es -> mergeList f (g es : xs)) | (c,ns,g) <- ts] | 112 | mergeList f (Fork e (Right ts) : xs) = Fork e $ Right [(c, ns, \es -> mergeList f (g es : xs)) | (c,ns,g) <- ts] | 112 | false | false | 0 | 13 | 26 | 90 | 46 | 44 | null | null |
Noeda/rwpas | src/RWPAS/Direction.hs | mit | deltaToDirection8 (V2 (-1) 0) = Just D8Left | 43 | deltaToDirection8 (V2 (-1) 0) = Just D8Left | 43 | deltaToDirection8 (V2 (-1) 0) = Just D8Left | 43 | false | false | 0 | 8 | 6 | 26 | 12 | 14 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/cabal-install/Distribution/Client/Dependency/Modular/PSQ.hs | bsd-3-clause | filterKeys :: (k -> Bool) -> PSQ k a -> PSQ k a
filterKeys p (PSQ xs) = PSQ (S.filter (p . fst) xs) | 99 | filterKeys :: (k -> Bool) -> PSQ k a -> PSQ k a
filterKeys p (PSQ xs) = PSQ (S.filter (p . fst) xs) | 99 | filterKeys p (PSQ xs) = PSQ (S.filter (p . fst) xs) | 51 | false | true | 0 | 9 | 23 | 67 | 33 | 34 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/NodeGroups/SetNodeTemplate.hs | mpl-2.0 | -- | Project ID for this request.
ngsntProject :: Lens' NodeGroupsSetNodeTemplate Text
ngsntProject
= lens _ngsntProject (\ s a -> s{_ngsntProject = a}) | 154 | ngsntProject :: Lens' NodeGroupsSetNodeTemplate Text
ngsntProject
= lens _ngsntProject (\ s a -> s{_ngsntProject = a}) | 120 | ngsntProject
= lens _ngsntProject (\ s a -> s{_ngsntProject = a}) | 67 | true | true | 1 | 9 | 24 | 46 | 22 | 24 | null | null |
worksap-ate/aws-sdk | Cloud/AWS/Lib/Query.hs | bsd-3-clause | filtersParam :: [Filter] -> QueryParam
filtersParam filters = "Filter" |.#. transpose [keyParams, valParams]
where
keyParams = map (("Name" |=) . fst) filters
valParams = map (("Value" |.#=) . snd) filters | 215 | filtersParam :: [Filter] -> QueryParam
filtersParam filters = "Filter" |.#. transpose [keyParams, valParams]
where
keyParams = map (("Name" |=) . fst) filters
valParams = map (("Value" |.#=) . snd) filters | 215 | filtersParam filters = "Filter" |.#. transpose [keyParams, valParams]
where
keyParams = map (("Name" |=) . fst) filters
valParams = map (("Value" |.#=) . snd) filters | 176 | false | true | 0 | 8 | 39 | 79 | 43 | 36 | null | null |
jameysharp/lotos | LOTOS/Specialize.hs | gpl-2.0 | -- "Lambda-lifting" for processes. This is conceptually related to the
-- supercombinator compilation strategy, as described in chapter 13 of "The
-- Implementation of Functional Programming Languages" (Simon Peyton Jones,
-- 1987). Use this if you're compiling to a language that doesn't
-- support nested functions. If... | 485 | liftProcesses :: Process -> Process
liftProcesses = runFreshM . liftProcessesM | 78 | liftProcesses = runFreshM . liftProcessesM | 42 | true | true | 1 | 7 | 69 | 33 | 17 | 16 | null | null |
jacekszymanski/wxHaskell | wx/src/Graphics/UI/WX/Menu.hs | lgpl-2.1 | toolControl :: ToolBar a -> Control b -> IO ()
toolControl toolbar control
= do _ <- toolBarAddControl toolbar control
return ()
{--------------------------------------------------------------------------------
Statusbar
--------------------------------------------------------------------------------}
-... | 381 | toolControl :: ToolBar a -> Control b -> IO ()
toolControl toolbar control
= do _ <- toolBarAddControl toolbar control
return ()
{--------------------------------------------------------------------------------
Statusbar
--------------------------------------------------------------------------------}
-... | 381 | toolControl toolbar control
= do _ <- toolBarAddControl toolbar control
return ()
{--------------------------------------------------------------------------------
Statusbar
--------------------------------------------------------------------------------}
-- | A field in a status bar.
--
-- * Instances:... | 334 | false | true | 0 | 8 | 55 | 60 | 29 | 31 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2020/M11/D18/Solution.hs | mit | parseContinents :: FilePath -> IO ContinentInfoMap
parseContinents file = maybe Map.empty fmapify . dcdr <$> BL.readFile file
where mapify = uncurry Map.insert . (name . conti &&& id)
fmapify = foldr mapify Map.empty
dcdr :: ByteString -> Maybe [ContinentInfo]
dcdr = decode
{--
>>> parseC... | 934 | parseContinents :: FilePath -> IO ContinentInfoMap
parseContinents file = maybe Map.empty fmapify . dcdr <$> BL.readFile file
where mapify = uncurry Map.insert . (name . conti &&& id)
fmapify = foldr mapify Map.empty
dcdr :: ByteString -> Maybe [ContinentInfo]
dcdr = decode
{--
>>> parseC... | 934 | parseContinents file = maybe Map.empty fmapify . dcdr <$> BL.readFile file
where mapify = uncurry Map.insert . (name . conti &&& id)
fmapify = foldr mapify Map.empty
dcdr :: ByteString -> Maybe [ContinentInfo]
dcdr = decode
{--
>>> parseContinents (continentDir ++ continentsJSON)
>>> let ... | 883 | false | true | 0 | 8 | 185 | 105 | 54 | 51 | null | null |
bitemyapp/dejafu | Test/DejaFu/Deterministic/Schedule.hs | mit | -- | Turn a potentially pre-emptive scheduler into a non-preemptive
-- one.
makeNP :: Scheduler s -> Scheduler s
makeNP sched = newsched where
newsched s p@(Just (prior, _)) threads
| prior `elem` map fst (toList threads) = (prior, s)
| otherwise = sched s p threads
newsched s Nothing threads = sched s Noth... | 331 | makeNP :: Scheduler s -> Scheduler s
makeNP sched = newsched where
newsched s p@(Just (prior, _)) threads
| prior `elem` map fst (toList threads) = (prior, s)
| otherwise = sched s p threads
newsched s Nothing threads = sched s Nothing threads | 255 | makeNP sched = newsched where
newsched s p@(Just (prior, _)) threads
| prior `elem` map fst (toList threads) = (prior, s)
| otherwise = sched s p threads
newsched s Nothing threads = sched s Nothing threads | 218 | true | true | 0 | 13 | 67 | 122 | 61 | 61 | null | null |
vizietto/kalkulu | src/Kalkulu/Builtin/Logic.hs | gpl-3.0 | logicBuiltins :: [(B.BuiltinSymbol, BuiltinDefinition)]
logicBuiltins = [
(B.True, true)
, (B.False, false)
, (B.And, and_)
-- , (B.Or, or_)
] | 154 | logicBuiltins :: [(B.BuiltinSymbol, BuiltinDefinition)]
logicBuiltins = [
(B.True, true)
, (B.False, false)
, (B.And, and_)
-- , (B.Or, or_)
] | 154 | logicBuiltins = [
(B.True, true)
, (B.False, false)
, (B.And, and_)
-- , (B.Or, or_)
] | 98 | false | true | 0 | 9 | 31 | 63 | 36 | 27 | null | null |
mattias-lundell/timber-llvm | src/LLVMKindle.hs | bsd-3-clause | dropBreakLabel :: CodeGen ()
dropBreakLabel = cgfModify (\s -> s { cgfBreakLabel = tail (cgfBreakLabel s) }) | 108 | dropBreakLabel :: CodeGen ()
dropBreakLabel = cgfModify (\s -> s { cgfBreakLabel = tail (cgfBreakLabel s) }) | 108 | dropBreakLabel = cgfModify (\s -> s { cgfBreakLabel = tail (cgfBreakLabel s) }) | 79 | false | true | 0 | 12 | 16 | 44 | 23 | 21 | null | null |
nickgeoca/idris-py | src/IRTS/CodegenPython.hs | bsd-3-clause | cgPrim (LLe _) = cgPOp "<=" | 30 | cgPrim (LLe _) = cgPOp "<=" | 30 | cgPrim (LLe _) = cgPOp "<=" | 30 | false | false | 0 | 6 | 8 | 19 | 8 | 11 | null | null |
wavewave/hxournal | lib/Application/HXournal/ModelAction/Select.hs | bsd-2-clause | getULBBoxFromSelected :: Page SelectMode -> ULMaybe BBox
getULBBoxFromSelected tpage =
let activelayer = unTEitherAlterHitted . get g_bstrokes . gselectedlayerbuf . glayers $ tpage
in case activelayer of
Left _ -> Bottom
Right alist -> bbox4AllStrokes . takeHittedStrokes $ alist
-- | | 309 | getULBBoxFromSelected :: Page SelectMode -> ULMaybe BBox
getULBBoxFromSelected tpage =
let activelayer = unTEitherAlterHitted . get g_bstrokes . gselectedlayerbuf . glayers $ tpage
in case activelayer of
Left _ -> Bottom
Right alist -> bbox4AllStrokes . takeHittedStrokes $ alist
-- | | 308 | getULBBoxFromSelected tpage =
let activelayer = unTEitherAlterHitted . get g_bstrokes . gselectedlayerbuf . glayers $ tpage
in case activelayer of
Left _ -> Bottom
Right alist -> bbox4AllStrokes . takeHittedStrokes $ alist
-- | | 251 | false | true | 0 | 13 | 65 | 85 | 40 | 45 | null | null |
dmort27/HsSPE | Data/Phonology/Representations.hs | bsd-3-clause | ipaDiacritics :: (String, FMatrix) -> GenParser Char RuleState (String, FMatrix)
ipaDiacritics (seg, fm) = getState >>= \(_, _, dias) ->
(many (choice (map (\(d, f) -> try $ string d >> return (d, f)) dias)) >>=
return . foldr (\(d, f) (seg', fm') -> (seg' ++ d... | 340 | ipaDiacritics :: (String, FMatrix) -> GenParser Char RuleState (String, FMatrix)
ipaDiacritics (seg, fm) = getState >>= \(_, _, dias) ->
(many (choice (map (\(d, f) -> try $ string d >> return (d, f)) dias)) >>=
return . foldr (\(d, f) (seg', fm') -> (seg' ++ d... | 340 | ipaDiacritics (seg, fm) = getState >>= \(_, _, dias) ->
(many (choice (map (\(d, f) -> try $ string d >> return (d, f)) dias)) >>=
return . foldr (\(d, f) (seg', fm') -> (seg' ++ d, f fm')) (seg, fm)) | 259 | false | true | 0 | 19 | 109 | 173 | 96 | 77 | null | null |
crockeo/whatisthisgame | src/WhatIsThisGame/Controllers/EnemySpawner.hs | mit | maybeAppendEnemy :: Bool -> V2 Float -> Float -> [Maybe Entity] -> [Maybe Entity]
maybeAppendEnemy False _ _ l = l | 119 | maybeAppendEnemy :: Bool -> V2 Float -> Float -> [Maybe Entity] -> [Maybe Entity]
maybeAppendEnemy False _ _ l = l | 119 | maybeAppendEnemy False _ _ l = l | 37 | false | true | 0 | 10 | 25 | 51 | 25 | 26 | null | null |
danr/hipspec | examples/old-examples/hip/ProductiveUseOfFailure.hs | gpl-3.0 | drop _ [] = [] | 14 | drop _ [] = [] | 14 | drop _ [] = [] | 14 | false | false | 0 | 6 | 4 | 19 | 8 | 11 | null | null |
benjamin-wagon/homeworld | Moves.hs | agpl-3.0 | emptyState ∷ GameSt
emptyState = GameSt
{ _reserve = startingDeck
, _systems = IntMap.empty
, _turn = 0
, _numSystems = 0
, _numPlayers = 0
, _history = []
} | 186 | emptyState ∷ GameSt
emptyState = GameSt
{ _reserve = startingDeck
, _systems = IntMap.empty
, _turn = 0
, _numSystems = 0
, _numPlayers = 0
, _history = []
} | 186 | emptyState = GameSt
{ _reserve = startingDeck
, _systems = IntMap.empty
, _turn = 0
, _numSystems = 0
, _numPlayers = 0
, _history = []
} | 166 | false | true | 0 | 8 | 59 | 63 | 35 | 28 | null | null |
rfranek/duckling | Duckling/Time/FR/Rules.hs | bsd-3-clause | ruleEntreDatetimeEtDatetimeInterval :: Rule
ruleEntreDatetimeEtDatetimeInterval = Rule
{ name = "entre <datetime> et <datetime> (interval)"
, pattern =
[ regex "entre"
, dimension Time
, regex "et"
, dimension Time
]
, prod = \tokens -> case tokens of
(_:Token Time td1:_:Token Time td2:_... | 400 | ruleEntreDatetimeEtDatetimeInterval :: Rule
ruleEntreDatetimeEtDatetimeInterval = Rule
{ name = "entre <datetime> et <datetime> (interval)"
, pattern =
[ regex "entre"
, dimension Time
, regex "et"
, dimension Time
]
, prod = \tokens -> case tokens of
(_:Token Time td1:_:Token Time td2:_... | 400 | ruleEntreDatetimeEtDatetimeInterval = Rule
{ name = "entre <datetime> et <datetime> (interval)"
, pattern =
[ regex "entre"
, dimension Time
, regex "et"
, dimension Time
]
, prod = \tokens -> case tokens of
(_:Token Time td1:_:Token Time td2:_) ->
Token Time <$> interval TTime.C... | 356 | false | true | 0 | 17 | 102 | 125 | 64 | 61 | null | null |
sethfowler/bzbeaver | src/Bugzilla.hs | bsd-3-clause | reqBug (ReviewedRequest bug _ _) = bug | 38 | reqBug (ReviewedRequest bug _ _) = bug | 38 | reqBug (ReviewedRequest bug _ _) = bug | 38 | false | false | 0 | 6 | 6 | 20 | 9 | 11 | null | null |
mdibaiee/serverman | src/System/Serverman/Types.hs | gpl-3.0 | liftedAsync :: MonadBaseControl IO m => m a -> m (Async (StM m a))
liftedAsync m = liftBaseWith $ \runInIO -> async (runInIO m) | 129 | liftedAsync :: MonadBaseControl IO m => m a -> m (Async (StM m a))
liftedAsync m = liftBaseWith $ \runInIO -> async (runInIO m) | 127 | liftedAsync m = liftBaseWith $ \runInIO -> async (runInIO m) | 60 | false | true | 0 | 11 | 25 | 65 | 31 | 34 | null | null |
brendanhay/gogol | gogol-file/gen/Network/Google/Resource/File/Projects/Locations/Backups/Delete.hs | mpl-2.0 | -- | JSONP
plbdCallback :: Lens' ProjectsLocationsBackupsDelete (Maybe Text)
plbdCallback
= lens _plbdCallback (\ s a -> s{_plbdCallback = a}) | 144 | plbdCallback :: Lens' ProjectsLocationsBackupsDelete (Maybe Text)
plbdCallback
= lens _plbdCallback (\ s a -> s{_plbdCallback = a}) | 133 | plbdCallback
= lens _plbdCallback (\ s a -> s{_plbdCallback = a}) | 67 | true | true | 0 | 9 | 21 | 48 | 25 | 23 | null | null |
sannsyn/aeson-value-parser | library/AesonValueParser.hs | mit | bool :: Value Bool
bool = Value $
ReaderT $ \case
Aeson.Bool x -> return x
_ -> empty
| 97 | bool :: Value Bool
bool = Value $
ReaderT $ \case
Aeson.Bool x -> return x
_ -> empty
| 97 | bool = Value $
ReaderT $ \case
Aeson.Bool x -> return x
_ -> empty
| 78 | false | true | 4 | 9 | 30 | 51 | 22 | 29 | null | null |
spinda/liquidhaskell | tests/gsoc15/unknown/pos/meas00.hs | bsd-3-clause | {- qualif PosLen(v:[a]): (len v) > 0 @-}
{- zooper :: {v:[a] | (len v) > 0} -> a -}
zooper :: [a] -> a
zooper = undefined | 122 | zooper :: [a] -> a
zooper = undefined | 37 | zooper = undefined | 18 | true | true | 0 | 6 | 28 | 20 | 12 | 8 | null | null |
ddssff/rdf4h | src/Text/RDF/RDF4H/NTriplesParser.hs | bsd-3-clause | -- A URI reference is one or more nrab_character inside angle brackets.
nt_uriref :: GenParser () T.Text
nt_uriref = between_chars '<' '>' (liftM T.pack (many (satisfy ( /= '>')))) | 180 | nt_uriref :: GenParser () T.Text
nt_uriref = between_chars '<' '>' (liftM T.pack (many (satisfy ( /= '>')))) | 108 | nt_uriref = between_chars '<' '>' (liftM T.pack (many (satisfy ( /= '>')))) | 75 | true | true | 0 | 12 | 28 | 54 | 28 | 26 | null | null |
csabahruska/GFXDemo | BSPLoader.hs | bsd-3-clause | -- ^ Stores texture information
lumpPlanes = 2 :: Int | 60 | lumpPlanes = 2 :: Int | 28 | lumpPlanes = 2 :: Int | 28 | true | false | 0 | 4 | 16 | 10 | 6 | 4 | null | null |
federicotdn/hvc | src/Hash.hs | gpl-3.0 | bstrSHA1 :: Strict.ByteString -> Strict.ByteString
bstrSHA1 bs = SHA1.hash bs | 77 | bstrSHA1 :: Strict.ByteString -> Strict.ByteString
bstrSHA1 bs = SHA1.hash bs | 77 | bstrSHA1 bs = SHA1.hash bs | 26 | false | true | 0 | 6 | 9 | 27 | 13 | 14 | null | null |
dysinger/amazonka | amazonka-ecs/gen/Network/AWS/ECS/SubmitContainerStateChange.hs | mpl-2.0 | -- | The short name or full Amazon Resource Name (ARN) of the cluster that hosts
-- the container.
scscCluster :: Lens' SubmitContainerStateChange (Maybe Text)
scscCluster = lens _scscCluster (\s a -> s { _scscCluster = a }) | 224 | scscCluster :: Lens' SubmitContainerStateChange (Maybe Text)
scscCluster = lens _scscCluster (\s a -> s { _scscCluster = a }) | 125 | scscCluster = lens _scscCluster (\s a -> s { _scscCluster = a }) | 64 | true | true | 0 | 9 | 37 | 47 | 26 | 21 | null | null |
skywind3000/language | haskell/colormap.hs | mit | colors = [0, 1, 2] | 18 | colors = [0, 1, 2] | 18 | colors = [0, 1, 2] | 18 | false | false | 1 | 5 | 4 | 18 | 9 | 9 | null | null |
wereHamster/nauva | pkg/hs/nauva-dev-server/src/Nauva/Server.hs | mit | websocketApplication :: Handle -> AppH -> WS.PendingConnection -> IO ()
websocketApplication nauvaH appH pendingConnection = do
conn <- WS.acceptRequest pendingConnection
WS.forkPingThread conn 5
locationSignalCopy <- atomically $ dupTChan (snd $ hLocation $ routerH appH)
void $ forkIO $ forever $ do
... | 2,499 | websocketApplication :: Handle -> AppH -> WS.PendingConnection -> IO ()
websocketApplication nauvaH appH pendingConnection = do
conn <- WS.acceptRequest pendingConnection
WS.forkPingThread conn 5
locationSignalCopy <- atomically $ dupTChan (snd $ hLocation $ routerH appH)
void $ forkIO $ forever $ do
... | 2,499 | websocketApplication nauvaH appH pendingConnection = do
conn <- WS.acceptRequest pendingConnection
WS.forkPingThread conn 5
locationSignalCopy <- atomically $ dupTChan (snd $ hLocation $ routerH appH)
void $ forkIO $ forever $ do
path <- atomically $ do
locPathname <$> readTChan loc... | 2,427 | false | true | 0 | 22 | 825 | 720 | 328 | 392 | null | null |
tdidriksen/copatterns | src/findus/test/TypeCheckerTests.hs | mit | inRoot :: [Defi] -> CheckEnv
inRoot es =
case buildRootEnv es of
Right envs -> envs
Left err -> error $ show err | 122 | inRoot :: [Defi] -> CheckEnv
inRoot es =
case buildRootEnv es of
Right envs -> envs
Left err -> error $ show err | 122 | inRoot es =
case buildRootEnv es of
Right envs -> envs
Left err -> error $ show err | 93 | false | true | 0 | 9 | 32 | 53 | 25 | 28 | null | null |
ezyang/ghc | compiler/basicTypes/Name.hs | bsd-3-clause | -- | Compare Names lexicographically
-- This only works for Names that originate in the source code or have been
-- tidied.
stableNameCmp :: Name -> Name -> Ordering
stableNameCmp (Name { n_sort = s1, n_occ = occ1 })
(Name { n_sort = s2, n_occ = occ2 })
= (s1 `sort_cmp` s2) `thenCmp` (occ1 `compare` occ... | 1,388 | stableNameCmp :: Name -> Name -> Ordering
stableNameCmp (Name { n_sort = s1, n_occ = occ1 })
(Name { n_sort = s2, n_occ = occ2 })
= (s1 `sort_cmp` s2) `thenCmp` (occ1 `compare` occ2)
-- The ordinary compare on OccNames is lexicographic
where
-- Later constructors are bigger
sort_cmp (Exter... | 1,264 | stableNameCmp (Name { n_sort = s1, n_occ = occ1 })
(Name { n_sort = s2, n_occ = occ2 })
= (s1 `sort_cmp` s2) `thenCmp` (occ1 `compare` occ2)
-- The ordinary compare on OccNames is lexicographic
where
-- Later constructors are bigger
sort_cmp (External m1) (External m2) = m1 `stableMo... | 1,222 | true | true | 34 | 8 | 513 | 287 | 157 | 130 | null | null |
bkoropoff/Idris-dev | src/Idris/Core/Evaluate.hs | bsd-3-clause | addCtxtDef :: Name -> Def -> Context -> Context
addCtxtDef n d c = let ctxt = definitions c
ctxt' = addDef n (d, Public, Unchecked, EmptyMI) $! ctxt in
c { definitions = ctxt' } | 223 | addCtxtDef :: Name -> Def -> Context -> Context
addCtxtDef n d c = let ctxt = definitions c
ctxt' = addDef n (d, Public, Unchecked, EmptyMI) $! ctxt in
c { definitions = ctxt' } | 223 | addCtxtDef n d c = let ctxt = definitions c
ctxt' = addDef n (d, Public, Unchecked, EmptyMI) $! ctxt in
c { definitions = ctxt' } | 175 | false | true | 0 | 11 | 81 | 84 | 42 | 42 | null | null |
Palmik/data-store | src/Data/Store.hs | bsd-3-clause | printIndex :: Show (I.Index irs ts) => I.Store tag krs irs ts v -> IO ()
printIndex = putStrLn . showIndex | 106 | printIndex :: Show (I.Index irs ts) => I.Store tag krs irs ts v -> IO ()
printIndex = putStrLn . showIndex | 106 | printIndex = putStrLn . showIndex | 33 | false | true | 0 | 10 | 20 | 60 | 27 | 33 | null | null |
grandpascorpion/canon | Math/NumberTheory/Canon/SpecialFunctions.hs | gpl-3.0 | conwayGuy :: Canon -> Canon
-- | Conway-Guy function is a conwayChain of n copies of n.
conwayGuy n = conwayChain (replicate (fromIntegral n) n) | 171 | conwayGuy :: Canon -> Canon
conwayGuy n = conwayChain (replicate (fromIntegral n) n) | 84 | conwayGuy n = conwayChain (replicate (fromIntegral n) n) | 56 | true | true | 0 | 9 | 51 | 41 | 19 | 22 | null | null |
trskop/cabal | Cabal/Distribution/Simple/LHC.hs | bsd-3-clause | ghcVerbosityOptions :: Verbosity -> [String]
ghcVerbosityOptions verbosity
| verbosity >= deafening = ["-v"]
| verbosity >= normal = []
| otherwise = ["-w", "-v0"] | 194 | ghcVerbosityOptions :: Verbosity -> [String]
ghcVerbosityOptions verbosity
| verbosity >= deafening = ["-v"]
| verbosity >= normal = []
| otherwise = ["-w", "-v0"] | 194 | ghcVerbosityOptions verbosity
| verbosity >= deafening = ["-v"]
| verbosity >= normal = []
| otherwise = ["-w", "-v0"] | 149 | false | true | 0 | 8 | 54 | 74 | 35 | 39 | null | null |
pacak/hdevtools | src/Cabal.hs | mit | allComponentsBy :: PackageDescription
-> (Component -> a)
-> [a]
allComponentsBy pkg_descr f =
[ f (CLib lib) | Just lib <- [library pkg_descr]
, buildable (libBuildInfo lib) ]
++ [ f (CExe exe) | exe <- executables pkg_descr
, buildable (bu... | 625 | allComponentsBy :: PackageDescription
-> (Component -> a)
-> [a]
allComponentsBy pkg_descr f =
[ f (CLib lib) | Just lib <- [library pkg_descr]
, buildable (libBuildInfo lib) ]
++ [ f (CExe exe) | exe <- executables pkg_descr
, buildable (bu... | 625 | allComponentsBy pkg_descr f =
[ f (CLib lib) | Just lib <- [library pkg_descr]
, buildable (libBuildInfo lib) ]
++ [ f (CExe exe) | exe <- executables pkg_descr
, buildable (buildInfo exe) ]
++ [ f (CTest tst) | tst <- testSuites pkg_descr
, buildable ... | 528 | false | true | 6 | 10 | 239 | 219 | 102 | 117 | null | null |
MichaelMackus/hsrl | RL/UI/Sprite.hs | mit | toMessage e (EventMessage (ItemsSeen items)) = let suffix = if length items > 1 then "There are " ++ show (length items - 1) ++ " more items here." else ""
in Just $ "You see a " ++ showIdentified (identified (player (level e))) (head items) ++ ". " ++ suffix | 307 | toMessage e (EventMessage (ItemsSeen items)) = let suffix = if length items > 1 then "There are " ++ show (length items - 1) ++ " more items here." else ""
in Just $ "You see a " ++ showIdentified (identified (player (level e))) (head items) ++ ". " ++ suffix | 307 | toMessage e (EventMessage (ItemsSeen items)) = let suffix = if length items > 1 then "There are " ++ show (length items - 1) ++ " more items here." else ""
in Just $ "You see a " ++ showIdentified (identified (player (level e))) (head items) ++ ". " ++ suffix | 307 | false | false | 0 | 16 | 98 | 115 | 56 | 59 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Graphics/AnimatedModel.hs | mit | animatedModelSetModelAttr :: (Parent AnimatedModel a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to AnimatedModel or ascentor
-> ResourceRef -- ^ Value
-> m ()
animatedModelSetModelAttr p rref = liftIO $ with rref $ \rref' -> do
let ptr = parentPointer p
[C.exp| void { $(AnimatedModel* ptr)->SetModelAttr(*$(Re... | 389 | animatedModelSetModelAttr :: (Parent AnimatedModel a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to AnimatedModel or ascentor
-> ResourceRef -- ^ Value
-> m ()
animatedModelSetModelAttr p rref = liftIO $ with rref $ \rref' -> do
let ptr = parentPointer p
[C.exp| void { $(AnimatedModel* ptr)->SetModelAttr(*$(Re... | 389 | animatedModelSetModelAttr p rref = liftIO $ with rref $ \rref' -> do
let ptr = parentPointer p
[C.exp| void { $(AnimatedModel* ptr)->SetModelAttr(*$(ResourceRef* rref')) } |]
-- | Set bones' animation enabled attribute. | 224 | false | true | 0 | 12 | 69 | 95 | 49 | 46 | null | null |
aniketd/learn.haskell | RWH/4_and_before/SimpleJSON/Prettify.hs | unlicense | w `fits` "" = True | 18 | w `fits` "" = True | 18 | w `fits` "" = True | 18 | false | false | 0 | 5 | 4 | 18 | 8 | 10 | null | null |
arypbatista/LIS-Parser | LISEval.hs | gpl-3.0 | evalCom (If be bt bf)
= \mem -> if (evalB be mem)
then (evalBlock bt mem)
else (evalBlock bf mem) | 130 | evalCom (If be bt bf)
= \mem -> if (evalB be mem)
then (evalBlock bt mem)
else (evalBlock bf mem) | 130 | evalCom (If be bt bf)
= \mem -> if (evalB be mem)
then (evalBlock bt mem)
else (evalBlock bf mem) | 130 | false | false | 0 | 8 | 52 | 56 | 29 | 27 | null | null |
wizzup/advent_of_code | 2016/2/part2.hs | mit | step D B2 = B6 | 14 | step D B2 = B6 | 14 | step D B2 = B6 | 14 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
keera-studios/hsQt | Qtc/Gui/QUndoView.hs | bsd-2-clause | setEmptyLabel :: QUndoView a -> ((String)) -> IO ()
setEmptyLabel x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withCWString x1 $ \cstr_x1 ->
qtc_QUndoView_setEmptyLabel cobj_x0 cstr_x1 | 190 | setEmptyLabel :: QUndoView a -> ((String)) -> IO ()
setEmptyLabel x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withCWString x1 $ \cstr_x1 ->
qtc_QUndoView_setEmptyLabel cobj_x0 cstr_x1 | 190 | setEmptyLabel x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withCWString x1 $ \cstr_x1 ->
qtc_QUndoView_setEmptyLabel cobj_x0 cstr_x1 | 138 | false | true | 4 | 9 | 35 | 76 | 36 | 40 | null | null |
romanb/amazonka | amazonka-ml/gen/Network/AWS/MachineLearning/DescribeDataSources.hs | mpl-2.0 | -- | A two-value parameter that determines the sequence of the resulting list of 'DataSource'.
--
-- 'asc' - Arranges the list in ascending order (A-Z, 0-9). 'dsc' - Arranges the
-- list in descending order (Z-A, 9-0). Results are sorted by 'FilterVariable'.
ddsSortOrder :: Lens' DescribeDataSources (Maybe SortOrder)... | 388 | ddsSortOrder :: Lens' DescribeDataSources (Maybe SortOrder)
ddsSortOrder = lens _ddsSortOrder (\s a -> s { _ddsSortOrder = a }) | 127 | ddsSortOrder = lens _ddsSortOrder (\s a -> s { _ddsSortOrder = a }) | 67 | true | true | 0 | 9 | 63 | 49 | 28 | 21 | null | null |
ksaveljev/hake-2 | src/Game/Monsters/MChick.hs | bsd-3-clause | chickMoveSlash :: MMoveT
chickMoveSlash = MMoveT "chickMoveSlash" frameAttack204 frameAttack212 chickFramesSlash Nothing | 120 | chickMoveSlash :: MMoveT
chickMoveSlash = MMoveT "chickMoveSlash" frameAttack204 frameAttack212 chickFramesSlash Nothing | 120 | chickMoveSlash = MMoveT "chickMoveSlash" frameAttack204 frameAttack212 chickFramesSlash Nothing | 95 | false | true | 0 | 5 | 10 | 22 | 11 | 11 | null | null |
jokusi/Astview | src/gui/Language/Astview/Gui/Menu.hs | mit | uiManagerBuildLanguagesMenu :: UIManager -> AstAction ()
uiManagerBuildLanguagesMenu uiManager ref = do
langs <- getKnownLanguages ref
forM_ langs $ \lang -> do
mergeId <- uiManagerNewMergeId uiManager
let ident = "actionLanguage"++name lang
uiManagerAddUi uiManager mergeId "/ui/menubar/Languages/LangsS... | 543 | uiManagerBuildLanguagesMenu :: UIManager -> AstAction ()
uiManagerBuildLanguagesMenu uiManager ref = do
langs <- getKnownLanguages ref
forM_ langs $ \lang -> do
mergeId <- uiManagerNewMergeId uiManager
let ident = "actionLanguage"++name lang
uiManagerAddUi uiManager mergeId "/ui/menubar/Languages/LangsS... | 543 | uiManagerBuildLanguagesMenu uiManager ref = do
langs <- getKnownLanguages ref
forM_ langs $ \lang -> do
mergeId <- uiManagerNewMergeId uiManager
let ident = "actionLanguage"++name lang
uiManagerAddUi uiManager mergeId "/ui/menubar/Languages/LangsSep"
(ident :: String)
(Just... | 486 | false | true | 0 | 15 | 134 | 111 | 53 | 58 | null | null |
fibsifan/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | isSpecial '\8216' = True | 24 | isSpecial '\8216' = True | 24 | isSpecial '\8216' = True | 24 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
LucasNeis/INE-5416 | R5/training.hs | gpl-2.0 | --parte 1
f x = case x of
0 -> 1
1 -> 5
2 -> 2
_ -> 1 | 61 | f x = case x of
0 -> 1
1 -> 5
2 -> 2
_ -> 1 | 51 | f x = case x of
0 -> 1
1 -> 5
2 -> 2
_ -> 1 | 51 | true | false | 0 | 7 | 27 | 38 | 19 | 19 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |'T.mapAccumR'
t_mapAccumR = T.mapAccumR | 43 | t_mapAccumR = T.mapAccumR | 25 | t_mapAccumR = T.mapAccumR | 25 | true | false | 0 | 5 | 4 | 9 | 5 | 4 | null | null |
bitemyapp/scotty | Web/Scotty/Trans.hs | bsd-3-clause | -- | Run a scotty application using the warp server.
-- NB: scotty p === scottyT p id
scottyT :: (Monad m, MonadIO n)
=> Port
-> (m Response -> IO Response) -- ^ Run monad 'm' into 'IO', called at each action.
-> ScottyT e m ()
-> n ()
scottyT p = scottyOptsT $ def { settings = setPort p... | 337 | scottyT :: (Monad m, MonadIO n)
=> Port
-> (m Response -> IO Response) -- ^ Run monad 'm' into 'IO', called at each action.
-> ScottyT e m ()
-> n ()
scottyT p = scottyOptsT $ def { settings = setPort p (settings def) } | 251 | scottyT p = scottyOptsT $ def { settings = setPort p (settings def) } | 69 | true | true | 0 | 10 | 96 | 94 | 48 | 46 | null | null |
hguenther/smtlib2 | extras/composite/Language/SMTLib2/Composite/Domains.hs | gpl-3.0 | subInf _ _ PosInfinity = Just NegInfinity | 41 | subInf _ _ PosInfinity = Just NegInfinity | 41 | subInf _ _ PosInfinity = Just NegInfinity | 41 | false | false | 1 | 5 | 6 | 15 | 6 | 9 | null | null |
mitchellwrosen/language-lua2 | src/Language/Lua/Token.hs | bsd-3-clause | showToken TkOr = "or" | 32 | showToken TkOr = "or" | 32 | showToken TkOr = "or" | 32 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
markuspf/Idris-dev | src/IRTS/Simplified.hs | bsd-3-clause | simplifyDefs :: DDefs -> [(Name, DDecl)] -> TC [(Name, SDecl)]
simplifyDefs ctxt [] = return [] | 95 | simplifyDefs :: DDefs -> [(Name, DDecl)] -> TC [(Name, SDecl)]
simplifyDefs ctxt [] = return [] | 95 | simplifyDefs ctxt [] = return [] | 32 | false | true | 0 | 9 | 15 | 52 | 28 | 24 | null | null |
goldfirere/singletons | singletons-th/src/Data/Singletons/TH/Single.hs | bsd-3-clause | isException (DSigE e _) = isException e | 49 | isException (DSigE e _) = isException e | 49 | isException (DSigE e _) = isException e | 49 | false | false | 0 | 7 | 16 | 20 | 9 | 11 | null | null |
mgsloan/toy-gtk-diagrams | Examples/KeyMove.hs | bsd-3-clause | main = runToy $ State (100 & 100) (0 & 0) | 41 | main = runToy $ State (100 & 100) (0 & 0) | 41 | main = runToy $ State (100 & 100) (0 & 0) | 41 | false | false | 3 | 7 | 10 | 33 | 15 | 18 | null | null |
lesguillemets/fouricle | src/Fouriers.hs | mit | sawToothWave :: Fourier
sawToothWave = [1 / fromIntegral n | n <- [1..]::[Int]] | 79 | sawToothWave :: Fourier
sawToothWave = [1 / fromIntegral n | n <- [1..]::[Int]] | 79 | sawToothWave = [1 / fromIntegral n | n <- [1..]::[Int]] | 55 | false | true | 0 | 8 | 12 | 38 | 21 | 17 | null | null |
olsner/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | mkNoCount :: Tickish id -> Tickish id
mkNoCount n | not (tickishCounts n) = n
| not (tickishCanSplit n) = panic "mkNoCount: Cannot split!" | 152 | mkNoCount :: Tickish id -> Tickish id
mkNoCount n | not (tickishCounts n) = n
| not (tickishCanSplit n) = panic "mkNoCount: Cannot split!" | 152 | mkNoCount n | not (tickishCounts n) = n
| not (tickishCanSplit n) = panic "mkNoCount: Cannot split!" | 114 | false | true | 0 | 10 | 37 | 60 | 26 | 34 | null | null |
michaelficarra/purescript | src/Language/PureScript/Sugar/BindingGroups.hs | mit | collapseBindingGroups :: [Declaration] -> [Declaration]
collapseBindingGroups = let (f, _, _) = everywhereOnValues id collapseBindingGroupsForValue id in map f . concatMap go
where
go (DataBindingGroupDeclaration ds) = ds
go (BindingGroupDeclaration ds) = map (\(ident, nameKind, val) -> ValueDeclaration ident nam... | 449 | collapseBindingGroups :: [Declaration] -> [Declaration]
collapseBindingGroups = let (f, _, _) = everywhereOnValues id collapseBindingGroupsForValue id in map f . concatMap go
where
go (DataBindingGroupDeclaration ds) = ds
go (BindingGroupDeclaration ds) = map (\(ident, nameKind, val) -> ValueDeclaration ident nam... | 449 | collapseBindingGroups = let (f, _, _) = everywhereOnValues id collapseBindingGroupsForValue id in map f . concatMap go
where
go (DataBindingGroupDeclaration ds) = ds
go (BindingGroupDeclaration ds) = map (\(ident, nameKind, val) -> ValueDeclaration ident nameKind [] (Right val)) ds
go (PositionedDeclaration pos... | 393 | false | true | 0 | 10 | 70 | 176 | 89 | 87 | null | null |
DavidAlphaFox/darcs | src/Darcs/Patch/Choices.hs | gpl-2.0 | makeUncertain :: Patchy p => Label -> PatchChoices p wA wB -> PatchChoices p wA wB
makeUncertain t (PCs f l) = fmlFirst ((== t) . label) False NilRL f l | 152 | makeUncertain :: Patchy p => Label -> PatchChoices p wA wB -> PatchChoices p wA wB
makeUncertain t (PCs f l) = fmlFirst ((== t) . label) False NilRL f l | 152 | makeUncertain t (PCs f l) = fmlFirst ((== t) . label) False NilRL f l | 69 | false | true | 0 | 8 | 30 | 75 | 37 | 38 | null | null |
mightymoose/liquidhaskell | benchmarks/vector-0.10.0.1/Data/Vector/Fusion/Stream.hs | bsd-3-clause | eq (M.Stream step1 s1 _) (M.Stream step2 s2 _) = eq_loop0 SPEC s1 s2
where
eq_loop0 !sPEC s1 s2 = case unId (step1 s1) of
Yield x s1' -> eq_loop1 SPEC x s1' s2
Skip s1' -> eq_loop0 SPEC s1' s2
Done -> null (M.Stream... | 648 | eq (M.Stream step1 s1 _) (M.Stream step2 s2 _) = eq_loop0 SPEC s1 s2
where
eq_loop0 !sPEC s1 s2 = case unId (step1 s1) of
Yield x s1' -> eq_loop1 SPEC x s1' s2
Skip s1' -> eq_loop0 SPEC s1' s2
Done -> null (M.Stream... | 648 | eq (M.Stream step1 s1 _) (M.Stream step2 s2 _) = eq_loop0 SPEC s1 s2
where
eq_loop0 !sPEC s1 s2 = case unId (step1 s1) of
Yield x s1' -> eq_loop1 SPEC x s1' s2
Skip s1' -> eq_loop0 SPEC s1' s2
Done -> null (M.Stream... | 648 | false | false | 1 | 13 | 313 | 211 | 98 | 113 | null | null |
judah/haskeline | System/Console/Haskeline/Vi.hs | bsd-3-clause | movements :: [(Key,InsertMode -> InsertMode)]
movements = [ (simpleChar 'h', goLeft)
, (simpleChar 'l', goRight)
, (simpleChar ' ', goRight)
, (simpleKey LeftKey, goLeft)
, (simpleKey RightKey, goRight)
, (simpleChar '0', moveToStart)
, (simpleChar... | 1,252 | movements :: [(Key,InsertMode -> InsertMode)]
movements = [ (simpleChar 'h', goLeft)
, (simpleChar 'l', goRight)
, (simpleChar ' ', goRight)
, (simpleKey LeftKey, goLeft)
, (simpleKey RightKey, goRight)
, (simpleChar '0', moveToStart)
, (simpleChar... | 1,252 | movements = [ (simpleChar 'h', goLeft)
, (simpleChar 'l', goRight)
, (simpleChar ' ', goRight)
, (simpleKey LeftKey, goLeft)
, (simpleKey RightKey, goRight)
, (simpleChar '0', moveToStart)
, (simpleChar '$', moveToEnd)
, (simpleChar '^'... | 1,206 | false | true | 0 | 9 | 462 | 285 | 157 | 128 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | readListPrecDefault_RDR = varQual_RDR gHC_READ (fsLit "readListPrecDefault") | 76 | readListPrecDefault_RDR = varQual_RDR gHC_READ (fsLit "readListPrecDefault") | 76 | readListPrecDefault_RDR = varQual_RDR gHC_READ (fsLit "readListPrecDefault") | 76 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/InstanceGroups/AggregatedList.hs | mpl-2.0 | -- | The maximum number of results per page that should be returned. If the
-- number of available results is larger than \`maxResults\`, Compute
-- Engine returns a \`nextPageToken\` that can be used to get the next page
-- of results in subsequent list requests. Acceptable values are \`0\` to
-- \`500\`, inclusive. (... | 493 | igalMaxResults :: Lens' InstanceGroupsAggregatedList Word32
igalMaxResults
= lens _igalMaxResults
(\ s a -> s{_igalMaxResults = a})
. _Coerce | 155 | igalMaxResults
= lens _igalMaxResults
(\ s a -> s{_igalMaxResults = a})
. _Coerce | 95 | true | true | 1 | 8 | 87 | 53 | 28 | 25 | null | null |
forste/haReFork | tools/base/lib/Lists.hs | bsd-3-clause | xs `subset` ys = all (`elem` ys) xs | 36 | xs `subset` ys = all (`elem` ys) xs | 36 | xs `subset` ys = all (`elem` ys) xs | 36 | false | false | 0 | 6 | 8 | 28 | 15 | 13 | null | null |
jutaro/rdf4h | src/Data/RDF/Graph/HashMapS.hs | bsd-3-clause | prefixMappings' :: HashMapS -> PrefixMappings
prefixMappings' (HashMapS (_, _, pms)) = pms | 90 | prefixMappings' :: HashMapS -> PrefixMappings
prefixMappings' (HashMapS (_, _, pms)) = pms | 90 | prefixMappings' (HashMapS (_, _, pms)) = pms | 44 | false | true | 0 | 10 | 11 | 39 | 19 | 20 | null | null |
anr/prog-haskell | chapter-04.hs | mit | -- 3
safetaila :: [a] -> [a]
safetaila xs = if null xs then [] else tail xs | 76 | safetaila :: [a] -> [a]
safetaila xs = if null xs then [] else tail xs | 70 | safetaila xs = if null xs then [] else tail xs | 46 | true | true | 0 | 6 | 18 | 41 | 22 | 19 | null | null |
forsyde/forsyde-shallow | src/ForSyDe/Shallow/MoC/CSDF.hs | bsd-3-clause | -- > Actors with four outputs
-- | The process constructor 'actor14CSDF' constructs an CSDF actor with
-- one input and four output signals. For each firing, the actor behaves
-- accordingly to the scenario (a tuple with the number of consumed tokens,
-- produced tokens and the function) defined in the list of tuples,... | 649 | actor14CSDF :: [(Int, (Int, Int, Int, Int), [a] -> ([b], [c], [d], [e]))]
-> Signal a -> (Signal b, Signal c, Signal d, Signal e)
actor14CSDF s xs = unzip4CSDF (outputTokens s) $ mapCSDF (inpOut1n s) xs | 214 | actor14CSDF s xs = unzip4CSDF (outputTokens s) $ mapCSDF (inpOut1n s) xs | 72 | true | true | 0 | 10 | 125 | 137 | 79 | 58 | null | null |
Yuras/io-region | misc/imask/example2.hs | bsd-3-clause | PutStr :: Handle -> String -> IO ()
hPutStr h@(Handle ref) str = do
hFlush h
writeIORef ref (Just str)
| 107 | hPutStr :: Handle -> String -> IO ()
hPutStr h@(Handle ref) str = do
hFlush h
writeIORef ref (Just str) | 107 | hPutStr h@(Handle ref) str = do
hFlush h
writeIORef ref (Just str) | 70 | false | true | 3 | 6 | 24 | 52 | 27 | 25 | null | null |
jtojnar/haste-compiler | libraries/haste-lib/src/Haste/Audio.hs | bsd-3-clause | getDuration :: MonadIO m => Audio -> m Double
getDuration (Audio e) = do
dur <- getProp e "duration"
case fromJSString dur of
Just d -> return d
_ -> return 0
-- | Get the current play time of the loaded sound, in seconds. | 240 | getDuration :: MonadIO m => Audio -> m Double
getDuration (Audio e) = do
dur <- getProp e "duration"
case fromJSString dur of
Just d -> return d
_ -> return 0
-- | Get the current play time of the loaded sound, in seconds. | 240 | getDuration (Audio e) = do
dur <- getProp e "duration"
case fromJSString dur of
Just d -> return d
_ -> return 0
-- | Get the current play time of the loaded sound, in seconds. | 194 | false | true | 0 | 10 | 62 | 78 | 35 | 43 | null | null |
fmapfmapfmap/amazonka | amazonka-swf/gen/Network/AWS/SWF/RespondActivityTaskCanceled.hs | mpl-2.0 | -- | /Optional./ Information about the cancellation.
rDetails :: Lens' RespondActivityTaskCanceled (Maybe Text)
rDetails = lens _rDetails (\ s a -> s{_rDetails = a}) | 165 | rDetails :: Lens' RespondActivityTaskCanceled (Maybe Text)
rDetails = lens _rDetails (\ s a -> s{_rDetails = a}) | 112 | rDetails = lens _rDetails (\ s a -> s{_rDetails = a}) | 53 | true | true | 1 | 9 | 23 | 51 | 25 | 26 | null | null |
ChaosCabbage/my-haskell-flailing | src/CPU/Instructions.hs | bsd-3-clause | ld_x_pointer :: (CPUReference s r Word8) => r -> CPUPointer s -> CPU s ()
ld_x_pointer to from =
readPtr from >>= writeWord to | 131 | ld_x_pointer :: (CPUReference s r Word8) => r -> CPUPointer s -> CPU s ()
ld_x_pointer to from =
readPtr from >>= writeWord to | 131 | ld_x_pointer to from =
readPtr from >>= writeWord to | 57 | false | true | 0 | 9 | 28 | 57 | 27 | 30 | null | null |
pparkkin/eta | compiler/ETA/SimplCore/OccurAnal.hs | bsd-3-clause | mkOneOcc :: OccEnv -> Id -> InterestingCxt -> UsageDetails
mkOneOcc env id int_cxt
| isLocalId id
= unitVarEnv id (OneOcc False True int_cxt)
| id `elemVarSet` occ_gbl_scrut env
= unitVarEnv id NoOccInfo
| otherwise
= emptyDetails | 244 | mkOneOcc :: OccEnv -> Id -> InterestingCxt -> UsageDetails
mkOneOcc env id int_cxt
| isLocalId id
= unitVarEnv id (OneOcc False True int_cxt)
| id `elemVarSet` occ_gbl_scrut env
= unitVarEnv id NoOccInfo
| otherwise
= emptyDetails | 244 | mkOneOcc env id int_cxt
| isLocalId id
= unitVarEnv id (OneOcc False True int_cxt)
| id `elemVarSet` occ_gbl_scrut env
= unitVarEnv id NoOccInfo
| otherwise
= emptyDetails | 185 | false | true | 0 | 9 | 49 | 91 | 42 | 49 | null | null |
jutaro/rdf4h | src/Data/RDF/MTriples.hs | bsd-3-clause | query' :: MTriples -> Maybe Subject -> Maybe Predicate -> Maybe Object -> Triples
query' (MTriples ((sm,_),_,_)) (Just s) Nothing Nothing =
fromMaybe [] (Map.lookup s sm) | 174 | query' :: MTriples -> Maybe Subject -> Maybe Predicate -> Maybe Object -> Triples
query' (MTriples ((sm,_),_,_)) (Just s) Nothing Nothing =
fromMaybe [] (Map.lookup s sm) | 174 | query' (MTriples ((sm,_),_,_)) (Just s) Nothing Nothing =
fromMaybe [] (Map.lookup s sm) | 92 | false | true | 0 | 9 | 30 | 89 | 45 | 44 | null | null |
acowley/ghc | compiler/main/DynFlags.hs | bsd-3-clause | updOptLevel :: Int -> DynFlags -> DynFlags
-- ^ Sets the 'DynFlags' to be appropriate to the optimisation level
updOptLevel n dfs
= dfs2{ optLevel = final_n }
where
final_n = max 0 (min 2 n) -- Clamp to 0 <= n <= 2
dfs1 = foldr (flip gopt_unset) dfs remove_gopts
dfs2 = foldr (flip gopt_set) dfs1 extr... | 605 | updOptLevel :: Int -> DynFlags -> DynFlags
updOptLevel n dfs
= dfs2{ optLevel = final_n }
where
final_n = max 0 (min 2 n) -- Clamp to 0 <= n <= 2
dfs1 = foldr (flip gopt_unset) dfs remove_gopts
dfs2 = foldr (flip gopt_set) dfs1 extra_gopts
extra_gopts = [ f | (ns,f) <- optLevelFlags, final_n `el... | 536 | updOptLevel n dfs
= dfs2{ optLevel = final_n }
where
final_n = max 0 (min 2 n) -- Clamp to 0 <= n <= 2
dfs1 = foldr (flip gopt_unset) dfs remove_gopts
dfs2 = foldr (flip gopt_set) dfs1 extra_gopts
extra_gopts = [ f | (ns,f) <- optLevelFlags, final_n `elem` ns ]
remove_gopts = [ f | (ns,f) <- ... | 493 | true | true | 3 | 9 | 120 | 176 | 89 | 87 | null | null |
sdiehl/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Base classes (Eq, Ord, Functor)
fmapName, eqClassName, eqName, ordClassName, geName, functorClassName :: Name
eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey | 181 | fmapName, eqClassName, eqName, ordClassName, geName, functorClassName :: Name
eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey | 146 | eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey | 68 | true | true | 0 | 7 | 31 | 35 | 23 | 12 | null | null |
vikraman/ghc | compiler/prelude/THNames.hs | bsd-3-clause | liftIdKey = mkPreludeMiscIdUnique 203 | 47 | liftIdKey = mkPreludeMiscIdUnique 203 | 47 | liftIdKey = mkPreludeMiscIdUnique 203 | 47 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
ptitfred/ftv-vods | app/CLI.hs | bsd-3-clause | uploadsPlaylistId :: Client YouTubeId
uploadsPlaylistId = channelUploadPlaylist <$> findChannel "FroggedTV" | 107 | uploadsPlaylistId :: Client YouTubeId
uploadsPlaylistId = channelUploadPlaylist <$> findChannel "FroggedTV" | 107 | uploadsPlaylistId = channelUploadPlaylist <$> findChannel "FroggedTV" | 69 | false | true | 1 | 6 | 9 | 24 | 10 | 14 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Actions/WindowBringer.hs | bsd-2-clause | -- | Pops open an application with window titles given over stdin. Choose one,
-- and you will be taken to the corresponding workspace.
gotoMenu' :: String -> X ()
gotoMenu' menuCmd = gotoMenuArgs' menuCmd [] | 210 | gotoMenu' :: String -> X ()
gotoMenu' menuCmd = gotoMenuArgs' menuCmd [] | 72 | gotoMenu' menuCmd = gotoMenuArgs' menuCmd [] | 44 | true | true | 0 | 7 | 37 | 32 | 16 | 16 | null | null |
hdbc/hdbc-sqlite3 | testsrc/TestSbasics.hs | bsd-3-clause | executeReplace = dbTestCase (\dbh ->
do sth <- prepare dbh "INSERT INTO hdbctest1 VALUES ('executeReplace',?,?,?)"
sExecute sth [Just "1", Just "1234", Just "Foo"]
sExecute sth [Just "2", Nothing, Just "Bar"]
commit dbh
sth <- prepare dbh "SELECT * FROM hdbctest1 WHERE testname = ? ORDER... | 796 | executeReplace = dbTestCase (\dbh ->
do sth <- prepare dbh "INSERT INTO hdbctest1 VALUES ('executeReplace',?,?,?)"
sExecute sth [Just "1", Just "1234", Just "Foo"]
sExecute sth [Just "2", Nothing, Just "Bar"]
commit dbh
sth <- prepare dbh "SELECT * FROM hdbctest1 WHERE testname = ? ORDER... | 796 | executeReplace = dbTestCase (\dbh ->
do sth <- prepare dbh "INSERT INTO hdbctest1 VALUES ('executeReplace',?,?,?)"
sExecute sth [Just "1", Just "1234", Just "Foo"]
sExecute sth [Just "2", Nothing, Just "Bar"]
commit dbh
sth <- prepare dbh "SELECT * FROM hdbctest1 WHERE testname = ? ORDER... | 796 | false | false | 0 | 16 | 298 | 215 | 102 | 113 | null | null |
BitFunctor/bitfunctor | test/src/Network/BitFunctor/Account/Tests.hs | mit | prop_accountid_erases_sk :: Account -> Bool
prop_accountid_erases_sk acc = secKey (fromAccountId $ toAccountId acc) == Nothing | 126 | prop_accountid_erases_sk :: Account -> Bool
prop_accountid_erases_sk acc = secKey (fromAccountId $ toAccountId acc) == Nothing | 126 | prop_accountid_erases_sk acc = secKey (fromAccountId $ toAccountId acc) == Nothing | 82 | false | true | 0 | 9 | 14 | 35 | 17 | 18 | null | null |
muspellsson/hiccup | TclLib/NSCmds.hs | lgpl-2.1 | ns_children args = case args of
[] -> childrenNS Nothing >>= lreturn
[nsn] -> childrenNS (Just (parseNSTag (T.asBStr nsn))) >>= lreturn
_ -> argErr "namespace children" | 199 | ns_children args = case args of
[] -> childrenNS Nothing >>= lreturn
[nsn] -> childrenNS (Just (parseNSTag (T.asBStr nsn))) >>= lreturn
_ -> argErr "namespace children" | 199 | ns_children args = case args of
[] -> childrenNS Nothing >>= lreturn
[nsn] -> childrenNS (Just (parseNSTag (T.asBStr nsn))) >>= lreturn
_ -> argErr "namespace children" | 199 | false | false | 1 | 16 | 56 | 76 | 35 | 41 | null | null |
tjakway/ghcjvm | testsuite/tests/dependent/should_compile/dynamic-paper.hs | bsd-3-clause | eval :: Term -> DynamicSilly
eqT = undefined | 45 | eval :: Term -> DynamicSilly
eqT = undefined | 44 | eqT = undefined | 15 | false | true | 0 | 7 | 8 | 18 | 8 | 10 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/RestoreAddressToClassic.hs | mpl-2.0 | -- | Creates a value of 'RestoreAddressToClassicResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ratcrsStatus'
--
-- * 'ratcrsPublicIP'
--
-- * 'ratcrsResponseStatus'
restoreAddressToClassicResponse
:: Int -- ^ 'ratcrsRes... | 574 | restoreAddressToClassicResponse
:: Int -- ^ 'ratcrsResponseStatus'
-> RestoreAddressToClassicResponse
restoreAddressToClassicResponse pResponseStatus_ =
RestoreAddressToClassicResponse'
{ _ratcrsStatus = Nothing
, _ratcrsPublicIP = Nothing
, _ratcrsResponseStatus = pResponseStatus_
} | 312 | restoreAddressToClassicResponse pResponseStatus_ =
RestoreAddressToClassicResponse'
{ _ratcrsStatus = Nothing
, _ratcrsPublicIP = Nothing
, _ratcrsResponseStatus = pResponseStatus_
} | 202 | true | true | 0 | 6 | 94 | 48 | 32 | 16 | null | null |
kosmoskatten/synthetic-web | test/TestSuite/Plan.hs | mit | encodeDecodePlanIsEqual :: Plan -> Bool
encodeDecodePlanIsEqual plan =
case parse parsePlan "" $ writePlan plan of
Right plan' -> plan' == plan
Left _ -> False
-- | From an encoded plan decorated with comments, the decoded plan
-- shall be equal to the original plan. | 283 | encodeDecodePlanIsEqual :: Plan -> Bool
encodeDecodePlanIsEqual plan =
case parse parsePlan "" $ writePlan plan of
Right plan' -> plan' == plan
Left _ -> False
-- | From an encoded plan decorated with comments, the decoded plan
-- shall be equal to the original plan. | 283 | encodeDecodePlanIsEqual plan =
case parse parsePlan "" $ writePlan plan of
Right plan' -> plan' == plan
Left _ -> False
-- | From an encoded plan decorated with comments, the decoded plan
-- shall be equal to the original plan. | 243 | false | true | 0 | 8 | 61 | 58 | 28 | 30 | null | null |
spechub/Hets | Interfaces/History.hs | gpl-2.0 | processList :: [ListChange] -> [Int_NodeInfo]
-> [ListChange] -> ([Int_NodeInfo], [ListChange])
processList ls elems acc
= case ls of
-- if nothing to process return elements and changes
[] -> (elems, acc)
x : l ->
-- else check what type of change we are dealing with
case x of
... | 1,676 | processList :: [ListChange] -> [Int_NodeInfo]
-> [ListChange] -> ([Int_NodeInfo], [ListChange])
processList ls elems acc
= case ls of
-- if nothing to process return elements and changes
[] -> (elems, acc)
x : l ->
-- else check what type of change we are dealing with
case x of
... | 1,676 | processList ls elems acc
= case ls of
-- if nothing to process return elements and changes
[] -> (elems, acc)
x : l ->
-- else check what type of change we are dealing with
case x of
-- if it is a change in axioms
AxiomsChange nwaxms nb ->
-- apply change and store the un... | 1,568 | false | true | 6 | 29 | 748 | 388 | 208 | 180 | null | null |
plancalculus/nextstep-plist | Text/NSPlist/Parsec.hs | bsd-3-clause | pLineComment :: Parsec String u String
pLineComment = const <$> string "//" <*> recLineComment <* spaces
where
recLineComment = try (const "" <$> char '\n')
<|> ((:) <$> anyChar <*> recLineComment)
-- apparently the elements of an array may be separated by commas, but an array
-- may as well have... | 352 | pLineComment :: Parsec String u String
pLineComment = const <$> string "//" <*> recLineComment <* spaces
where
recLineComment = try (const "" <$> char '\n')
<|> ((:) <$> anyChar <*> recLineComment)
-- apparently the elements of an array may be separated by commas, but an array
-- may as well have... | 352 | pLineComment = const <$> string "//" <*> recLineComment <* spaces
where
recLineComment = try (const "" <$> char '\n')
<|> ((:) <$> anyChar <*> recLineComment)
-- apparently the elements of an array may be separated by commas, but an array
-- may as well have a comma after the final element | 313 | false | true | 0 | 9 | 79 | 76 | 39 | 37 | null | null |
edom/sound | src/Sound/Random.hs | bsd-3-clause | vrandoms :: forall g a. (Randoms g a [], Ran.Random a, Fractional a, Vu.Unbox a) => Int -> g -> Vu.Vector a
vrandoms size gen = Vu.map (\ x -> x + x - 1) . vfromlist $ take size (randoms gen :: [a]) | 198 | vrandoms :: forall g a. (Randoms g a [], Ran.Random a, Fractional a, Vu.Unbox a) => Int -> g -> Vu.Vector a
vrandoms size gen = Vu.map (\ x -> x + x - 1) . vfromlist $ take size (randoms gen :: [a]) | 198 | vrandoms size gen = Vu.map (\ x -> x + x - 1) . vfromlist $ take size (randoms gen :: [a]) | 90 | false | true | 0 | 11 | 43 | 118 | 61 | 57 | null | null |
edsko/cabal | Cabal/src/Distribution/PackageDescription/Check.hs | bsd-3-clause | repoTypeDirname _ = [] | 31 | repoTypeDirname _ = [] | 31 | repoTypeDirname _ = [] | 31 | false | false | 0 | 5 | 12 | 11 | 5 | 6 | null | null |
ndmitchell/hogle-dead | src/Action/Server.hs | bsd-3-clause | test :: IO ()
test = testing "Action.Server.displayItem" $ do
let expand = replace "{|" "<span class=name>" . replace "|}" "</span>" . replace "{*" "<b>" . replace "*}" "</b>"
collapse = replace "{|" "" . replace "|}" "" . replace "{*" "" . replace "*}" ""
let q === s | Just i <- readItem $ collapse s, ... | 758 | test :: IO ()
test = testing "Action.Server.displayItem" $ do
let expand = replace "{|" "<span class=name>" . replace "|}" "</span>" . replace "{*" "<b>" . replace "*}" "</b>"
collapse = replace "{|" "" . replace "|}" "" . replace "{*" "" . replace "*}" ""
let q === s | Just i <- readItem $ collapse s, ... | 758 | test = testing "Action.Server.displayItem" $ do
let expand = replace "{|" "<span class=name>" . replace "|}" "</span>" . replace "{*" "<b>" . replace "*}" "</b>"
collapse = replace "{|" "" . replace "|}" "" . replace "{*" "" . replace "*}" ""
let q === s | Just i <- readItem $ collapse s, displayItem (p... | 744 | false | true | 2 | 17 | 169 | 266 | 118 | 148 | null | null |
frankiesardo/seven-languages-in-seven-weeks | src/main/haskell/day2/sort_with.hs | apache-2.0 | sortWith f (h:t) = (sort lesser) ++ [h] ++ (sort greater)
where
lesser = filter (not . f h) t
greater = filter (f h) t | 154 | sortWith f (h:t) = (sort lesser) ++ [h] ++ (sort greater)
where
lesser = filter (not . f h) t
greater = filter (f h) t | 154 | sortWith f (h:t) = (sort lesser) ++ [h] ++ (sort greater)
where
lesser = filter (not . f h) t
greater = filter (f h) t | 154 | false | false | 0 | 10 | 61 | 79 | 40 | 39 | null | null |
mmath10/Moof | src/PostIndent.hs | lgpl-3.0 | --Function to map lexer tokens to the tokens that the
--parser will recieve
iTran T_Slash = I_Slash | 99 | iTran T_Slash = I_Slash | 23 | iTran T_Slash = I_Slash | 23 | true | false | 1 | 5 | 16 | 15 | 6 | 9 | null | null |
xu-hao/QueryArrow | QueryArrow-db-cypher/src/QueryArrow/Cypher/Cypher.hs | bsd-3-clause | cypherDeterminedVars builtin (FSequencing form1 form2) =
cypherDeterminedVars builtin form1 `union` cypherDeterminedVars builtin form2 | 138 | cypherDeterminedVars builtin (FSequencing form1 form2) =
cypherDeterminedVars builtin form1 `union` cypherDeterminedVars builtin form2 | 138 | cypherDeterminedVars builtin (FSequencing form1 form2) =
cypherDeterminedVars builtin form1 `union` cypherDeterminedVars builtin form2 | 138 | false | false | 0 | 7 | 16 | 35 | 17 | 18 | null | null |
jeroennoels/exact-real | src/Ternary/Compiler/StateSpace.hs | mit | decode :: CodePoint -> (TriangleParam, TS)
decode (Normal i) = Set.elemAt i normalStateBundle | 93 | decode :: CodePoint -> (TriangleParam, TS)
decode (Normal i) = Set.elemAt i normalStateBundle | 93 | decode (Normal i) = Set.elemAt i normalStateBundle | 50 | false | true | 0 | 6 | 12 | 41 | 20 | 21 | null | null |
GaloisInc/elf | src/Data/ElfEdit.hs | bsd-3-clause | steVisibility :: ElfSymbolTableEntry w -> ElfSymbolVisibility
steVisibility e = ElfSymbolVisibility (steOther e .&. 0x3) | 120 | steVisibility :: ElfSymbolTableEntry w -> ElfSymbolVisibility
steVisibility e = ElfSymbolVisibility (steOther e .&. 0x3) | 120 | steVisibility e = ElfSymbolVisibility (steOther e .&. 0x3) | 58 | false | true | 0 | 8 | 13 | 34 | 16 | 18 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.