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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
etrepat/learn-you-a-haskell-exercises | 02-starting-out.hs | gpl-3.0 | -- (It's better in my mind to think of this as a simple recursive iteration instead of a list
-- comprehension...)
ziplike' xs ys = reverse (ziptmp [] xs ys)
where ziptmp os [] _ = os
ziptmp os _ [] = os
ziptmp os (x:xs') (y:ys') = ziptmp ((x,y) : os) xs' ys'
-- Split a list xs at element k into a tu... | 458 | ziplike' xs ys = reverse (ziptmp [] xs ys)
where ziptmp os [] _ = os
ziptmp os _ [] = os
ziptmp os (x:xs') (y:ys') = ziptmp ((x,y) : os) xs' ys'
-- Split a list xs at element k into a tuple: The first part up to and including k, the second part after k
-- For example "splitAtIndex 3 [1,1,1,2,2,2]" re... | 343 | ziplike' xs ys = reverse (ziptmp [] xs ys)
where ziptmp os [] _ = os
ziptmp os _ [] = os
ziptmp os (x:xs') (y:ys') = ziptmp ((x,y) : os) xs' ys'
-- Split a list xs at element k into a tuple: The first part up to and including k, the second part after k
-- For example "splitAtIndex 3 [1,1,1,2,2,2]" re... | 343 | true | false | 2 | 8 | 104 | 106 | 56 | 50 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | The ID of the request entry this entry responds to.
rcbreBatchId :: Lens' RegionalinventoryCustomBatchResponseEntry (Maybe Word32)
rcbreBatchId
= lens _rcbreBatchId (\ s a -> s{_rcbreBatchId = a})
. mapping _Coerce | 227 | rcbreBatchId :: Lens' RegionalinventoryCustomBatchResponseEntry (Maybe Word32)
rcbreBatchId
= lens _rcbreBatchId (\ s a -> s{_rcbreBatchId = a})
. mapping _Coerce | 170 | rcbreBatchId
= lens _rcbreBatchId (\ s a -> s{_rcbreBatchId = a})
. mapping _Coerce | 91 | true | true | 0 | 10 | 39 | 55 | 28 | 27 | null | null |
CloudI/CloudI | src/api/haskell/external/bytestring-0.10.10.0/tests/builder/Data/ByteString/Builder/Tests.hs | mit | buildRecipe :: Recipe -> [Word8]
buildRecipe recipe =
L.unpack $ toLBS b
where
(b, toLBS) = recipeComponents recipe | 125 | buildRecipe :: Recipe -> [Word8]
buildRecipe recipe =
L.unpack $ toLBS b
where
(b, toLBS) = recipeComponents recipe | 125 | buildRecipe recipe =
L.unpack $ toLBS b
where
(b, toLBS) = recipeComponents recipe | 92 | false | true | 0 | 6 | 27 | 47 | 24 | 23 | null | null |
MnO2/kaleidoscope-plus | Main.hs | bsd-3-clause | parseBinaryOpRhs :: Int -> KSExpr -> Parser KSExpr
parseBinaryOpRhs expr_prec lhs = do
(do
p_whiteSpace
bin_op <- lookAhead p_operator
precTable <- getState
let curr_bin_op_prec = fromJust $ H.lookup bin_op precTable
if curr_bin_op_prec < expr_prec
then return lhs
else do
... | 1,250 | parseBinaryOpRhs :: Int -> KSExpr -> Parser KSExpr
parseBinaryOpRhs expr_prec lhs = do
(do
p_whiteSpace
bin_op <- lookAhead p_operator
precTable <- getState
let curr_bin_op_prec = fromJust $ H.lookup bin_op precTable
if curr_bin_op_prec < expr_prec
then return lhs
else do
... | 1,250 | parseBinaryOpRhs expr_prec lhs = do
(do
p_whiteSpace
bin_op <- lookAhead p_operator
precTable <- getState
let curr_bin_op_prec = fromJust $ H.lookup bin_op precTable
if curr_bin_op_prec < expr_prec
then return lhs
else do
p_whiteSpace
bin_op <- p_operato... | 1,199 | false | true | 0 | 27 | 519 | 290 | 131 | 159 | null | null |
dsalisbury/xmobar | src/Plugins/Monitors/Top.hs | bsd-3-clause | combine [] ts = ts | 18 | combine [] ts = ts | 18 | combine [] ts = ts | 18 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
sgillespie/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | isTopLevel TopLevel = True | 30 | isTopLevel TopLevel = True | 30 | isTopLevel TopLevel = True | 30 | false | false | 1 | 5 | 7 | 13 | 4 | 9 | null | null |
olorin/amazonka | gen/src/Gen/AST/Data/Syntax.hs | mpl-2.0 | pJEMay = ".?>" | 15 | pJEMay = ".?>" | 15 | pJEMay = ".?>" | 15 | false | false | 1 | 5 | 3 | 10 | 3 | 7 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp FloatSqrtOp = _ILIT(126) | 37 | tagOf_PrimOp FloatSqrtOp = _ILIT(126) | 37 | tagOf_PrimOp FloatSqrtOp = _ILIT(126) | 37 | false | false | 0 | 6 | 3 | 15 | 7 | 8 | null | null |
osa1/chsc | Termination/TagGraph.hs | bsd-3-clause | embedWithTagGraphs :: WQO State Generaliser
embedWithTagGraphs =
precomp stateTags $ postcomp generaliserFromGrowing $
refineCollection (\discard -> postcomp discard $ zippable (postcomp snd (prod equal nat)))
-- NB: NOT using natsWeak
where
-- consolidate :: (Functor f, Foldable.Foldable f) => ... | 2,918 | embedWithTagGraphs :: WQO State Generaliser
embedWithTagGraphs =
precomp stateTags $ postcomp generaliserFromGrowing $
refineCollection (\discard -> postcomp discard $ zippable (postcomp snd (prod equal nat)))
-- NB: NOT using natsWeak
where
-- consolidate :: (Functor f, Foldable.Foldable f) => ... | 2,918 | embedWithTagGraphs =
precomp stateTags $ postcomp generaliserFromGrowing $
refineCollection (\discard -> postcomp discard $ zippable (postcomp snd (prod equal nat)))
-- NB: NOT using natsWeak
where
-- consolidate :: (Functor f, Foldable.Foldable f) => f (TagSet, Nat) -> (TagSet, f Nat)
-- co... | 2,874 | false | true | 2 | 18 | 859 | 710 | 369 | 341 | null | null |
nevrenato/Hets_Fork | Common/Keywords.hs | gpl-2.0 | elseS :: String
elseS = "else" | 30 | elseS :: String
elseS = "else" | 30 | elseS = "else" | 14 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
capello/Haskell_Premier | Premier.hs | bsd-2-clause | prem''' = 2:[a | a <- [3,5..], (all (/= 0) (map (mod a) (takeWhile (<= truncate(sqrt (fromIntegral a::Float))) prem'''))) ] | 123 | prem''' = 2:[a | a <- [3,5..], (all (/= 0) (map (mod a) (takeWhile (<= truncate(sqrt (fromIntegral a::Float))) prem'''))) ] | 123 | prem''' = 2:[a | a <- [3,5..], (all (/= 0) (map (mod a) (takeWhile (<= truncate(sqrt (fromIntegral a::Float))) prem'''))) ] | 123 | false | false | 3 | 19 | 19 | 93 | 47 | 46 | null | null |
amccausl/Swish | Swish/HaskellUtils/LookupMapTest.hs | lgpl-2.1 | testLookupMapFind35b = testLookupMapFind "35b" lm35 4 "" | 56 | testLookupMapFind35b = testLookupMapFind "35b" lm35 4 "" | 56 | testLookupMapFind35b = testLookupMapFind "35b" lm35 4 "" | 56 | false | false | 1 | 5 | 6 | 19 | 7 | 12 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | bsd-3-clause | pprPanic :: String -> SDoc -> a
pprPanic s d = Outputable.pprPanic ("LlvmCodeGen.CodeGen." ++ s) d | 98 | pprPanic :: String -> SDoc -> a
pprPanic s d = Outputable.pprPanic ("LlvmCodeGen.CodeGen." ++ s) d | 98 | pprPanic s d = Outputable.pprPanic ("LlvmCodeGen.CodeGen." ++ s) d | 66 | false | true | 0 | 8 | 15 | 43 | 20 | 23 | null | null |
edom/sound | src/Sound/Endo.hs | bsd-3-clause | {- |
The first element is the integral.
-}
e0int :: (Num a) => a -> Endo a -> Endo (P a a)
e0int dx f = e0scanl (\ y fx -> y + fx * dx) f | 137 | e0int :: (Num a) => a -> Endo a -> Endo (P a a)
e0int dx f = e0scanl (\ y fx -> y + fx * dx) f | 94 | e0int dx f = e0scanl (\ y fx -> y + fx * dx) f | 46 | true | true | 0 | 10 | 37 | 71 | 36 | 35 | null | null |
byorgey/Idris-dev | src/Core/TT.hs | bsd-3-clause | isInjective _ = False | 38 | isInjective _ = False | 38 | isInjective _ = False | 38 | false | false | 0 | 4 | 20 | 10 | 4 | 6 | null | null |
notogawa/haiji | test/tests.hs | bsd-3-clause | main :: IO ()
main = $(defaultMainGenerator) | 44 | main :: IO ()
main = $(defaultMainGenerator) | 44 | main = $(defaultMainGenerator) | 30 | false | true | 0 | 7 | 6 | 26 | 11 | 15 | null | null |
sdiehl/ghc | compiler/basicTypes/RdrName.hs | bsd-3-clause | pickGREs (Qual mod _) gres = mapMaybe (pickQualGRE mod) gres | 60 | pickGREs (Qual mod _) gres = mapMaybe (pickQualGRE mod) gres | 60 | pickGREs (Qual mod _) gres = mapMaybe (pickQualGRE mod) gres | 60 | false | false | 0 | 7 | 9 | 30 | 14 | 16 | null | null |
ocramz/holy-project | src/HolyProject.hs | mit | -- | Randomly choose an end scenario and then show a \"serious\" error message
holyError :: String -> IO ()
holyError str = do
r <- randomIO
if r
then
do
bk "What... is your favourite colour?"
you "Blue. No, yel..."
putStrLn "[You are thrown ov... | 751 | holyError :: String -> IO ()
holyError str = do
r <- randomIO
if r
then
do
bk "What... is your favourite colour?"
you "Blue. No, yel..."
putStrLn "[You are thrown over the edge into the volcano]"
you "You: Auuuuuuuuuuuugh"
... | 672 | holyError str = do
r <- randomIO
if r
then
do
bk "What... is your favourite colour?"
you "Blue. No, yel..."
putStrLn "[You are thrown over the edge into the volcano]"
you "You: Auuuuuuuuuuuugh"
bk " Hee hee heh."... | 643 | true | true | 0 | 10 | 296 | 110 | 46 | 64 | null | null |
arekfu/project_euler | p0032/p0032.hs | mit | chunks2 :: Int -> Int -> [a] -> ([a],[a],[a])
chunks2 i j l = (first,second,third)
where (first,secth) = splitAt i l
(second,third) = splitAt j secth | 171 | chunks2 :: Int -> Int -> [a] -> ([a],[a],[a])
chunks2 i j l = (first,second,third)
where (first,secth) = splitAt i l
(second,third) = splitAt j secth | 171 | chunks2 i j l = (first,second,third)
where (first,secth) = splitAt i l
(second,third) = splitAt j secth | 125 | false | true | 0 | 9 | 47 | 96 | 54 | 42 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F32.hs | bsd-3-clause | -- glVideoCaptureNV ------------------------------------------------------------
glVideoCaptureNV
:: MonadIO m
=> GLuint -- ^ @video_capture_slot@.
-> Ptr GLuint -- ^ @sequence_num@.
-> Ptr GLuint64EXT -- ^ @capture_time@.
-> m GLenum
glVideoCaptureNV v1 v2 v3 = liftIO $ dyn933 ptr_glVideoCaptureNV v1 v2 v3 | 319 | glVideoCaptureNV
:: MonadIO m
=> GLuint -- ^ @video_capture_slot@.
-> Ptr GLuint -- ^ @sequence_num@.
-> Ptr GLuint64EXT -- ^ @capture_time@.
-> m GLenum
glVideoCaptureNV v1 v2 v3 = liftIO $ dyn933 ptr_glVideoCaptureNV v1 v2 v3 | 237 | glVideoCaptureNV v1 v2 v3 = liftIO $ dyn933 ptr_glVideoCaptureNV v1 v2 v3 | 73 | true | true | 0 | 10 | 49 | 67 | 32 | 35 | null | null |
Fuuzetsu/yi-haskell-utils | src/Yi/Mode/Haskell/Utils/Internal.hs | gpl-3.0 | getTypeAtPoint :: YiM (Either T.Text HType)
getTypeAtPoint = getModuleName >>= \case
Left err -> return $ Left err
Right n -> do
BufferFileInfo fn _ ln cl _ _ _ <- withCurrentBuffer bufInfoB
printMsg $ T.pack fn <> ":" <> T.pack n <> ":" <> showT ln <> ":" <> showT cl
(ts, _) <- io $ runGhcModT defaultO... | 1,398 | getTypeAtPoint :: YiM (Either T.Text HType)
getTypeAtPoint = getModuleName >>= \case
Left err -> return $ Left err
Right n -> do
BufferFileInfo fn _ ln cl _ _ _ <- withCurrentBuffer bufInfoB
printMsg $ T.pack fn <> ":" <> T.pack n <> ":" <> showT ln <> ":" <> showT cl
(ts, _) <- io $ runGhcModT defaultO... | 1,398 | getTypeAtPoint = getModuleName >>= \case
Left err -> return $ Left err
Right n -> do
BufferFileInfo fn _ ln cl _ _ _ <- withCurrentBuffer bufInfoB
printMsg $ T.pack fn <> ":" <> T.pack n <> ":" <> showT ln <> ":" <> showT cl
(ts, _) <- io $ runGhcModT defaultOptions (types fn ln cl)
case ts of
... | 1,354 | false | true | 0 | 31 | 521 | 470 | 222 | 248 | null | null |
markus1189/PearlsFAD | src/MakingACentury.hs | gpl-3.0 | prettyPrintFactor :: Factor -> String
prettyPrintFactor = concatMap show | 72 | prettyPrintFactor :: Factor -> String
prettyPrintFactor = concatMap show | 72 | prettyPrintFactor = concatMap show | 34 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
mariefarrell/Hets | Maude/Symbol.hs | gpl-2.0 | -- | True iff the argument is a wildcard 'Operator'.
isOpWildcard :: Symbol -> Bool
isOpWildcard symb = case symb of
OpWildcard _ -> True
_ -> False
-- | True iff the argument is a qualified 'Operator'. | 211 | isOpWildcard :: Symbol -> Bool
isOpWildcard symb = case symb of
OpWildcard _ -> True
_ -> False
-- | True iff the argument is a qualified 'Operator'. | 158 | isOpWildcard symb = case symb of
OpWildcard _ -> True
_ -> False
-- | True iff the argument is a qualified 'Operator'. | 127 | true | true | 3 | 5 | 46 | 37 | 20 | 17 | null | null |
sgillespie/ghc | compiler/main/HscMain.hs | bsd-3-clause | hscKcType
:: HscEnv
-> Bool -- ^ Normalise the type
-> String -- ^ The type as a string
-> IO (Type, Kind) -- ^ Resulting type (possibly normalised) and kind
hscKcType hsc_env0 normalise str = runInteractiveHsc hsc_env0 $ do
hsc_env <- getHscEnv
ty <- hscParseType str
ioMsgMaybe ... | 351 | hscKcType
:: HscEnv
-> Bool -- ^ Normalise the type
-> String -- ^ The type as a string
-> IO (Type, Kind)
hscKcType hsc_env0 normalise str = runInteractiveHsc hsc_env0 $ do
hsc_env <- getHscEnv
ty <- hscParseType str
ioMsgMaybe $ tcRnType hsc_env normalise ty | 300 | hscKcType hsc_env0 normalise str = runInteractiveHsc hsc_env0 $ do
hsc_env <- getHscEnv
ty <- hscParseType str
ioMsgMaybe $ tcRnType hsc_env normalise ty | 165 | true | true | 0 | 10 | 92 | 85 | 40 | 45 | null | null |
keithodulaigh/Hets | ExtModal/Parse_AS.hs | gpl-2.0 | emDotFormulae :: [Annotation] -> [VAR_DECL] -> Range -> AParser st FrameForm
emDotFormulae a v p = fmap (axiomsToFrames a v p)
$ dotFormulae False ext_modal_reserved_words | 173 | emDotFormulae :: [Annotation] -> [VAR_DECL] -> Range -> AParser st FrameForm
emDotFormulae a v p = fmap (axiomsToFrames a v p)
$ dotFormulae False ext_modal_reserved_words | 173 | emDotFormulae a v p = fmap (axiomsToFrames a v p)
$ dotFormulae False ext_modal_reserved_words | 96 | false | true | 2 | 8 | 26 | 64 | 31 | 33 | null | null |
nomeata/ghc | compiler/codeGen/CgCallConv.hs | bsd-3-clause | slowCallPattern (DoubleArg: _) = (fsLit "stg_ap_d", 1) | 79 | slowCallPattern (DoubleArg: _) = (fsLit "stg_ap_d", 1) | 79 | slowCallPattern (DoubleArg: _) = (fsLit "stg_ap_d", 1) | 79 | false | false | 0 | 7 | 31 | 25 | 13 | 12 | null | null |
brendanhay/gogol | gogol-cloudiot/gen/Network/Google/CloudIOT/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'DeviceState' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dsUpdateTime'
--
-- * 'dsBinaryData'
deviceState
:: DeviceState
deviceState = DeviceState' {_dsUpdateTime = Nothing, _dsBinaryData = Nothing} | 317 | deviceState
:: DeviceState
deviceState = DeviceState' {_dsUpdateTime = Nothing, _dsBinaryData = Nothing} | 108 | deviceState = DeviceState' {_dsUpdateTime = Nothing, _dsBinaryData = Nothing} | 77 | true | true | 0 | 7 | 53 | 39 | 23 | 16 | null | null |
happlebao/Core-Haskell | SyntaxChecker.hs | bsd-3-clause | getNameFromPat (PParen p) = getNameFromPat p | 44 | getNameFromPat (PParen p) = getNameFromPat p | 44 | getNameFromPat (PParen p) = getNameFromPat p | 44 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
ducis/cassandra-minimalist | cassandra-cql-0.3.0.1/Database/Cassandra/CQL1.hs | apache-2.0 | decodeEltM :: (ProtoElt a, MonadIO m) => Text -> ByteString -> Text -> m a
decodeEltM what bs qt =
case decodeElt bs of
Left err -> throw $ LocalProtocolError
("can't parse" `T.append` what `T.append` ": " `T.append` T.pack err) qt
Right res -> return res | 287 | decodeEltM :: (ProtoElt a, MonadIO m) => Text -> ByteString -> Text -> m a
decodeEltM what bs qt =
case decodeElt bs of
Left err -> throw $ LocalProtocolError
("can't parse" `T.append` what `T.append` ": " `T.append` T.pack err) qt
Right res -> return res | 287 | decodeEltM what bs qt =
case decodeElt bs of
Left err -> throw $ LocalProtocolError
("can't parse" `T.append` what `T.append` ": " `T.append` T.pack err) qt
Right res -> return res | 212 | false | true | 0 | 13 | 77 | 121 | 60 | 61 | null | null |
mzini/TcT | source/Tct/Method/Predicates.hs | gpl-3.0 | problemPredicate :: String -> (Problem -> Bool) -> S.ProcessorInstance Predicate
problemPredicate s p = (S.StdProcessor $ ProblemPredicate s p) `S.withArgs` Union | 162 | problemPredicate :: String -> (Problem -> Bool) -> S.ProcessorInstance Predicate
problemPredicate s p = (S.StdProcessor $ ProblemPredicate s p) `S.withArgs` Union | 162 | problemPredicate s p = (S.StdProcessor $ ProblemPredicate s p) `S.withArgs` Union | 81 | false | true | 0 | 8 | 20 | 58 | 30 | 28 | null | null |
Happy0/snowdrift | Model/Project.hs | agpl-3.0 | fetchProjectDeletedPledgesBeforeDB :: ProjectId -> UTCTime -> Int64 -> DB [EventDeletedPledge]
fetchProjectDeletedPledgesBeforeDB project_id before lim = fmap (map entityVal) $
select $
from $ \edp -> do
where_ $
edp ^. EventDeletedPledgeTs <=. val before &&.
edp ^. EventDeletedPledgePr... | 501 | fetchProjectDeletedPledgesBeforeDB :: ProjectId -> UTCTime -> Int64 -> DB [EventDeletedPledge]
fetchProjectDeletedPledgesBeforeDB project_id before lim = fmap (map entityVal) $
select $
from $ \edp -> do
where_ $
edp ^. EventDeletedPledgeTs <=. val before &&.
edp ^. EventDeletedPledgePr... | 501 | fetchProjectDeletedPledgesBeforeDB project_id before lim = fmap (map entityVal) $
select $
from $ \edp -> do
where_ $
edp ^. EventDeletedPledgeTs <=. val before &&.
edp ^. EventDeletedPledgeProject ==. val project_id
orderBy [ desc $ edp ^. EventDeletedPledgeTs, desc $ edp ^. EventD... | 406 | false | true | 0 | 14 | 110 | 136 | 65 | 71 | null | null |
yiannist/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | hvDiskType :: String
hvDiskType = "disk_type" | 45 | hvDiskType :: String
hvDiskType = "disk_type" | 45 | hvDiskType = "disk_type" | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
lennart/tidal-midi | Sound/Tidal/Tetra.hs | gpl-3.0 | mod2src = makeF oscPolysynth "mod2src" | 42 | mod2src = makeF oscPolysynth "mod2src" | 42 | mod2src = makeF oscPolysynth "mod2src" | 42 | false | false | 0 | 5 | 8 | 11 | 5 | 6 | null | null |
ajtulloch/haskell-ml | MachineLearning/DecisionTrees.hs | mit | sampleWithoutReplacement :: MonadRandom m => Int -> V.Vector a -> m (V.Vector a)
sampleWithoutReplacement n = withVector (liftM (take n) . shuffleM) | 148 | sampleWithoutReplacement :: MonadRandom m => Int -> V.Vector a -> m (V.Vector a)
sampleWithoutReplacement n = withVector (liftM (take n) . shuffleM) | 148 | sampleWithoutReplacement n = withVector (liftM (take n) . shuffleM) | 67 | false | true | 0 | 11 | 21 | 64 | 30 | 34 | null | null |
quesebifurcan/sequential | Score/Main.hs | bsd-3-clause | mkInstrument ::
Instruments -> Text -> V.Validation [SoundErrors] Instrument
mkInstrument (Instruments m) k =
case result of
Just v -> V.Success v
Nothing -> V.Failure [NoInstrumentError k]
where result = Map.lookup k m | 233 | mkInstrument ::
Instruments -> Text -> V.Validation [SoundErrors] Instrument
mkInstrument (Instruments m) k =
case result of
Just v -> V.Success v
Nothing -> V.Failure [NoInstrumentError k]
where result = Map.lookup k m | 233 | mkInstrument (Instruments m) k =
case result of
Just v -> V.Success v
Nothing -> V.Failure [NoInstrumentError k]
where result = Map.lookup k m | 154 | false | true | 0 | 10 | 46 | 90 | 43 | 47 | null | null |
nbloomf/carl | src/Carl/String.hs | gpl-3.0 | strCat :: Text -> Text -> Either StrErr Text
strCat (Text a) (Text b) = Right $ Text $ a ++ b | 93 | strCat :: Text -> Text -> Either StrErr Text
strCat (Text a) (Text b) = Right $ Text $ a ++ b | 93 | strCat (Text a) (Text b) = Right $ Text $ a ++ b | 48 | false | true | 0 | 7 | 21 | 53 | 26 | 27 | null | null |
ejconlon/analyze | test/Generation.hs | bsd-3-clause | valueTypeGen :: Gen ValueType
valueTypeGen = arbitraryBoundedEnum | 65 | valueTypeGen :: Gen ValueType
valueTypeGen = arbitraryBoundedEnum | 65 | valueTypeGen = arbitraryBoundedEnum | 35 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
joshsz/raskell | src/Raskell/Parser/Whitespace.hs | mit | lexeme :: Parser a -> Parser a
lexeme p = p <* whitespace | 57 | lexeme :: Parser a -> Parser a
lexeme p = p <* whitespace | 57 | lexeme p = p <* whitespace | 26 | false | true | 2 | 7 | 12 | 35 | 15 | 20 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/InstanceGroupManagers/SetInstanceTemplate.hs | mpl-2.0 | -- | Multipart request metadata.
igmsitPayload :: Lens' InstanceGroupManagersSetInstanceTemplate InstanceGroupManagersSetInstanceTemplateRequest
igmsitPayload
= lens _igmsitPayload
(\ s a -> s{_igmsitPayload = a}) | 221 | igmsitPayload :: Lens' InstanceGroupManagersSetInstanceTemplate InstanceGroupManagersSetInstanceTemplateRequest
igmsitPayload
= lens _igmsitPayload
(\ s a -> s{_igmsitPayload = a}) | 188 | igmsitPayload
= lens _igmsitPayload
(\ s a -> s{_igmsitPayload = a}) | 76 | true | true | 0 | 9 | 28 | 47 | 23 | 24 | null | null |
ku00/aoj-haskell | src/ITP1_3_B.hs | bsd-3-clause | main = loopPutCase 1 | 20 | main = loopPutCase 1 | 20 | main = loopPutCase 1 | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
spechub/Hets | OWL2/AS.hs | gpl-2.0 | checkPredef :: PreDefMaps -> IRI -> Bool
checkPredef ms = isJust . checkPredefAux ms | 84 | checkPredef :: PreDefMaps -> IRI -> Bool
checkPredef ms = isJust . checkPredefAux ms | 84 | checkPredef ms = isJust . checkPredefAux ms | 43 | false | true | 0 | 6 | 13 | 29 | 14 | 15 | null | null |
aniketd/learn.haskell | RWH/5_json_library/PrettyJSON.hs | unlicense | string :: String -> Doc
string = enclose '"' '"' . hcat . map oneChar | 70 | string :: String -> Doc
string = enclose '"' '"' . hcat . map oneChar | 70 | string = enclose '"' '"' . hcat . map oneChar | 46 | false | true | 0 | 7 | 15 | 31 | 15 | 16 | null | null |
mpickering/hackage-server | Distribution/Server/Features/Distro/State.hs | bsd-3-clause | modifyDistroMaintainers :: DistroName -> (UserList -> UserList) -> Update Distros ()
modifyDistroMaintainers name func = modify (\distros -> distros {distDistros = Dist.modifyDistroMaintainers name func (distDistros distros) }) | 227 | modifyDistroMaintainers :: DistroName -> (UserList -> UserList) -> Update Distros ()
modifyDistroMaintainers name func = modify (\distros -> distros {distDistros = Dist.modifyDistroMaintainers name func (distDistros distros) }) | 227 | modifyDistroMaintainers name func = modify (\distros -> distros {distDistros = Dist.modifyDistroMaintainers name func (distDistros distros) }) | 142 | false | true | 0 | 12 | 26 | 72 | 37 | 35 | null | null |
sdiehl/ghc | compiler/main/SysTools/Terminal.hs | bsd-3-clause | -- | Check if ANSI escape sequences can be used to control color in stderr.
stderrSupportsAnsiColors :: IO Bool
stderrSupportsAnsiColors = do
#if defined(MIN_VERSION_terminfo)
queryTerminal stdError `andM` do
(termSupportsColors <$> setupTermFromEnv)
`catch` \ (_ :: SetupTermError) ->
pure False
... | 2,285 | stderrSupportsAnsiColors :: IO Bool
stderrSupportsAnsiColors = do
#if defined(MIN_VERSION_terminfo)
queryTerminal stdError `andM` do
(termSupportsColors <$> setupTermFromEnv)
`catch` \ (_ :: SetupTermError) ->
pure False
where
andM :: Monad m => m Bool -> m Bool -> m Bool
andM mx my = do... | 2,209 | stderrSupportsAnsiColors = do
#if defined(MIN_VERSION_terminfo)
queryTerminal stdError `andM` do
(termSupportsColors <$> setupTermFromEnv)
`catch` \ (_ :: SetupTermError) ->
pure False
where
andM :: Monad m => m Bool -> m Bool -> m Bool
andM mx my = do
x <- mx
if x
th... | 2,173 | true | true | 59 | 13 | 583 | 601 | 315 | 286 | null | null |
kmate/HaRe | test/testdata/Renaming/D2.hs | bsd-3-clause | fringe (Branch left right) = fringe left ++ fringe right | 56 | fringe (Branch left right) = fringe left ++ fringe right | 56 | fringe (Branch left right) = fringe left ++ fringe right | 56 | false | false | 0 | 6 | 9 | 28 | 12 | 16 | null | null |
jwiegley/ghc-release | libraries/binary/benchmarks/Builder.hs | gpl-3.0 | largeByteString :: S.ByteString
largeByteString = S.pack word8s | 63 | largeByteString :: S.ByteString
largeByteString = S.pack word8s | 63 | largeByteString = S.pack word8s | 31 | false | true | 0 | 6 | 6 | 18 | 9 | 9 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Reports/Get.hs | mpl-2.0 | -- | V1 error format.
rgXgafv :: Lens' ReportsGet (Maybe Xgafv)
rgXgafv = lens _rgXgafv (\ s a -> s{_rgXgafv = a}) | 114 | rgXgafv :: Lens' ReportsGet (Maybe Xgafv)
rgXgafv = lens _rgXgafv (\ s a -> s{_rgXgafv = a}) | 92 | rgXgafv = lens _rgXgafv (\ s a -> s{_rgXgafv = a}) | 50 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
mpickering/ghc-exactprint | src/Language/Haskell/GHC/ExactPrint/Print.hs | bsd-3-clause | withSortKey :: (Monad m, Monoid w) => [(GHC.SrcSpan, Annotated ())] -> EP w m ()
withSortKey xs = do
Ann{..} <- asks epAnn
let ordered = case annSortKey of
Nothing -> map snd xs
Just keys -> orderByKey xs keys
`debug` ("withSortKey:" ++
... | 686 | withSortKey :: (Monad m, Monoid w) => [(GHC.SrcSpan, Annotated ())] -> EP w m ()
withSortKey xs = do
Ann{..} <- asks epAnn
let ordered = case annSortKey of
Nothing -> map snd xs
Just keys -> orderByKey xs keys
`debug` ("withSortKey:" ++
... | 686 | withSortKey xs = do
Ann{..} <- asks epAnn
let ordered = case annSortKey of
Nothing -> map snd xs
Just keys -> orderByKey xs keys
`debug` ("withSortKey:" ++
showGhc (map fst (sortBy (comparing (flip elemInd... | 605 | false | true | 0 | 25 | 319 | 182 | 90 | 92 | null | null |
ulyssesp/AoC | src/day10.hs | bsd-3-clause | tokenState [Bot x, Low, a, High, b] s = s & (lowMap . at x .~ Just a) & (highMap . at x .~ Just b) | 98 | tokenState [Bot x, Low, a, High, b] s = s & (lowMap . at x .~ Just a) & (highMap . at x .~ Just b) | 98 | tokenState [Bot x, Low, a, High, b] s = s & (lowMap . at x .~ Just a) & (highMap . at x .~ Just b) | 98 | false | false | 0 | 10 | 25 | 71 | 36 | 35 | null | null |
TransformingMusicology/libaudioDB-haskell | src/Sound/Audio/Features/ReadTurtle.hs | gpl-3.0 | parseTurtleFeaturesWithoutTimesGraph (Right g) = return (nVectors, dimensions, features, Nothing)
where
dimensions = head ((map read $ words dim) :: [Int]) -- FIXME I only want one dimension value, but this serialisation seems to contain multiple numbers. What does that mean?
features = DV.fromList ((map re... | 1,266 | parseTurtleFeaturesWithoutTimesGraph (Right g) = return (nVectors, dimensions, features, Nothing)
where
dimensions = head ((map read $ words dim) :: [Int]) -- FIXME I only want one dimension value, but this serialisation seems to contain multiple numbers. What does that mean?
features = DV.fromList ((map re... | 1,266 | parseTurtleFeaturesWithoutTimesGraph (Right g) = return (nVectors, dimensions, features, Nothing)
where
dimensions = head ((map read $ words dim) :: [Int]) -- FIXME I only want one dimension value, but this serialisation seems to contain multiple numbers. What does that mean?
features = DV.fromList ((map re... | 1,266 | false | false | 0 | 9 | 295 | 327 | 166 | 161 | null | null |
david-caro/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkNeedlessCommands2 = verify checkNeedlessCommands "foo=`echo \\`expr 3 + 2\\``" | 88 | prop_checkNeedlessCommands2 = verify checkNeedlessCommands "foo=`echo \\`expr 3 + 2\\``" | 88 | prop_checkNeedlessCommands2 = verify checkNeedlessCommands "foo=`echo \\`expr 3 + 2\\``" | 88 | false | false | 0 | 5 | 8 | 11 | 5 | 6 | null | null |
tel/hs-nanomsg | src/Network/Nanomsg/C/Options.hs | apache-2.0 | optSNDBUF :: Option SNDBUF CInt
optSNDBUF = Option (getSym "NN_SNDBUF") solLevel | 102 | optSNDBUF :: Option SNDBUF CInt
optSNDBUF = Option (getSym "NN_SNDBUF") solLevel | 102 | optSNDBUF = Option (getSym "NN_SNDBUF") solLevel | 59 | false | true | 1 | 7 | 32 | 32 | 13 | 19 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/ConnectionTypes/Get.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
ctgUploadProtocol :: Lens' ConnectionTypesGet (Maybe Text)
ctgUploadProtocol
= lens _ctgUploadProtocol
(\ s a -> s{_ctgUploadProtocol = a}) | 209 | ctgUploadProtocol :: Lens' ConnectionTypesGet (Maybe Text)
ctgUploadProtocol
= lens _ctgUploadProtocol
(\ s a -> s{_ctgUploadProtocol = a}) | 147 | ctgUploadProtocol
= lens _ctgUploadProtocol
(\ s a -> s{_ctgUploadProtocol = a}) | 88 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
Deewiant/haschoo | Haschoo/Evaluator/Standard/Characters.hs | bsd-3-clause | scmToChar [] = tooFewArgs "integer->char" | 50 | scmToChar [] = tooFewArgs "integer->char" | 50 | scmToChar [] = tooFewArgs "integer->char" | 50 | false | false | 1 | 5 | 13 | 17 | 6 | 11 | null | null |
rblaze/haskell-dbus | lib/DBus/Client.hs | apache-2.0 | -- | Stop a 'Client''s callback thread and close its underlying socket.
disconnect :: Client -> IO ()
disconnect client = do
killThread (clientThreadID client)
disconnect' client | 186 | disconnect :: Client -> IO ()
disconnect client = do
killThread (clientThreadID client)
disconnect' client | 114 | disconnect client = do
killThread (clientThreadID client)
disconnect' client | 84 | true | true | 0 | 9 | 34 | 42 | 19 | 23 | null | null |
jgm/pandoc2 | Text/Pandoc2/Reader/Markdown.hs | gpl-2.0 | pHtmlInline :: PMonad m => MP m (PR Inlines)
pHtmlInline = Const . rawInline (Format "html")
<$> (pHtmlComment <|> snd <$> pHtmlTag) | 143 | pHtmlInline :: PMonad m => MP m (PR Inlines)
pHtmlInline = Const . rawInline (Format "html")
<$> (pHtmlComment <|> snd <$> pHtmlTag) | 143 | pHtmlInline = Const . rawInline (Format "html")
<$> (pHtmlComment <|> snd <$> pHtmlTag) | 98 | false | true | 3 | 9 | 32 | 65 | 29 | 36 | null | null |
kelnage/tamarin-prover | lib/theory/src/Theory.hs | gpl-3.0 | -- | All lemmas of a theory.
diffTheoryLemmas :: DiffTheory sig c r r2 p p2 -> [(Side, Lemma p2)]
diffTheoryLemmas =
foldDiffTheoryItem (const []) (const []) (const []) return (const []) (const []) <=< L.get diffThyItems | 223 | diffTheoryLemmas :: DiffTheory sig c r r2 p p2 -> [(Side, Lemma p2)]
diffTheoryLemmas =
foldDiffTheoryItem (const []) (const []) (const []) return (const []) (const []) <=< L.get diffThyItems | 194 | diffTheoryLemmas =
foldDiffTheoryItem (const []) (const []) (const []) return (const []) (const []) <=< L.get diffThyItems | 125 | true | true | 0 | 10 | 39 | 111 | 53 | 58 | null | null |
wizzup/advent_of_code | 2016/2/part1.hs | mit | step U B9 = B6 | 14 | step U B9 = B6 | 14 | step U B9 = B6 | 14 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
sapek/pandoc | src/Text/Pandoc/Readers/MediaWiki.hs | gpl-2.0 | defListItem :: MWParser (Inlines, [Blocks])
defListItem = try $ do
terms <- mconcat . intersperse B.linebreak <$> many defListTerm
-- we allow dd with no dt, or dt with no dd
defs <- if B.isNull terms
then notFollowedBy (try $ string ":<math>") *>
many1 (listItem ':')
... | 374 | defListItem :: MWParser (Inlines, [Blocks])
defListItem = try $ do
terms <- mconcat . intersperse B.linebreak <$> many defListTerm
-- we allow dd with no dt, or dt with no dd
defs <- if B.isNull terms
then notFollowedBy (try $ string ":<math>") *>
many1 (listItem ':')
... | 374 | defListItem = try $ do
terms <- mconcat . intersperse B.linebreak <$> many defListTerm
-- we allow dd with no dt, or dt with no dd
defs <- if B.isNull terms
then notFollowedBy (try $ string ":<math>") *>
many1 (listItem ':')
else many (listItem ':')
return (te... | 330 | false | true | 3 | 14 | 112 | 123 | 58 | 65 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_139 (111#) = happyGoto action_35 | 39 | action_139 (111#) = happyGoto action_35 | 39 | action_139 (111#) = happyGoto action_35 | 39 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
uros-stegic/canx | server/canx-server/Handler/User.hs | gpl-3.0 | postUserDrawingR :: UserId -> Handler Value
postUserDrawingR _ = do
addHeader "Access-Control-Allow-Origin" "*"
addHeader "Access-Control-Allow-Headers" "content-type, authorization"
addHeader "Access-Control-Expose-Headers" "authorization"
requestBody <- runDB requireJsonBody :: Handler Drawing
_ <... | 440 | postUserDrawingR :: UserId -> Handler Value
postUserDrawingR _ = do
addHeader "Access-Control-Allow-Origin" "*"
addHeader "Access-Control-Allow-Headers" "content-type, authorization"
addHeader "Access-Control-Expose-Headers" "authorization"
requestBody <- runDB requireJsonBody :: Handler Drawing
_ <... | 440 | postUserDrawingR _ = do
addHeader "Access-Control-Allow-Origin" "*"
addHeader "Access-Control-Allow-Headers" "content-type, authorization"
addHeader "Access-Control-Expose-Headers" "authorization"
requestBody <- runDB requireJsonBody :: Handler Drawing
_ <- runDB $ insertEntity requestBody
sendR... | 396 | false | true | 0 | 9 | 68 | 90 | 40 | 50 | null | null |
green-haskell/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | isAtomicHsExpr (HsPar e) = isAtomicHsExpr (unLoc e) | 56 | isAtomicHsExpr (HsPar e) = isAtomicHsExpr (unLoc e) | 56 | isAtomicHsExpr (HsPar e) = isAtomicHsExpr (unLoc e) | 56 | false | false | 0 | 7 | 11 | 25 | 11 | 14 | null | null |
dgvncsz0f/nws | src/Jerimum/PostgreSQL/Types/Type.hs | bsd-3-clause | formatType (ScalarType TText) = "text" | 38 | formatType (ScalarType TText) = "text" | 38 | formatType (ScalarType TText) = "text" | 38 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
factisresearch/dockercook | src/lib/Cook/Docker/TLS.hs | mit | tlsDockerOpts :: String -> IO Options
tlsDockerOpts host =
do explicitCertsPath <- lookupEnv "DOCKER_CERT_PATH"
certsPath <-
case explicitCertsPath of
Just path -> return path
Nothing ->
(</> ".docker") <$> getEnv "HOME"
let certPath = certsPath </... | 798 | tlsDockerOpts :: String -> IO Options
tlsDockerOpts host =
do explicitCertsPath <- lookupEnv "DOCKER_CERT_PATH"
certsPath <-
case explicitCertsPath of
Just path -> return path
Nothing ->
(</> ".docker") <$> getEnv "HOME"
let certPath = certsPath </... | 798 | tlsDockerOpts host =
do explicitCertsPath <- lookupEnv "DOCKER_CERT_PATH"
certsPath <-
case explicitCertsPath of
Just path -> return path
Nothing ->
(</> ".docker") <$> getEnv "HOME"
let certPath = certsPath </> "cert.pem"
keyPath = cert... | 760 | false | true | 0 | 12 | 273 | 187 | 89 | 98 | null | null |
spell-music/temporal-csound | src/Csound/Converter.hs | bsd-3-clause | -- Drums
fromDrum :: SigSpace a => a -> Dr -> a
fromDrum a (amp, _) = mul (sig amp) a | 86 | fromDrum :: SigSpace a => a -> Dr -> a
fromDrum a (amp, _) = mul (sig amp) a | 76 | fromDrum a (amp, _) = mul (sig amp) a | 37 | true | true | 0 | 7 | 21 | 49 | 25 | 24 | null | null |
heathweiss/Tricad | src/Examples/Diffs/FirstDiff.hs | gpl-2.0 | writeLargeShapeWithMap = do
let piePiece = largeShapeMap^.at (DegreeRange 0 45)
extractFromMap (Just cpt) = cpt
piePieceTriangle = FacesAll +++^ (extractFromMap piePiece)
writeStlToFile $ newStlShape "largeShape" piePieceTriangle
{-Extract the CornerPoint from the map Maybe result. Gives CornerPointsE... | 338 | writeLargeShapeWithMap = do
let piePiece = largeShapeMap^.at (DegreeRange 0 45)
extractFromMap (Just cpt) = cpt
piePieceTriangle = FacesAll +++^ (extractFromMap piePiece)
writeStlToFile $ newStlShape "largeShape" piePieceTriangle
{-Extract the CornerPoint from the map Maybe result. Gives CornerPointsE... | 338 | writeLargeShapeWithMap = do
let piePiece = largeShapeMap^.at (DegreeRange 0 45)
extractFromMap (Just cpt) = cpt
piePieceTriangle = FacesAll +++^ (extractFromMap piePiece)
writeStlToFile $ newStlShape "largeShape" piePieceTriangle
{-Extract the CornerPoint from the map Maybe result. Gives CornerPointsE... | 338 | false | false | 1 | 14 | 56 | 76 | 35 | 41 | null | null |
vincenthz/cryptonite | Crypto/PubKey/ECC/P256.hs | bsd-3-clause | withTempPoint :: (Ptr P256X -> Ptr P256Y -> IO a) -> IO a
withTempPoint f = allocTempScrubbed pointSize (\p -> let px = castPtr p in f px (pxToPy px)) | 150 | withTempPoint :: (Ptr P256X -> Ptr P256Y -> IO a) -> IO a
withTempPoint f = allocTempScrubbed pointSize (\p -> let px = castPtr p in f px (pxToPy px)) | 150 | withTempPoint f = allocTempScrubbed pointSize (\p -> let px = castPtr p in f px (pxToPy px)) | 92 | false | true | 0 | 12 | 29 | 83 | 38 | 45 | null | null |
bionikspoon/playing-with-haskell---oreilly | ch05/PrettyJSON.hs | mit | oneChar :: Char -> Doc
oneChar c =
case lookup c simpleEscapes of
Just r -> text r
Nothing | mustEscape c -> hexEscape c
| otherwise -> char c
where mustEscape c' = c' < ' ' || c' == '\x7f' || c' > '\xff' | 250 | oneChar :: Char -> Doc
oneChar c =
case lookup c simpleEscapes of
Just r -> text r
Nothing | mustEscape c -> hexEscape c
| otherwise -> char c
where mustEscape c' = c' < ' ' || c' == '\x7f' || c' > '\xff' | 250 | oneChar c =
case lookup c simpleEscapes of
Just r -> text r
Nothing | mustEscape c -> hexEscape c
| otherwise -> char c
where mustEscape c' = c' < ' ' || c' == '\x7f' || c' > '\xff' | 227 | false | true | 0 | 11 | 91 | 106 | 46 | 60 | null | null |
frantisekfarka/ghc-dsi | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprSizeDecl :: CLabel -> SDoc
pprSizeDecl lbl
= sdocWithPlatform $ \platform ->
if osElfTarget (platformOS platform)
then ptext (sLit "\t.size") <+> ppr lbl
<> ptext (sLit ", .-") <> ppr lbl
else empty | 216 | pprSizeDecl :: CLabel -> SDoc
pprSizeDecl lbl
= sdocWithPlatform $ \platform ->
if osElfTarget (platformOS platform)
then ptext (sLit "\t.size") <+> ppr lbl
<> ptext (sLit ", .-") <> ppr lbl
else empty | 216 | pprSizeDecl lbl
= sdocWithPlatform $ \platform ->
if osElfTarget (platformOS platform)
then ptext (sLit "\t.size") <+> ppr lbl
<> ptext (sLit ", .-") <> ppr lbl
else empty | 186 | false | true | 2 | 12 | 47 | 87 | 40 | 47 | null | null |
ghc-android/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | emitPrimOp _ res ReadOffAddrOp_Word64 args = doIndexOffAddrOp Nothing b64 res args | 99 | emitPrimOp _ res ReadOffAddrOp_Word64 args = doIndexOffAddrOp Nothing b64 res args | 99 | emitPrimOp _ res ReadOffAddrOp_Word64 args = doIndexOffAddrOp Nothing b64 res args | 99 | false | false | 0 | 5 | 27 | 24 | 11 | 13 | null | null |
qrilka/xlsx | src/Codec/Xlsx/Writer.hs | mit | genComments :: Int -> Cells -> STRef s Int -> ST s (Maybe (Element, [ReferencedFileData]))
genComments n cells ref =
if null comments
then do
return Nothing
else do
rId1 <- nextRefId ref
rId2 <- nextRefId ref
let el = refElement "legacyDrawing" rId2
return $ Just (el,... | 1,185 | genComments :: Int -> Cells -> STRef s Int -> ST s (Maybe (Element, [ReferencedFileData]))
genComments n cells ref =
if null comments
then do
return Nothing
else do
rId1 <- nextRefId ref
rId2 <- nextRefId ref
let el = refElement "legacyDrawing" rId2
return $ Just (el,... | 1,185 | genComments n cells ref =
if null comments
then do
return Nothing
else do
rId1 <- nextRefId ref
rId2 <- nextRefId ref
let el = refElement "legacyDrawing" rId2
return $ Just (el, [(rId1, commentsFile), (rId2, vmlDrawingFile)])
where
comments = concatMap (\(row, r... | 1,094 | false | true | 8 | 16 | 276 | 324 | 161 | 163 | null | null |
scslab/iterio-server | Examples/Blog/Post.hs | bsd-3-clause | toPost :: Statement -> IO Post
toPost stmt = do
pid <- getFieldValue stmt "id"
title <- getFieldValue stmt "title"
body <- getFieldValue stmt "body"
return $ Post (Just pid) title body | 192 | toPost :: Statement -> IO Post
toPost stmt = do
pid <- getFieldValue stmt "id"
title <- getFieldValue stmt "title"
body <- getFieldValue stmt "body"
return $ Post (Just pid) title body | 192 | toPost stmt = do
pid <- getFieldValue stmt "id"
title <- getFieldValue stmt "title"
body <- getFieldValue stmt "body"
return $ Post (Just pid) title body | 161 | false | true | 0 | 11 | 39 | 82 | 35 | 47 | null | null |
spacekitteh/smcghc | libraries/base/GHC/ForeignPtr.hs | bsd-3-clause | -- no effect
finalizeForeignPtr (ForeignPtr _ foreignPtr) = foreignPtrFinalizer refFinalizers
where
refFinalizers = case foreignPtr of
(PlainForeignPtr ref) -> ref
(MallocPtr _ ref) -> ref
PlainPtr _ ->
... | 377 | finalizeForeignPtr (ForeignPtr _ foreignPtr) = foreignPtrFinalizer refFinalizers
where
refFinalizers = case foreignPtr of
(PlainForeignPtr ref) -> ref
(MallocPtr _ ref) -> ref
PlainPtr _ ->
... | 364 | finalizeForeignPtr (ForeignPtr _ foreignPtr) = foreignPtrFinalizer refFinalizers
where
refFinalizers = case foreignPtr of
(PlainForeignPtr ref) -> ref
(MallocPtr _ ref) -> ref
PlainPtr _ ->
... | 364 | true | false | 0 | 11 | 169 | 70 | 34 | 36 | null | null |
Heather/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reify ist t@(App _ _ _)
| (P _ f _, args) <- unApply t = reifyApp ist f args | 86 | reify ist t@(App _ _ _)
| (P _ f _, args) <- unApply t = reifyApp ist f args | 86 | reify ist t@(App _ _ _)
| (P _ f _, args) <- unApply t = reifyApp ist f args | 86 | false | false | 0 | 10 | 29 | 58 | 27 | 31 | null | null |
kawu/french-tag | src/NLP/Partage4Xmg/Morph.hs | bsd-2-clause | -- | Get the lemma of the analysis.
lemma :: Ana -> T.Text
lemma = Lex.lemma . word | 83 | lemma :: Ana -> T.Text
lemma = Lex.lemma . word | 47 | lemma = Lex.lemma . word | 24 | true | true | 1 | 8 | 17 | 32 | 14 | 18 | null | null |
nevrenato/Hets_Fork | CspCASL/Parse_CspCASL_Process.hs | gpl-2.0 | cspComps :: AParser st ([Id], Range)
cspComps = try $ do
o <- pToken $ string "[" << notFollowedBy (oneOf "[]|")
(ts, ps) <- parseId cspKeywords `separatedBy` commaT
c <- cBracketT
return (ts, toRange o ps c) | 216 | cspComps :: AParser st ([Id], Range)
cspComps = try $ do
o <- pToken $ string "[" << notFollowedBy (oneOf "[]|")
(ts, ps) <- parseId cspKeywords `separatedBy` commaT
c <- cBracketT
return (ts, toRange o ps c) | 216 | cspComps = try $ do
o <- pToken $ string "[" << notFollowedBy (oneOf "[]|")
(ts, ps) <- parseId cspKeywords `separatedBy` commaT
c <- cBracketT
return (ts, toRange o ps c) | 179 | false | true | 0 | 12 | 44 | 104 | 52 | 52 | null | null |
santolucito/ives | tests/stutter.hs | mit | p2 f (x:xs)=
f x:f x:map2 f xs
| 34 | map2 f (x:xs)=
f x:f x:map2 f xs | 34 | map2 f (x:xs)=
f x:f x:map2 f xs | 34 | false | false | 2 | 6 | 11 | 41 | 17 | 24 | null | null |
porglezomp/lambda-twitter | src/Data/AppState.hs | mit | junkFrame :: Frame
junkFrame = Frame 0 0 0 Top | 46 | junkFrame :: Frame
junkFrame = Frame 0 0 0 Top | 46 | junkFrame = Frame 0 0 0 Top | 27 | false | true | 0 | 6 | 9 | 30 | 11 | 19 | null | null |
np/lens | src/Control/Lens/IndexedTraversal.hs | bsd-3-clause | -- | Traverse the /nth/ element of a 'Traversable' container.
--
-- @'element' ≡ 'elementOf' 'traverse'@
element :: Traversable t => Int -> IndexedTraversal' Int (t a) a
element = elementOf traverse | 198 | element :: Traversable t => Int -> IndexedTraversal' Int (t a) a
element = elementOf traverse | 93 | element = elementOf traverse | 28 | true | true | 0 | 10 | 31 | 47 | 22 | 25 | null | null |
d0kt0r0/estuary | client/src/Estuary/Render/Renderer.hs | gpl-3.0 | renderTextProgramChanged irc c z (EphemeralNotation x,y,eTime) = do
maybeJSoLang <- (Map.lookup x . jsoLangs) <$> get
case maybeJSoLang of
Just j -> do
parseResult <- liftIO $ JSoLang.parse j y
case parseResult of
Right x' -> do
liftIO $ T.putStrLn $ "result of parsing " <> x <> ":... | 545 | renderTextProgramChanged irc c z (EphemeralNotation x,y,eTime) = do
maybeJSoLang <- (Map.lookup x . jsoLangs) <$> get
case maybeJSoLang of
Just j -> do
parseResult <- liftIO $ JSoLang.parse j y
case parseResult of
Right x' -> do
liftIO $ T.putStrLn $ "result of parsing " <> x <> ":... | 545 | renderTextProgramChanged irc c z (EphemeralNotation x,y,eTime) = do
maybeJSoLang <- (Map.lookup x . jsoLangs) <$> get
case maybeJSoLang of
Just j -> do
parseResult <- liftIO $ JSoLang.parse j y
case parseResult of
Right x' -> do
liftIO $ T.putStrLn $ "result of parsing " <> x <> ":... | 545 | false | false | 0 | 21 | 148 | 189 | 89 | 100 | null | null |
jvoigtlaender/elm-lang.org | src/backend/Init/Helpers.hs | bsd-3-clause | makeForReal :: FilePath -> FilePath -> IO ()
makeForReal input output =
do compilerResult <-
runExceptT $
Utils.run "elm-make" [ "--yes", input, "--output=" ++ output ]
case compilerResult of
Left msg ->
do putStrLn (" problem compiling " ++ input ++ "\n")
hP... | 408 | makeForReal :: FilePath -> FilePath -> IO ()
makeForReal input output =
do compilerResult <-
runExceptT $
Utils.run "elm-make" [ "--yes", input, "--output=" ++ output ]
case compilerResult of
Left msg ->
do putStrLn (" problem compiling " ++ input ++ "\n")
hP... | 408 | makeForReal input output =
do compilerResult <-
runExceptT $
Utils.run "elm-make" [ "--yes", input, "--output=" ++ output ]
case compilerResult of
Left msg ->
do putStrLn (" problem compiling " ++ input ++ "\n")
hPutStrLn stderr msg
exitFailure
... | 363 | false | true | 0 | 15 | 146 | 121 | 56 | 65 | null | null |
tjakway/ghcjvm | compiler/nativeGen/SPARC/Ppr.hs | bsd-3-clause | pprInstr (BI cond b blockid)
= hcat [
text "\tb", pprCond cond,
if b then pp_comma_a else empty,
char '\t',
ppr (mkAsmTempLabel (getUnique blockid))
] | 188 | pprInstr (BI cond b blockid)
= hcat [
text "\tb", pprCond cond,
if b then pp_comma_a else empty,
char '\t',
ppr (mkAsmTempLabel (getUnique blockid))
] | 188 | pprInstr (BI cond b blockid)
= hcat [
text "\tb", pprCond cond,
if b then pp_comma_a else empty,
char '\t',
ppr (mkAsmTempLabel (getUnique blockid))
] | 188 | false | false | 0 | 11 | 62 | 69 | 35 | 34 | null | null |
yugr/sudoku | src/Support.hs | mit | drop_last (x:xs) = x:drop_last xs | 33 | drop_last (x:xs) = x:drop_last xs | 33 | drop_last (x:xs) = x:drop_last xs | 33 | false | false | 0 | 7 | 4 | 23 | 11 | 12 | null | null |
tomlokhorst/language-cil | src/Language/Cil/Parser.hs | bsd-3-clause | pInstr :: TParser Instr
pInstr = OpCode <$> pOpCode | 51 | pInstr :: TParser Instr
pInstr = OpCode <$> pOpCode | 51 | pInstr = OpCode <$> pOpCode | 27 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
Changaco/haskell-plugins | src/System/Plugins/Make.hs | lgpl-2.1 | makeClean :: FilePath -> IO ()
makeClean f = let f_hi = replaceExtension f hiSuf
f_o = replaceExtension f objSuf
in mapM_ rm_f [f_hi, f_o] | 171 | makeClean :: FilePath -> IO ()
makeClean f = let f_hi = replaceExtension f hiSuf
f_o = replaceExtension f objSuf
in mapM_ rm_f [f_hi, f_o] | 171 | makeClean f = let f_hi = replaceExtension f hiSuf
f_o = replaceExtension f objSuf
in mapM_ rm_f [f_hi, f_o] | 140 | false | true | 0 | 9 | 57 | 60 | 29 | 31 | null | null |
gridaphobe/ghc | compiler/types/Type.hs | bsd-3-clause | mkFamilyTyConApp :: TyCon -> [Type] -> Type
-- ^ Given a family instance TyCon and its arg types, return the
-- corresponding family type. E.g:
--
-- > data family T a
-- > data instance T (Maybe b) = MkT b
--
-- Where the instance tycon is :RTL, so:
--
-- > mkFamilyTyConApp :RTL Int = T (Maybe Int)
mkFamilyTyConApp... | 614 | mkFamilyTyConApp :: TyCon -> [Type] -> Type
mkFamilyTyConApp tc tys
| Just (fam_tc, fam_tys) <- tyConFamInst_maybe tc
, let tvs = tyConTyVars tc
fam_subst = ASSERT2( length tvs == length tys, ppr tc <+> ppr tys )
zipTopTCvSubst tvs tys
= mkTyConApp fam_tc (substTys fam_subst fam_tys)
... | 354 | mkFamilyTyConApp tc tys
| Just (fam_tc, fam_tys) <- tyConFamInst_maybe tc
, let tvs = tyConTyVars tc
fam_subst = ASSERT2( length tvs == length tys, ppr tc <+> ppr tys )
zipTopTCvSubst tvs tys
= mkTyConApp fam_tc (substTys fam_subst fam_tys)
| otherwise
= mkTyConApp tc tys | 310 | true | true | 0 | 14 | 146 | 140 | 71 | 69 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/RegionInstanceGroupManagers/ListErrors.hs | mpl-2.0 | -- | Opt-in for partial success behavior which provides partial results in
-- case of failure. The default value is false.
rigmleReturnPartialSuccess :: Lens' RegionInstanceGroupManagersListErrors (Maybe Bool)
rigmleReturnPartialSuccess
= lens _rigmleReturnPartialSuccess
(\ s a -> s{_rigmleReturnPartialSuccess ... | 325 | rigmleReturnPartialSuccess :: Lens' RegionInstanceGroupManagersListErrors (Maybe Bool)
rigmleReturnPartialSuccess
= lens _rigmleReturnPartialSuccess
(\ s a -> s{_rigmleReturnPartialSuccess = a}) | 202 | rigmleReturnPartialSuccess
= lens _rigmleReturnPartialSuccess
(\ s a -> s{_rigmleReturnPartialSuccess = a}) | 115 | true | true | 0 | 9 | 45 | 49 | 26 | 23 | null | null |
vito/hummus | src/Hummus/Types.hs | bsd-3-clause | isIgnore _ = False | 18 | isIgnore _ = False | 18 | isIgnore _ = False | 18 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/TargetTCPProxies/SetProxyHeader.hs | mpl-2.0 | -- | Name of the TargetTcpProxy resource whose ProxyHeader is to be set.
ttpsphTargetTCPProxy :: Lens' TargetTCPProxiesSetProxyHeader Text
ttpsphTargetTCPProxy
= lens _ttpsphTargetTCPProxy
(\ s a -> s{_ttpsphTargetTCPProxy = a}) | 236 | ttpsphTargetTCPProxy :: Lens' TargetTCPProxiesSetProxyHeader Text
ttpsphTargetTCPProxy
= lens _ttpsphTargetTCPProxy
(\ s a -> s{_ttpsphTargetTCPProxy = a}) | 163 | ttpsphTargetTCPProxy
= lens _ttpsphTargetTCPProxy
(\ s a -> s{_ttpsphTargetTCPProxy = a}) | 97 | true | true | 0 | 9 | 36 | 42 | 22 | 20 | null | null |
ptol/oczor | src/Oczor/Test/TestCompiler.hs | mit | compile = compileLang "js" | 26 | compile = compileLang "js" | 26 | compile = compileLang "js" | 26 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
lostbean/radio-fm69 | example/Main.hs | bsd-3-clause | w2c :: Word8 -> Char
w2c = toEnum . fromIntegral | 48 | w2c :: Word8 -> Char
w2c = toEnum . fromIntegral | 48 | w2c = toEnum . fromIntegral | 27 | false | true | 0 | 7 | 9 | 26 | 11 | 15 | null | null |
seereason/cabal | Cabal/Distribution/Simple/Setup.hs | bsd-3-clause | flagToMaybe :: Flag a -> Maybe a
flagToMaybe (Flag x) = Just x | 62 | flagToMaybe :: Flag a -> Maybe a
flagToMaybe (Flag x) = Just x | 62 | flagToMaybe (Flag x) = Just x | 29 | false | true | 0 | 9 | 12 | 38 | 16 | 22 | null | null |
xor-xor/webapp_spock | src/App.hs | bsd-3-clause | healthCheck :: SpockAction Pg.Connection MySession AppState ()
healthCheck = do
setStatus status200
text "OK" | 113 | healthCheck :: SpockAction Pg.Connection MySession AppState ()
healthCheck = do
setStatus status200
text "OK" | 113 | healthCheck = do
setStatus status200
text "OK" | 50 | false | true | 0 | 7 | 17 | 36 | 16 | 20 | null | null |
mrmonday/Idris-dev | src/IRTS/Compiler.hs | bsd-3-clause | mkLDecl n _ = return $ (declArgs [] True n LNothing) | 52 | mkLDecl n _ = return $ (declArgs [] True n LNothing) | 52 | mkLDecl n _ = return $ (declArgs [] True n LNothing) | 52 | false | false | 0 | 8 | 10 | 29 | 14 | 15 | null | null |
seereason/cabal | cabal-install/Main.hs | bsd-3-clause | sandboxAction :: SandboxFlags -> [String] -> GlobalFlags -> IO ()
sandboxAction sandboxFlags extraArgs globalFlags = do
let verbosity = fromFlag (sandboxVerbosity sandboxFlags)
case extraArgs of
-- Basic sandbox commands.
["init"] -> sandboxInit verbosity sandboxFlags globalFlags
["delete"] -> sandboxDe... | 1,473 | sandboxAction :: SandboxFlags -> [String] -> GlobalFlags -> IO ()
sandboxAction sandboxFlags extraArgs globalFlags = do
let verbosity = fromFlag (sandboxVerbosity sandboxFlags)
case extraArgs of
-- Basic sandbox commands.
["init"] -> sandboxInit verbosity sandboxFlags globalFlags
["delete"] -> sandboxDe... | 1,473 | sandboxAction sandboxFlags extraArgs globalFlags = do
let verbosity = fromFlag (sandboxVerbosity sandboxFlags)
case extraArgs of
-- Basic sandbox commands.
["init"] -> sandboxInit verbosity sandboxFlags globalFlags
["delete"] -> sandboxDelete verbosity sandboxFlags globalFlags
("add-source":extra) -... | 1,407 | false | true | 0 | 16 | 329 | 321 | 156 | 165 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_LUMINANCE12_ALPHA4_EXT :: GLenum
gl_LUMINANCE12_ALPHA4_EXT = 0x8046 | 70 | gl_LUMINANCE12_ALPHA4_EXT :: GLenum
gl_LUMINANCE12_ALPHA4_EXT = 0x8046 | 70 | gl_LUMINANCE12_ALPHA4_EXT = 0x8046 | 34 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
shlevy/ghc | compiler/utils/Util.hs | bsd-3-clause | liftFst :: (a -> b) -> (a, c) -> (b, c)
liftFst f (a,c) = (f a, c) | 66 | liftFst :: (a -> b) -> (a, c) -> (b, c)
liftFst f (a,c) = (f a, c) | 66 | liftFst f (a,c) = (f a, c) | 26 | false | true | 0 | 7 | 17 | 63 | 34 | 29 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 1468987 = 2045 | 34 | getValueFromProduct 1468987 = 2045 | 34 | getValueFromProduct 1468987 = 2045 | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
urbanslug/ghc | compiler/cmm/CmmType.hs | bsd-3-clause | narrowS W32 x = fromIntegral (fromIntegral x :: Int32) | 54 | narrowS W32 x = fromIntegral (fromIntegral x :: Int32) | 54 | narrowS W32 x = fromIntegral (fromIntegral x :: Int32) | 54 | false | false | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
nevrenato/HetsAlloy | utils/GenerateRules/ParseFile.hs | gpl-2.0 | importList :: Parser String -> Parser String -> Parser String
importList start finish = let
x = finish
+++ do
l <- importList start finish
s <- x
return (l ++ s)
+++ do
c <- item
s <- x
return (c : s)
in do
s1 <- start
s2 <- x
... | 340 | importList :: Parser String -> Parser String -> Parser String
importList start finish = let
x = finish
+++ do
l <- importList start finish
s <- x
return (l ++ s)
+++ do
c <- item
s <- x
return (c : s)
in do
s1 <- start
s2 <- x
... | 340 | importList start finish = let
x = finish
+++ do
l <- importList start finish
s <- x
return (l ++ s)
+++ do
c <- item
s <- x
return (c : s)
in do
s1 <- start
s2 <- x
return (s1 ++ s2) | 278 | false | true | 0 | 15 | 151 | 138 | 62 | 76 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.