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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
davidlazar/generic-k | src/Data/Generics/K/ToK.hs | mit | defaultToKLabel :: (Data a) => a -> KLabel
defaultToKLabel a = KLabel $ Syntax ctor : replicate (glength a) Hole
where ctor = showConstr . toConstr $ a | 155 | defaultToKLabel :: (Data a) => a -> KLabel
defaultToKLabel a = KLabel $ Syntax ctor : replicate (glength a) Hole
where ctor = showConstr . toConstr $ a | 155 | defaultToKLabel a = KLabel $ Syntax ctor : replicate (glength a) Hole
where ctor = showConstr . toConstr $ a | 112 | false | true | 0 | 8 | 31 | 64 | 32 | 32 | null | null |
michaelficarra/purescript | src/Language/PureScript/Publish/BoxesHelpers.hs | mit | indentWidth :: Int
indentWidth = 2 | 34 | indentWidth :: Int
indentWidth = 2 | 34 | indentWidth = 2 | 15 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
Sgoettschkes/learning | haskell/ProjectEuler/tests/Problems/Problem053Spec.hs | mit | main :: IO()
main = hspec spec | 30 | main :: IO()
main = hspec spec | 30 | main = hspec spec | 17 | false | true | 0 | 7 | 6 | 25 | 10 | 15 | null | null |
meiersi/scyther-proof | src/Scyther/Theory/FOL.hs | gpl-3.0 | -- | Build an intermediate disjunction by evaluationg the ListT transformed
-- monadic computation of a formula and returning it as a single disjunctive
-- formula.
--
-- TODO: Move
interDisjM :: Monad m => ListT m F.Formula -> ListT m F.Formula
interDisjM f = do
formulas <- lift $ runListT f
case formulas of
[... | 365 | interDisjM :: Monad m => ListT m F.Formula -> ListT m F.Formula
interDisjM f = do
formulas <- lift $ runListT f
case formulas of
[] -> mzero
_ -> return $ F.disj formulas | 183 | interDisjM f = do
formulas <- lift $ runListT f
case formulas of
[] -> mzero
_ -> return $ F.disj formulas | 119 | true | true | 0 | 13 | 76 | 93 | 44 | 49 | null | null |
liamoc/hilbert | Prover.hs | bsd-3-clause | oops :: ProofTreeZipper -> ProofTreeZipper
oops (PTZ ctx (PT str _)) = PTZ ctx (PT str Nothing) | 95 | oops :: ProofTreeZipper -> ProofTreeZipper
oops (PTZ ctx (PT str _)) = PTZ ctx (PT str Nothing) | 95 | oops (PTZ ctx (PT str _)) = PTZ ctx (PT str Nothing) | 52 | false | true | 0 | 9 | 16 | 47 | 23 | 24 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AccountUserProFiles/Patch.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
aupfpUploadProtocol :: Lens' AccountUserProFilesPatch (Maybe Text)
aupfpUploadProtocol
= lens _aupfpUploadProtocol
(\ s a -> s{_aupfpUploadProtocol = a}) | 223 | aupfpUploadProtocol :: Lens' AccountUserProFilesPatch (Maybe Text)
aupfpUploadProtocol
= lens _aupfpUploadProtocol
(\ s a -> s{_aupfpUploadProtocol = a}) | 161 | aupfpUploadProtocol
= lens _aupfpUploadProtocol
(\ s a -> s{_aupfpUploadProtocol = a}) | 94 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
lindenbaum/mediabus | src/Data/MediaBus/Conduit/Stream.hs | bsd-3-clause | -- | Log a stream.
logStreamC ::
(Show (Stream i s t p c), Monad m, MonadLogger m) =>
(Stream i s t p c -> Maybe LogLevel) ->
Text ->
ConduitT (Stream i s t p c) (Stream i s t p c) m ()
logStreamC f title =
mapMC
( \x -> do
mapM_ (`logOtherN` (title <> fromString (show x))) (f x)
return x
... | 325 | logStreamC ::
(Show (Stream i s t p c), Monad m, MonadLogger m) =>
(Stream i s t p c -> Maybe LogLevel) ->
Text ->
ConduitT (Stream i s t p c) (Stream i s t p c) m ()
logStreamC f title =
mapMC
( \x -> do
mapM_ (`logOtherN` (title <> fromString (show x))) (f x)
return x
) | 306 | logStreamC f title =
mapMC
( \x -> do
mapM_ (`logOtherN` (title <> fromString (show x))) (f x)
return x
) | 131 | true | true | 0 | 16 | 100 | 178 | 88 | 90 | null | null |
uduki/hsQt | Qtc/Gui/QWidget.hs | bsd-2-clause | qWidgetSetTabOrder :: ((QWidget t1, QWidget t2)) -> IO ()
qWidgetSetTabOrder (x1, x2)
= withObjectPtr x1 $ \cobj_x1 ->
withObjectPtr x2 $ \cobj_x2 ->
qtc_QWidget_setTabOrder cobj_x1 cobj_x2 | 199 | qWidgetSetTabOrder :: ((QWidget t1, QWidget t2)) -> IO ()
qWidgetSetTabOrder (x1, x2)
= withObjectPtr x1 $ \cobj_x1 ->
withObjectPtr x2 $ \cobj_x2 ->
qtc_QWidget_setTabOrder cobj_x1 cobj_x2 | 199 | qWidgetSetTabOrder (x1, x2)
= withObjectPtr x1 $ \cobj_x1 ->
withObjectPtr x2 $ \cobj_x2 ->
qtc_QWidget_setTabOrder cobj_x1 cobj_x2 | 141 | false | true | 0 | 9 | 35 | 73 | 37 | 36 | null | null |
adbrowne/dynamodb-eventstore | dynamodb-eventstore/tests/DynamoDbEventStore/InMemoryDynamoTable.hs | mit | queryDb :: QueryDirection -> Text -> Natural -> Maybe Int64 -> InMemoryDynamoTable -> [DynamoReadResult]
queryDb direction streamId maxEvents startEvent db =
let
rangeItems = db ^. inMemoryDynamoTableTable . at streamId . non mempty
items = case (direction, startEvent) of
(QueryDirectionForward, Nothing... | 1,033 | queryDb :: QueryDirection -> Text -> Natural -> Maybe Int64 -> InMemoryDynamoTable -> [DynamoReadResult]
queryDb direction streamId maxEvents startEvent db =
let
rangeItems = db ^. inMemoryDynamoTableTable . at streamId . non mempty
items = case (direction, startEvent) of
(QueryDirectionForward, Nothing... | 1,033 | queryDb direction streamId maxEvents startEvent db =
let
rangeItems = db ^. inMemoryDynamoTableTable . at streamId . non mempty
items = case (direction, startEvent) of
(QueryDirectionForward, Nothing) -> Map.toAscList rangeItems
(QueryDirectionForward, Just startEventNumber) ->
rangeItems
... | 928 | false | true | 0 | 16 | 229 | 259 | 135 | 124 | null | null |
ruuda/hoff | tests/ServerSpec.hs | apache-2.0 | isCommitStatusEvent :: Github.WebhookEvent -> Bool
isCommitStatusEvent event = case event of
Github.CommitStatus _ -> True
_ -> False | 157 | isCommitStatusEvent :: Github.WebhookEvent -> Bool
isCommitStatusEvent event = case event of
Github.CommitStatus _ -> True
_ -> False | 157 | isCommitStatusEvent event = case event of
Github.CommitStatus _ -> True
_ -> False | 106 | false | true | 0 | 9 | 41 | 41 | 20 | 21 | null | null |
Ming-Tang/FP15 | src/FP15/Compiler/Syntax/CommaNotation.hs | mit | walkCommaNode (CompN1 n e) = UComp1 <$> walkCommaInfix n <*> return e | 69 | walkCommaNode (CompN1 n e) = UComp1 <$> walkCommaInfix n <*> return e | 69 | walkCommaNode (CompN1 n e) = UComp1 <$> walkCommaInfix n <*> return e | 69 | false | false | 0 | 7 | 11 | 31 | 14 | 17 | null | null |
haskellGardener/yusic | src/Yusic.hs | mit | toSigPitch Cs_Db7 = Cs_Db | 25 | toSigPitch Cs_Db7 = Cs_Db | 25 | toSigPitch Cs_Db7 = Cs_Db | 25 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ml9951/ghc | compiler/prelude/THNames.hs | bsd-3-clause | -- data FamilyResultSig = ...
noSigIdKey, kindSigIdKey, tyVarSigIdKey :: Unique
noSigIdKey = mkPreludeMiscIdUnique 416 | 125 | noSigIdKey, kindSigIdKey, tyVarSigIdKey :: Unique
noSigIdKey = mkPreludeMiscIdUnique 416 | 95 | noSigIdKey = mkPreludeMiscIdUnique 416 | 45 | true | true | 0 | 5 | 20 | 19 | 12 | 7 | null | null |
np/lens | src/Control/Lens/Traversal.hs | bsd-3-clause | insT :: BazaarT a b f t -> [a]
insT = toListOf bazaarT | 54 | insT :: BazaarT a b f t -> [a]
insT = toListOf bazaarT | 54 | insT = toListOf bazaarT | 23 | false | true | 0 | 6 | 12 | 30 | 15 | 15 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | supplyRequired ZergDefiler = 4 | 30 | supplyRequired ZergDefiler = 4 | 30 | supplyRequired ZergDefiler = 4 | 30 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
urbanslug/ghc | testsuite/tests/boxy/PList1.hs | bsd-3-clause | test3 :: [Sid] -- SLPJ added
test3 = reverse test2 | 50 | test3 :: [Sid]
test3 = reverse test2 | 36 | test3 = reverse test2 | 21 | true | true | 0 | 5 | 9 | 18 | 10 | 8 | null | null |
brendanhay/gogol | gogol-ml/gen/Network/Google/Resource/Ml/Projects/Models/Patch.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pmpUploadProtocol :: Lens' ProjectsModelsPatch (Maybe Text)
pmpUploadProtocol
= lens _pmpUploadProtocol
(\ s a -> s{_pmpUploadProtocol = a}) | 210 | pmpUploadProtocol :: Lens' ProjectsModelsPatch (Maybe Text)
pmpUploadProtocol
= lens _pmpUploadProtocol
(\ s a -> s{_pmpUploadProtocol = a}) | 148 | pmpUploadProtocol
= lens _pmpUploadProtocol
(\ s a -> s{_pmpUploadProtocol = a}) | 88 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
brendanhay/gogol | gogol-qpxexpress/gen/Network/Google/QPXExpress/Types.hs | mpl-2.0 | -- | Default request referring to version 'v1' of the QPX Express API. This contains the host and root path used as a starting point for constructing service requests.
qPXExpressService :: ServiceConfig
qPXExpressService
= defaultService (ServiceId "qpxExpress:v1")
"www.googleapis.com" | 294 | qPXExpressService :: ServiceConfig
qPXExpressService
= defaultService (ServiceId "qpxExpress:v1")
"www.googleapis.com" | 126 | qPXExpressService
= defaultService (ServiceId "qpxExpress:v1")
"www.googleapis.com" | 91 | true | true | 0 | 7 | 45 | 26 | 12 | 14 | null | null |
angler-lang/angler-lang | src/Language/Angler/MixfixParser.hs | bsd-3-clause | runMixfix :: LoadPrecTable a -> (a, LoadPrecTableState)
runMixfix = flip runState def | 85 | runMixfix :: LoadPrecTable a -> (a, LoadPrecTableState)
runMixfix = flip runState def | 85 | runMixfix = flip runState def | 29 | false | true | 0 | 6 | 11 | 29 | 15 | 14 | null | null |
wavewave/madgraph-auto-dataset | src/HEP/Automation/MadGraph/Dataset/Set20110718set1TEV.hs | gpl-3.0 | eventsets :: [EventSet]
eventsets =
[ EventSet processSetup
(RS { param = p
, numevent = 100000
, machine = TeVatron
, rgrun = Fixed
, rgscale = 200.0
, match = MLM
, cut = DefCut
... | 618 | eventsets :: [EventSet]
eventsets =
[ EventSet processSetup
(RS { param = p
, numevent = 100000
, machine = TeVatron
, rgrun = Fixed
, rgscale = 200.0
, match = MLM
, cut = DefCut
... | 618 | eventsets =
[ EventSet processSetup
(RS { param = p
, numevent = 100000
, machine = TeVatron
, rgrun = Fixed
, rgscale = 200.0
, match = MLM
, cut = DefCut
, pythia ... | 594 | false | true | 0 | 11 | 350 | 134 | 78 | 56 | null | null |
xmonad/xmonad-contrib | XMonad/Prompt.hs | bsd-3-clause | -- | Modify the prompter, i.e. for chaining prompters.
modifyPrompter :: ((String -> String) -> (String -> String)) -> XP ()
modifyPrompter p = modify $ \s -> s { prompter = p $ prompter s } | 190 | modifyPrompter :: ((String -> String) -> (String -> String)) -> XP ()
modifyPrompter p = modify $ \s -> s { prompter = p $ prompter s } | 135 | modifyPrompter p = modify $ \s -> s { prompter = p $ prompter s } | 65 | true | true | 0 | 10 | 36 | 69 | 37 | 32 | null | null |
pbv/codex | src/Codex/Tester/InputOutput.hs | mit | numberResult :: Int -> Int -> String -> Result -> Result
numberResult num total args Result{..}
= Result resultStatus (test <> resultReport)
where test
= T.pack (printf "*** Test %d / %d ***\n\n" num total) <>
"Command-line arguments:\n" <> T.pack args <> "\n" | 284 | numberResult :: Int -> Int -> String -> Result -> Result
numberResult num total args Result{..}
= Result resultStatus (test <> resultReport)
where test
= T.pack (printf "*** Test %d / %d ***\n\n" num total) <>
"Command-line arguments:\n" <> T.pack args <> "\n" | 284 | numberResult num total args Result{..}
= Result resultStatus (test <> resultReport)
where test
= T.pack (printf "*** Test %d / %d ***\n\n" num total) <>
"Command-line arguments:\n" <> T.pack args <> "\n" | 227 | false | true | 9 | 7 | 66 | 83 | 45 | 38 | null | null |
marco-faustinelli/bassbull | src/Bassbull.hs | bsd-3-clause | fourth :: (a, b, c, d) -> d
fourth (_, _, _, d) = d | 51 | fourth :: (a, b, c, d) -> d
fourth (_, _, _, d) = d | 51 | fourth (_, _, _, d) = d | 23 | false | true | 0 | 6 | 14 | 46 | 26 | 20 | null | null |
brendanhay/gogol | gogol-plus-domains/gen/Network/Google/PlusDomains/Types/Product.hs | mpl-2.0 | -- | The image representation of this actor.
caImage :: Lens' CommentActor (Maybe CommentActorImage)
caImage = lens _caImage (\ s a -> s{_caImage = a}) | 151 | caImage :: Lens' CommentActor (Maybe CommentActorImage)
caImage = lens _caImage (\ s a -> s{_caImage = a}) | 106 | caImage = lens _caImage (\ s a -> s{_caImage = a}) | 50 | true | true | 0 | 9 | 24 | 46 | 25 | 21 | null | null |
dancor/melang | src/Util/ReadLines.hs | mit | hReadLines :: Handle -> IO [BS.ByteString]
hReadLines h =
liftM2 (:) (BS.hGetLine h) (hReadLines h)
`catch`
(\e -> if isEOFError e then return [] else ioError e) | 173 | hReadLines :: Handle -> IO [BS.ByteString]
hReadLines h =
liftM2 (:) (BS.hGetLine h) (hReadLines h)
`catch`
(\e -> if isEOFError e then return [] else ioError e) | 173 | hReadLines h =
liftM2 (:) (BS.hGetLine h) (hReadLines h)
`catch`
(\e -> if isEOFError e then return [] else ioError e) | 130 | false | true | 0 | 11 | 38 | 86 | 44 | 42 | null | null |
pikajude/kevin | src/Kevin/IRC/Protocol.hs | gpl-3.0 | -- * Authentication-getting function
notice :: Handle -> T.Text -> IO ()
notice h str = do
klogNow Blue ("client -> " ++ T.unpack asStr)
T.hPutStr h (asStr <> "\r\n")
where asStr = printf "NOTICE AUTH :%s" [str] | 231 | notice :: Handle -> T.Text -> IO ()
notice h str = do
klogNow Blue ("client -> " ++ T.unpack asStr)
T.hPutStr h (asStr <> "\r\n")
where asStr = printf "NOTICE AUTH :%s" [str] | 194 | notice h str = do
klogNow Blue ("client -> " ++ T.unpack asStr)
T.hPutStr h (asStr <> "\r\n")
where asStr = printf "NOTICE AUTH :%s" [str] | 158 | true | true | 0 | 11 | 57 | 84 | 41 | 43 | null | null |
konn/yapan | test/Text/JapandocSpec.hs | bsd-3-clause | main :: IO ()
main = hspec spec | 31 | main :: IO ()
main = hspec spec | 31 | main = hspec spec | 17 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
jamshidh/ethereum-data-leveldb | src/Blockchain/DB/CodeDB.hs | bsd-3-clause | addCode::B.ByteString->DBM ()
addCode = codeDBPut | 49 | addCode::B.ByteString->DBM ()
addCode = codeDBPut | 49 | addCode = codeDBPut | 19 | false | true | 0 | 8 | 4 | 29 | 12 | 17 | null | null |
bj4rtmar/sdl2 | src/SDL/Video/Renderer.hs | bsd-3-clause | -- | Bind an OpenGL\/ES\/ES2 texture to the current context for use with when rendering OpenGL primitives directly.
--
-- See @<https://wiki.libsdl.org/SDL_GL_BindTexture SDL_GL_BindTexture>@ for C documentation.
glBindTexture :: (Functor m,MonadIO m)
=> Texture -- ^ The texture to bind to the current Ope... | 500 | glBindTexture :: (Functor m,MonadIO m)
=> Texture -- ^ The texture to bind to the current OpenGL\/ES\/ES2 context
-> m ()
glBindTexture (Texture t) =
throwIfNeg_ "SDL.Video.Renderer.glBindTexture" "SDL_GL_BindTexture" $
Raw.glBindTexture t nullPtr nullPtr | 287 | glBindTexture (Texture t) =
throwIfNeg_ "SDL.Video.Renderer.glBindTexture" "SDL_GL_BindTexture" $
Raw.glBindTexture t nullPtr nullPtr | 137 | true | true | 0 | 10 | 90 | 73 | 35 | 38 | null | null |
bch29/robo-monad | src/Game/Robo/Core/Many/List.hs | gpl-3.0 | manyFromList :: [a] -> Many a
manyFromList = id | 47 | manyFromList :: [a] -> Many a
manyFromList = id | 47 | manyFromList = id | 17 | false | true | 0 | 6 | 8 | 21 | 11 | 10 | null | null |
tolysz/wai | warp-tls/Network/Wai/Handler/WarpTLS.hs | mit | fill :: S.ByteString -> Buffer -> BufSize -> Recv -> IO (Bool,S.ByteString)
fill bs0 buf0 siz0 recv
| siz0 <= len0 = do
let (bs, leftover) = S.splitAt siz0 bs0
void $ copy buf0 bs
return (True, leftover)
| otherwise = do
buf <- copy buf0 bs0
loop buf (siz0 - len0)
where
len0 = S.... | 693 | fill :: S.ByteString -> Buffer -> BufSize -> Recv -> IO (Bool,S.ByteString)
fill bs0 buf0 siz0 recv
| siz0 <= len0 = do
let (bs, leftover) = S.splitAt siz0 bs0
void $ copy buf0 bs
return (True, leftover)
| otherwise = do
buf <- copy buf0 bs0
loop buf (siz0 - len0)
where
len0 = S.... | 693 | fill bs0 buf0 siz0 recv
| siz0 <= len0 = do
let (bs, leftover) = S.splitAt siz0 bs0
void $ copy buf0 bs
return (True, leftover)
| otherwise = do
buf <- copy buf0 bs0
loop buf (siz0 - len0)
where
len0 = S.length bs0
loop _ 0 = return (True, "")
loop buf siz = do
... | 617 | false | true | 2 | 16 | 253 | 332 | 155 | 177 | null | null |
tek/proteome | packages/proteome/lib/Proteome/Files/Syntax.hs | mit | filesSyntax :: Syntax
filesSyntax =
Syntax items [] links
where
items =
[asterisk, base, name, sync]
links =
[hlAsterisk, hlBase, hlName] | 161 | filesSyntax :: Syntax
filesSyntax =
Syntax items [] links
where
items =
[asterisk, base, name, sync]
links =
[hlAsterisk, hlBase, hlName] | 161 | filesSyntax =
Syntax items [] links
where
items =
[asterisk, base, name, sync]
links =
[hlAsterisk, hlBase, hlName] | 139 | false | true | 0 | 6 | 44 | 54 | 31 | 23 | null | null |
pqwy/redex | src/Operations.hs | bsd-3-clause | splicingBeta, lazyBeta :: Term -> Term -> Term
splicingBeta (ast -> Lam x m) t = substitute t x m | 98 | splicingBeta, lazyBeta :: Term -> Term -> Term
splicingBeta (ast -> Lam x m) t = substitute t x m | 97 | splicingBeta (ast -> Lam x m) t = substitute t x m | 50 | false | true | 0 | 8 | 20 | 45 | 23 | 22 | null | null |
romanofski/codesnippets | courseraAlgorithms2/graphs/src/JSON.hs | unlicense | parseGraph :: Value -> Parser Graph
parseGraph v = do
p <- pure v >>= parseJSON :: Parser (Maybe JSONMap)
case p of
Just f -> pure (toGraph f)
Nothing -> fail "Can not parse JSON to build graph" | 206 | parseGraph :: Value -> Parser Graph
parseGraph v = do
p <- pure v >>= parseJSON :: Parser (Maybe JSONMap)
case p of
Just f -> pure (toGraph f)
Nothing -> fail "Can not parse JSON to build graph" | 206 | parseGraph v = do
p <- pure v >>= parseJSON :: Parser (Maybe JSONMap)
case p of
Just f -> pure (toGraph f)
Nothing -> fail "Can not parse JSON to build graph" | 170 | false | true | 1 | 13 | 50 | 81 | 37 | 44 | null | null |
eborden/website | src/Types.hs | bsd-3-clause | randomHill :: Bounds -> StdGen -> (Sprite, StdGen)
randomHill screen g =
let (x, g') = randomR (0, panelWidth screen) g
(w, g'') = randomR ((width screen `div` 10) * 3, (width screen `div` 10) * 5) g'
(c, g''') = randomColor g''
(h, newGen) = randomR ((height screen `div` 80) * 2, (height screen `di... | 437 | randomHill :: Bounds -> StdGen -> (Sprite, StdGen)
randomHill screen g =
let (x, g') = randomR (0, panelWidth screen) g
(w, g'') = randomR ((width screen `div` 10) * 3, (width screen `div` 10) * 5) g'
(c, g''') = randomColor g''
(h, newGen) = randomR ((height screen `div` 80) * 2, (height screen `di... | 437 | randomHill screen g =
let (x, g') = randomR (0, panelWidth screen) g
(w, g'') = randomR ((width screen `div` 10) * 3, (width screen `div` 10) * 5) g'
(c, g''') = randomColor g''
(h, newGen) = randomR ((height screen `div` 80) * 2, (height screen `div` 80) * 12) g'''
b = Bounds w h
p = Po... | 386 | false | true | 0 | 14 | 114 | 229 | 123 | 106 | null | null |
eatobin/cis194 | lesson1/src/LS01.hs | bsd-3-clause | -- Do nothing to the empty list
sumEveryTwo (x:[]) = [x] | 60 | sumEveryTwo (x:[]) = [x] | 28 | sumEveryTwo (x:[]) = [x] | 28 | true | false | 0 | 8 | 14 | 22 | 12 | 10 | null | null |
ekmett/bitwise | src/Data/Array/BitArray/IO.hs | bsd-3-clause | or :: Ix i => IOBitArray i -> IO Bool
or a = do
bs <- getBounds a
let total = rangeSize bs
full = total .&. complement (mask 6)
count = full `shiftR` 6
loop :: Ptr Word64 -> Int -> IO Bool
loop p n
| n < count = do
w <- peekElemOff p n
if w /= (0 :: Word64) th... | 660 | or :: Ix i => IOBitArray i -> IO Bool
or a = do
bs <- getBounds a
let total = rangeSize bs
full = total .&. complement (mask 6)
count = full `shiftR` 6
loop :: Ptr Word64 -> Int -> IO Bool
loop p n
| n < count = do
w <- peekElemOff p n
if w /= (0 :: Word64) th... | 660 | or a = do
bs <- getBounds a
let total = rangeSize bs
full = total .&. complement (mask 6)
count = full `shiftR` 6
loop :: Ptr Word64 -> Int -> IO Bool
loop p n
| n < count = do
w <- peekElemOff p n
if w /= (0 :: Word64) then return True else loop p (n + 1)
... | 622 | false | true | 0 | 16 | 243 | 278 | 130 | 148 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F15.hs | bsd-3-clause | ptr_glIsEnablediOES :: FunPtr (GLenum -> GLuint -> IO GLboolean)
ptr_glIsEnablediOES = unsafePerformIO $ getCommand "glIsEnablediOES" | 133 | ptr_glIsEnablediOES :: FunPtr (GLenum -> GLuint -> IO GLboolean)
ptr_glIsEnablediOES = unsafePerformIO $ getCommand "glIsEnablediOES" | 133 | ptr_glIsEnablediOES = unsafePerformIO $ getCommand "glIsEnablediOES" | 68 | false | true | 2 | 8 | 14 | 37 | 17 | 20 | null | null |
VictorDenisov/jdi | src/Language/Java/Jdwp.hs | gpl-2.0 | parseThreadGroupId :: JavaInt -> Get JavaThreadGroupId
parseThreadGroupId = parseObjectId | 89 | parseThreadGroupId :: JavaInt -> Get JavaThreadGroupId
parseThreadGroupId = parseObjectId | 89 | parseThreadGroupId = parseObjectId | 34 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
nushio3/Paraiso | Language/Paraiso/Generator/ClarisTrans.hs | bsd-3-clause | headerFile :: Context
headerFile = Context {fileType = HeaderFile, namespace = []} | 82 | headerFile :: Context
headerFile = Context {fileType = HeaderFile, namespace = []} | 82 | headerFile = Context {fileType = HeaderFile, namespace = []} | 60 | false | true | 0 | 7 | 11 | 27 | 16 | 11 | null | null |
DimaSamoz/mezzo | test/CompTestsCompile.hs | mit | scMoEfEFFs' = test $ (f hn :|: fs en) :-: (ef hn :|: e en) | 58 | scMoEfEFFs' = test $ (f hn :|: fs en) :-: (ef hn :|: e en) | 58 | scMoEfEFFs' = test $ (f hn :|: fs en) :-: (ef hn :|: e en) | 58 | false | false | 0 | 9 | 14 | 40 | 19 | 21 | null | null |
jeremyjh/distributed-process-lifted | test/Control/Distributed/Process/Lifted/Tests.hs | bsd-3-clause | testMonitorUnreachable :: TestTransport -> Bool -> Bool -> Assertion
testMonitorUnreachable TestTransport{..} mOrL un = do
deadProcess <- newEmptyMVar
done <- newEmptyMVar
forkIO $ do
localNode <- newLocalNode testTransport initRemoteTable
addr <- forkProcess localNode . liftIO $ threadDelay 1000000
... | 651 | testMonitorUnreachable :: TestTransport -> Bool -> Bool -> Assertion
testMonitorUnreachable TestTransport{..} mOrL un = do
deadProcess <- newEmptyMVar
done <- newEmptyMVar
forkIO $ do
localNode <- newLocalNode testTransport initRemoteTable
addr <- forkProcess localNode . liftIO $ threadDelay 1000000
... | 651 | testMonitorUnreachable TestTransport{..} mOrL un = do
deadProcess <- newEmptyMVar
done <- newEmptyMVar
forkIO $ do
localNode <- newLocalNode testTransport initRemoteTable
addr <- forkProcess localNode . liftIO $ threadDelay 1000000
closeLocalNode localNode
putMVar deadProcess addr
forkIO $ do
... | 582 | false | true | 1 | 14 | 122 | 168 | 72 | 96 | null | null |
egison/egison-tutorial | Main.hs | mit | showBanner :: IO ()
showBanner = do
putStrLn $ "Egison Tutorial Version " ++ showVersion P.version
putStrLn $ "Welcome to Egison Tutorial!"
putStrLn $ "** Information **"
putStrLn $ "We can use a \"Tab\" key to complete keywords on the interpreter."
putStrLn $ "If we type a \"Tab\" key after a closed parenthe... | 405 | showBanner :: IO ()
showBanner = do
putStrLn $ "Egison Tutorial Version " ++ showVersion P.version
putStrLn $ "Welcome to Egison Tutorial!"
putStrLn $ "** Information **"
putStrLn $ "We can use a \"Tab\" key to complete keywords on the interpreter."
putStrLn $ "If we type a \"Tab\" key after a closed parenthe... | 405 | showBanner = do
putStrLn $ "Egison Tutorial Version " ++ showVersion P.version
putStrLn $ "Welcome to Egison Tutorial!"
putStrLn $ "** Information **"
putStrLn $ "We can use a \"Tab\" key to complete keywords on the interpreter."
putStrLn $ "If we type a \"Tab\" key after a closed parenthesis, the next closed... | 385 | false | true | 0 | 9 | 74 | 67 | 30 | 37 | null | null |
mainland/nikola | src/Data/Vector/CUDA/Storable.hs | bsd-3-clause | unfoldrN = G.unfoldrN | 21 | unfoldrN = G.unfoldrN | 21 | unfoldrN = G.unfoldrN | 21 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | -- anti-aliasing flag: force on or off (default: the current system default)
wxFONTFLAG_ANTIALIASED :: Int
wxFONTFLAG_ANTIALIASED = 1 << 4 | 143 | wxFONTFLAG_ANTIALIASED :: Int
wxFONTFLAG_ANTIALIASED = 1 << 4 | 66 | wxFONTFLAG_ANTIALIASED = 1 << 4 | 36 | true | true | 0 | 6 | 24 | 23 | 10 | 13 | null | null |
alexandersgreen/qio-haskell | QIO/QioSyn.hs | bsd-2-clause | -- | Swap the state of the two given qubits
swap :: Qbit -> Qbit -> U
swap x y = Swap x y UReturn | 97 | swap :: Qbit -> Qbit -> U
swap x y = Swap x y UReturn | 53 | swap x y = Swap x y UReturn | 27 | true | true | 0 | 6 | 24 | 32 | 16 | 16 | null | null |
plcplc/muPromote-code | processors/test/MuPromote/Test/Unit/PromotableItem.hs | gpl-3.0 | -- | The collected specs testing promotion.
promotableItemSpecs :: Spec
promotableItemSpecs = do
promotableItem
-- | Specification for promotable items.
--
-- * Promotable items have a textual representation, used for marshalling.
-- Thus, we need to be able to read and write them. | 289 | promotableItemSpecs :: Spec
promotableItemSpecs = do
promotableItem
-- | Specification for promotable items.
--
-- * Promotable items have a textual representation, used for marshalling.
-- Thus, we need to be able to read and write them. | 245 | promotableItemSpecs = do
promotableItem
-- | Specification for promotable items.
--
-- * Promotable items have a textual representation, used for marshalling.
-- Thus, we need to be able to read and write them. | 217 | true | true | 0 | 7 | 50 | 26 | 13 | 13 | null | null |
beni55/language-c-inline | Language/C/Inline/State.hs | bsd-3-clause | modifyState :: (State -> State) -> Q ()
modifyState modify = runIO $ modifyIORef state modify | 93 | modifyState :: (State -> State) -> Q ()
modifyState modify = runIO $ modifyIORef state modify | 93 | modifyState modify = runIO $ modifyIORef state modify | 53 | false | true | 2 | 8 | 15 | 44 | 20 | 24 | null | null |
jfischoff/simple-poly | src/Language/SimplePoly/Infer.hs | bsd-3-clause | runEnvWith :: InferenceState
-> Env Identity Type
-> Either TypeError Type
runEnvWith initial = runIdentity . runEnvWithT initial | 153 | runEnvWith :: InferenceState
-> Env Identity Type
-> Either TypeError Type
runEnvWith initial = runIdentity . runEnvWithT initial | 153 | runEnvWith initial = runIdentity . runEnvWithT initial | 54 | false | true | 0 | 7 | 41 | 39 | 18 | 21 | null | null |
Concelo/concelo | src/Database/Concelo/Serializer.hs | bsd-3-clause | serializer private = Serializer private undefined (T.empty, T.empty) | 68 | serializer private = Serializer private undefined (T.empty, T.empty) | 68 | serializer private = Serializer private undefined (T.empty, T.empty) | 68 | false | false | 0 | 7 | 7 | 26 | 13 | 13 | null | null |
nevrenato/Hets_Fork | Maude/Maude2DG.hs | gpl-2.0 | newParamers4sorts _ _ _ = [] | 28 | newParamers4sorts _ _ _ = [] | 28 | newParamers4sorts _ _ _ = [] | 28 | false | false | 1 | 6 | 5 | 16 | 6 | 10 | null | null |
ltcmelo/psychec | formalism/muC.hs | bsd-3-clause | showConfig cfg@(Config { phi, psi, theta, k, kE, kF, kI, kW }) =
show $
formatPhiPsiTheta (phi, psi, theta) PP.<>
PP.text " [Ke] = " PP.<> ppK kE PP.<+> PP.text "\n" PP.<>
PP.text " [Kf] = " PP.<> ppK kF PP.<+> PP.text "\n" PP.<>
PP.text " [Ki] = " PP.<> ppK kI PP.<+> PP.text "\n" PP.<>
PP.text " [Kw] = " P... | 331 | showConfig cfg@(Config { phi, psi, theta, k, kE, kF, kI, kW }) =
show $
formatPhiPsiTheta (phi, psi, theta) PP.<>
PP.text " [Ke] = " PP.<> ppK kE PP.<+> PP.text "\n" PP.<>
PP.text " [Kf] = " PP.<> ppK kF PP.<+> PP.text "\n" PP.<>
PP.text " [Ki] = " PP.<> ppK kI PP.<+> PP.text "\n" PP.<>
PP.text " [Kw] = " P... | 331 | showConfig cfg@(Config { phi, psi, theta, k, kE, kF, kI, kW }) =
show $
formatPhiPsiTheta (phi, psi, theta) PP.<>
PP.text " [Ke] = " PP.<> ppK kE PP.<+> PP.text "\n" PP.<>
PP.text " [Kf] = " PP.<> ppK kF PP.<+> PP.text "\n" PP.<>
PP.text " [Ki] = " PP.<> ppK kI PP.<+> PP.text "\n" PP.<>
PP.text " [Kw] = " P... | 331 | false | false | 0 | 18 | 75 | 171 | 85 | 86 | null | null |
juretta/course | src/L02/List.hs | bsd-3-clause | -- Exercise 9
-- Relative Difficulty: 8
-- Correctness: 3.5 marks
-- Performance: 3.0 marks
-- Elegance: 2.5 marks
-- Total: 9
maximum :: List Int -> Int
maximum Nil = error "Empty list does not have a maximum" | 210 | maximum :: List Int -> Int
maximum Nil = error "Empty list does not have a maximum" | 83 | maximum Nil = error "Empty list does not have a maximum" | 56 | true | true | 0 | 6 | 38 | 30 | 17 | 13 | null | null |
christiaanb/ghc-typelits-extra | tests/ErrorTests.hs | bsd-2-clause | testFail14Errors =
["Expected: Proxy (FLog 0 4) -> Proxy 100"
," Actual: Proxy 100 -> Proxy 100"
] | 105 | testFail14Errors =
["Expected: Proxy (FLog 0 4) -> Proxy 100"
," Actual: Proxy 100 -> Proxy 100"
] | 105 | testFail14Errors =
["Expected: Proxy (FLog 0 4) -> Proxy 100"
," Actual: Proxy 100 -> Proxy 100"
] | 105 | false | false | 0 | 5 | 24 | 12 | 7 | 5 | null | null |
robstewart57/bindings-dc1394 | Bindings/DC1394/Types.hs | bsd-3-clause | fromFramerate Rate_30 = c'DC1394_FRAMERATE_30 | 45 | fromFramerate Rate_30 = c'DC1394_FRAMERATE_30 | 45 | fromFramerate Rate_30 = c'DC1394_FRAMERATE_30 | 45 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
ony/hledger | hledger-lib/Hledger/Data/Dates.hs | gpl-3.0 | -- | Calculate the intersection of a number of datespans.
spansIntersect [] = nulldatespan | 90 | spansIntersect [] = nulldatespan | 32 | spansIntersect [] = nulldatespan | 32 | true | false | 0 | 6 | 13 | 12 | 6 | 6 | null | null |
SimSaladin/hajong | hajong-server/src/Mahjong/Hand/Yaku/Standard.hs | mit | honitsu :: YakuCheck Yaku
honitsu = do
concealedHandDegrade
anyMentsuJantou honor
tile <- anyMentsuJantou' suited <&> tileGroupHead
replicateM_ 3 $ anyMentsuJantou (honor |. sameSuit tile)
return (Yaku 3 "Honitsu") | 234 | honitsu :: YakuCheck Yaku
honitsu = do
concealedHandDegrade
anyMentsuJantou honor
tile <- anyMentsuJantou' suited <&> tileGroupHead
replicateM_ 3 $ anyMentsuJantou (honor |. sameSuit tile)
return (Yaku 3 "Honitsu") | 234 | honitsu = do
concealedHandDegrade
anyMentsuJantou honor
tile <- anyMentsuJantou' suited <&> tileGroupHead
replicateM_ 3 $ anyMentsuJantou (honor |. sameSuit tile)
return (Yaku 3 "Honitsu") | 208 | false | true | 0 | 11 | 47 | 74 | 32 | 42 | null | null |
TomMD/ghc | compiler/types/TypeRep.hs | bsd-3-clause | ------------
pprClassPred :: Class -> [Type] -> SDoc
pprClassPred clas tys = pprTypeApp (classTyCon clas) tys | 109 | pprClassPred :: Class -> [Type] -> SDoc
pprClassPred clas tys = pprTypeApp (classTyCon clas) tys | 96 | pprClassPred clas tys = pprTypeApp (classTyCon clas) tys | 56 | true | true | 0 | 7 | 15 | 39 | 20 | 19 | null | null |
themoritz/cabal | cabal-testsuite/PackageTests/NewBuild/CmdRun/MultipleExes/cabal.test.hs | bsd-3-clause | main = cabalTest $ do
-- some ways of explicitly specifying an exe
cabal' "new-run" ["foo"] >>= assertOutputContains "Hello Foo"
cabal' "new-run" ["exe:bar"] >>= assertOutputContains "Hello Bar"
cabal' "new-run" ["MultipleExes:foo"] >>= assertOutputContains "Hello Foo"
-- there are multiple exes in ... | 525 | main = cabalTest $ do
-- some ways of explicitly specifying an exe
cabal' "new-run" ["foo"] >>= assertOutputContains "Hello Foo"
cabal' "new-run" ["exe:bar"] >>= assertOutputContains "Hello Bar"
cabal' "new-run" ["MultipleExes:foo"] >>= assertOutputContains "Hello Foo"
-- there are multiple exes in ... | 525 | main = cabalTest $ do
-- some ways of explicitly specifying an exe
cabal' "new-run" ["foo"] >>= assertOutputContains "Hello Foo"
cabal' "new-run" ["exe:bar"] >>= assertOutputContains "Hello Bar"
cabal' "new-run" ["MultipleExes:foo"] >>= assertOutputContains "Hello Foo"
-- there are multiple exes in ... | 525 | false | false | 0 | 12 | 92 | 115 | 54 | 61 | null | null |
williamHuang5468/LearningHaskell | CH6 High Order Function/High Order Function.hs | mit | applyTwice :: (a -> a) -> a -> a
-- 它標明了首個參數是個參數與回傳值型別都是a的函數,
-- 第二個參數與回傳值的型別也都是a。
-- 其首個參數是個型別為 (a->a) 的函數,第二個參數是個 a。 該函數的型別可以是 (Int->Int),也可以是 (String->String),但第二個參數必須與之一致。
applyTwice f x = f (f x) | 206 | applyTwice :: (a -> a) -> a -> a
applyTwice f x = f (f x) | 57 | applyTwice f x = f (f x) | 24 | true | true | 0 | 7 | 33 | 43 | 23 | 20 | null | null |
thomie/vector | Data/Vector/Storable.hs | bsd-3-clause | notElem = G.notElem | 19 | notElem = G.notElem | 19 | notElem = G.notElem | 19 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
formrre/yi | yi-core/src/Yi/Config/Simple.hs | gpl-2.0 | -- | List version of 'runAfterStartup'.
runManyAfterStartup :: [Action] -> ConfigM ()
runManyAfterStartup actions = initialActions %= (++ actions) | 146 | runManyAfterStartup :: [Action] -> ConfigM ()
runManyAfterStartup actions = initialActions %= (++ actions) | 106 | runManyAfterStartup actions = initialActions %= (++ actions) | 60 | true | true | 0 | 7 | 18 | 35 | 19 | 16 | null | null |
uduki/hsQt | Qtc/Gui/QPalette.hs | bsd-2-clause | brightText :: QPalette a -> (()) -> IO (QBrush ())
brightText x0 ()
= withObjectRefResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QPalette_brightText cobj_x0 | 164 | brightText :: QPalette a -> (()) -> IO (QBrush ())
brightText x0 ()
= withObjectRefResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QPalette_brightText cobj_x0 | 164 | brightText x0 ()
= withObjectRefResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QPalette_brightText cobj_x0 | 113 | false | true | 0 | 10 | 32 | 64 | 31 | 33 | null | null |
dschalk/JS-monads-part2 | Main.hs | bsd-3-clause | getGroup :: Text -> [(Text,Int,Text,WS.Connection)] -> Text
getGroup name state = extract [ c | (a,_,c,_) <- state, name == a ] | 127 | getGroup :: Text -> [(Text,Int,Text,WS.Connection)] -> Text
getGroup name state = extract [ c | (a,_,c,_) <- state, name == a ] | 127 | getGroup name state = extract [ c | (a,_,c,_) <- state, name == a ] | 67 | false | true | 0 | 10 | 21 | 81 | 43 | 38 | null | null |
emwap/feldspar-language | src/Feldspar/Core/Types.hs | bsd-3-clause | signedness :: Signedness s -> String
signedness U = "Word" | 58 | signedness :: Signedness s -> String
signedness U = "Word" | 58 | signedness U = "Word" | 21 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
brendanhay/gogol | gogol-youtube/gen/Network/Google/Resource/YouTube/LiveBroadcasts/Transition.hs | mpl-2.0 | -- | The *part* parameter specifies a comma-separated list of one or more
-- liveBroadcast resource properties that the API response will include.
-- The part names that you can include in the parameter value are id,
-- snippet, contentDetails, and status.
lbtPart :: Lens' LiveBroadcastsTransition [Text]
lbtPart
= le... | 368 | lbtPart :: Lens' LiveBroadcastsTransition [Text]
lbtPart
= lens _lbtPart (\ s a -> s{_lbtPart = a}) . _Coerce | 111 | lbtPart
= lens _lbtPart (\ s a -> s{_lbtPart = a}) . _Coerce | 62 | true | true | 0 | 10 | 61 | 52 | 29 | 23 | null | null |
pmiddend/physie | src/Physie/Main.hs | mit | drawPoint :: V2 Double -> GameState ()
drawPoint p = do
r <- use renderer
let o = 3
ls = [
(p + V2 (-o) (-o),p + V2 o (-o))
, (p + V2 o (-o),p + V2 o o)
, (p + V2 o o,p + V2 (-o) o)
, (p + V2 (-o) o,p + V2 (-o) (-o))]
lift $ mapM_ (drawLine r) $ over (traverse .... | 340 | drawPoint :: V2 Double -> GameState ()
drawPoint p = do
r <- use renderer
let o = 3
ls = [
(p + V2 (-o) (-o),p + V2 o (-o))
, (p + V2 o (-o),p + V2 o o)
, (p + V2 o o,p + V2 (-o) o)
, (p + V2 (-o) o,p + V2 (-o) (-o))]
lift $ mapM_ (drawLine r) $ over (traverse .... | 340 | drawPoint p = do
r <- use renderer
let o = 3
ls = [
(p + V2 (-o) (-o),p + V2 o (-o))
, (p + V2 o (-o),p + V2 o o)
, (p + V2 o o,p + V2 (-o) o)
, (p + V2 (-o) o,p + V2 (-o) (-o))]
lift $ mapM_ (drawLine r) $ over (traverse . each) toIntPoint ls | 301 | false | true | 0 | 16 | 130 | 237 | 120 | 117 | null | null |
GaloisInc/halvm-ghc | compiler/codeGen/StgCmmMonad.hs | bsd-3-clause | -- ----------------------------------------------------------------------------
-- Get/set the current ticky counter label
getTickyCtrLabel :: FCode CLabel
getTickyCtrLabel = do
info <- getInfoDown
return (cgd_ticky info) | 238 | getTickyCtrLabel :: FCode CLabel
getTickyCtrLabel = do
info <- getInfoDown
return (cgd_ticky info) | 114 | getTickyCtrLabel = do
info <- getInfoDown
return (cgd_ticky info) | 81 | true | true | 1 | 10 | 38 | 39 | 17 | 22 | null | null |
da-x/lamdu | bottlelib/Graphics/UI/Bottle/Widgets/TextEdit.hs | gpl-3.0 | makeDisplayStr :: String -> String -> String
makeDisplayStr empty "" = empty | 77 | makeDisplayStr :: String -> String -> String
makeDisplayStr empty "" = empty | 77 | makeDisplayStr empty "" = empty | 32 | false | true | 0 | 6 | 12 | 24 | 12 | 12 | null | null |
edsko/cabal | Cabal/src/Distribution/Simple/Utils.hs | bsd-3-clause | copyDirectoryRecursiveVerbose :: Verbosity -> FilePath -> FilePath -> IO ()
copyDirectoryRecursiveVerbose verbosity srcDir destDir = do
info verbosity ("copy directory '" ++ srcDir ++ "' to '" ++ destDir ++ "'.")
srcFiles <- getDirectoryContentsRecursive srcDir
copyFiles verbosity destDir [ (srcDir, f) | f <- src... | 451 | copyDirectoryRecursiveVerbose :: Verbosity -> FilePath -> FilePath -> IO ()
copyDirectoryRecursiveVerbose verbosity srcDir destDir = do
info verbosity ("copy directory '" ++ srcDir ++ "' to '" ++ destDir ++ "'.")
srcFiles <- getDirectoryContentsRecursive srcDir
copyFiles verbosity destDir [ (srcDir, f) | f <- src... | 451 | copyDirectoryRecursiveVerbose verbosity srcDir destDir = do
info verbosity ("copy directory '" ++ srcDir ++ "' to '" ++ destDir ++ "'.")
srcFiles <- getDirectoryContentsRecursive srcDir
copyFiles verbosity destDir [ (srcDir, f) | f <- srcFiles ]
---------------------------
-- Temporary files and dirs
-- | Advan... | 375 | false | true | 0 | 12 | 67 | 102 | 51 | 51 | null | null |
tibbe/ghc | compiler/cmm/PprC.hs | bsd-3-clause | isStrangeTypeGlobal :: GlobalReg -> Bool
isStrangeTypeGlobal CCCS = True | 87 | isStrangeTypeGlobal :: GlobalReg -> Bool
isStrangeTypeGlobal CCCS = True | 87 | isStrangeTypeGlobal CCCS = True | 46 | false | true | 0 | 5 | 23 | 18 | 9 | 9 | null | null |
codemac/yi-editor | src/Shim/Udproxy.hs | gpl-2.0 | main :: IO ()
main = withSocketsDo$ do
args <- getArgs
case args of
[socketfile] -> do
h <- connectServer socketfile -- portStr in win32
hSetBuffering stdout NoBuffering
hSetBuffering h LineBuffering
forkIO(stdinToSocket h)
stdoutFromSocket h
_ -> do
usage
exitFail... | 323 | main :: IO ()
main = withSocketsDo$ do
args <- getArgs
case args of
[socketfile] -> do
h <- connectServer socketfile -- portStr in win32
hSetBuffering stdout NoBuffering
hSetBuffering h LineBuffering
forkIO(stdinToSocket h)
stdoutFromSocket h
_ -> do
usage
exitFail... | 323 | main = withSocketsDo$ do
args <- getArgs
case args of
[socketfile] -> do
h <- connectServer socketfile -- portStr in win32
hSetBuffering stdout NoBuffering
hSetBuffering h LineBuffering
forkIO(stdinToSocket h)
stdoutFromSocket h
_ -> do
usage
exitFailure | 309 | false | true | 0 | 15 | 94 | 100 | 44 | 56 | null | null |
Xandaros/abnf | src/Text/ABNF/ABNF/Parser.hs | bsd-2-clause | vchar :: Parser Char
vchar = satisfy (\c -> ord c >= 0x21 && ord c <= 0x7E) | 75 | vchar :: Parser Char
vchar = satisfy (\c -> ord c >= 0x21 && ord c <= 0x7E) | 75 | vchar = satisfy (\c -> ord c >= 0x21 && ord c <= 0x7E) | 54 | false | true | 0 | 11 | 17 | 43 | 21 | 22 | null | null |
michalkonecny/polypaver | src/PolyPaver/Input/TPTP.hs | bsd-3-clause | binary_connective :: Parser (Form l -> Form l -> Form l)
binary_connective =
traceRule ("binary_connective") $
(foldr (<|>) (parserFail "Expecting a TPTP binary logical connective.") $
map connective_parser connectives)
where
connectives =
[("<=>", Nothing),
("=>", Just Implie... | 724 | binary_connective :: Parser (Form l -> Form l -> Form l)
binary_connective =
traceRule ("binary_connective") $
(foldr (<|>) (parserFail "Expecting a TPTP binary logical connective.") $
map connective_parser connectives)
where
connectives =
[("<=>", Nothing),
("=>", Just Implie... | 724 | binary_connective =
traceRule ("binary_connective") $
(foldr (<|>) (parserFail "Expecting a TPTP binary logical connective.") $
map connective_parser connectives)
where
connectives =
[("<=>", Nothing),
("=>", Just Implies),
-- ("<=", Just (flip Implies)), -- removed to... | 667 | false | true | 4 | 10 | 218 | 192 | 100 | 92 | null | null |
tmcdonell/hfx | src/haskell/Config.hs | bsd-3-clause | getDigestionRule _ = error "getDigestionRule: unknown enzyme digestion rule" | 77 | getDigestionRule _ = error "getDigestionRule: unknown enzyme digestion rule" | 77 | getDigestionRule _ = error "getDigestionRule: unknown enzyme digestion rule" | 77 | false | false | 0 | 4 | 9 | 13 | 5 | 8 | null | null |
sdiehl/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | vecElemTyConName :: Name
vecElemTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "VecElem") vecElemTyConKey vecElemTyCon | 130 | vecElemTyConName :: Name
vecElemTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "VecElem") vecElemTyConKey vecElemTyCon | 130 | vecElemTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "VecElem") vecElemTyConKey vecElemTyCon | 105 | false | true | 0 | 7 | 11 | 28 | 14 | 14 | null | null |
paulp/unison | parser-typechecker/src/Unison/Typechecker/Context1.hs | mit | fromMEnv :: (MEnv v -> a) -> MEnv v -> Either Note (a, Env v)
fromMEnv f m = Right (f m, env m) | 95 | fromMEnv :: (MEnv v -> a) -> MEnv v -> Either Note (a, Env v)
fromMEnv f m = Right (f m, env m) | 95 | fromMEnv f m = Right (f m, env m) | 33 | false | true | 0 | 10 | 23 | 70 | 33 | 37 | null | null |
gbataille/pandoc | src/Text/Pandoc/Readers/Org.hs | gpl-2.0 | dropLinkType :: String -> String
dropLinkType = tail . snd . break (== ':') | 75 | dropLinkType :: String -> String
dropLinkType = tail . snd . break (== ':') | 75 | dropLinkType = tail . snd . break (== ':') | 42 | false | true | 1 | 7 | 13 | 37 | 17 | 20 | null | null |
songpp/my-haskell-playground | src/BinarySearchTree.hs | apache-2.0 | ceilingKey :: Ord k => k -> BSTree k v-> Maybe (k, v)
ceilingKey k Nil = Nothing | 80 | ceilingKey :: Ord k => k -> BSTree k v-> Maybe (k, v)
ceilingKey k Nil = Nothing | 80 | ceilingKey k Nil = Nothing | 26 | false | true | 0 | 9 | 17 | 45 | 22 | 23 | null | null |
bamboo/idris-cil | src/IRTS/Cil/FFI.hs | bsd-3-clause | foreignType (FApp cilTy [def, typeArgs])
| cilTy == sUN "CILTyGen" = GenericReferenceTypeInstance assembly typeName cilTyArgs
where (ReferenceType assembly typeName) = foreignType def
cilTyArgs = foreignTypeList typeArgs | 232 | foreignType (FApp cilTy [def, typeArgs])
| cilTy == sUN "CILTyGen" = GenericReferenceTypeInstance assembly typeName cilTyArgs
where (ReferenceType assembly typeName) = foreignType def
cilTyArgs = foreignTypeList typeArgs | 232 | foreignType (FApp cilTy [def, typeArgs])
| cilTy == sUN "CILTyGen" = GenericReferenceTypeInstance assembly typeName cilTyArgs
where (ReferenceType assembly typeName) = foreignType def
cilTyArgs = foreignTypeList typeArgs | 232 | false | false | 1 | 9 | 37 | 70 | 33 | 37 | null | null |
ddssff/pandoc | src/Text/Pandoc/Writers/LaTeX.hs | gpl-2.0 | toBabel ("en":"US":_) = "american" | 41 | toBabel ("en":"US":_) = "american" | 41 | toBabel ("en":"US":_) = "american" | 41 | false | false | 0 | 8 | 10 | 20 | 10 | 10 | null | null |
urbanslug/ghc | testsuite/tests/perf/compiler/T783.hs | bsd-3-clause | foo x | x == 63 = 63 | 20 | foo x | x == 63 = 63 | 20 | foo x | x == 63 = 63 | 20 | false | false | 0 | 8 | 7 | 23 | 9 | 14 | null | null |
mgsloan/curve | Data/Curve/Poly.hs | bsd-3-clause | polymap f (Poly xs) = Poly (map f xs) | 37 | polymap f (Poly xs) = Poly (map f xs) | 37 | polymap f (Poly xs) = Poly (map f xs) | 37 | false | false | 0 | 7 | 8 | 30 | 13 | 17 | null | null |
TomMD/CV | performance/Pixelwise.hs | bsd-3-clause | pwFlip :: Image GrayScale D32 -> Image GrayScale D32
pwFlip i = unsafePerformIO $ withClone i (return . toImage . remap flip . fromImage)
where flip f = \(x,y) -> f (w-x,y)
(w,h) = getSize i | 207 | pwFlip :: Image GrayScale D32 -> Image GrayScale D32
pwFlip i = unsafePerformIO $ withClone i (return . toImage . remap flip . fromImage)
where flip f = \(x,y) -> f (w-x,y)
(w,h) = getSize i | 207 | pwFlip i = unsafePerformIO $ withClone i (return . toImage . remap flip . fromImage)
where flip f = \(x,y) -> f (w-x,y)
(w,h) = getSize i | 154 | false | true | 0 | 10 | 52 | 104 | 53 | 51 | null | null |
brendanhay/gogol | gogol-sourcerepo/gen/Network/Google/Resource/SourceRepo/Projects/Repos/Sync.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
prsUploadProtocol :: Lens' ProjectsReposSync (Maybe Text)
prsUploadProtocol
= lens _prsUploadProtocol
(\ s a -> s{_prsUploadProtocol = a}) | 208 | prsUploadProtocol :: Lens' ProjectsReposSync (Maybe Text)
prsUploadProtocol
= lens _prsUploadProtocol
(\ s a -> s{_prsUploadProtocol = a}) | 146 | prsUploadProtocol
= lens _prsUploadProtocol
(\ s a -> s{_prsUploadProtocol = a}) | 88 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
jwiegley/ghc-release | libraries/binary/src/Data/Binary/Builder/Base.hs | gpl-3.0 | -- putWord16le w16 = writeN 2 (\p -> poke (castPtr p) w16)
-- | Write a Word32 in big endian format
putWord32be :: Word32 -> Builder
putWord32be w = writeN 4 $ \p -> do
poke p (fromIntegral (shiftr_w32 w 24) :: Word8)
poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 w 16) :: Word8)
poke (p `plu... | 438 | putWord32be :: Word32 -> Builder
putWord32be w = writeN 4 $ \p -> do
poke p (fromIntegral (shiftr_w32 w 24) :: Word8)
poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 w 16) :: Word8)
poke (p `plusPtr` 2) (fromIntegral (shiftr_w32 w 8) :: Word8)
poke (p `plusPtr` 3) (fromIntegral (w) ... | 337 | putWord32be w = writeN 4 $ \p -> do
poke p (fromIntegral (shiftr_w32 w 24) :: Word8)
poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 w 16) :: Word8)
poke (p `plusPtr` 2) (fromIntegral (shiftr_w32 w 8) :: Word8)
poke (p `plusPtr` 3) (fromIntegral (w) :: Word8)
| 304 | true | true | 0 | 13 | 117 | 154 | 81 | 73 | null | null |
gsdlab/clafer | src/Language/Clafer/Intermediate/TypeSystem.hs | mit | isTInteger :: IType -> Bool
isTInteger TInteger = True | 61 | isTInteger :: IType -> Bool
isTInteger TInteger = True | 61 | isTInteger TInteger = True | 30 | false | true | 0 | 5 | 15 | 18 | 9 | 9 | null | null |
djeik/goto | libgoto/Language/GoLite/Syntax/SrcAnn.hs | mit | -- | Removes source annotations from a type/variable declaration.
bareDecl :: SrcAnnDeclaration -> BasicDeclaration
bareDecl (TypeDecl (TypeDeclBody i ty)) =
TypeDecl (TypeDeclBody (bare i) (bareType ty)) | 212 | bareDecl :: SrcAnnDeclaration -> BasicDeclaration
bareDecl (TypeDecl (TypeDeclBody i ty)) =
TypeDecl (TypeDeclBody (bare i) (bareType ty)) | 146 | bareDecl (TypeDecl (TypeDeclBody i ty)) =
TypeDecl (TypeDeclBody (bare i) (bareType ty)) | 96 | true | true | 0 | 9 | 33 | 56 | 28 | 28 | null | null |
bitemyapp/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isFlexi _ = False | 21 | isFlexi _ = False | 21 | isFlexi _ = False | 21 | false | false | 0 | 4 | 7 | 10 | 4 | 6 | null | null |
ekmett/ermine | src/Ermine/Parser/Type.hs | bsd-2-clause | typ4 :: (Applicative m, Monad m, TokenParsing m) => m Typ
typ4 = build <$ symbol "forall" <*> quantBindings <* dot <*> typ4
<|> typ3
where
build (kvs, tvks) = forall maybeHint stringHint (Just <$> kvs) tvks (And [])
-- | Parse a 'Type'. | 244 | typ4 :: (Applicative m, Monad m, TokenParsing m) => m Typ
typ4 = build <$ symbol "forall" <*> quantBindings <* dot <*> typ4
<|> typ3
where
build (kvs, tvks) = forall maybeHint stringHint (Just <$> kvs) tvks (And [])
-- | Parse a 'Type'. | 244 | typ4 = build <$ symbol "forall" <*> quantBindings <* dot <*> typ4
<|> typ3
where
build (kvs, tvks) = forall maybeHint stringHint (Just <$> kvs) tvks (And [])
-- | Parse a 'Type'. | 186 | false | true | 0 | 10 | 51 | 102 | 52 | 50 | null | null |
sapek/pandoc | src/Text/Pandoc/Readers/Docx/Parse.hs | gpl-2.0 | elemToBodyPart _ _ = throwError WrongElem | 41 | elemToBodyPart _ _ = throwError WrongElem | 41 | elemToBodyPart _ _ = throwError WrongElem | 41 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
darthdeus/ghc-mod-ng | Language/Haskell/GhcMod/Find.hs | bsd-3-clause | -- | Finding modules to which the symbol belong.
findSymbol :: Symbol -> GhcMod String
findSymbol sym = convert' =<< lookupSym sym <$> getSymMdlDb | 146 | findSymbol :: Symbol -> GhcMod String
findSymbol sym = convert' =<< lookupSym sym <$> getSymMdlDb | 97 | findSymbol sym = convert' =<< lookupSym sym <$> getSymMdlDb | 59 | true | true | 0 | 7 | 23 | 38 | 17 | 21 | null | null |
ComputationWithBoundedResources/tct-trs | src/Tct/Trs/Processor/Matrix/MI.hs | bsd-3-clause | rcConstraints :: [Q] -> [Matrix IExpr] -> GOne -> SmtM ()
rcConstraints qs mxs gOne = Smt.assert $ Smt.bigAnd [ ggeq mxs 1 x .=> gOne 1 x | x <- qs ] | 149 | rcConstraints :: [Q] -> [Matrix IExpr] -> GOne -> SmtM ()
rcConstraints qs mxs gOne = Smt.assert $ Smt.bigAnd [ ggeq mxs 1 x .=> gOne 1 x | x <- qs ] | 149 | rcConstraints qs mxs gOne = Smt.assert $ Smt.bigAnd [ ggeq mxs 1 x .=> gOne 1 x | x <- qs ] | 91 | false | true | 0 | 9 | 32 | 82 | 40 | 42 | null | null |
vaibhavsagar/duffer.hs | duffer/src/Duffer/Loose/Parser.hs | bsd-3-clause | validateSha1 :: Monad m => ByteString -> m Ref
validateSha1 possibleRef = maybe
(return possibleRef)
(const $ fail "invalid ref")
$ find (notInClass "0-9a-f") possibleRef | 182 | validateSha1 :: Monad m => ByteString -> m Ref
validateSha1 possibleRef = maybe
(return possibleRef)
(const $ fail "invalid ref")
$ find (notInClass "0-9a-f") possibleRef | 182 | validateSha1 possibleRef = maybe
(return possibleRef)
(const $ fail "invalid ref")
$ find (notInClass "0-9a-f") possibleRef | 135 | false | true | 2 | 8 | 36 | 71 | 31 | 40 | null | null |
HIPERFIT/futhark | src/Futhark/Analysis/PrimExp/Convert.hs | isc | primExpFromExp f (BasicOp (ConvOp op x)) =
ConvOpExp op <$> primExpFromSubExpM f x | 84 | primExpFromExp f (BasicOp (ConvOp op x)) =
ConvOpExp op <$> primExpFromSubExpM f x | 84 | primExpFromExp f (BasicOp (ConvOp op x)) =
ConvOpExp op <$> primExpFromSubExpM f x | 84 | false | false | 2 | 8 | 14 | 40 | 17 | 23 | null | null |
mcmaniac/ghc | compiler/cmm/CmmNode.hs | bsd-3-clause | wrapRecExp f e = f e | 39 | wrapRecExp f e = f e | 39 | wrapRecExp f e = f e | 39 | false | false | 0 | 5 | 24 | 14 | 6 | 8 | null | null |
fpco/fay | src/Fay/Compiler/Desugar.hs | bsd-3-clause | desugarBindsTypeSigs :: (Data l, Typeable l) => Module l -> Desugar l (Module l)
desugarBindsTypeSigs = transformBiM $ \(BDecls srcInfo decls) -> do
decls' <- addFFIExpTypeSigs decls
return $ BDecls srcInfo decls' | 217 | desugarBindsTypeSigs :: (Data l, Typeable l) => Module l -> Desugar l (Module l)
desugarBindsTypeSigs = transformBiM $ \(BDecls srcInfo decls) -> do
decls' <- addFFIExpTypeSigs decls
return $ BDecls srcInfo decls' | 217 | desugarBindsTypeSigs = transformBiM $ \(BDecls srcInfo decls) -> do
decls' <- addFFIExpTypeSigs decls
return $ BDecls srcInfo decls' | 136 | false | true | 2 | 10 | 35 | 90 | 41 | 49 | null | null |
codygman/yesod-dsl | YesodDsl/Generator/Classes.hs | bsd-2-clause | classDefField :: Class -> Field -> String
classDefField c cf = T.unpack $(codegenFile "codegen/class-field.cg")
where
f = case cf of
Field _ _ _ _ (EntityField "ClassInstance") _ -> cf {
fieldContent = EntityField (className c ++ "Instance")
}
_ -> cf | 315 | classDefField :: Class -> Field -> String
classDefField c cf = T.unpack $(codegenFile "codegen/class-field.cg")
where
f = case cf of
Field _ _ _ _ (EntityField "ClassInstance") _ -> cf {
fieldContent = EntityField (className c ++ "Instance")
}
_ -> cf | 315 | classDefField c cf = T.unpack $(codegenFile "codegen/class-field.cg")
where
f = case cf of
Field _ _ _ _ (EntityField "ClassInstance") _ -> cf {
fieldContent = EntityField (className c ++ "Instance")
}
_ -> cf | 273 | false | true | 0 | 13 | 105 | 100 | 49 | 51 | null | null |
blajzer/dispatch | Language/Dispatch/Parser.hs | bsd-3-clause | param :: GenParser Char st A.Param
param = try parseNumber <|>
try parseCharacter <|>
try parseLiteral <|>
parseSymbol | 142 | param :: GenParser Char st A.Param
param = try parseNumber <|>
try parseCharacter <|>
try parseLiteral <|>
parseSymbol | 142 | param = try parseNumber <|>
try parseCharacter <|>
try parseLiteral <|>
parseSymbol | 107 | false | true | 1 | 8 | 41 | 45 | 19 | 26 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_HJA_STRINGEOL :: Int
wxSTC_HJA_STRINGEOL = 66 | 51 | wxSTC_HJA_STRINGEOL :: Int
wxSTC_HJA_STRINGEOL = 66 | 51 | wxSTC_HJA_STRINGEOL = 66 | 24 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.