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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
joeyinbox/space-invaders-haskell | src/Dataset.hs | gpl-2.0 | getBunkerTopRight2Img (_,_,_,(_,_,_,_,_,_,_,(_,_,_,_,_,_,a,_,_,_,_,_,_,_,_,_,_,_,_,_,_),_)) = a | 95 | getBunkerTopRight2Img (_,_,_,(_,_,_,_,_,_,_,(_,_,_,_,_,_,a,_,_,_,_,_,_,_,_,_,_,_,_,_,_),_)) = a | 95 | getBunkerTopRight2Img (_,_,_,(_,_,_,_,_,_,_,(_,_,_,_,_,_,a,_,_,_,_,_,_,_,_,_,_,_,_,_,_),_)) = a | 95 | false | false | 0 | 7 | 3 | 112 | 72 | 40 | null | null |
olsner/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | translateOp _ (VecNegOp FloatVec n w) = Just (MO_VF_Neg n w) | 61 | translateOp _ (VecNegOp FloatVec n w) = Just (MO_VF_Neg n w) | 61 | translateOp _ (VecNegOp FloatVec n w) = Just (MO_VF_Neg n w) | 61 | false | false | 1 | 7 | 11 | 34 | 15 | 19 | null | null |
jabolopes/fmark | src/Weaver.hs | bsd-3-clause | weaveLines loc lns1 lns2 =
let (matLns, unmatLns) = splitAt (length lns2 - 1) lns1 in
do docss <- weaveLines loc matLns $ init lns2
doc <- weaveExtraLines loc unmatLns $ last lns2
return $ docss ++ [[doc]]
-- | 'weaveStyle' @doc style@ combines content 'Document' @doc@ and
-- style 'Document' @style@ in a single styled 'Document'. | 356 | weaveLines loc lns1 lns2 =
let (matLns, unmatLns) = splitAt (length lns2 - 1) lns1 in
do docss <- weaveLines loc matLns $ init lns2
doc <- weaveExtraLines loc unmatLns $ last lns2
return $ docss ++ [[doc]]
-- | 'weaveStyle' @doc style@ combines content 'Document' @doc@ and
-- style 'Document' @style@ in a single styled 'Document'. | 356 | weaveLines loc lns1 lns2 =
let (matLns, unmatLns) = splitAt (length lns2 - 1) lns1 in
do docss <- weaveLines loc matLns $ init lns2
doc <- weaveExtraLines loc unmatLns $ last lns2
return $ docss ++ [[doc]]
-- | 'weaveStyle' @doc style@ combines content 'Document' @doc@ and
-- style 'Document' @style@ in a single styled 'Document'. | 356 | false | false | 0 | 12 | 80 | 103 | 49 | 54 | null | null |
brendanhay/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Edits/Tracks/Patch.hs | mpl-2.0 | -- | Identifier of the track.
etptTrack :: Lens' EditsTracksPatch Text
etptTrack
= lens _etptTrack (\ s a -> s{_etptTrack = a}) | 129 | etptTrack :: Lens' EditsTracksPatch Text
etptTrack
= lens _etptTrack (\ s a -> s{_etptTrack = a}) | 99 | etptTrack
= lens _etptTrack (\ s a -> s{_etptTrack = a}) | 58 | true | true | 0 | 9 | 23 | 42 | 22 | 20 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/HaXml/src/Text/XML/HaXml/Combinators.hs | bsd-3-clause | -- = f `o` (keep `with` g)
-- | Process CHildren In Place. The filter is applied to any children
-- of an element content, and the element rebuilt around the results.
chip :: CFilter i -> CFilter i
chip f (CElem (Elem n as cs) i) = [ CElem (Elem n as (concatMap f cs)) i ] | 276 | chip :: CFilter i -> CFilter i
chip f (CElem (Elem n as cs) i) = [ CElem (Elem n as (concatMap f cs)) i ] | 105 | chip f (CElem (Elem n as cs) i) = [ CElem (Elem n as (concatMap f cs)) i ] | 74 | true | true | 0 | 11 | 61 | 78 | 38 | 40 | null | null |
nsmryan/CADH | src/CADH/DataDefs.hs | bsd-3-clause | wrapPrim (Uint32 e _) n = Uint32 e $ toEnum n | 45 | wrapPrim (Uint32 e _) n = Uint32 e $ toEnum n | 45 | wrapPrim (Uint32 e _) n = Uint32 e $ toEnum n | 45 | false | false | 1 | 6 | 10 | 33 | 13 | 20 | null | null |
markflorisson/hpack | testrepo/bytestring-0.10.2.0/Data/ByteString/Char8.hs | bsd-3-clause | -- | /O(n)/ 'cons' is analogous to (:) for lists, but of different
-- complexity, as it requires a memcpy.
cons :: Char -> ByteString -> ByteString
cons = B.cons . c2w | 167 | cons :: Char -> ByteString -> ByteString
cons = B.cons . c2w | 60 | cons = B.cons . c2w | 19 | true | true | 1 | 8 | 31 | 35 | 16 | 19 | null | null |
luzhuomi/xhaskell-regex-deriv | Text/Regex/Deriv/ByteString/BitCode.hs | bsd-3-clause | execPatMatch :: (DfaTable, Pat, IM.IntMap RE) -> Word -> Maybe Env
execPatMatch (dfa, p, im) w =
let res = dfa `seq` p `seq` im `seq` execDfa dfa w [(0, mkSPath (strip p))]
in case res of
{ [] -> Nothing
; [ (i, sp) ] ->
let r' = im IM.! i
-- io = logger (putStrLn (show i))
path = {- io `seq`-} r' `seq` sp `seq` retrieveEmpty r' sp
r = p `seq` strip p
-- io = logger (putStrLn (show path) >> putStrLn (show sp) >> putStrLn (show r'))
parseTree = path `seq` decode r path
-- io = logger (putStrLn (show path) >> putStrLn (show parseTree) >> putStrLn (show p))
(env, _) = {- io `seq` -} parseTree `seq` extractSR p r parseTree 0
in Just env
} | 764 | execPatMatch :: (DfaTable, Pat, IM.IntMap RE) -> Word -> Maybe Env
execPatMatch (dfa, p, im) w =
let res = dfa `seq` p `seq` im `seq` execDfa dfa w [(0, mkSPath (strip p))]
in case res of
{ [] -> Nothing
; [ (i, sp) ] ->
let r' = im IM.! i
-- io = logger (putStrLn (show i))
path = {- io `seq`-} r' `seq` sp `seq` retrieveEmpty r' sp
r = p `seq` strip p
-- io = logger (putStrLn (show path) >> putStrLn (show sp) >> putStrLn (show r'))
parseTree = path `seq` decode r path
-- io = logger (putStrLn (show path) >> putStrLn (show parseTree) >> putStrLn (show p))
(env, _) = {- io `seq` -} parseTree `seq` extractSR p r parseTree 0
in Just env
} | 764 | execPatMatch (dfa, p, im) w =
let res = dfa `seq` p `seq` im `seq` execDfa dfa w [(0, mkSPath (strip p))]
in case res of
{ [] -> Nothing
; [ (i, sp) ] ->
let r' = im IM.! i
-- io = logger (putStrLn (show i))
path = {- io `seq`-} r' `seq` sp `seq` retrieveEmpty r' sp
r = p `seq` strip p
-- io = logger (putStrLn (show path) >> putStrLn (show sp) >> putStrLn (show r'))
parseTree = path `seq` decode r path
-- io = logger (putStrLn (show path) >> putStrLn (show parseTree) >> putStrLn (show p))
(env, _) = {- io `seq` -} parseTree `seq` extractSR p r parseTree 0
in Just env
} | 697 | false | true | 3 | 15 | 254 | 239 | 134 | 105 | null | null |
DougBurke/swish | tests/GraphPartitionTest.hs | lgpl-2.1 | testBasic34 = testEq "testBasic34" ga4 (getArcs gp4) | 52 | testBasic34 = testEq "testBasic34" ga4 (getArcs gp4) | 52 | testBasic34 = testEq "testBasic34" ga4 (getArcs gp4) | 52 | false | false | 0 | 7 | 6 | 19 | 9 | 10 | null | null |
tuura/process-mining | macroscope/Tuura/Macroscope/Main.hs | bsd-3-clause | showEvent :: MacroEvent (Event String) -> String
showEvent e = "(" ++ label (first e) ++ ", " ++ label (second e)
++ ") at " ++ show [begin e, end e]
++ " (weight = " ++ show (weight e) ++ ")" | 203 | showEvent :: MacroEvent (Event String) -> String
showEvent e = "(" ++ label (first e) ++ ", " ++ label (second e)
++ ") at " ++ show [begin e, end e]
++ " (weight = " ++ show (weight e) ++ ")" | 202 | showEvent e = "(" ++ label (first e) ++ ", " ++ label (second e)
++ ") at " ++ show [begin e, end e]
++ " (weight = " ++ show (weight e) ++ ")" | 153 | false | true | 10 | 9 | 53 | 112 | 49 | 63 | null | null |
circuithub/persistent-mysql-extra | Database/Persist/MySQL/Extra.hs | mit | insertOrUpdateUniqueMany_
:: (MonadIO m,MonadThrow m,MonadBaseControl IO m,PersistEntity record,PersistEntity t,PersistEntityBackend record ~ SqlBackend)
=> SqlPriority
-> Int
-> Bool
-> [record]
-> [DupUpdate t]
-> ReaderT SqlBackend m ()
insertOrUpdateUniqueMany_ priority chunk commitChunks rs ufs =
forM_ (chunksOf chunk rs) $ \rs' -> do
insertOrUpdateUniqueMany_' priority rs' (map dupUpdateFieldDef ufs)
when commitChunks transactionSave | 467 | insertOrUpdateUniqueMany_
:: (MonadIO m,MonadThrow m,MonadBaseControl IO m,PersistEntity record,PersistEntity t,PersistEntityBackend record ~ SqlBackend)
=> SqlPriority
-> Int
-> Bool
-> [record]
-> [DupUpdate t]
-> ReaderT SqlBackend m ()
insertOrUpdateUniqueMany_ priority chunk commitChunks rs ufs =
forM_ (chunksOf chunk rs) $ \rs' -> do
insertOrUpdateUniqueMany_' priority rs' (map dupUpdateFieldDef ufs)
when commitChunks transactionSave | 467 | insertOrUpdateUniqueMany_ priority chunk commitChunks rs ufs =
forM_ (chunksOf chunk rs) $ \rs' -> do
insertOrUpdateUniqueMany_' priority rs' (map dupUpdateFieldDef ufs)
when commitChunks transactionSave | 213 | false | true | 0 | 13 | 75 | 157 | 75 | 82 | null | null |
mudphone/HaskellBook | src/ReaderPractice.hs | mit | z = [7, 8, 9] | 13 | z = [7, 8, 9] | 13 | z = [7, 8, 9] | 13 | false | false | 1 | 5 | 4 | 18 | 9 | 9 | null | null |
shlevy/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | ap_RDR = nameRdrName apAName | 45 | ap_RDR = nameRdrName apAName | 45 | ap_RDR = nameRdrName apAName | 45 | false | false | 0 | 5 | 20 | 9 | 4 | 5 | null | null |
reinerp/chunked-sequence | Data/Sequence/Chunked.hs | bsd-3-clause | consLargeChunk :: forall a. Unbox a => V.Vector a -> Seq a -> Seq a
consLargeChunk chunk (Seq xs) = Seq (Chunk chunk F.<| xs) | 125 | consLargeChunk :: forall a. Unbox a => V.Vector a -> Seq a -> Seq a
consLargeChunk chunk (Seq xs) = Seq (Chunk chunk F.<| xs) | 125 | consLargeChunk chunk (Seq xs) = Seq (Chunk chunk F.<| xs) | 57 | false | true | 0 | 9 | 24 | 68 | 32 | 36 | null | null |
ethercrow/docopt.hs | System/Console/Docopt/ParseUtils.hs | mit | inlineSpaces1 :: CharParser u ()
inlineSpaces1 = skipMany1 (satisfy isInlineSpace)
<?> "1+ inline-spaces" | 119 | inlineSpaces1 :: CharParser u ()
inlineSpaces1 = skipMany1 (satisfy isInlineSpace)
<?> "1+ inline-spaces" | 119 | inlineSpaces1 = skipMany1 (satisfy isInlineSpace)
<?> "1+ inline-spaces" | 86 | false | true | 2 | 7 | 26 | 38 | 16 | 22 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Elements/Tabular.hs | bsd-3-clause | -- | A short-hand notion for @ elDynAttr\' \"table\" ... @
tableD' ∷ forall t m a. (DomBuilder t m, PostBuild t m) ⇒ Dynamic t Table → m a → m (Element EventResult (DomBuilderSpace m) t, a)
tableD' bm = elDynAttr' "table" (A.attrMap <$> bm) | 240 | tableD' ∷ forall t m a. (DomBuilder t m, PostBuild t m) ⇒ Dynamic t Table → m a → m (Element EventResult (DomBuilderSpace m) t, a)
tableD' bm = elDynAttr' "table" (A.attrMap <$> bm) | 181 | tableD' bm = elDynAttr' "table" (A.attrMap <$> bm) | 50 | true | true | 0 | 14 | 45 | 98 | 49 | 49 | null | null |
byorgey/Idris-dev | src/Idris/ElabTerm.hs | bsd-3-clause | reifyTTConst (P _ n _) | n == reflm "B32Type" = return $ B32Type | 65 | reifyTTConst (P _ n _) | n == reflm "B32Type" = return $ B32Type | 65 | reifyTTConst (P _ n _) | n == reflm "B32Type" = return $ B32Type | 65 | false | false | 0 | 9 | 14 | 36 | 16 | 20 | null | null |
alephcloud/hs-aws-kinesis-client | src/Aws/Kinesis/Client/Consumer/Internal/Kit.hs | apache-2.0 | -- | A lens for '_ckKinesisKit'.
--
ckKinesisKit ∷ Lens' ConsumerKit KinesisKit
ckKinesisKit = lens _ckKinesisKit $ \ck kk → ck { _ckKinesisKit = kk } | 150 | ckKinesisKit ∷ Lens' ConsumerKit KinesisKit
ckKinesisKit = lens _ckKinesisKit $ \ck kk → ck { _ckKinesisKit = kk } | 114 | ckKinesisKit = lens _ckKinesisKit $ \ck kk → ck { _ckKinesisKit = kk } | 70 | true | true | 0 | 8 | 25 | 40 | 22 | 18 | null | null |
chrisdone/haskell-docs | src/haddock-api/Haskell/Docs/HaddockDoc.hs | bsd-3-clause | doc (DocDefList xs) = unlines (map (\(i,x) -> doc i ++ ". " ++ doc x) xs) | 73 | doc (DocDefList xs) = unlines (map (\(i,x) -> doc i ++ ". " ++ doc x) xs) | 73 | doc (DocDefList xs) = unlines (map (\(i,x) -> doc i ++ ". " ++ doc x) xs) | 73 | false | false | 0 | 12 | 16 | 55 | 27 | 28 | null | null |
techno-tanoC/brain | src/Brain/Gochiusa.hs | bsd-3-clause | pdec = string "チノ" >> return PDec | 33 | pdec = string "チノ" >> return PDec | 33 | pdec = string "チノ" >> return PDec | 33 | false | false | 3 | 5 | 6 | 20 | 7 | 13 | null | null |
diku-dk/futhark | src/Language/Futhark/Parser/Monad.hs | isc | mustBe (L loc _) expected =
parseErrorAt loc . Just $
"Only the keyword '" <> expected <> "' may appear here." | 116 | mustBe (L loc _) expected =
parseErrorAt loc . Just $
"Only the keyword '" <> expected <> "' may appear here." | 116 | mustBe (L loc _) expected =
parseErrorAt loc . Just $
"Only the keyword '" <> expected <> "' may appear here." | 116 | false | false | 0 | 9 | 27 | 38 | 18 | 20 | null | null |
draperlaboratory/specgen | src/Language/CSPM/SpecGen/UML2CSP.hs | bsd-3-clause | guardToExp (GNot g) = liftM (EUOp UNot) $ guardToExp g | 62 | guardToExp (GNot g) = liftM (EUOp UNot) $ guardToExp g | 62 | guardToExp (GNot g) = liftM (EUOp UNot) $ guardToExp g | 62 | false | false | 0 | 8 | 17 | 31 | 14 | 17 | null | null |
kim/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/Types.hs | mpl-2.0 | -- | If specified, the configuration option must be a numeric value less than
-- this value.
codMaxValue :: Lens' ConfigurationOptionDescription (Maybe Int)
codMaxValue = lens _codMaxValue (\s a -> s { _codMaxValue = a }) | 221 | codMaxValue :: Lens' ConfigurationOptionDescription (Maybe Int)
codMaxValue = lens _codMaxValue (\s a -> s { _codMaxValue = a }) | 128 | codMaxValue = lens _codMaxValue (\s a -> s { _codMaxValue = a }) | 64 | true | true | 0 | 9 | 35 | 47 | 26 | 21 | null | null |
rueshyna/gogol | gogol-language/gen/Network/Google/Language/Types/Product.hs | mpl-2.0 | -- | The part of speech tag.
posTag :: Lens' PartOfSpeech (Maybe PartOfSpeechTag)
posTag = lens _posTag (\ s a -> s{_posTag = a}) | 129 | posTag :: Lens' PartOfSpeech (Maybe PartOfSpeechTag)
posTag = lens _posTag (\ s a -> s{_posTag = a}) | 100 | posTag = lens _posTag (\ s a -> s{_posTag = a}) | 47 | true | true | 0 | 9 | 23 | 46 | 25 | 21 | null | null |
nilcons/hflags | examples/ComplexExample.hs | apache-2.0 | main = do
_ <- $initHFlags "HFlags example program v0.1"
when (flags_dry_run) $ exitSuccess
forM_ [1..flags_repeat] (const greet)
putStrLn $ "IIRC, your favorite color is " ++ show flags_favorite_color ++ "."
where
s = show (sum flags_numbers_to_sum)
percentPutStrLn 0 _ = return ()
percentPutStrLn p str = let n = ceiling $ fromIntegral (length str) * p / 100.0
in putStrLn $ take n str
greet = percentPutStrLn flags_percent $ case flags_language of
English -> "Hello " ++ flags_name ++ ", very nice to meet you, the sum is " ++ s ++ "!"
Hungarian -> "Szia " ++ flags_name ++ ", orvendek a talalkozasnak, a szamok osszege " ++ s ++ "!" | 702 | main = do
_ <- $initHFlags "HFlags example program v0.1"
when (flags_dry_run) $ exitSuccess
forM_ [1..flags_repeat] (const greet)
putStrLn $ "IIRC, your favorite color is " ++ show flags_favorite_color ++ "."
where
s = show (sum flags_numbers_to_sum)
percentPutStrLn 0 _ = return ()
percentPutStrLn p str = let n = ceiling $ fromIntegral (length str) * p / 100.0
in putStrLn $ take n str
greet = percentPutStrLn flags_percent $ case flags_language of
English -> "Hello " ++ flags_name ++ ", very nice to meet you, the sum is " ++ s ++ "!"
Hungarian -> "Szia " ++ flags_name ++ ", orvendek a talalkozasnak, a szamok osszege " ++ s ++ "!" | 702 | main = do
_ <- $initHFlags "HFlags example program v0.1"
when (flags_dry_run) $ exitSuccess
forM_ [1..flags_repeat] (const greet)
putStrLn $ "IIRC, your favorite color is " ++ show flags_favorite_color ++ "."
where
s = show (sum flags_numbers_to_sum)
percentPutStrLn 0 _ = return ()
percentPutStrLn p str = let n = ceiling $ fromIntegral (length str) * p / 100.0
in putStrLn $ take n str
greet = percentPutStrLn flags_percent $ case flags_language of
English -> "Hello " ++ flags_name ++ ", very nice to meet you, the sum is " ++ s ++ "!"
Hungarian -> "Szia " ++ flags_name ++ ", orvendek a talalkozasnak, a szamok osszege " ++ s ++ "!" | 702 | false | false | 0 | 14 | 178 | 210 | 99 | 111 | null | null |
s9gf4ult/yesod | yesod-bin/AddHandler.hs | mit | addHandlerFiles :: FilePath -> (String, FilePath) -> String -> String -> IO ()
addHandlerFiles cabal (name, handlerFile) pattern methods = do
src <- getSrcDir cabal
let applicationFile = concat [src, "/Application.hs"]
modify applicationFile $ fixApp name
modify cabal $ fixCabal name
modify "config/routes" $ fixRoutes name pattern methods
writeFile handlerFile $ mkHandler name pattern methods
specExists <- doesFileExist specFile
unless specExists $
writeFile specFile $ mkSpec name pattern methods
where
specFile = "test/Handler/" ++ name ++ "Spec.hs"
modify fp f = readFile fp >>= writeFile fp . f | 650 | addHandlerFiles :: FilePath -> (String, FilePath) -> String -> String -> IO ()
addHandlerFiles cabal (name, handlerFile) pattern methods = do
src <- getSrcDir cabal
let applicationFile = concat [src, "/Application.hs"]
modify applicationFile $ fixApp name
modify cabal $ fixCabal name
modify "config/routes" $ fixRoutes name pattern methods
writeFile handlerFile $ mkHandler name pattern methods
specExists <- doesFileExist specFile
unless specExists $
writeFile specFile $ mkSpec name pattern methods
where
specFile = "test/Handler/" ++ name ++ "Spec.hs"
modify fp f = readFile fp >>= writeFile fp . f | 650 | addHandlerFiles cabal (name, handlerFile) pattern methods = do
src <- getSrcDir cabal
let applicationFile = concat [src, "/Application.hs"]
modify applicationFile $ fixApp name
modify cabal $ fixCabal name
modify "config/routes" $ fixRoutes name pattern methods
writeFile handlerFile $ mkHandler name pattern methods
specExists <- doesFileExist specFile
unless specExists $
writeFile specFile $ mkSpec name pattern methods
where
specFile = "test/Handler/" ++ name ++ "Spec.hs"
modify fp f = readFile fp >>= writeFile fp . f | 571 | false | true | 0 | 11 | 135 | 215 | 98 | 117 | null | null |
redien/reuse-lang | standard-library/specification/conversions.hs | cc0-1.0 | list_pair_to_reuse :: [(a, b)] -> Reuse.List (Reuse.Pair a b)
list_pair_to_reuse xs = list_to_reuse (map pair_to_reuse xs) | 122 | list_pair_to_reuse :: [(a, b)] -> Reuse.List (Reuse.Pair a b)
list_pair_to_reuse xs = list_to_reuse (map pair_to_reuse xs) | 122 | list_pair_to_reuse xs = list_to_reuse (map pair_to_reuse xs) | 60 | false | true | 0 | 9 | 15 | 56 | 28 | 28 | null | null |
m0ar/safe-streaming | src/Streaming/Internal.hs | bsd-3-clause | delays :: (LMonadIO m, LFunctor f, LApplicative f) => Double -> Stream f m r
delays seconds = loop where
loop = Effect $ liftIO (threadDelay delay) >> return (Step (pure loop))
delay = fromInteger (truncate (1000000 * seconds))
| 232 | delays :: (LMonadIO m, LFunctor f, LApplicative f) => Double -> Stream f m r
delays seconds = loop where
loop = Effect $ liftIO (threadDelay delay) >> return (Step (pure loop))
delay = fromInteger (truncate (1000000 * seconds))
| 232 | delays seconds = loop where
loop = Effect $ liftIO (threadDelay delay) >> return (Step (pure loop))
delay = fromInteger (truncate (1000000 * seconds))
| 155 | false | true | 0 | 10 | 43 | 105 | 53 | 52 | null | null |
apyrgio/ganeti | src/Ganeti/JQScheduler/Filtering.hs | bsd-2-clause | -- | For a given job queue and set of filters, calculates how many rate
-- limiting filter slots are available and how many are taken by running jobs
-- in the queue.
queueRateLimitSlotMap :: Queue -> Set FilterRule -> RateLimitSlotMap
queueRateLimitSlotMap queue filters =
let -- Rate limiting slots for each filter, with 0 occupied count each
-- (limits only).
emptyFilterSlots =
Map.fromList
[ (uuid, Slot 0 n)
| FilterRule{ frUuid = uuid
, frAction = RateLimit n } <- Set.toList filters ]
-- How many rate limiting slots are taken by the jobs currently running
-- in the queue jobs (counts only).
-- A job takes a slot of a RateLimit filter if that filter is the first
-- one that matches for the job.
runningJobSlots = Map.fromListWith (+)
[ (frUuid, 1) | Just FilterRule{ frUuid, frAction = RateLimit _ } <-
map (applyingFilter filters . jJob)
$ qRunning queue ++ qManipulated queue ]
in -- Fill limits from above with counts from above.
emptyFilterSlots `occupySlots` runningJobSlots | 1,157 | queueRateLimitSlotMap :: Queue -> Set FilterRule -> RateLimitSlotMap
queueRateLimitSlotMap queue filters =
let -- Rate limiting slots for each filter, with 0 occupied count each
-- (limits only).
emptyFilterSlots =
Map.fromList
[ (uuid, Slot 0 n)
| FilterRule{ frUuid = uuid
, frAction = RateLimit n } <- Set.toList filters ]
-- How many rate limiting slots are taken by the jobs currently running
-- in the queue jobs (counts only).
-- A job takes a slot of a RateLimit filter if that filter is the first
-- one that matches for the job.
runningJobSlots = Map.fromListWith (+)
[ (frUuid, 1) | Just FilterRule{ frUuid, frAction = RateLimit _ } <-
map (applyingFilter filters . jJob)
$ qRunning queue ++ qManipulated queue ]
in -- Fill limits from above with counts from above.
emptyFilterSlots `occupySlots` runningJobSlots | 990 | queueRateLimitSlotMap queue filters =
let -- Rate limiting slots for each filter, with 0 occupied count each
-- (limits only).
emptyFilterSlots =
Map.fromList
[ (uuid, Slot 0 n)
| FilterRule{ frUuid = uuid
, frAction = RateLimit n } <- Set.toList filters ]
-- How many rate limiting slots are taken by the jobs currently running
-- in the queue jobs (counts only).
-- A job takes a slot of a RateLimit filter if that filter is the first
-- one that matches for the job.
runningJobSlots = Map.fromListWith (+)
[ (frUuid, 1) | Just FilterRule{ frUuid, frAction = RateLimit _ } <-
map (applyingFilter filters . jJob)
$ qRunning queue ++ qManipulated queue ]
in -- Fill limits from above with counts from above.
emptyFilterSlots `occupySlots` runningJobSlots | 921 | true | true | 0 | 18 | 335 | 180 | 97 | 83 | null | null |
owestphal/LootLanguage | src/BaseTypeList.hs | bsd-3-clause | armourEnergyShieldGloves = ["Chain Gloves","Ringmail Gloves","Mesh Gloves","Riveted Gloves",
"Zealot Gloves","Soldier Gloves","Legion Gloves","Crusader Gloves"] | 162 | armourEnergyShieldGloves = ["Chain Gloves","Ringmail Gloves","Mesh Gloves","Riveted Gloves",
"Zealot Gloves","Soldier Gloves","Legion Gloves","Crusader Gloves"] | 162 | armourEnergyShieldGloves = ["Chain Gloves","Ringmail Gloves","Mesh Gloves","Riveted Gloves",
"Zealot Gloves","Soldier Gloves","Legion Gloves","Crusader Gloves"] | 162 | false | false | 0 | 5 | 13 | 30 | 19 | 11 | null | null |
AlexanderPankiv/ghc | compiler/simplCore/SetLevels.hs | bsd-3-clause | zap_demand_info :: Var -> Var
zap_demand_info v
| isId v = zapIdDemandInfo v
| otherwise = v | 99 | zap_demand_info :: Var -> Var
zap_demand_info v
| isId v = zapIdDemandInfo v
| otherwise = v | 99 | zap_demand_info v
| isId v = zapIdDemandInfo v
| otherwise = v | 69 | false | true | 0 | 8 | 23 | 47 | 19 | 28 | null | null |
scottgw/eiffel-typecheck | Util/Monad.hs | bsd-3-clause | lookupClassM t = error $ "lookupClassM: can't lookup a " ++ show t ++ " type" | 77 | lookupClassM t = error $ "lookupClassM: can't lookup a " ++ show t ++ " type" | 77 | lookupClassM t = error $ "lookupClassM: can't lookup a " ++ show t ++ " type" | 77 | false | false | 0 | 7 | 15 | 24 | 11 | 13 | null | null |
diku-kmc/kleenexlang | src/KMC/SymbolicFST.hs | mit | -- | Get the number of transitions in the FST
fstTransSize :: FST q pred func -> Int
fstTransSize fst' = M.size (eForward (fstE fst')) + M.size (eForwardEpsilon (fstE fst')) | 173 | fstTransSize :: FST q pred func -> Int
fstTransSize fst' = M.size (eForward (fstE fst')) + M.size (eForwardEpsilon (fstE fst')) | 127 | fstTransSize fst' = M.size (eForward (fstE fst')) + M.size (eForwardEpsilon (fstE fst')) | 88 | true | true | 0 | 10 | 29 | 64 | 31 | 33 | null | null |
sopvop/snap | test/suite/Snap/Snaplet/Auth/Handlers/Tests.hs | bsd-3-clause | testUsernameExists :: Test
testUsernameExists = testCase "username exists" assertUserExists
where
assertUserExists :: Assertion
assertUserExists = do
let hdl = with auth $ A.usernameExists "foo"
res <- evalHandler Nothing (ST.get "" Map.empty) hdl appInit
either (assertFailure . show) (assertBool failMsg) res
failMsg = "usernameExists: Expected to return True, but it didn't."
------------------------------------------------------------------------------ | 498 | testUsernameExists :: Test
testUsernameExists = testCase "username exists" assertUserExists
where
assertUserExists :: Assertion
assertUserExists = do
let hdl = with auth $ A.usernameExists "foo"
res <- evalHandler Nothing (ST.get "" Map.empty) hdl appInit
either (assertFailure . show) (assertBool failMsg) res
failMsg = "usernameExists: Expected to return True, but it didn't."
------------------------------------------------------------------------------ | 498 | testUsernameExists = testCase "username exists" assertUserExists
where
assertUserExists :: Assertion
assertUserExists = do
let hdl = with auth $ A.usernameExists "foo"
res <- evalHandler Nothing (ST.get "" Map.empty) hdl appInit
either (assertFailure . show) (assertBool failMsg) res
failMsg = "usernameExists: Expected to return True, but it didn't."
------------------------------------------------------------------------------ | 471 | false | true | 2 | 13 | 91 | 110 | 52 | 58 | null | null |
deyaaeldeen/nAnnotizer | Dynamizer/Sampling.hs | gpl-3.0 | runSampleFromBinsWithLogging :: forall a. (Ord a, Show a)
=> ProgramF (Ann a (ExpF (Ann a Type))) -- ^ The fully-statically typed AST to sample from
-> Int -- ^ The number of samples in each bin
-> Int -- ^ The number of bins
-> IO [[ProgramF (Ann a (ExpF (Ann a Type)))]] -- ^ The list of bins, where each is a list of samples
runSampleFromBinsWithLogging ast ns nb = runSamplingWithLogging $ sampleFromBins ast ns nb | 621 | runSampleFromBinsWithLogging :: forall a. (Ord a, Show a)
=> ProgramF (Ann a (ExpF (Ann a Type))) -- ^ The fully-statically typed AST to sample from
-> Int -- ^ The number of samples in each bin
-> Int -- ^ The number of bins
-> IO [[ProgramF (Ann a (ExpF (Ann a Type)))]]
runSampleFromBinsWithLogging ast ns nb = runSamplingWithLogging $ sampleFromBins ast ns nb | 566 | runSampleFromBinsWithLogging ast ns nb = runSamplingWithLogging $ sampleFromBins ast ns nb | 90 | true | true | 0 | 19 | 279 | 124 | 64 | 60 | null | null |
AlexanderPankiv/ghc | compiler/prelude/THNames.hs | bsd-3-clause | integerLIdKey = mkPreludeMiscIdUnique 222 | 45 | integerLIdKey = mkPreludeMiscIdUnique 222 | 45 | integerLIdKey = mkPreludeMiscIdUnique 222 | 45 | false | false | 1 | 5 | 7 | 12 | 4 | 8 | null | null |
andreagenso/java2scala | src/J2s/Scanner.hs | apache-2.0 | isHexaFloatingPointLiteral3 (c1:c2:[]) = False | 50 | isHexaFloatingPointLiteral3 (c1:c2:[]) = False | 50 | isHexaFloatingPointLiteral3 (c1:c2:[]) = False | 50 | false | false | 0 | 8 | 7 | 23 | 11 | 12 | null | null |
brendanhay/gogol | gogol-run/gen/Network/Google/Resource/Run/Projects/Locations/Services/TestIAMPermissions.hs | mpl-2.0 | -- | Creates a value of 'ProjectsLocationsServicesTestIAMPermissions' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'plstipXgafv'
--
-- * 'plstipUploadProtocol'
--
-- * 'plstipAccessToken'
--
-- * 'plstipUploadType'
--
-- * 'plstipPayload'
--
-- * 'plstipResource'
--
-- * 'plstipCallback'
projectsLocationsServicesTestIAMPermissions
:: TestIAMPermissionsRequest -- ^ 'plstipPayload'
-> Text -- ^ 'plstipResource'
-> ProjectsLocationsServicesTestIAMPermissions
projectsLocationsServicesTestIAMPermissions pPlstipPayload_ pPlstipResource_ =
ProjectsLocationsServicesTestIAMPermissions'
{ _plstipXgafv = Nothing
, _plstipUploadProtocol = Nothing
, _plstipAccessToken = Nothing
, _plstipUploadType = Nothing
, _plstipPayload = pPlstipPayload_
, _plstipResource = pPlstipResource_
, _plstipCallback = Nothing
} | 939 | projectsLocationsServicesTestIAMPermissions
:: TestIAMPermissionsRequest -- ^ 'plstipPayload'
-> Text -- ^ 'plstipResource'
-> ProjectsLocationsServicesTestIAMPermissions
projectsLocationsServicesTestIAMPermissions pPlstipPayload_ pPlstipResource_ =
ProjectsLocationsServicesTestIAMPermissions'
{ _plstipXgafv = Nothing
, _plstipUploadProtocol = Nothing
, _plstipAccessToken = Nothing
, _plstipUploadType = Nothing
, _plstipPayload = pPlstipPayload_
, _plstipResource = pPlstipResource_
, _plstipCallback = Nothing
} | 562 | projectsLocationsServicesTestIAMPermissions pPlstipPayload_ pPlstipResource_ =
ProjectsLocationsServicesTestIAMPermissions'
{ _plstipXgafv = Nothing
, _plstipUploadProtocol = Nothing
, _plstipAccessToken = Nothing
, _plstipUploadType = Nothing
, _plstipPayload = pPlstipPayload_
, _plstipResource = pPlstipResource_
, _plstipCallback = Nothing
} | 379 | true | true | 0 | 8 | 150 | 96 | 62 | 34 | null | null |
DougBurke/swish | tests/N3FormatterTest.hs | lgpl-2.1 | -- datatype/literal graphs
graph_l1, graph_l2, graph_l3, graph_l4 :: RDFGraph
graph_l1 = toGraph [arc s1 p1 lfr] | 113 | graph_l1, graph_l2, graph_l3, graph_l4 :: RDFGraph
graph_l1 = toGraph [arc s1 p1 lfr] | 85 | graph_l1 = toGraph [arc s1 p1 lfr] | 34 | true | true | 0 | 7 | 16 | 31 | 19 | 12 | null | null |
shlevy/ghc | compiler/utils/Outputable.hs | bsd-3-clause | punctuate :: SDoc -- ^ The punctuation
-> [SDoc] -- ^ The list that will have punctuation added between every adjacent pair of elements
-> [SDoc] -- ^ Punctuated list
punctuate _ [] = [] | 212 | punctuate :: SDoc -- ^ The punctuation
-> [SDoc] -- ^ The list that will have punctuation added between every adjacent pair of elements
-> [SDoc]
punctuate _ [] = [] | 191 | punctuate _ [] = [] | 23 | true | true | 0 | 7 | 60 | 37 | 21 | 16 | null | null |
dmalikov/lambdabot | Plugin/Spell.hs | mit | off :: ModuleUnit Bool
off = writeMS False | 42 | off :: ModuleUnit Bool
off = writeMS False | 42 | off = writeMS False | 19 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
GaloisInc/halvm-ghc | compiler/utils/Util.hs | bsd-3-clause | dropList :: [b] -> [a] -> [a]
dropList [] xs = xs | 52 | dropList :: [b] -> [a] -> [a]
dropList [] xs = xs | 52 | dropList [] xs = xs | 22 | false | true | 0 | 7 | 14 | 35 | 19 | 16 | null | null |
vincenthz/hs-cryptohash | Crypto/Hash/MD2.hs | bsd-3-clause | -- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString
hash d = digestToByteStringWitness H.MD2 $ H.hash d | 139 | hash :: ByteString -> ByteString
hash d = digestToByteStringWitness H.MD2 $ H.hash d | 84 | hash d = digestToByteStringWitness H.MD2 $ H.hash d | 51 | true | true | 0 | 7 | 22 | 38 | 17 | 21 | null | null |
clarissalittler/randomimages | ShapeToBmp.hs | gpl-2.0 | maxPixel = 65535 | 16 | maxPixel = 65535 | 16 | maxPixel = 65535 | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
bitemyapp/ballast | src/Ballast/Types.hs | bsd-3-clause | prodEnvConfig :: IO ShipwireConfig
prodEnvConfig = do
(login, passw) <- credentialsEnv
return $ ShipwireConfig ShipwireProduction login passw | 145 | prodEnvConfig :: IO ShipwireConfig
prodEnvConfig = do
(login, passw) <- credentialsEnv
return $ ShipwireConfig ShipwireProduction login passw | 145 | prodEnvConfig = do
(login, passw) <- credentialsEnv
return $ ShipwireConfig ShipwireProduction login passw | 110 | false | true | 0 | 8 | 20 | 41 | 20 | 21 | null | null |
zachsully/hakaru | haskell/Tests/Hakaru.hs | bsd-3-clause | normal01 = "normal(-0.0,1.0)" | 30 | normal01 = "normal(-0.0,1.0)" | 30 | normal01 = "normal(-0.0,1.0)" | 30 | false | false | 0 | 4 | 3 | 6 | 3 | 3 | null | null |
tpsinnem/Idris-dev | src/Idris/IdrisDoc.hs | bsd-3-clause | extractPTermNames (PPi _ n _ p1 p2) = n : concatMap extract [p1, p2] | 69 | extractPTermNames (PPi _ n _ p1 p2) = n : concatMap extract [p1, p2] | 69 | extractPTermNames (PPi _ n _ p1 p2) = n : concatMap extract [p1, p2] | 69 | false | false | 0 | 7 | 14 | 38 | 19 | 19 | null | null |
ml9951/ThreadScope | GUI/SummaryView.hs | bsd-3-clause | setSummaryStats :: SummaryView -> SummaryStats -> Bool -> IO ()
setSummaryStats view SummaryStats{..} hasHeapEvents = do
setTimeStats view summTimeStats
if hasHeapEvents
then do setHeapStatsAvailable view True
setHeapStats view summHeapStats
setGcStats view summGcStats
else setHeapStatsAvailable view False
setSparkStats view summSparkStats | 401 | setSummaryStats :: SummaryView -> SummaryStats -> Bool -> IO ()
setSummaryStats view SummaryStats{..} hasHeapEvents = do
setTimeStats view summTimeStats
if hasHeapEvents
then do setHeapStatsAvailable view True
setHeapStats view summHeapStats
setGcStats view summGcStats
else setHeapStatsAvailable view False
setSparkStats view summSparkStats | 401 | setSummaryStats view SummaryStats{..} hasHeapEvents = do
setTimeStats view summTimeStats
if hasHeapEvents
then do setHeapStatsAvailable view True
setHeapStats view summHeapStats
setGcStats view summGcStats
else setHeapStatsAvailable view False
setSparkStats view summSparkStats | 337 | false | true | 0 | 10 | 98 | 97 | 43 | 54 | null | null |
reckbo/hs-hcp-pipeline | src/Stage/Normalize.hs | bsd-3-clause | meanb0_file :: FilePath
meanb0_file = outdir </> "Pos-1-meanb0" | 63 | meanb0_file :: FilePath
meanb0_file = outdir </> "Pos-1-meanb0" | 63 | meanb0_file = outdir </> "Pos-1-meanb0" | 39 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
pseudonom/persistent | persistent-template/Database/Persist/TH/Internal.hs | mit | defaultIdType :: EntityDef -> Bool
defaultIdType t = fieldType (entityId t) == FTTypeCon Nothing (keyIdText t) | 110 | defaultIdType :: EntityDef -> Bool
defaultIdType t = fieldType (entityId t) == FTTypeCon Nothing (keyIdText t) | 110 | defaultIdType t = fieldType (entityId t) == FTTypeCon Nothing (keyIdText t) | 75 | false | true | 0 | 8 | 15 | 42 | 20 | 22 | null | null |
cauterize-tools/cauterize | src/Cauterize/Dynamic/Unpack.hs | bsd-3-clause | unpackTag :: C.Tag -> Get Integer
unpackTag C.T1 = liftM fromIntegral getWord8 | 78 | unpackTag :: C.Tag -> Get Integer
unpackTag C.T1 = liftM fromIntegral getWord8 | 78 | unpackTag C.T1 = liftM fromIntegral getWord8 | 44 | false | true | 0 | 6 | 11 | 30 | 14 | 16 | null | null |
snoyberg/hackage-server | Distribution/Server/Features/Core/Backup.hs | bsd-3-clause | ----------- Converting pieces of PkgInfo to entries
cabalListToExport :: PackageId -> [(CabalFileText, UploadInfo)] -> [BackupEntry]
cabalListToExport pkgId cabalInfos = csvToBackup (pkgPath pkgId "uploads.csv") (versionListToCSV infos):
map cabalToExport (zip [0..] cabals)
where (cabals, infos) = unzip cabalInfos
cabalName = display (packageName pkgId) ++ ".cabal"
cabalToExport :: (Int, CabalFileText) -> BackupEntry
cabalToExport (0, CabalFileText bs) = BackupByteString (pkgPath pkgId cabalName) bs
cabalToExport (n, CabalFileText bs) = BackupByteString (pkgPath pkgId (cabalName ++ "-" ++ show n)) bs | 645 | cabalListToExport :: PackageId -> [(CabalFileText, UploadInfo)] -> [BackupEntry]
cabalListToExport pkgId cabalInfos = csvToBackup (pkgPath pkgId "uploads.csv") (versionListToCSV infos):
map cabalToExport (zip [0..] cabals)
where (cabals, infos) = unzip cabalInfos
cabalName = display (packageName pkgId) ++ ".cabal"
cabalToExport :: (Int, CabalFileText) -> BackupEntry
cabalToExport (0, CabalFileText bs) = BackupByteString (pkgPath pkgId cabalName) bs
cabalToExport (n, CabalFileText bs) = BackupByteString (pkgPath pkgId (cabalName ++ "-" ++ show n)) bs | 593 | cabalListToExport pkgId cabalInfos = csvToBackup (pkgPath pkgId "uploads.csv") (versionListToCSV infos):
map cabalToExport (zip [0..] cabals)
where (cabals, infos) = unzip cabalInfos
cabalName = display (packageName pkgId) ++ ".cabal"
cabalToExport :: (Int, CabalFileText) -> BackupEntry
cabalToExport (0, CabalFileText bs) = BackupByteString (pkgPath pkgId cabalName) bs
cabalToExport (n, CabalFileText bs) = BackupByteString (pkgPath pkgId (cabalName ++ "-" ++ show n)) bs | 512 | true | true | 0 | 10 | 111 | 202 | 104 | 98 | null | null |
wrengr/bytestring-trie | src/Data/Trie/Internal.hs | bsd-3-clause | singleton k v = Arc k (Just v) Empty | 36 | singleton k v = Arc k (Just v) Empty | 36 | singleton k v = Arc k (Just v) Empty | 36 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
wxwxwwxxx/ghc | compiler/nativeGen/AsmCodeGen.hs | bsd-3-clause | cmmNativeGenStream :: (Outputable statics, Outputable instr, Instruction instr)
=> DynFlags
-> Module -> ModLocation
-> NcgImpl statics instr jumpDest
-> BufHandle
-> UniqSupply
-> Stream IO RawCmmGroup ()
-> NativeGenAcc statics instr
-> IO (NativeGenAcc statics instr, UniqSupply)
cmmNativeGenStream dflags this_mod modLoc ncgImpl h us cmm_stream ngs
= do r <- Stream.runStream cmm_stream
case r of
Left () ->
return (ngs { ngs_imports = reverse $ ngs_imports ngs
, ngs_natives = reverse $ ngs_natives ngs
, ngs_colorStats = reverse $ ngs_colorStats ngs
, ngs_linearStats = reverse $ ngs_linearStats ngs
},
us)
Right (cmms, cmm_stream') -> do
-- Generate debug information
let debugFlag = gopt Opt_Debug dflags
!ndbgs | debugFlag = cmmDebugGen modLoc cmms
| otherwise = []
dbgMap = debugToMap ndbgs
-- Insert split marker, generate native code
let splitFlag = gopt Opt_SplitObjs dflags
split_marker = CmmProc mapEmpty mkSplitMarkerLabel [] $
ofBlockList (panic "split_marker_entry") []
cmms' | splitFlag = split_marker : cmms
| otherwise = cmms
(ngs',us') <- cmmNativeGens dflags this_mod modLoc ncgImpl h dbgMap us
cmms' ngs 0
-- Link native code information into debug blocks
let !ldbgs = cmmDebugLink (ngs_labels ngs') ndbgs
dumpIfSet_dyn dflags Opt_D_dump_debug "Debug Infos"
(vcat $ map ppr ldbgs)
-- Emit & clear DWARF information when generating split
-- object files, as we need it to land in the same object file
(ngs'', us'') <-
if debugFlag && splitFlag
then do (dwarf, us'') <- dwarfGen dflags modLoc us ldbgs
emitNativeCode dflags h dwarf
return (ngs' { ngs_debug = []
, ngs_dwarfFiles = emptyUFM
, ngs_labels = [] },
us'')
else return (ngs' { ngs_debug = ngs_debug ngs' ++ ldbgs
, ngs_labels = [] },
us')
cmmNativeGenStream dflags this_mod modLoc ncgImpl h us''
cmm_stream' ngs''
-- | Do native code generation on all these cmms.
-- | 2,644 | cmmNativeGenStream :: (Outputable statics, Outputable instr, Instruction instr)
=> DynFlags
-> Module -> ModLocation
-> NcgImpl statics instr jumpDest
-> BufHandle
-> UniqSupply
-> Stream IO RawCmmGroup ()
-> NativeGenAcc statics instr
-> IO (NativeGenAcc statics instr, UniqSupply)
cmmNativeGenStream dflags this_mod modLoc ncgImpl h us cmm_stream ngs
= do r <- Stream.runStream cmm_stream
case r of
Left () ->
return (ngs { ngs_imports = reverse $ ngs_imports ngs
, ngs_natives = reverse $ ngs_natives ngs
, ngs_colorStats = reverse $ ngs_colorStats ngs
, ngs_linearStats = reverse $ ngs_linearStats ngs
},
us)
Right (cmms, cmm_stream') -> do
-- Generate debug information
let debugFlag = gopt Opt_Debug dflags
!ndbgs | debugFlag = cmmDebugGen modLoc cmms
| otherwise = []
dbgMap = debugToMap ndbgs
-- Insert split marker, generate native code
let splitFlag = gopt Opt_SplitObjs dflags
split_marker = CmmProc mapEmpty mkSplitMarkerLabel [] $
ofBlockList (panic "split_marker_entry") []
cmms' | splitFlag = split_marker : cmms
| otherwise = cmms
(ngs',us') <- cmmNativeGens dflags this_mod modLoc ncgImpl h dbgMap us
cmms' ngs 0
-- Link native code information into debug blocks
let !ldbgs = cmmDebugLink (ngs_labels ngs') ndbgs
dumpIfSet_dyn dflags Opt_D_dump_debug "Debug Infos"
(vcat $ map ppr ldbgs)
-- Emit & clear DWARF information when generating split
-- object files, as we need it to land in the same object file
(ngs'', us'') <-
if debugFlag && splitFlag
then do (dwarf, us'') <- dwarfGen dflags modLoc us ldbgs
emitNativeCode dflags h dwarf
return (ngs' { ngs_debug = []
, ngs_dwarfFiles = emptyUFM
, ngs_labels = [] },
us'')
else return (ngs' { ngs_debug = ngs_debug ngs' ++ ldbgs
, ngs_labels = [] },
us')
cmmNativeGenStream dflags this_mod modLoc ncgImpl h us''
cmm_stream' ngs''
-- | Do native code generation on all these cmms.
-- | 2,643 | cmmNativeGenStream dflags this_mod modLoc ncgImpl h us cmm_stream ngs
= do r <- Stream.runStream cmm_stream
case r of
Left () ->
return (ngs { ngs_imports = reverse $ ngs_imports ngs
, ngs_natives = reverse $ ngs_natives ngs
, ngs_colorStats = reverse $ ngs_colorStats ngs
, ngs_linearStats = reverse $ ngs_linearStats ngs
},
us)
Right (cmms, cmm_stream') -> do
-- Generate debug information
let debugFlag = gopt Opt_Debug dflags
!ndbgs | debugFlag = cmmDebugGen modLoc cmms
| otherwise = []
dbgMap = debugToMap ndbgs
-- Insert split marker, generate native code
let splitFlag = gopt Opt_SplitObjs dflags
split_marker = CmmProc mapEmpty mkSplitMarkerLabel [] $
ofBlockList (panic "split_marker_entry") []
cmms' | splitFlag = split_marker : cmms
| otherwise = cmms
(ngs',us') <- cmmNativeGens dflags this_mod modLoc ncgImpl h dbgMap us
cmms' ngs 0
-- Link native code information into debug blocks
let !ldbgs = cmmDebugLink (ngs_labels ngs') ndbgs
dumpIfSet_dyn dflags Opt_D_dump_debug "Debug Infos"
(vcat $ map ppr ldbgs)
-- Emit & clear DWARF information when generating split
-- object files, as we need it to land in the same object file
(ngs'', us'') <-
if debugFlag && splitFlag
then do (dwarf, us'') <- dwarfGen dflags modLoc us ldbgs
emitNativeCode dflags h dwarf
return (ngs' { ngs_debug = []
, ngs_dwarfFiles = emptyUFM
, ngs_labels = [] },
us'')
else return (ngs' { ngs_debug = ngs_debug ngs' ++ ldbgs
, ngs_labels = [] },
us')
cmmNativeGenStream dflags this_mod modLoc ncgImpl h us''
cmm_stream' ngs''
-- | Do native code generation on all these cmms.
-- | 2,248 | false | true | 0 | 20 | 1,085 | 576 | 287 | 289 | null | null |
mietek/hl | src/HL/View/Downloads.hs | bsd-3-clause | stackage :: Html ()
stackage =
do h3_ "Stackage Nightly"
p_ "Stackage is a nightly generated stable repository of snapshots of package sets in \
\which only packages which build and pass tests together are bundled \
\together into a snapshot."
p_ (a_ [href_ "http://www.stackage.org/nightly"] $ "Get Stackage Nightly →") | 348 | stackage :: Html ()
stackage =
do h3_ "Stackage Nightly"
p_ "Stackage is a nightly generated stable repository of snapshots of package sets in \
\which only packages which build and pass tests together are bundled \
\together into a snapshot."
p_ (a_ [href_ "http://www.stackage.org/nightly"] $ "Get Stackage Nightly →") | 348 | stackage =
do h3_ "Stackage Nightly"
p_ "Stackage is a nightly generated stable repository of snapshots of package sets in \
\which only packages which build and pass tests together are bundled \
\together into a snapshot."
p_ (a_ [href_ "http://www.stackage.org/nightly"] $ "Get Stackage Nightly →") | 328 | false | true | 1 | 13 | 77 | 54 | 22 | 32 | null | null |
relrod/ext2 | src/System/Ext2/Parsers.hs | bsd-2-clause | readInodeTable :: MonadGet m => Int -> m (V.Vector Inode)
readInodeTable n = V.replicateM n readInode | 102 | readInodeTable :: MonadGet m => Int -> m (V.Vector Inode)
readInodeTable n = V.replicateM n readInode | 102 | readInodeTable n = V.replicateM n readInode | 43 | false | true | 0 | 10 | 16 | 43 | 20 | 23 | null | null |
GaloisInc/halvm-ghc | compiler/llvmGen/LlvmMangler.hs | bsd-3-clause | rewrites :: [Rewrite]
rewrites = [rewriteSymType, rewriteAVX] | 61 | rewrites :: [Rewrite]
rewrites = [rewriteSymType, rewriteAVX] | 61 | rewrites = [rewriteSymType, rewriteAVX] | 39 | false | true | 0 | 5 | 6 | 20 | 12 | 8 | null | null |
kawu/ltag | src/NLP/LTAG/Early.hs | bsd-2-clause | -- | We try to complete states from previous chart entries given
-- the final (fully parsed) states from the current entry. While
-- doing this we can obtain new final states and thus `substAll`
-- may be needed to run again.
substAll
:: (Ord a, Ord b)
=> Entry a b -- ^ The current chart entry Chart[i]
-> Chart a b -- ^ The chart with previous entries
-> Entry a b
substAll curr chart
= S.union curr $ S.fromList
$ concatMap doit $ S.toList curr
where
doit (st, i) =
-- We do substitution only with respect to completed
-- parse trees.
if null (right st) then
-- Substitution on some previous state from Chart[i]
-- which starts on position j does not change its
-- position.
let substOn (xs, j) = (,j) <$> subst st xs
-- Below we know, that <i> refers to some previous
-- entry and not the current state because each tree
-- spans over at least one non-terminal.
in mapMaybe substOn $ S.toList $ chart !? i
-- Otherwise: no new states.
else []
-- | We try to complete states from previous chart entries given
-- the partially parsed auxiliary trees from the current entry. | 1,260 | substAll
:: (Ord a, Ord b)
=> Entry a b -- ^ The current chart entry Chart[i]
-> Chart a b -- ^ The chart with previous entries
-> Entry a b
substAll curr chart
= S.union curr $ S.fromList
$ concatMap doit $ S.toList curr
where
doit (st, i) =
-- We do substitution only with respect to completed
-- parse trees.
if null (right st) then
-- Substitution on some previous state from Chart[i]
-- which starts on position j does not change its
-- position.
let substOn (xs, j) = (,j) <$> subst st xs
-- Below we know, that <i> refers to some previous
-- entry and not the current state because each tree
-- spans over at least one non-terminal.
in mapMaybe substOn $ S.toList $ chart !? i
-- Otherwise: no new states.
else []
-- | We try to complete states from previous chart entries given
-- the partially parsed auxiliary trees from the current entry. | 1,033 | substAll curr chart
= S.union curr $ S.fromList
$ concatMap doit $ S.toList curr
where
doit (st, i) =
-- We do substitution only with respect to completed
-- parse trees.
if null (right st) then
-- Substitution on some previous state from Chart[i]
-- which starts on position j does not change its
-- position.
let substOn (xs, j) = (,j) <$> subst st xs
-- Below we know, that <i> refers to some previous
-- entry and not the current state because each tree
-- spans over at least one non-terminal.
in mapMaybe substOn $ S.toList $ chart !? i
-- Otherwise: no new states.
else []
-- | We try to complete states from previous chart entries given
-- the partially parsed auxiliary trees from the current entry. | 862 | true | true | 6 | 11 | 389 | 193 | 100 | 93 | null | null |
MichielDerhaeg/stack | src/Stack/Types/Config.hs | bsd-3-clause | snapshotDefL :: HasBuildConfig s => Lens' s SnapshotDef
snapshotDefL = buildConfigL.lens
bcSnapshotDef
(\x y -> x { bcSnapshotDef = y }) | 144 | snapshotDefL :: HasBuildConfig s => Lens' s SnapshotDef
snapshotDefL = buildConfigL.lens
bcSnapshotDef
(\x y -> x { bcSnapshotDef = y }) | 144 | snapshotDefL = buildConfigL.lens
bcSnapshotDef
(\x y -> x { bcSnapshotDef = y }) | 88 | false | true | 1 | 9 | 28 | 59 | 27 | 32 | null | null |
shlevy/ghc | compiler/hsSyn/HsBinds.hs | bsd-3-clause | isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool
isEmptyLHsBinds = isEmptyBag | 74 | isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool
isEmptyLHsBinds = isEmptyBag | 74 | isEmptyLHsBinds = isEmptyBag | 28 | false | true | 0 | 7 | 9 | 27 | 11 | 16 | null | null |
gcross/greedy-variable-layout | Algorithm/VariableLayout.hs | bsd-3-clause | -- @-node:gcross.20090615091711.13:<< Types >>
-- @nl
-- @+others
-- @+node:gcross.20090615091711.29:fragmentBlocks
fragmentBlocks :: Alignment -> Offset -> [(Alignment,Offset)]
fragmentBlocks final_alignment starting_offset = go final_alignment
where
final_offset = (`shiftL` final_alignment) . (+1) . (`shiftR` final_alignment) $ starting_offset
complement_offset = (final_offset - starting_offset)
go alignment
| alignment < 0
= []
| not (complement_offset `testBit` alignment)
= go (alignment-1)
| otherwise
= (alignment,final_offset - (bit alignment))
: go (alignment-1)
-- @-node:gcross.20090615091711.29:fragmentBlocks
-- @+node:gcross.20090615091711.14:allocateBlock | 765 | fragmentBlocks :: Alignment -> Offset -> [(Alignment,Offset)]
fragmentBlocks final_alignment starting_offset = go final_alignment
where
final_offset = (`shiftL` final_alignment) . (+1) . (`shiftR` final_alignment) $ starting_offset
complement_offset = (final_offset - starting_offset)
go alignment
| alignment < 0
= []
| not (complement_offset `testBit` alignment)
= go (alignment-1)
| otherwise
= (alignment,final_offset - (bit alignment))
: go (alignment-1)
-- @-node:gcross.20090615091711.29:fragmentBlocks
-- @+node:gcross.20090615091711.14:allocateBlock | 648 | fragmentBlocks final_alignment starting_offset = go final_alignment
where
final_offset = (`shiftL` final_alignment) . (+1) . (`shiftR` final_alignment) $ starting_offset
complement_offset = (final_offset - starting_offset)
go alignment
| alignment < 0
= []
| not (complement_offset `testBit` alignment)
= go (alignment-1)
| otherwise
= (alignment,final_offset - (bit alignment))
: go (alignment-1)
-- @-node:gcross.20090615091711.29:fragmentBlocks
-- @+node:gcross.20090615091711.14:allocateBlock | 586 | true | true | 7 | 11 | 160 | 177 | 100 | 77 | null | null |
vincenthz/hs-foundation | basement/Basement/UArray/Mutable.hs | bsd-3-clause | mutableSame _ _ = False | 23 | mutableSame _ _ = False | 23 | mutableSame _ _ = False | 23 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
jimcrayne/lmdb-bindings | Database/LMDB/Macros.hs | agpl-3.0 | -- delete fake = () bindings
gen x r st = trace ("pass-through: "++show x) $
r (st { st_decls = return [x] : st_decls st }) | 140 | gen x r st = trace ("pass-through: "++show x) $
r (st { st_decls = return [x] : st_decls st }) | 110 | gen x r st = trace ("pass-through: "++show x) $
r (st { st_decls = return [x] : st_decls st }) | 110 | true | false | 1 | 12 | 43 | 63 | 29 | 34 | null | null |
ddssff/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 | 0 | 7 | 13 | 30 | 16 | 14 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/streaming/2018-10-tim-williams-streaming-haskellX/src/GGListT.hs | unlicense | -- use case: generate list element's using `IO`
-- interleave effects between each list element
stdin :: ListT IO String
stdin = ListT $ do
eof <- System.IO.isEOF
if eof
then return Nil
else do
string <- getLine
return (Cons string stdin)
-- consume elements one-at-a-time -- only run effects for what is actually needed | 346 | stdin :: ListT IO String
stdin = ListT $ do
eof <- System.IO.isEOF
if eof
then return Nil
else do
string <- getLine
return (Cons string stdin)
-- consume elements one-at-a-time -- only run effects for what is actually needed | 249 | stdin = ListT $ do
eof <- System.IO.isEOF
if eof
then return Nil
else do
string <- getLine
return (Cons string stdin)
-- consume elements one-at-a-time -- only run effects for what is actually needed | 224 | true | true | 0 | 13 | 80 | 68 | 34 | 34 | null | null |
green-haskell/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | deTagBind :: TaggedBind t -> CoreBind
deTagBind (NonRec (TB b _) rhs) = NonRec b (deTagExpr rhs) | 96 | deTagBind :: TaggedBind t -> CoreBind
deTagBind (NonRec (TB b _) rhs) = NonRec b (deTagExpr rhs) | 96 | deTagBind (NonRec (TB b _) rhs) = NonRec b (deTagExpr rhs) | 58 | false | true | 0 | 9 | 16 | 48 | 23 | 25 | null | null |
limansky/wbxml | src/Wbxml/DOM.hs | bsd-3-clause | buildDoc = buildDocument configDom | 35 | buildDoc = buildDocument configDom | 35 | buildDoc = buildDocument configDom | 35 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
andreagenso/java2scala | src/J2s/Scanner.hs | apache-2.0 | isUTF (s1:s2:s3:s4:[]) = False | 36 | isUTF (s1:s2:s3:s4:[]) = False | 36 | isUTF (s1:s2:s3:s4:[]) = False | 36 | false | false | 0 | 10 | 9 | 31 | 15 | 16 | null | null |
RefactoringTools/HaRe | hareview/src/Language/Hareview/DataTree.hs | bsd-3-clause | flat :: Tree String -> Tree String
flat = id | 44 | flat :: Tree String -> Tree String
flat = id | 44 | flat = id | 9 | false | true | 0 | 7 | 9 | 27 | 11 | 16 | null | null |
sgillespie/ghc | compiler/stgSyn/StgSyn.hs | bsd-3-clause | stgSatOcc = SatCallsOnly | 27 | stgSatOcc = SatCallsOnly | 27 | stgSatOcc = SatCallsOnly | 27 | false | false | 0 | 4 | 5 | 6 | 3 | 3 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_B_IDENTIFIER :: Int
wxSTC_B_IDENTIFIER = 7 | 48 | wxSTC_B_IDENTIFIER :: Int
wxSTC_B_IDENTIFIER = 7 | 48 | wxSTC_B_IDENTIFIER = 7 | 22 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
sktt/dotfiles | xmonad/xmonad.symlink/xmonad.hs | mit | myLayout = smartBorders
$ mkToggle (NOBORDERS ?? FULL ?? EOT)
$ avoidStruts
$ myTiled ||| Full | 109 | myLayout = smartBorders
$ mkToggle (NOBORDERS ?? FULL ?? EOT)
$ avoidStruts
$ myTiled ||| Full | 109 | myLayout = smartBorders
$ mkToggle (NOBORDERS ?? FULL ?? EOT)
$ avoidStruts
$ myTiled ||| Full | 109 | false | false | 8 | 7 | 30 | 44 | 19 | 25 | null | null |
neobrain/aeson | Data/Aeson/Types/Internal.hs | bsd-3-clause | -- | Create a 'Value' from a list of name\/value 'Pair's. If duplicate
-- keys arise, earlier keys and their associated values win.
object :: [Pair] -> Value
object = Object . H.fromList | 187 | object :: [Pair] -> Value
object = Object . H.fromList | 54 | object = Object . H.fromList | 28 | true | true | 1 | 7 | 33 | 34 | 16 | 18 | null | null |
sdiehl/ghc | compiler/nativeGen/RegAlloc/Graph/SpillClean.hs | bsd-3-clause | -- | Add an association between these two things.
addAssoc :: Uniquable a
=> a -> a -> Assoc a -> Assoc a
addAssoc a b m
= let m1 = addToUFM_C unionUniqSets m a (unitUniqSet b)
m2 = addToUFM_C unionUniqSets m1 b (unitUniqSet a)
in m2 | 269 | addAssoc :: Uniquable a
=> a -> a -> Assoc a -> Assoc a
addAssoc a b m
= let m1 = addToUFM_C unionUniqSets m a (unitUniqSet b)
m2 = addToUFM_C unionUniqSets m1 b (unitUniqSet a)
in m2 | 218 | addAssoc a b m
= let m1 = addToUFM_C unionUniqSets m a (unitUniqSet b)
m2 = addToUFM_C unionUniqSets m1 b (unitUniqSet a)
in m2 | 153 | true | true | 0 | 11 | 82 | 90 | 43 | 47 | null | null |
plumlife/cabal | Cabal/Distribution/PackageDescription/PrettyPrint.hs | bsd-3-clause | ppTestSuites :: [(String, CondTree ConfVar [Dependency] TestSuite)] -> Doc
ppTestSuites suites =
emptyLine $ vcat [ text ("test-suite " ++ n)
$+$ nest indentWith (ppCondTree condTree Nothing ppTestSuite)
| (n,condTree) <- suites]
where
ppTestSuite testsuite Nothing =
maybe empty (\t -> text "type:" <+> disp t)
maybeTestType
$+$ maybe empty (\f -> text "main-is:" <+> text f)
(testSuiteMainIs testsuite)
$+$ maybe empty (\m -> text "test-module:" <+> disp m)
(testSuiteModule testsuite)
$+$ ppFieldsFiltered binfoDefaults binfoFieldDescrs (testBuildInfo testsuite)
$+$ ppCustomFields (customFieldsBI (testBuildInfo testsuite))
where
maybeTestType | testInterface testsuite == mempty = Nothing
| otherwise = Just (testType testsuite)
ppTestSuite (TestSuite _ _ buildInfo' _)
(Just (TestSuite _ _ buildInfo2 _)) =
ppDiffFields binfoFieldDescrs buildInfo' buildInfo2
$+$ ppCustomFields (customFieldsBI buildInfo')
testSuiteMainIs test = case testInterface test of
TestSuiteExeV10 _ f -> Just f
_ -> Nothing
testSuiteModule test = case testInterface test of
TestSuiteLibV09 _ m -> Just m
_ -> Nothing | 1,469 | ppTestSuites :: [(String, CondTree ConfVar [Dependency] TestSuite)] -> Doc
ppTestSuites suites =
emptyLine $ vcat [ text ("test-suite " ++ n)
$+$ nest indentWith (ppCondTree condTree Nothing ppTestSuite)
| (n,condTree) <- suites]
where
ppTestSuite testsuite Nothing =
maybe empty (\t -> text "type:" <+> disp t)
maybeTestType
$+$ maybe empty (\f -> text "main-is:" <+> text f)
(testSuiteMainIs testsuite)
$+$ maybe empty (\m -> text "test-module:" <+> disp m)
(testSuiteModule testsuite)
$+$ ppFieldsFiltered binfoDefaults binfoFieldDescrs (testBuildInfo testsuite)
$+$ ppCustomFields (customFieldsBI (testBuildInfo testsuite))
where
maybeTestType | testInterface testsuite == mempty = Nothing
| otherwise = Just (testType testsuite)
ppTestSuite (TestSuite _ _ buildInfo' _)
(Just (TestSuite _ _ buildInfo2 _)) =
ppDiffFields binfoFieldDescrs buildInfo' buildInfo2
$+$ ppCustomFields (customFieldsBI buildInfo')
testSuiteMainIs test = case testInterface test of
TestSuiteExeV10 _ f -> Just f
_ -> Nothing
testSuiteModule test = case testInterface test of
TestSuiteLibV09 _ m -> Just m
_ -> Nothing | 1,469 | ppTestSuites suites =
emptyLine $ vcat [ text ("test-suite " ++ n)
$+$ nest indentWith (ppCondTree condTree Nothing ppTestSuite)
| (n,condTree) <- suites]
where
ppTestSuite testsuite Nothing =
maybe empty (\t -> text "type:" <+> disp t)
maybeTestType
$+$ maybe empty (\f -> text "main-is:" <+> text f)
(testSuiteMainIs testsuite)
$+$ maybe empty (\m -> text "test-module:" <+> disp m)
(testSuiteModule testsuite)
$+$ ppFieldsFiltered binfoDefaults binfoFieldDescrs (testBuildInfo testsuite)
$+$ ppCustomFields (customFieldsBI (testBuildInfo testsuite))
where
maybeTestType | testInterface testsuite == mempty = Nothing
| otherwise = Just (testType testsuite)
ppTestSuite (TestSuite _ _ buildInfo' _)
(Just (TestSuite _ _ buildInfo2 _)) =
ppDiffFields binfoFieldDescrs buildInfo' buildInfo2
$+$ ppCustomFields (customFieldsBI buildInfo')
testSuiteMainIs test = case testInterface test of
TestSuiteExeV10 _ f -> Just f
_ -> Nothing
testSuiteModule test = case testInterface test of
TestSuiteLibV09 _ m -> Just m
_ -> Nothing | 1,394 | false | true | 4 | 14 | 521 | 379 | 186 | 193 | null | null |
stevezhee/eel | src/Eel.hs | bsd-3-clause | -- BAL: Should be architecture dependent
-- | Convenience function for when we need a value but we don't have
-- one handy (so that we can extract its inferred type).
unused :: String -> a
unused s = error $ "unused:" ++ s | 225 | unused :: String -> a
unused s = error $ "unused:" ++ s | 55 | unused s = error $ "unused:" ++ s | 33 | true | true | 0 | 6 | 46 | 29 | 16 | 13 | null | null |
elieux/ghc | compiler/utils/Util.hs | bsd-3-clause | -- | @atLength atLen atEnd ls n@ unravels list @ls@ to position @n@. Precisely:
--
-- @
-- atLength atLenPred atEndPred ls n
-- | n < 0 = atLenPred n
-- | length ls < n = atEndPred (n - length ls)
-- | otherwise = atLenPred (drop n ls)
-- @
atLength :: ([a] -> b)
-> (Int -> b)
-> [a]
-> Int
-> b
atLength atLenPred atEndPred ls n
| n < 0 = atEndPred n
| otherwise = go n ls
where
go n [] = atEndPred n
go 0 ls = atLenPred ls
go n (_:xs) = go (n-1) xs
-- Some special cases of atLength: | 564 | atLength :: ([a] -> b)
-> (Int -> b)
-> [a]
-> Int
-> b
atLength atLenPred atEndPred ls n
| n < 0 = atEndPred n
| otherwise = go n ls
where
go n [] = atEndPred n
go 0 ls = atLenPred ls
go n (_:xs) = go (n-1) xs
-- Some special cases of atLength: | 304 | atLength atLenPred atEndPred ls n
| n < 0 = atEndPred n
| otherwise = go n ls
where
go n [] = atEndPred n
go 0 ls = atLenPred ls
go n (_:xs) = go (n-1) xs
-- Some special cases of atLength: | 212 | true | true | 1 | 8 | 189 | 150 | 79 | 71 | null | null |
jhartikainen/hs-language-php | StringParse.hs | bsd-3-clause | charAscii = choice (map parseAscii asciiMap)
where
parseAscii (asc,code) = try (do{ string asc; return code })
-- escape code tables | 174 | charAscii = choice (map parseAscii asciiMap)
where
parseAscii (asc,code) = try (do{ string asc; return code })
-- escape code tables | 174 | charAscii = choice (map parseAscii asciiMap)
where
parseAscii (asc,code) = try (do{ string asc; return code })
-- escape code tables | 174 | false | false | 0 | 11 | 62 | 55 | 28 | 27 | null | null |
RossMeikleham/Potato-Tool | src/Main.hs | gpl-2.0 | main :: IO()
main = do
args <- getArgs
progName <- getProgName
let command = head args
if length args <= 0
then putStrLn ("Usage " ++ progName ++ " [vmu file]")
else executeCommand command args | 251 | main :: IO()
main = do
args <- getArgs
progName <- getProgName
let command = head args
if length args <= 0
then putStrLn ("Usage " ++ progName ++ " [vmu file]")
else executeCommand command args | 251 | main = do
args <- getArgs
progName <- getProgName
let command = head args
if length args <= 0
then putStrLn ("Usage " ++ progName ++ " [vmu file]")
else executeCommand command args | 238 | false | true | 0 | 11 | 93 | 79 | 37 | 42 | null | null |
NightRa/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | declared (PPostulate _ _ _ _ _ _ n t) = [n] | 43 | declared (PPostulate _ _ _ _ _ _ n t) = [n] | 43 | declared (PPostulate _ _ _ _ _ _ n t) = [n] | 43 | false | false | 0 | 7 | 11 | 32 | 16 | 16 | null | null |
brendanhay/gogol | gogol-cloudsearch/gen/Network/Google/Resource/CloudSearch/Stats/Index/Datasources/Get.hs | mpl-2.0 | -- | Year of date. Must be from 1 to 9999.
sidgToDateYear :: Lens' StatsIndexDatasourcesGet (Maybe Int32)
sidgToDateYear
= lens _sidgToDateYear
(\ s a -> s{_sidgToDateYear = a})
. mapping _Coerce | 209 | sidgToDateYear :: Lens' StatsIndexDatasourcesGet (Maybe Int32)
sidgToDateYear
= lens _sidgToDateYear
(\ s a -> s{_sidgToDateYear = a})
. mapping _Coerce | 166 | sidgToDateYear
= lens _sidgToDateYear
(\ s a -> s{_sidgToDateYear = a})
. mapping _Coerce | 103 | true | true | 0 | 10 | 44 | 55 | 28 | 27 | null | null |
bitemyapp/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | defaultStripeConnections = 10 | 29 | defaultStripeConnections = 10 | 29 | defaultStripeConnections = 10 | 29 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
apyrgio/snf-ganeti | src/Ganeti/Constants.hs | bsd-2-clause | autoRepairAllTypes :: FrozenSet String
autoRepairAllTypes =
ConstantUtils.mkSet [autoRepairFailover,
autoRepairFixStorage,
autoRepairMigrate,
autoRepairReinstall] | 233 | autoRepairAllTypes :: FrozenSet String
autoRepairAllTypes =
ConstantUtils.mkSet [autoRepairFailover,
autoRepairFixStorage,
autoRepairMigrate,
autoRepairReinstall] | 233 | autoRepairAllTypes =
ConstantUtils.mkSet [autoRepairFailover,
autoRepairFixStorage,
autoRepairMigrate,
autoRepairReinstall] | 194 | false | true | 0 | 6 | 81 | 31 | 17 | 14 | null | null |
rgaiacs/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | umlaut :: Char -> String
umlaut 'A' = "Ä" | 41 | umlaut :: Char -> String
umlaut 'A' = "Ä" | 41 | umlaut 'A' = "Ä" | 16 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
brendanhay/gogol | gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/DicomStores/Studies/Delete.hs | mpl-2.0 | -- | Creates a value of 'ProjectsLocationsDataSetsDicomStoresStudiesDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pldsdssdParent'
--
-- * 'pldsdssdXgafv'
--
-- * 'pldsdssdUploadProtocol'
--
-- * 'pldsdssdAccessToken'
--
-- * 'pldsdssdUploadType'
--
-- * 'pldsdssdCallback'
--
-- * 'pldsdssdDicomWebPath'
projectsLocationsDataSetsDicomStoresStudiesDelete
:: Text -- ^ 'pldsdssdParent'
-> Text -- ^ 'pldsdssdDicomWebPath'
-> ProjectsLocationsDataSetsDicomStoresStudiesDelete
projectsLocationsDataSetsDicomStoresStudiesDelete pPldsdssdParent_ pPldsdssdDicomWebPath_ =
ProjectsLocationsDataSetsDicomStoresStudiesDelete'
{ _pldsdssdParent = pPldsdssdParent_
, _pldsdssdXgafv = Nothing
, _pldsdssdUploadProtocol = Nothing
, _pldsdssdAccessToken = Nothing
, _pldsdssdUploadType = Nothing
, _pldsdssdCallback = Nothing
, _pldsdssdDicomWebPath = pPldsdssdDicomWebPath_
} | 1,003 | projectsLocationsDataSetsDicomStoresStudiesDelete
:: Text -- ^ 'pldsdssdParent'
-> Text -- ^ 'pldsdssdDicomWebPath'
-> ProjectsLocationsDataSetsDicomStoresStudiesDelete
projectsLocationsDataSetsDicomStoresStudiesDelete pPldsdssdParent_ pPldsdssdDicomWebPath_ =
ProjectsLocationsDataSetsDicomStoresStudiesDelete'
{ _pldsdssdParent = pPldsdssdParent_
, _pldsdssdXgafv = Nothing
, _pldsdssdUploadProtocol = Nothing
, _pldsdssdAccessToken = Nothing
, _pldsdssdUploadType = Nothing
, _pldsdssdCallback = Nothing
, _pldsdssdDicomWebPath = pPldsdssdDicomWebPath_
} | 603 | projectsLocationsDataSetsDicomStoresStudiesDelete pPldsdssdParent_ pPldsdssdDicomWebPath_ =
ProjectsLocationsDataSetsDicomStoresStudiesDelete'
{ _pldsdssdParent = pPldsdssdParent_
, _pldsdssdXgafv = Nothing
, _pldsdssdUploadProtocol = Nothing
, _pldsdssdAccessToken = Nothing
, _pldsdssdUploadType = Nothing
, _pldsdssdCallback = Nothing
, _pldsdssdDicomWebPath = pPldsdssdDicomWebPath_
} | 422 | true | true | 0 | 6 | 150 | 87 | 60 | 27 | null | null |
eryx67/haskell-libtorrent | src/Network/Libtorrent/Extensions.hs | bsd-3-clause | ltTrackersPlugin :: MonadIO m => m (Ptr C'TorrentPlugin)
ltTrackersPlugin =
liftIO [CU.exp| TorrentPlugin * { &libtorrent::create_lt_trackers_plugin } |] | 155 | ltTrackersPlugin :: MonadIO m => m (Ptr C'TorrentPlugin)
ltTrackersPlugin =
liftIO [CU.exp| TorrentPlugin * { &libtorrent::create_lt_trackers_plugin } |] | 155 | ltTrackersPlugin =
liftIO [CU.exp| TorrentPlugin * { &libtorrent::create_lt_trackers_plugin } |] | 98 | false | true | 0 | 8 | 19 | 36 | 19 | 17 | null | null |
TorosFanny/kaleidoscope | src/chapter6/Lexer.hs | mit | whitespace = Tok.whiteSpace lexer | 33 | whitespace = Tok.whiteSpace lexer | 33 | whitespace = Tok.whiteSpace lexer | 33 | false | false | 1 | 5 | 3 | 15 | 5 | 10 | null | null |
balodja/sesyrel | src/Sesyrel/FaultTree/Base.hs | bsd-3-clause | literalToRegisterAdderM :: Monad m => Int -> [Variable] -> FaultTreeMonadT k m ([Variable], Maybe Variable)
literalToRegisterAdderM k' vars = go k' vars Nothing
where
go k (x : xs) (Just c) = do
(s, c') <- if k `mod` 2 == 0
then twoBitsAdderM x c
else twoBitsPlusOneAdderM x c
(ss, c'') <- go (k `div` 2) xs (Just c')
return (s : ss, c'')
go k (x : xs) Nothing = do
(s, c') <- if k `mod` 2 == 0
then return (x, Nothing)
else do {s <- notM x; return (s, Just x)}
(ss, c'') <- go (k `div` 2) xs c'
return (s : ss, c'')
go _ [] c = return ([], c) | 661 | literalToRegisterAdderM :: Monad m => Int -> [Variable] -> FaultTreeMonadT k m ([Variable], Maybe Variable)
literalToRegisterAdderM k' vars = go k' vars Nothing
where
go k (x : xs) (Just c) = do
(s, c') <- if k `mod` 2 == 0
then twoBitsAdderM x c
else twoBitsPlusOneAdderM x c
(ss, c'') <- go (k `div` 2) xs (Just c')
return (s : ss, c'')
go k (x : xs) Nothing = do
(s, c') <- if k `mod` 2 == 0
then return (x, Nothing)
else do {s <- notM x; return (s, Just x)}
(ss, c'') <- go (k `div` 2) xs c'
return (s : ss, c'')
go _ [] c = return ([], c) | 661 | literalToRegisterAdderM k' vars = go k' vars Nothing
where
go k (x : xs) (Just c) = do
(s, c') <- if k `mod` 2 == 0
then twoBitsAdderM x c
else twoBitsPlusOneAdderM x c
(ss, c'') <- go (k `div` 2) xs (Just c')
return (s : ss, c'')
go k (x : xs) Nothing = do
(s, c') <- if k `mod` 2 == 0
then return (x, Nothing)
else do {s <- notM x; return (s, Just x)}
(ss, c'') <- go (k `div` 2) xs c'
return (s : ss, c'')
go _ [] c = return ([], c) | 553 | false | true | 0 | 13 | 235 | 337 | 177 | 160 | null | null |
changlinli/nikki | src/Sorts/Nikki/Configuration.hs | lgpl-3.0 | nikkiFeetFriction :: CpFloat = 1.65 | 35 | nikkiFeetFriction :: CpFloat = 1.65 | 35 | nikkiFeetFriction :: CpFloat = 1.65 | 35 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
ctford/Idris-Elba-dev | src/IRTS/Bytecode.hs | bsd-3-clause | moveReg off [] = [] | 19 | moveReg off [] = [] | 19 | moveReg off [] = [] | 19 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
kim/amazonka | amazonka-ec2/gen/Network/AWS/EC2/RegisterImage.hs | mpl-2.0 | -- | A description for your AMI.
ri1Description :: Lens' RegisterImage (Maybe Text)
ri1Description = lens _ri1Description (\s a -> s { _ri1Description = a }) | 157 | ri1Description :: Lens' RegisterImage (Maybe Text)
ri1Description = lens _ri1Description (\s a -> s { _ri1Description = a }) | 124 | ri1Description = lens _ri1Description (\s a -> s { _ri1Description = a }) | 73 | true | true | 1 | 9 | 25 | 49 | 25 | 24 | null | null |
PavelClaudiuStefan/FMI | An_3_Semestru_1/ProgramareDeclarativa/Laboratoare/Laborator7/lab7.hs | cc0-1.0 | -- 7.
equivalent :: Prop -> Prop -> Bool
equivalent = undefined | 63 | equivalent :: Prop -> Prop -> Bool
equivalent = undefined | 57 | equivalent = undefined | 22 | true | true | 0 | 6 | 11 | 20 | 11 | 9 | null | null |
benkolera/phb | hs/Phb/Output/Email.hs | mit | amber = fromList [("background-color","#FFFF99")] | 55 | amber = fromList [("background-color","#FFFF99")] | 55 | amber = fromList [("background-color","#FFFF99")] | 55 | false | false | 0 | 7 | 9 | 18 | 10 | 8 | null | null |
snoyberg/ghc | compiler/main/HscTypes.hs | bsd-3-clause | numToTrustInfo 3 = setSafeMode Sf_Safe | 38 | numToTrustInfo 3 = setSafeMode Sf_Safe | 38 | numToTrustInfo 3 = setSafeMode Sf_Safe | 38 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
noteed/scp-streams | Network/SCP/Protocol.hs | bsd-3-clause | receiveStd :: IO SCP
receiveStd = do
let scp = SCP S.stdout S.stdin Nothing
startReceiving scp
return scp | 111 | receiveStd :: IO SCP
receiveStd = do
let scp = SCP S.stdout S.stdin Nothing
startReceiving scp
return scp | 111 | receiveStd = do
let scp = SCP S.stdout S.stdin Nothing
startReceiving scp
return scp | 90 | false | true | 1 | 12 | 23 | 50 | 20 | 30 | null | null |
lpeterse/koka | src/Kind/InferKind.hs | apache-2.0 | (@@) :: KSub -> KSub -> KSub
sub1 @@ sub2
= KSub (IM.union (unKSub sub1) (unKSub (sub1 |=> sub2))) | 102 | (@@) :: KSub -> KSub -> KSub
sub1 @@ sub2
= KSub (IM.union (unKSub sub1) (unKSub (sub1 |=> sub2))) | 101 | sub1 @@ sub2
= KSub (IM.union (unKSub sub1) (unKSub (sub1 |=> sub2))) | 72 | false | true | 0 | 11 | 22 | 59 | 30 | 29 | null | null |
schell/caltrops | src/Effect.hs | mit | getUserByEmail :: Text -> Effect (Maybe User)
getUserByEmail e = do
users <- getUsers
return $ foldl look4Email Nothing users
where look4Email (Just u) _ = Just u
look4Email Nothing u = if userEmail u == e
then Just u
else Nothing | 337 | getUserByEmail :: Text -> Effect (Maybe User)
getUserByEmail e = do
users <- getUsers
return $ foldl look4Email Nothing users
where look4Email (Just u) _ = Just u
look4Email Nothing u = if userEmail u == e
then Just u
else Nothing | 337 | getUserByEmail e = do
users <- getUsers
return $ foldl look4Email Nothing users
where look4Email (Just u) _ = Just u
look4Email Nothing u = if userEmail u == e
then Just u
else Nothing | 291 | false | true | 0 | 9 | 148 | 97 | 46 | 51 | null | null |
vTurbine/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | doubleFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "doubleFromInteger") doubleFromIntegerIdKey | 103 | doubleFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "doubleFromInteger") doubleFromIntegerIdKey | 103 | doubleFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "doubleFromInteger") doubleFromIntegerIdKey | 103 | false | false | 0 | 7 | 10 | 19 | 9 | 10 | null | null |
tjhunter/karps | haskell/src/Spark/Core/Internal/RowUtils.hs | apache-2.0 | rowCell :: [Cell] -> Cell
rowCell = RowElement . Row . V.fromList | 65 | rowCell :: [Cell] -> Cell
rowCell = RowElement . Row . V.fromList | 65 | rowCell = RowElement . Row . V.fromList | 39 | false | true | 0 | 6 | 11 | 28 | 15 | 13 | null | null |
brendanhay/gogol | gogol-tracing/gen/Network/Google/Resource/Tracing/Projects/Traces/Spans/Create.hs | mpl-2.0 | -- | Creates a value of 'ProjectsTracesSpansCreate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ptscXgafv'
--
-- * 'ptscUploadProtocol'
--
-- * 'ptscPp'
--
-- * 'ptscAccessToken'
--
-- * 'ptscUploadType'
--
-- * 'ptscPayload'
--
-- * 'ptscBearerToken'
--
-- * 'ptscName'
--
-- * 'ptscCallback'
projectsTracesSpansCreate
:: Span -- ^ 'ptscPayload'
-> Text -- ^ 'ptscName'
-> ProjectsTracesSpansCreate
projectsTracesSpansCreate pPtscPayload_ pPtscName_ =
ProjectsTracesSpansCreate'
{ _ptscXgafv = Nothing
, _ptscUploadProtocol = Nothing
, _ptscPp = True
, _ptscAccessToken = Nothing
, _ptscUploadType = Nothing
, _ptscPayload = pPtscPayload_
, _ptscBearerToken = Nothing
, _ptscName = pPtscName_
, _ptscCallback = Nothing
} | 865 | projectsTracesSpansCreate
:: Span -- ^ 'ptscPayload'
-> Text -- ^ 'ptscName'
-> ProjectsTracesSpansCreate
projectsTracesSpansCreate pPtscPayload_ pPtscName_ =
ProjectsTracesSpansCreate'
{ _ptscXgafv = Nothing
, _ptscUploadProtocol = Nothing
, _ptscPp = True
, _ptscAccessToken = Nothing
, _ptscUploadType = Nothing
, _ptscPayload = pPtscPayload_
, _ptscBearerToken = Nothing
, _ptscName = pPtscName_
, _ptscCallback = Nothing
} | 481 | projectsTracesSpansCreate pPtscPayload_ pPtscName_ =
ProjectsTracesSpansCreate'
{ _ptscXgafv = Nothing
, _ptscUploadProtocol = Nothing
, _ptscPp = True
, _ptscAccessToken = Nothing
, _ptscUploadType = Nothing
, _ptscPayload = pPtscPayload_
, _ptscBearerToken = Nothing
, _ptscName = pPtscName_
, _ptscCallback = Nothing
} | 363 | true | true | 0 | 8 | 174 | 112 | 74 | 38 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.