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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bj4rtmar/sdl2 | src/SDL/Video/Renderer.hs | bsd-3-clause | -- | Clear the current rendering target with the drawing color.
--
-- See @<https://wiki.libsdl.org/SDL_RenderClear SDL_RenderClear>@ for C documentation.
renderClear :: (Functor m, MonadIO m) => Renderer -> m ()
renderClear (Renderer r) =
throwIfNeg_ "SDL.Video.renderClear" "SDL_RenderClear" $
Raw.renderClear r | 317 | renderClear :: (Functor m, MonadIO m) => Renderer -> m ()
renderClear (Renderer r) =
throwIfNeg_ "SDL.Video.renderClear" "SDL_RenderClear" $
Raw.renderClear r | 162 | renderClear (Renderer r) =
throwIfNeg_ "SDL.Video.renderClear" "SDL_RenderClear" $
Raw.renderClear r | 104 | true | true | 0 | 8 | 43 | 67 | 32 | 35 | null | null |
Altech/haScm | test/Scheme/EvaluatorSpec.hs | gpl-3.0 | defaultEnv' = liftIO defaultEnv | 31 | defaultEnv' = liftIO defaultEnv | 31 | defaultEnv' = liftIO defaultEnv | 31 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
romanb/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/GetVaultAccessPolicy.hs | mpl-2.0 | -- | 'GetVaultAccessPolicyResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'gvaprPolicy' @::@ 'Maybe' 'VaultAccessPolicy'
--
getVaultAccessPolicyResponse :: GetVaultAccessPolicyResponse
getVaultAccessPolicyResponse = GetVaultAccessPolicyResponse
{ _gvaprPolicy = Nothing
} | 324 | getVaultAccessPolicyResponse :: GetVaultAccessPolicyResponse
getVaultAccessPolicyResponse = GetVaultAccessPolicyResponse
{ _gvaprPolicy = Nothing
} | 155 | getVaultAccessPolicyResponse = GetVaultAccessPolicyResponse
{ _gvaprPolicy = Nothing
} | 94 | true | true | 0 | 7 | 39 | 29 | 18 | 11 | null | null |
input-output-hk/pos-haskell-prototype | chain/test/Test/Pos/Chain/Ssc/Gen.hs | mit | genVssCertificatesMap :: ProtocolMagic -> Gen VssCertificatesMap
genVssCertificatesMap pm =
mkVssCertificatesMap <$> Gen.list (Range.linear 0 5) (genVssCertificate pm) | 171 | genVssCertificatesMap :: ProtocolMagic -> Gen VssCertificatesMap
genVssCertificatesMap pm =
mkVssCertificatesMap <$> Gen.list (Range.linear 0 5) (genVssCertificate pm) | 171 | genVssCertificatesMap pm =
mkVssCertificatesMap <$> Gen.list (Range.linear 0 5) (genVssCertificate pm) | 106 | false | true | 0 | 9 | 20 | 48 | 23 | 25 | null | null |
adept/hledger | bin/hledger-check-fancyassertions.hs | gpl-3.0 | -- | Get the closing balances of every account referenced by a group
-- of postings.
closingBalances' :: [H.Posting] -> [(H.AccountName, H.MixedAmount)]
closingBalances' postings =
let postingsByAccount =
groupBy ((==) `on` H.paccount) . sortOn H.paccount $ postings
in map (\ps@(p:_) -> (H.paccount p, H.sumPostings ps)) postingsByAccount | 351 | closingBalances' :: [H.Posting] -> [(H.AccountName, H.MixedAmount)]
closingBalances' postings =
let postingsByAccount =
groupBy ((==) `on` H.paccount) . sortOn H.paccount $ postings
in map (\ps@(p:_) -> (H.paccount p, H.sumPostings ps)) postingsByAccount | 266 | closingBalances' postings =
let postingsByAccount =
groupBy ((==) `on` H.paccount) . sortOn H.paccount $ postings
in map (\ps@(p:_) -> (H.paccount p, H.sumPostings ps)) postingsByAccount | 198 | true | true | 0 | 14 | 57 | 117 | 64 | 53 | null | null |
brendanhay/gogol | gogol-testing/gen/Network/Google/Testing/Types/Product.hs | mpl-2.0 | -- | Output only. The cloud project that owns the test execution.
teProjectId :: Lens' TestExecution (Maybe Text)
teProjectId
= lens _teProjectId (\ s a -> s{_teProjectId = a}) | 178 | teProjectId :: Lens' TestExecution (Maybe Text)
teProjectId
= lens _teProjectId (\ s a -> s{_teProjectId = a}) | 112 | teProjectId
= lens _teProjectId (\ s a -> s{_teProjectId = a}) | 64 | true | true | 0 | 9 | 30 | 48 | 25 | 23 | null | null |
ndmitchell/shake | src/Development/Shake/Internal/History/Cloud.hs | bsd-3-clause | ewLaterFence :: (Locked () -> IO ()) -> Seconds -> a -> IO a -> IO (Fence Locked a)
newLaterFence relock maxTime def act = do
fence <- newFence
forkFinally (timeout maxTime act) $ \res -> relock $ signalFence fence $ case res of
Right (Just v) -> v
_ -> def
pure fence
| 297 | newLaterFence :: (Locked () -> IO ()) -> Seconds -> a -> IO a -> IO (Fence Locked a)
newLaterFence relock maxTime def act = do
fence <- newFence
forkFinally (timeout maxTime act) $ \res -> relock $ signalFence fence $ case res of
Right (Just v) -> v
_ -> def
pure fence | 297 | newLaterFence relock maxTime def act = do
fence <- newFence
forkFinally (timeout maxTime act) $ \res -> relock $ signalFence fence $ case res of
Right (Just v) -> v
_ -> def
pure fence | 212 | false | true | 0 | 15 | 82 | 145 | 66 | 79 | null | null |
haroldcarr/juno | src/Juno/Consensus/Handle/AppendEntriesResponse.hs | bsd-3-clause | handle :: Monad m => AppendEntriesResponse -> JT.Raft m ()
handle ae = do
s <- get
let ape = AEResponseEnv
(JT._nodeRole s)
(JT._term s)
(JT._commitProof s)
(AEResponseOut{..}, l) <- runReaderT (runWriterT (handleAEResponse ae)) ape
mapM_ debug l
JT.commitProof .= _stateMergeCommitProof
doCommit
case _leaderState of
NotLeader -> return ()
DoNothing -> resetElectionTimerLeader
StatelessSendAE{..} ->
resetElectionTimerLeader
Unconvinced{..} -> do
JT.lConvinced %= Set.delete _deleteConvinced
resetElectionTimerLeader
ConvincedAndSuccessful{..} -> do
updateLNextIndex $ Map.insert _incrementNextIndexNode $ _incrementNextIndexLogIndex + 1
JT.lConvinced %= Set.insert _insertConvinced
resetElectionTimerLeader
ConvincedAndUnsuccessful{..} -> do
updateLNextIndex $ Map.insert _sendAENodeID _setLaggingLogIndex
resetElectionTimerLeader | 961 | handle :: Monad m => AppendEntriesResponse -> JT.Raft m ()
handle ae = do
s <- get
let ape = AEResponseEnv
(JT._nodeRole s)
(JT._term s)
(JT._commitProof s)
(AEResponseOut{..}, l) <- runReaderT (runWriterT (handleAEResponse ae)) ape
mapM_ debug l
JT.commitProof .= _stateMergeCommitProof
doCommit
case _leaderState of
NotLeader -> return ()
DoNothing -> resetElectionTimerLeader
StatelessSendAE{..} ->
resetElectionTimerLeader
Unconvinced{..} -> do
JT.lConvinced %= Set.delete _deleteConvinced
resetElectionTimerLeader
ConvincedAndSuccessful{..} -> do
updateLNextIndex $ Map.insert _incrementNextIndexNode $ _incrementNextIndexLogIndex + 1
JT.lConvinced %= Set.insert _insertConvinced
resetElectionTimerLeader
ConvincedAndUnsuccessful{..} -> do
updateLNextIndex $ Map.insert _sendAENodeID _setLaggingLogIndex
resetElectionTimerLeader | 961 | handle ae = do
s <- get
let ape = AEResponseEnv
(JT._nodeRole s)
(JT._term s)
(JT._commitProof s)
(AEResponseOut{..}, l) <- runReaderT (runWriterT (handleAEResponse ae)) ape
mapM_ debug l
JT.commitProof .= _stateMergeCommitProof
doCommit
case _leaderState of
NotLeader -> return ()
DoNothing -> resetElectionTimerLeader
StatelessSendAE{..} ->
resetElectionTimerLeader
Unconvinced{..} -> do
JT.lConvinced %= Set.delete _deleteConvinced
resetElectionTimerLeader
ConvincedAndSuccessful{..} -> do
updateLNextIndex $ Map.insert _incrementNextIndexNode $ _incrementNextIndexLogIndex + 1
JT.lConvinced %= Set.insert _insertConvinced
resetElectionTimerLeader
ConvincedAndUnsuccessful{..} -> do
updateLNextIndex $ Map.insert _sendAENodeID _setLaggingLogIndex
resetElectionTimerLeader | 902 | false | true | 0 | 16 | 215 | 280 | 129 | 151 | null | null |
helino/wham | src/Wham/SignExc.hs | bsd-3-clause | NonErrorS `le` _ = ret NonErrorT | 32 | NonErrorS `le` _ = ret NonErrorT | 32 | NonErrorS `le` _ = ret NonErrorT | 32 | false | false | 0 | 5 | 5 | 17 | 8 | 9 | null | null |
danieldk/lbfgs-hs | Numeric/LBFGS.hs | apache-2.0 | mergeLineSearchAlgorithm (BacktrackingWolfe c) p =
p { R.linesearch = R.backtrackingWolfe,
R.wolfe = realToFrac c } | 132 | mergeLineSearchAlgorithm (BacktrackingWolfe c) p =
p { R.linesearch = R.backtrackingWolfe,
R.wolfe = realToFrac c } | 132 | mergeLineSearchAlgorithm (BacktrackingWolfe c) p =
p { R.linesearch = R.backtrackingWolfe,
R.wolfe = realToFrac c } | 132 | false | false | 0 | 7 | 31 | 40 | 21 | 19 | null | null |
VDBWRAIR/Haskell-MAAPs | src/Lib.hs | bsd-3-clause | expand :: String -> Either Error [(Codon, [AA])]
expand xs = (zip codons) <$> expandeds
where
codons = map Codon $ takeWhile (not . null) $ unfoldr (Just . (splitAt 3)) xs
expandeds = sequence $ zipWith tryExpand [1..] codons
tryExpand i cdn@(Codon x) = if (not $ null $ intersect x "-N") then Right [] else expandTriple i cdn | 343 | expand :: String -> Either Error [(Codon, [AA])]
expand xs = (zip codons) <$> expandeds
where
codons = map Codon $ takeWhile (not . null) $ unfoldr (Just . (splitAt 3)) xs
expandeds = sequence $ zipWith tryExpand [1..] codons
tryExpand i cdn@(Codon x) = if (not $ null $ intersect x "-N") then Right [] else expandTriple i cdn | 342 | expand xs = (zip codons) <$> expandeds
where
codons = map Codon $ takeWhile (not . null) $ unfoldr (Just . (splitAt 3)) xs
expandeds = sequence $ zipWith tryExpand [1..] codons
tryExpand i cdn@(Codon x) = if (not $ null $ intersect x "-N") then Right [] else expandTriple i cdn | 293 | false | true | 9 | 10 | 76 | 183 | 85 | 98 | null | null |
kmate/HaRe | old/testing/duplication/D2.hs | bsd-3-clause | sq x = x ^ pow | 14 | sq x = x ^ pow | 14 | sq x = x ^ pow | 14 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
mightymoose/liquidhaskell | tests/todo/CatMaybes.hs | bsd-3-clause | {-@ foo :: x:[a]
-> {v:[a] | Set_sub (listElts v) (listElts x)}
@-}
foo = catMaybes . map bar
where
catMaybes [] = []
catMaybes (Nothing:xs) = catMaybes xs
catMaybes (Just x : xs) = x:catMaybes xs | 226 | foo = catMaybes . map bar
where
catMaybes [] = []
catMaybes (Nothing:xs) = catMaybes xs
catMaybes (Just x : xs) = x:catMaybes xs | 143 | foo = catMaybes . map bar
where
catMaybes [] = []
catMaybes (Nothing:xs) = catMaybes xs
catMaybes (Just x : xs) = x:catMaybes xs | 143 | true | false | 1 | 8 | 66 | 75 | 35 | 40 | null | null |
chrisdone/ghc-server | src/GHC/Compat.hs | bsd-3-clause | showSDoc = Outputable.showSDoc | 30 | showSDoc = Outputable.showSDoc | 30 | showSDoc = Outputable.showSDoc | 30 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
nevrenato/Hets_Fork | GUI/hets_cgi.hs | gpl-2.0 | {- the directory where the Hets-lib repository is checked out. Must be
accessable by the cgi script -}
caslLibDir :: String
caslLibDir = "/home/cofi/Hets-lib" | 158 | caslLibDir :: String
caslLibDir = "/home/cofi/Hets-lib" | 55 | caslLibDir = "/home/cofi/Hets-lib" | 34 | true | true | 0 | 6 | 23 | 19 | 8 | 11 | null | null |
mpickering/HaRe | src/Language/Haskell/Refact/Utils/ExactPrint.hs | bsd-3-clause | transferEntryDP :: (SYB.Data a, SYB.Data b) => Anns -> GHC.Located a -> GHC.Located b -> Anns
transferEntryDP ans a b = (const anns') ans
where
anns = ans
maybeAnns = do -- Maybe monad
anA <- Map.lookup (mkKey a) anns
anB <- Map.lookup (mkKey b) anns
let anB' = Ann { annEntryDelta = annEntryDelta anA
-- , annDelta = annDelta anA
-- , annTrueEntryDelta = annTrueEntryDelta anA
, annPriorComments = annPriorComments anA ++ annPriorComments anB
, annFollowingComments = annFollowingComments anA ++ annFollowingComments anB
, annsDP = annsDP anB
, annSortKey = annSortKey anB
, annCapturedSpan = annCapturedSpan anB
}
return (Map.insert (mkKey b) anB' anns)
-- return (error $ "transferEntryDP: (mkKey a,mkKey b,anA,anB,anB')" ++ showGhc (mkKey a,mkKey b,anA,anB,anB') )
anns' = fromMaybe
(error $ "transferEntryDP: lookup failed (a,b)=" ++ show (mkKey a,mkKey b))
maybeAnns
-- ---------------------------------------------------------------------
{-
adjustAnnOffset :: ColDelta -> Annotation -> Annotation
adjustAnnOffset (ColDelta cd) (Ann (DP (ro,co)) (ColDelta ad) kds) = Ann edp cd' kds'
where
edp = case ro of
0 -> DP (ro,co)
_ -> DP (ro,co - cd)
cd' = ColDelta (ad - cd)
kds' = fmap adjustEntrySpan kds
adjustEntrySpan (AnnSpanEntry,dp) =
case dp of
DP (0,c) -> (AnnSpanEntry,DP (0,c))
DP (r,c) -> (AnnSpanEntry,DP (r, c - cd))
adjustEntrySpan x = x
-}
-- ---------------------------------------------------------------------
-- ++AZ++:TODO: this is a re-implementation of mkAnnKey in ghc-exactprint | 1,902 | transferEntryDP :: (SYB.Data a, SYB.Data b) => Anns -> GHC.Located a -> GHC.Located b -> Anns
transferEntryDP ans a b = (const anns') ans
where
anns = ans
maybeAnns = do -- Maybe monad
anA <- Map.lookup (mkKey a) anns
anB <- Map.lookup (mkKey b) anns
let anB' = Ann { annEntryDelta = annEntryDelta anA
-- , annDelta = annDelta anA
-- , annTrueEntryDelta = annTrueEntryDelta anA
, annPriorComments = annPriorComments anA ++ annPriorComments anB
, annFollowingComments = annFollowingComments anA ++ annFollowingComments anB
, annsDP = annsDP anB
, annSortKey = annSortKey anB
, annCapturedSpan = annCapturedSpan anB
}
return (Map.insert (mkKey b) anB' anns)
-- return (error $ "transferEntryDP: (mkKey a,mkKey b,anA,anB,anB')" ++ showGhc (mkKey a,mkKey b,anA,anB,anB') )
anns' = fromMaybe
(error $ "transferEntryDP: lookup failed (a,b)=" ++ show (mkKey a,mkKey b))
maybeAnns
-- ---------------------------------------------------------------------
{-
adjustAnnOffset :: ColDelta -> Annotation -> Annotation
adjustAnnOffset (ColDelta cd) (Ann (DP (ro,co)) (ColDelta ad) kds) = Ann edp cd' kds'
where
edp = case ro of
0 -> DP (ro,co)
_ -> DP (ro,co - cd)
cd' = ColDelta (ad - cd)
kds' = fmap adjustEntrySpan kds
adjustEntrySpan (AnnSpanEntry,dp) =
case dp of
DP (0,c) -> (AnnSpanEntry,DP (0,c))
DP (r,c) -> (AnnSpanEntry,DP (r, c - cd))
adjustEntrySpan x = x
-}
-- ---------------------------------------------------------------------
-- ++AZ++:TODO: this is a re-implementation of mkAnnKey in ghc-exactprint | 1,902 | transferEntryDP ans a b = (const anns') ans
where
anns = ans
maybeAnns = do -- Maybe monad
anA <- Map.lookup (mkKey a) anns
anB <- Map.lookup (mkKey b) anns
let anB' = Ann { annEntryDelta = annEntryDelta anA
-- , annDelta = annDelta anA
-- , annTrueEntryDelta = annTrueEntryDelta anA
, annPriorComments = annPriorComments anA ++ annPriorComments anB
, annFollowingComments = annFollowingComments anA ++ annFollowingComments anB
, annsDP = annsDP anB
, annSortKey = annSortKey anB
, annCapturedSpan = annCapturedSpan anB
}
return (Map.insert (mkKey b) anB' anns)
-- return (error $ "transferEntryDP: (mkKey a,mkKey b,anA,anB,anB')" ++ showGhc (mkKey a,mkKey b,anA,anB,anB') )
anns' = fromMaybe
(error $ "transferEntryDP: lookup failed (a,b)=" ++ show (mkKey a,mkKey b))
maybeAnns
-- ---------------------------------------------------------------------
{-
adjustAnnOffset :: ColDelta -> Annotation -> Annotation
adjustAnnOffset (ColDelta cd) (Ann (DP (ro,co)) (ColDelta ad) kds) = Ann edp cd' kds'
where
edp = case ro of
0 -> DP (ro,co)
_ -> DP (ro,co - cd)
cd' = ColDelta (ad - cd)
kds' = fmap adjustEntrySpan kds
adjustEntrySpan (AnnSpanEntry,dp) =
case dp of
DP (0,c) -> (AnnSpanEntry,DP (0,c))
DP (r,c) -> (AnnSpanEntry,DP (r, c - cd))
adjustEntrySpan x = x
-}
-- ---------------------------------------------------------------------
-- ++AZ++:TODO: this is a re-implementation of mkAnnKey in ghc-exactprint | 1,808 | false | true | 2 | 14 | 618 | 270 | 136 | 134 | null | null |
sdiehl/ghc | compiler/nativeGen/SPARC/CodeGen/Gen32.hs | bsd-3-clause | condIntReg EQQ x y = do
(src1, code1) <- getSomeReg x
(src2, code2) <- getSomeReg y
let
code__2 dst = code1 `appOL` code2 `appOL` toOL [
XOR False src1 (RIReg src2) dst,
SUB False True g0 (RIReg dst) g0,
SUB True False g0 (RIImm (ImmInt (-1))) dst]
return (Any II32 code__2) | 334 | condIntReg EQQ x y = do
(src1, code1) <- getSomeReg x
(src2, code2) <- getSomeReg y
let
code__2 dst = code1 `appOL` code2 `appOL` toOL [
XOR False src1 (RIReg src2) dst,
SUB False True g0 (RIReg dst) g0,
SUB True False g0 (RIImm (ImmInt (-1))) dst]
return (Any II32 code__2) | 334 | condIntReg EQQ x y = do
(src1, code1) <- getSomeReg x
(src2, code2) <- getSomeReg y
let
code__2 dst = code1 `appOL` code2 `appOL` toOL [
XOR False src1 (RIReg src2) dst,
SUB False True g0 (RIReg dst) g0,
SUB True False g0 (RIImm (ImmInt (-1))) dst]
return (Any II32 code__2) | 334 | false | false | 0 | 19 | 110 | 155 | 77 | 78 | null | null |
bitemyapp/ether | src/Control/Monad/Ether/Implicit/State/Strict.hs | bsd-3-clause | -- | See 'Control.Monad.Ether.State.Strict.runStateT'.
runStateT :: StateT s m a -> s -> m (a, s)
runStateT = Explicit.runStateT Proxy | 134 | runStateT :: StateT s m a -> s -> m (a, s)
runStateT = Explicit.runStateT Proxy | 79 | runStateT = Explicit.runStateT Proxy | 36 | true | true | 0 | 8 | 19 | 41 | 21 | 20 | null | null |
timtylin/scholdoc-texmath | src/Text/TeXMath/Readers/OMML.hs | gpl-2.0 | unGroup exps = exps | 19 | unGroup exps = exps | 19 | unGroup exps = exps | 19 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
albertov/hs-mapnik | bindings/src/Mapnik/Bindings/Symbolizer.hs | bsd-3-clause | defaultRowMaxDiff :: Double
defaultRowMaxDiff = -1 | 50 | defaultRowMaxDiff :: Double
defaultRowMaxDiff = -1 | 50 | defaultRowMaxDiff = -1 | 22 | false | true | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
aristidb/datastorage | src/TypedBinary.hs | bsd-3-clause | maxSize :: TypeSize -> TypeSize -> TypeSize
maxSize (Constant a) (Constant b) = Range (min a b) (Just $ max a b) | 112 | maxSize :: TypeSize -> TypeSize -> TypeSize
maxSize (Constant a) (Constant b) = Range (min a b) (Just $ max a b) | 112 | maxSize (Constant a) (Constant b) = Range (min a b) (Just $ max a b) | 68 | false | true | 0 | 8 | 21 | 61 | 30 | 31 | null | null |
sigrlami/pollock | app-reflex/app/Main.hs | mit | textEcho :: MonadWidget t m => m ()
textEcho = do
let cfg = TextAreaConfig "" never (constDyn ( "class" =: "inputee"))
t <- textArea cfg
tvs <- mapDyn identifyLanguage $ value t
el "br" (return ())
elClass "div" "output" $ do
dynText (value t)
elClass "div" "output lang" $ do
dynText (tvs) | 317 | textEcho :: MonadWidget t m => m ()
textEcho = do
let cfg = TextAreaConfig "" never (constDyn ( "class" =: "inputee"))
t <- textArea cfg
tvs <- mapDyn identifyLanguage $ value t
el "br" (return ())
elClass "div" "output" $ do
dynText (value t)
elClass "div" "output lang" $ do
dynText (tvs) | 317 | textEcho = do
let cfg = TextAreaConfig "" never (constDyn ( "class" =: "inputee"))
t <- textArea cfg
tvs <- mapDyn identifyLanguage $ value t
el "br" (return ())
elClass "div" "output" $ do
dynText (value t)
elClass "div" "output lang" $ do
dynText (tvs) | 281 | false | true | 0 | 14 | 79 | 148 | 64 | 84 | null | null |
romanb/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/Types.hs | mpl-2.0 | -- | The specific server-side encryption mode that you want Elastic Transcoder to
-- use when decrypting your input files or encrypting your output files. Elastic
-- Transcoder supports the following options:
--
-- S3: Amazon S3 creates and manages the keys used for encrypting your files.
--
-- S3-AWS-KMS: Amazon S3 calls the Amazon Key Management Service, which creates
-- and manages the keys that are used for encrypting your files. If you specify 'S3-AWS-KMS' and you don't want to use the default key, you must add the AWS-KMS key that
-- you want to use to your pipeline.
--
-- AES-CBC-PKCS7: A padded cipher-block mode of operation originally used for
-- HLS files.
--
-- AES-CTR: AES Counter Mode.
--
-- AES-GCM: AES Galois Counter Mode, a mode of operation that is an
-- authenticated encryption format, meaning that a file, key, or initialization
-- vector that has been tampered with will fail the decryption process.
--
-- For all three AES options, you must provide the following settings, which
-- must be base64-encoded:
--
-- Key
--
-- Key MD5
--
-- Initialization Vector
--
-- For the AES modes, your private encryption keys and your unencrypted data
-- are never stored by AWS; therefore, it is important that you safely manage
-- your encryption keys. If you lose them, you won't be able to unencrypt your
-- data.
--
eMode :: Lens' Encryption (Maybe Text)
eMode = lens _eMode (\s a -> s { _eMode = a }) | 1,424 | eMode :: Lens' Encryption (Maybe Text)
eMode = lens _eMode (\s a -> s { _eMode = a }) | 85 | eMode = lens _eMode (\s a -> s { _eMode = a }) | 46 | true | true | 1 | 9 | 251 | 84 | 57 | 27 | null | null |
urbanslug/ghc | testsuite/tests/profiling/should_run/T3001-2.hs | bsd-3-clause | utWord32beB :: Word32 -> Builder
putWord32beB w = writeN 4 $ \p -> do
poke p (fromIntegral (shiftr_w32 w 24) :: Word8)
poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 w 16) :: Word8)
poke (p `plusPtr` 2) (fromIntegral (shiftr_w32 w 8) :: Word8)
poke (p `plusPtr` 3) (fromIntegral (w) :: Word8)
| 338 | putWord32beB :: Word32 -> Builder
putWord32beB w = writeN 4 $ \p -> do
poke p (fromIntegral (shiftr_w32 w 24) :: Word8)
poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 w 16) :: Word8)
poke (p `plusPtr` 2) (fromIntegral (shiftr_w32 w 8) :: Word8)
poke (p `plusPtr` 3) (fromIntegral (w) :: Word8) | 338 | putWord32beB w = writeN 4 $ \p -> do
poke p (fromIntegral (shiftr_w32 w 24) :: Word8)
poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 w 16) :: Word8)
poke (p `plusPtr` 2) (fromIntegral (shiftr_w32 w 8) :: Word8)
poke (p `plusPtr` 3) (fromIntegral (w) :: Word8) | 304 | false | true | 0 | 13 | 95 | 152 | 79 | 73 | null | null |
yusent/cfdis | src/CFDI/Types/Currency.hs | mit | decimalPlaces CUR_XSU = 0 | 25 | decimalPlaces CUR_XSU = 0 | 25 | decimalPlaces CUR_XSU = 0 | 25 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mbakke/ganeti | src/Ganeti/HTools/Node.hs | bsd-2-clause | -- | Returns state-of-world free memory on the node.
-- | NOTE: This value is valid only before placement simulations.
-- | TODO: Redefine this for memoy overcommitment.
reportedFreeMem :: Node -> Int
reportedFreeMem = fMem | 223 | reportedFreeMem :: Node -> Int
reportedFreeMem = fMem | 53 | reportedFreeMem = fMem | 22 | true | true | 0 | 5 | 35 | 18 | 11 | 7 | null | null |
apyrgio/ganeti | src/Ganeti/Objects/BitArray.hs | bsd-2-clause | zeroes :: Int -> BitArray
zeroes s = BitArray s IS.empty | 56 | zeroes :: Int -> BitArray
zeroes s = BitArray s IS.empty | 56 | zeroes s = BitArray s IS.empty | 30 | false | true | 0 | 7 | 10 | 32 | 13 | 19 | null | null |
FiskerLars/dragoncurve | src/L.hs | mit | rotateright :: Move -> Move
rotateright = rotateleft.backwards | 62 | rotateright :: Move -> Move
rotateright = rotateleft.backwards | 62 | rotateright = rotateleft.backwards | 34 | false | true | 0 | 5 | 7 | 17 | 9 | 8 | null | null |
bumptech/riak-haskell-client | src/Network/Riak/Request.hs | apache-2.0 | -- | Create a server-info request.
getServerInfo :: GetServerInfoRequest
getServerInfo = GetServerInfoRequest | 109 | getServerInfo :: GetServerInfoRequest
getServerInfo = GetServerInfoRequest | 74 | getServerInfo = GetServerInfoRequest | 36 | true | true | 0 | 4 | 11 | 12 | 7 | 5 | null | null |
ajnsit/packman | Test/AllTests.hs | bsd-3-clause | pack_array :: (String, IO Bool)
pack_array = ("duplicating an array of 128 elements",
do packet1 <- trySerialize output
putStrLn (take (3*80) (show packet1) ++ "...")
putStrLn "now unpacking (deserialize):"
copy <- deserialize packet1
putStrLn ("unpacked, now evaluate")
putStrLn (show copy)
return $ copy == A.amap (2*) arr
) | 455 | pack_array :: (String, IO Bool)
pack_array = ("duplicating an array of 128 elements",
do packet1 <- trySerialize output
putStrLn (take (3*80) (show packet1) ++ "...")
putStrLn "now unpacking (deserialize):"
copy <- deserialize packet1
putStrLn ("unpacked, now evaluate")
putStrLn (show copy)
return $ copy == A.amap (2*) arr
) | 455 | pack_array = ("duplicating an array of 128 elements",
do packet1 <- trySerialize output
putStrLn (take (3*80) (show packet1) ++ "...")
putStrLn "now unpacking (deserialize):"
copy <- deserialize packet1
putStrLn ("unpacked, now evaluate")
putStrLn (show copy)
return $ copy == A.amap (2*) arr
) | 423 | false | true | 0 | 13 | 176 | 126 | 60 | 66 | null | null |
Undeterminant/taffybar | src/System/Taffybar/FreedesktopNotifications.hs | bsd-3-clause | -- | Create a new notification area with the given configuration.
notifyAreaNew :: NotificationConfig -> IO Widget
notifyAreaNew cfg = do
frame <- frameNew
box <- hBoxNew False 3
textArea <- labelNew (Nothing :: Maybe String)
button <- eventBoxNew
sep <- vSeparatorNew
bLabel <- labelNew (Nothing :: Maybe String)
widgetSetName bLabel ("NotificationCloseButton" :: String)
labelSetMarkup bLabel ("×" :: String)
labelSetMaxWidthChars textArea (notificationMaxLength cfg)
labelSetEllipsize textArea EllipsizeEnd
containerAdd button bLabel
boxPackStart box textArea PackGrow 0
boxPackStart box sep PackNatural 0
boxPackStart box button PackNatural 0
containerAdd frame box
widgetHideAll frame
istate <- initialNoteState (toWidget frame) textArea cfg
_ <- on button buttonReleaseEvent (userCancel istate)
realizableWrapper <- hBoxNew False 0
boxPackStart realizableWrapper frame PackNatural 0
widgetShow realizableWrapper
-- We can't start the dbus listener thread until we are in the GTK
-- main loop, otherwise things are prone to lock up and block
-- infinitely on an mvar. Bad stuff - only start the dbus thread
-- after the fake invisible wrapper widget is realized.
_ <- on realizableWrapper realize $ do
_ <- forkIO (displayThread istate)
notificationDaemon (notify istate) (closeNotification istate)
-- Don't show the widget by default - it will appear when needed
return (toWidget realizableWrapper)
where
-- | Close the current note and pull up the next, if any
userCancel s = do
liftIO $ do
atomically $ nextNotification s
wakeupDisplayThread s
return True | 1,681 | notifyAreaNew :: NotificationConfig -> IO Widget
notifyAreaNew cfg = do
frame <- frameNew
box <- hBoxNew False 3
textArea <- labelNew (Nothing :: Maybe String)
button <- eventBoxNew
sep <- vSeparatorNew
bLabel <- labelNew (Nothing :: Maybe String)
widgetSetName bLabel ("NotificationCloseButton" :: String)
labelSetMarkup bLabel ("×" :: String)
labelSetMaxWidthChars textArea (notificationMaxLength cfg)
labelSetEllipsize textArea EllipsizeEnd
containerAdd button bLabel
boxPackStart box textArea PackGrow 0
boxPackStart box sep PackNatural 0
boxPackStart box button PackNatural 0
containerAdd frame box
widgetHideAll frame
istate <- initialNoteState (toWidget frame) textArea cfg
_ <- on button buttonReleaseEvent (userCancel istate)
realizableWrapper <- hBoxNew False 0
boxPackStart realizableWrapper frame PackNatural 0
widgetShow realizableWrapper
-- We can't start the dbus listener thread until we are in the GTK
-- main loop, otherwise things are prone to lock up and block
-- infinitely on an mvar. Bad stuff - only start the dbus thread
-- after the fake invisible wrapper widget is realized.
_ <- on realizableWrapper realize $ do
_ <- forkIO (displayThread istate)
notificationDaemon (notify istate) (closeNotification istate)
-- Don't show the widget by default - it will appear when needed
return (toWidget realizableWrapper)
where
-- | Close the current note and pull up the next, if any
userCancel s = do
liftIO $ do
atomically $ nextNotification s
wakeupDisplayThread s
return True | 1,615 | notifyAreaNew cfg = do
frame <- frameNew
box <- hBoxNew False 3
textArea <- labelNew (Nothing :: Maybe String)
button <- eventBoxNew
sep <- vSeparatorNew
bLabel <- labelNew (Nothing :: Maybe String)
widgetSetName bLabel ("NotificationCloseButton" :: String)
labelSetMarkup bLabel ("×" :: String)
labelSetMaxWidthChars textArea (notificationMaxLength cfg)
labelSetEllipsize textArea EllipsizeEnd
containerAdd button bLabel
boxPackStart box textArea PackGrow 0
boxPackStart box sep PackNatural 0
boxPackStart box button PackNatural 0
containerAdd frame box
widgetHideAll frame
istate <- initialNoteState (toWidget frame) textArea cfg
_ <- on button buttonReleaseEvent (userCancel istate)
realizableWrapper <- hBoxNew False 0
boxPackStart realizableWrapper frame PackNatural 0
widgetShow realizableWrapper
-- We can't start the dbus listener thread until we are in the GTK
-- main loop, otherwise things are prone to lock up and block
-- infinitely on an mvar. Bad stuff - only start the dbus thread
-- after the fake invisible wrapper widget is realized.
_ <- on realizableWrapper realize $ do
_ <- forkIO (displayThread istate)
notificationDaemon (notify istate) (closeNotification istate)
-- Don't show the widget by default - it will appear when needed
return (toWidget realizableWrapper)
where
-- | Close the current note and pull up the next, if any
userCancel s = do
liftIO $ do
atomically $ nextNotification s
wakeupDisplayThread s
return True | 1,566 | true | true | 0 | 14 | 342 | 380 | 169 | 211 | null | null |
acowley/ghc | compiler/types/OptCoercion.hs | bsd-3-clause | -- | Optimize a coercion, making no assumptions.
opt_co1 :: CvSubst
-> SymFlag
-> Coercion -> NormalCo
opt_co1 env sym co = opt_co2 env sym (coercionRole co) co | 176 | opt_co1 :: CvSubst
-> SymFlag
-> Coercion -> NormalCo
opt_co1 env sym co = opt_co2 env sym (coercionRole co) co | 127 | opt_co1 env sym co = opt_co2 env sym (coercionRole co) co | 57 | true | true | 0 | 7 | 43 | 46 | 23 | 23 | null | null |
jml/diff-match-patch | test/Spec.hs | gpl-3.0 | main :: IO ()
main = defaultMain tests | 38 | main :: IO ()
main = defaultMain tests | 38 | main = defaultMain tests | 24 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
ibraimgm/learn-haskell | src/Rational.hs | bsd-3-clause | simplifyRatio :: Ratio -> Ratio
simplifyRatio (Ratio n d) = (Ratio n' d')
where
m = mdc n d
n' = n `div` m
d' = d `div` m
-- operator to create a new ratio | 170 | simplifyRatio :: Ratio -> Ratio
simplifyRatio (Ratio n d) = (Ratio n' d')
where
m = mdc n d
n' = n `div` m
d' = d `div` m
-- operator to create a new ratio | 170 | simplifyRatio (Ratio n d) = (Ratio n' d')
where
m = mdc n d
n' = n `div` m
d' = d `div` m
-- operator to create a new ratio | 138 | false | true | 3 | 9 | 50 | 91 | 41 | 50 | null | null |
alsonkemp/turbinado | Turbinado/PreProcessor/Parser/HAML.hs | bsd-3-clause | termPunctuation = "-_" | 22 | termPunctuation = "-_" | 22 | termPunctuation = "-_" | 22 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
alexander-at-github/eta | compiler/ETA/DeSugar/DsArrows.hs | bsd-3-clause | dsCmdStmt ids local_vars out_ids (BindStmt pat cmd _ _) env_ids = do
(core_cmd, fv_cmd, env_ids1) <- dsfixCmd ids local_vars unitTy (hsLPatType pat) cmd
let
pat_ty = hsLPatType pat
pat_vars = mkVarSet (collectPatBinders pat)
env_ids2 = varSetElems (mkVarSet out_ids `minusVarSet` pat_vars)
env_ty2 = mkBigCoreVarTupTy env_ids2
-- multiplexing function
-- \ (xs) -> (((xs1),()),(xs2))
core_mux <- matchEnv env_ids
(mkCorePairExpr
(mkCorePairExpr (mkBigCoreVarTup env_ids1) mkCoreUnitExpr)
(mkBigCoreVarTup env_ids2))
-- projection function
-- \ (p, (xs2)) -> (zs)
env_id <- newSysLocalDs env_ty2
uniqs <- newUniqueSupply
let
after_c_ty = mkCorePairTy pat_ty env_ty2
out_ty = mkBigCoreVarTupTy out_ids
body_expr = coreCaseTuple uniqs env_id env_ids2 (mkBigCoreVarTup out_ids)
fail_expr <- mkFailExpr (StmtCtxt DoExpr) out_ty
pat_id <- selectSimpleMatchVarL pat
match_code <- matchSimply (Var pat_id) (StmtCtxt DoExpr) pat body_expr fail_expr
pair_id <- newSysLocalDs after_c_ty
let
proj_expr = Lam pair_id (coreCasePair pair_id pat_id env_id match_code)
-- put it all together
let
in_ty = mkBigCoreVarTupTy env_ids
in_ty1 = mkCorePairTy (mkBigCoreVarTupTy env_ids1) unitTy
in_ty2 = mkBigCoreVarTupTy env_ids2
before_c_ty = mkCorePairTy in_ty1 in_ty2
return (do_premap ids in_ty before_c_ty out_ty core_mux $
do_compose ids before_c_ty after_c_ty out_ty
(do_first ids in_ty1 pat_ty in_ty2 core_cmd) $
do_arr ids after_c_ty out_ty proj_expr,
fv_cmd `unionVarSet` (mkVarSet out_ids `minusVarSet` pat_vars))
-- D; xs' |-a do { ss } : t
-- --------------------------------------
-- D; xs |-a do { let binds; ss } : t
--
-- ---> arr (\ (xs) -> let binds in (xs')) >>> ss | 1,976 | dsCmdStmt ids local_vars out_ids (BindStmt pat cmd _ _) env_ids = do
(core_cmd, fv_cmd, env_ids1) <- dsfixCmd ids local_vars unitTy (hsLPatType pat) cmd
let
pat_ty = hsLPatType pat
pat_vars = mkVarSet (collectPatBinders pat)
env_ids2 = varSetElems (mkVarSet out_ids `minusVarSet` pat_vars)
env_ty2 = mkBigCoreVarTupTy env_ids2
-- multiplexing function
-- \ (xs) -> (((xs1),()),(xs2))
core_mux <- matchEnv env_ids
(mkCorePairExpr
(mkCorePairExpr (mkBigCoreVarTup env_ids1) mkCoreUnitExpr)
(mkBigCoreVarTup env_ids2))
-- projection function
-- \ (p, (xs2)) -> (zs)
env_id <- newSysLocalDs env_ty2
uniqs <- newUniqueSupply
let
after_c_ty = mkCorePairTy pat_ty env_ty2
out_ty = mkBigCoreVarTupTy out_ids
body_expr = coreCaseTuple uniqs env_id env_ids2 (mkBigCoreVarTup out_ids)
fail_expr <- mkFailExpr (StmtCtxt DoExpr) out_ty
pat_id <- selectSimpleMatchVarL pat
match_code <- matchSimply (Var pat_id) (StmtCtxt DoExpr) pat body_expr fail_expr
pair_id <- newSysLocalDs after_c_ty
let
proj_expr = Lam pair_id (coreCasePair pair_id pat_id env_id match_code)
-- put it all together
let
in_ty = mkBigCoreVarTupTy env_ids
in_ty1 = mkCorePairTy (mkBigCoreVarTupTy env_ids1) unitTy
in_ty2 = mkBigCoreVarTupTy env_ids2
before_c_ty = mkCorePairTy in_ty1 in_ty2
return (do_premap ids in_ty before_c_ty out_ty core_mux $
do_compose ids before_c_ty after_c_ty out_ty
(do_first ids in_ty1 pat_ty in_ty2 core_cmd) $
do_arr ids after_c_ty out_ty proj_expr,
fv_cmd `unionVarSet` (mkVarSet out_ids `minusVarSet` pat_vars))
-- D; xs' |-a do { ss } : t
-- --------------------------------------
-- D; xs |-a do { let binds; ss } : t
--
-- ---> arr (\ (xs) -> let binds in (xs')) >>> ss | 1,976 | dsCmdStmt ids local_vars out_ids (BindStmt pat cmd _ _) env_ids = do
(core_cmd, fv_cmd, env_ids1) <- dsfixCmd ids local_vars unitTy (hsLPatType pat) cmd
let
pat_ty = hsLPatType pat
pat_vars = mkVarSet (collectPatBinders pat)
env_ids2 = varSetElems (mkVarSet out_ids `minusVarSet` pat_vars)
env_ty2 = mkBigCoreVarTupTy env_ids2
-- multiplexing function
-- \ (xs) -> (((xs1),()),(xs2))
core_mux <- matchEnv env_ids
(mkCorePairExpr
(mkCorePairExpr (mkBigCoreVarTup env_ids1) mkCoreUnitExpr)
(mkBigCoreVarTup env_ids2))
-- projection function
-- \ (p, (xs2)) -> (zs)
env_id <- newSysLocalDs env_ty2
uniqs <- newUniqueSupply
let
after_c_ty = mkCorePairTy pat_ty env_ty2
out_ty = mkBigCoreVarTupTy out_ids
body_expr = coreCaseTuple uniqs env_id env_ids2 (mkBigCoreVarTup out_ids)
fail_expr <- mkFailExpr (StmtCtxt DoExpr) out_ty
pat_id <- selectSimpleMatchVarL pat
match_code <- matchSimply (Var pat_id) (StmtCtxt DoExpr) pat body_expr fail_expr
pair_id <- newSysLocalDs after_c_ty
let
proj_expr = Lam pair_id (coreCasePair pair_id pat_id env_id match_code)
-- put it all together
let
in_ty = mkBigCoreVarTupTy env_ids
in_ty1 = mkCorePairTy (mkBigCoreVarTupTy env_ids1) unitTy
in_ty2 = mkBigCoreVarTupTy env_ids2
before_c_ty = mkCorePairTy in_ty1 in_ty2
return (do_premap ids in_ty before_c_ty out_ty core_mux $
do_compose ids before_c_ty after_c_ty out_ty
(do_first ids in_ty1 pat_ty in_ty2 core_cmd) $
do_arr ids after_c_ty out_ty proj_expr,
fv_cmd `unionVarSet` (mkVarSet out_ids `minusVarSet` pat_vars))
-- D; xs' |-a do { ss } : t
-- --------------------------------------
-- D; xs |-a do { let binds; ss } : t
--
-- ---> arr (\ (xs) -> let binds in (xs')) >>> ss | 1,976 | false | false | 0 | 14 | 537 | 450 | 220 | 230 | null | null |
spechub/Hets | CASL/Overload.hs | gpl-2.0 | -- | minimal common supersorts of the two input sorts
minimalSupers :: Sign f e -> SORT -> SORT -> [SORT]
minimalSupers = minimalSupers1 True | 141 | minimalSupers :: Sign f e -> SORT -> SORT -> [SORT]
minimalSupers = minimalSupers1 True | 87 | minimalSupers = minimalSupers1 True | 35 | true | true | 0 | 10 | 24 | 41 | 19 | 22 | null | null |
joelburget/frankenstein | src/Planetary/Core/Typecheck.hs | bsd-3-clause | check :: TmI -> UTy IntVar -> TcM' ()
-- FUN
check (Lambda binders body)
(SuspendedTyU (CompTyU dom (PegU ability codom))) =
-- TODO: strictZip
let varTypes = Map.fromList $ zip binders dom
in withValTypes' varTypes body $ \body' ->
withAbility ability $
check body' codom | 300 | check :: TmI -> UTy IntVar -> TcM' ()
check (Lambda binders body)
(SuspendedTyU (CompTyU dom (PegU ability codom))) =
-- TODO: strictZip
let varTypes = Map.fromList $ zip binders dom
in withValTypes' varTypes body $ \body' ->
withAbility ability $
check body' codom | 293 | check (Lambda binders body)
(SuspendedTyU (CompTyU dom (PegU ability codom))) =
-- TODO: strictZip
let varTypes = Map.fromList $ zip binders dom
in withValTypes' varTypes body $ \body' ->
withAbility ability $
check body' codom | 255 | true | true | 0 | 11 | 73 | 112 | 54 | 58 | null | null |
rahulmutt/ghcvm | libraries/base/GHC/IO/Encoding/UTF32.hs | bsd-3-clause | utf32le_EF :: CodingFailureMode -> IO (TextEncoder ())
utf32le_EF cfm =
return (BufferCodec {
encode = utf32le_encode,
recover = recoverEncode cfm,
close = return (),
getState = return (),
setState = const $ return ()
}) | 303 | utf32le_EF :: CodingFailureMode -> IO (TextEncoder ())
utf32le_EF cfm =
return (BufferCodec {
encode = utf32le_encode,
recover = recoverEncode cfm,
close = return (),
getState = return (),
setState = const $ return ()
}) | 303 | utf32le_EF cfm =
return (BufferCodec {
encode = utf32le_encode,
recover = recoverEncode cfm,
close = return (),
getState = return (),
setState = const $ return ()
}) | 248 | false | true | 0 | 11 | 117 | 89 | 47 | 42 | null | null |
elieux/ghc | compiler/nativeGen/Dwarf/Types.hs | bsd-3-clause | -- | Generates unwind information for a block. We only generate
-- instructions where unwind information actually changes. This small
-- optimisations saves a lot of space, as subsequent blocks often have
-- the same unwind information.
pprFrameBlock :: UnwindTable -> DwarfFrameBlock -> (UnwindTable, SDoc)
pprFrameBlock oldUws (DwarfFrameBlock blockLbl hasInfo uws)
| uws == oldUws
= (oldUws, empty)
| otherwise
= (,) uws $ sdocWithPlatform $ \plat ->
let lbl = ppr blockLbl <> if hasInfo then text "-1" else empty
-- see [Note: Info Offset]
isChanged g v | old == Just v = Nothing
| otherwise = Just (old, v)
where old = Map.lookup g oldUws
changed = Map.toList $ Map.mapMaybeWithKey isChanged uws
died = Map.toList $ Map.difference oldUws uws
in pprByte dW_CFA_set_loc $$ pprWord lbl $$
vcat (map (uncurry $ pprSetUnwind plat) changed) $$
vcat (map (pprUndefUnwind plat . fst) died) | 1,007 | pprFrameBlock :: UnwindTable -> DwarfFrameBlock -> (UnwindTable, SDoc)
pprFrameBlock oldUws (DwarfFrameBlock blockLbl hasInfo uws)
| uws == oldUws
= (oldUws, empty)
| otherwise
= (,) uws $ sdocWithPlatform $ \plat ->
let lbl = ppr blockLbl <> if hasInfo then text "-1" else empty
-- see [Note: Info Offset]
isChanged g v | old == Just v = Nothing
| otherwise = Just (old, v)
where old = Map.lookup g oldUws
changed = Map.toList $ Map.mapMaybeWithKey isChanged uws
died = Map.toList $ Map.difference oldUws uws
in pprByte dW_CFA_set_loc $$ pprWord lbl $$
vcat (map (uncurry $ pprSetUnwind plat) changed) $$
vcat (map (pprUndefUnwind plat . fst) died) | 770 | pprFrameBlock oldUws (DwarfFrameBlock blockLbl hasInfo uws)
| uws == oldUws
= (oldUws, empty)
| otherwise
= (,) uws $ sdocWithPlatform $ \plat ->
let lbl = ppr blockLbl <> if hasInfo then text "-1" else empty
-- see [Note: Info Offset]
isChanged g v | old == Just v = Nothing
| otherwise = Just (old, v)
where old = Map.lookup g oldUws
changed = Map.toList $ Map.mapMaybeWithKey isChanged uws
died = Map.toList $ Map.difference oldUws uws
in pprByte dW_CFA_set_loc $$ pprWord lbl $$
vcat (map (uncurry $ pprSetUnwind plat) changed) $$
vcat (map (pprUndefUnwind plat . fst) died) | 699 | true | true | 0 | 17 | 264 | 271 | 135 | 136 | null | null |
noteed/openerpfront | script.hs | bsd-3-clause | andleE _ (Right v) = return v
| 30 | handleE _ (Right v) = return v | 30 | handleE _ (Right v) = return v | 30 | false | false | 0 | 7 | 7 | 20 | 9 | 11 | null | null |
rockdragon/julia-programming | code/haskell/Applicative.hs | mit | b :: Char
b = 'x' | 17 | b :: Char
b = 'x' | 17 | b = 'x' | 7 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
faylang/fay-server | src/Language/Fay/JQuery.hs | bsd-3-clause | select :: String -> Fay JQuery
select = ffi "window['jQuery'](%1)" | 66 | select :: String -> Fay JQuery
select = ffi "window['jQuery'](%1)" | 66 | select = ffi "window['jQuery'](%1)" | 35 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
Rathcke/uni | ap/advanced programming/assignment1/SalsaInterp.hs | gpl-3.0 | getContext :: Salsa Context
getContext = Salsa (\c -> Right(c, c, [])) | 70 | getContext :: Salsa Context
getContext = Salsa (\c -> Right(c, c, [])) | 70 | getContext = Salsa (\c -> Right(c, c, [])) | 42 | false | true | 0 | 10 | 11 | 45 | 22 | 23 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_VARIABLE_F_NV :: GLenum
gl_VARIABLE_F_NV = 0x8528 | 52 | gl_VARIABLE_F_NV :: GLenum
gl_VARIABLE_F_NV = 0x8528 | 52 | gl_VARIABLE_F_NV = 0x8528 | 25 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
jmlb23/haskell | ch06/euclides.hs | gpl-3.0 | mytail :: [a] -> [a]
mytail (x:xs) = xs | 39 | mytail :: [a] -> [a]
mytail (x:xs) = xs | 39 | mytail (x:xs) = xs | 18 | false | true | 0 | 9 | 8 | 37 | 18 | 19 | null | null |
ahelwer/UofC | cpsc449/as1/Chapter6.hs | mit | addPairwise :: [Int] -> [Int] -> [Int]
addPairwise intList1 intList2
= [ m + n | (m,n) <- zip intList1 intList2 ] | 115 | addPairwise :: [Int] -> [Int] -> [Int]
addPairwise intList1 intList2
= [ m + n | (m,n) <- zip intList1 intList2 ] | 115 | addPairwise intList1 intList2
= [ m + n | (m,n) <- zip intList1 intList2 ] | 76 | false | true | 0 | 9 | 23 | 65 | 33 | 32 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Text.hs | bsd-3-clause | -- | /O(n)/ Remove leading white space from a string. Equivalent to:
--
-- > dropWhile isSpace
stripStart :: Text -> Text
stripStart = dropWhile isSpace | 153 | stripStart :: Text -> Text
stripStart = dropWhile isSpace | 57 | stripStart = dropWhile isSpace | 30 | true | true | 0 | 7 | 26 | 27 | 13 | 14 | null | null |
d-day/relation | include/pointfree-style/pointfree-1.0.4.3/Plugin/Pl/Rules.hs | bsd-3-clause | fmapIE = Quote $ Var Inf "fmap" | 36 | fmapIE = Quote $ Var Inf "fmap" | 36 | fmapIE = Quote $ Var Inf "fmap" | 36 | false | false | 0 | 6 | 11 | 15 | 7 | 8 | null | null |
hvr/vector | Data/Vector.hs | bsd-3-clause | unsafeAccum = G.unsafeAccum | 27 | unsafeAccum = G.unsafeAccum | 27 | unsafeAccum = G.unsafeAccum | 27 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
bkoropoff/Idris-dev | src/Idris/ElabDecls.hs | bsd-3-clause | elabDecl' what info (PData doc argDocs s f co d)
| what /= ETypes
= do logLvl 1 $ "Elaborating " ++ show (d_name d)
elabData info s doc argDocs f co d
| otherwise
= do logLvl 1 $ "Elaborating [type of] " ++ show (d_name d)
elabData info s doc argDocs f co (PLaterdecl (d_name d) (d_name_fc d) (d_tcon d)) | 334 | elabDecl' what info (PData doc argDocs s f co d)
| what /= ETypes
= do logLvl 1 $ "Elaborating " ++ show (d_name d)
elabData info s doc argDocs f co d
| otherwise
= do logLvl 1 $ "Elaborating [type of] " ++ show (d_name d)
elabData info s doc argDocs f co (PLaterdecl (d_name d) (d_name_fc d) (d_tcon d)) | 334 | elabDecl' what info (PData doc argDocs s f co d)
| what /= ETypes
= do logLvl 1 $ "Elaborating " ++ show (d_name d)
elabData info s doc argDocs f co d
| otherwise
= do logLvl 1 $ "Elaborating [type of] " ++ show (d_name d)
elabData info s doc argDocs f co (PLaterdecl (d_name d) (d_name_fc d) (d_tcon d)) | 334 | false | false | 0 | 13 | 91 | 164 | 73 | 91 | null | null |
nevrenato/Hets_Fork | CommonLogic/Symbol.hs | gpl-2.0 | -- | Converts a signature to a set of symbols
symOf :: Sign.Sign -> Set.Set Symbol
symOf x = Set.fold (\ y -> Set.insert Symbol {symName = y}) Set.empty $
Sign.allItems x | 181 | symOf :: Sign.Sign -> Set.Set Symbol
symOf x = Set.fold (\ y -> Set.insert Symbol {symName = y}) Set.empty $
Sign.allItems x | 135 | symOf x = Set.fold (\ y -> Set.insert Symbol {symName = y}) Set.empty $
Sign.allItems x | 98 | true | true | 0 | 11 | 42 | 65 | 33 | 32 | null | null |
silky/csound-expression | src/Csound/Options.hs | bsd-3-clause | setDacBy :: String -> Options
setDacBy port = setOutput name
where name
| null port = "dac"
| otherwise = "dac:" ++ port | 149 | setDacBy :: String -> Options
setDacBy port = setOutput name
where name
| null port = "dac"
| otherwise = "dac:" ++ port | 149 | setDacBy port = setOutput name
where name
| null port = "dac"
| otherwise = "dac:" ++ port | 119 | false | true | 0 | 8 | 51 | 62 | 26 | 36 | null | null |
oldmanmike/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | -- | For debugging problems with the CLabel representation.
-- We can't make a Show instance for CLabel because lots of its components don't have instances.
-- The regular Outputable instance only shows the label name, and not its other info.
--
pprDebugCLabel :: CLabel -> SDoc
pprDebugCLabel lbl
= case lbl of
IdLabel{} -> ppr lbl <> (parens $ text "IdLabel")
CmmLabel pkg _name _info
-> ppr lbl <> (parens $ text "CmmLabel" <+> ppr pkg)
RtsLabel{} -> ppr lbl <> (parens $ text "RtsLabel")
ForeignLabel _name mSuffix src funOrData
-> ppr lbl <> (parens $ text "ForeignLabel"
<+> ppr mSuffix
<+> ppr src
<+> ppr funOrData)
_ -> ppr lbl <> (parens $ text "other CLabel)") | 867 | pprDebugCLabel :: CLabel -> SDoc
pprDebugCLabel lbl
= case lbl of
IdLabel{} -> ppr lbl <> (parens $ text "IdLabel")
CmmLabel pkg _name _info
-> ppr lbl <> (parens $ text "CmmLabel" <+> ppr pkg)
RtsLabel{} -> ppr lbl <> (parens $ text "RtsLabel")
ForeignLabel _name mSuffix src funOrData
-> ppr lbl <> (parens $ text "ForeignLabel"
<+> ppr mSuffix
<+> ppr src
<+> ppr funOrData)
_ -> ppr lbl <> (parens $ text "other CLabel)") | 611 | pprDebugCLabel lbl
= case lbl of
IdLabel{} -> ppr lbl <> (parens $ text "IdLabel")
CmmLabel pkg _name _info
-> ppr lbl <> (parens $ text "CmmLabel" <+> ppr pkg)
RtsLabel{} -> ppr lbl <> (parens $ text "RtsLabel")
ForeignLabel _name mSuffix src funOrData
-> ppr lbl <> (parens $ text "ForeignLabel"
<+> ppr mSuffix
<+> ppr src
<+> ppr funOrData)
_ -> ppr lbl <> (parens $ text "other CLabel)") | 578 | true | true | 8 | 12 | 313 | 184 | 89 | 95 | null | null |
mrakgr/futhark | src/Futhark/CodeGen/ImpGen.hs | bsd-3-clause | declaringVarEntry :: VName -> VarEntry -> ImpM op a -> ImpM op a
declaringVarEntry name entry m = do
case entry of
MemVar entry' ->
emit $ Imp.DeclareMem name $ entryMemSpace entry'
ScalarVar entry' ->
emit $ Imp.DeclareScalar name $ entryScalarType entry'
ArrayVar _ ->
return ()
local (insertInVtable name entry) m | 350 | declaringVarEntry :: VName -> VarEntry -> ImpM op a -> ImpM op a
declaringVarEntry name entry m = do
case entry of
MemVar entry' ->
emit $ Imp.DeclareMem name $ entryMemSpace entry'
ScalarVar entry' ->
emit $ Imp.DeclareScalar name $ entryScalarType entry'
ArrayVar _ ->
return ()
local (insertInVtable name entry) m | 350 | declaringVarEntry name entry m = do
case entry of
MemVar entry' ->
emit $ Imp.DeclareMem name $ entryMemSpace entry'
ScalarVar entry' ->
emit $ Imp.DeclareScalar name $ entryScalarType entry'
ArrayVar _ ->
return ()
local (insertInVtable name entry) m | 285 | false | true | 0 | 13 | 85 | 127 | 57 | 70 | null | null |
PhDP/Manticore | Akarui/Parser/NamedFuzzy.hs | apache-2.0 | getNamedFuzzy :: Parser NamedFuzzy
getNamedFuzzy = do
n <- identifier
reservedOp "="
reservedOp "{"
fs <- getFuzzy
reservedOp "}"
return $ NamedFuzzy (T.pack n) fs | 175 | getNamedFuzzy :: Parser NamedFuzzy
getNamedFuzzy = do
n <- identifier
reservedOp "="
reservedOp "{"
fs <- getFuzzy
reservedOp "}"
return $ NamedFuzzy (T.pack n) fs | 175 | getNamedFuzzy = do
n <- identifier
reservedOp "="
reservedOp "{"
fs <- getFuzzy
reservedOp "}"
return $ NamedFuzzy (T.pack n) fs | 140 | false | true | 0 | 12 | 36 | 72 | 29 | 43 | null | null |
Chase-C/KDtree | src/KDtree.hs | gpl-2.0 | toList :: KDtree a -> [a]
toList = F.foldr (:) [] | 49 | toList :: KDtree a -> [a]
toList = F.foldr (:) [] | 49 | toList = F.foldr (:) [] | 23 | false | true | 0 | 8 | 10 | 40 | 18 | 22 | null | null |
probcomp/haxcat | ChiSquareTest.hs | apache-2.0 | the_p_value :: (Monad m) => Int -> RVarT m Double
the_p_value samples = do
data1 <- replicateM samples $ categoricalT test_weights
data2 <- replicateM samples $ categoricalT test_weights
return $ chi_square_p data1 data2 | 226 | the_p_value :: (Monad m) => Int -> RVarT m Double
the_p_value samples = do
data1 <- replicateM samples $ categoricalT test_weights
data2 <- replicateM samples $ categoricalT test_weights
return $ chi_square_p data1 data2 | 226 | the_p_value samples = do
data1 <- replicateM samples $ categoricalT test_weights
data2 <- replicateM samples $ categoricalT test_weights
return $ chi_square_p data1 data2 | 176 | false | true | 0 | 9 | 38 | 78 | 35 | 43 | null | null |
konn/gitolist | GitUtils.hs | bsd-2-clause | creatable perm = _creatable perm | 35 | creatable perm = _creatable perm | 35 | creatable perm = _creatable perm | 35 | false | false | 1 | 5 | 7 | 16 | 5 | 11 | null | null |
EarlDolphin/Learn-You-A-Haskell | ch2/lizt/Lizt.hs | bsd-3-clause | length' :: [a] -> Int
length' xs = length'' xs 0 where
length'' :: [a] -> Int -> Int
length'' (x:xs) returner = length'' xs (returner + 1)
length'' _ returner = returner
-- 6. null
-- checks if a list is empty. If it is, it returns True, otherwise it returns False. Use this function instead of xs == [] (if you have a list called xs) | 341 | length' :: [a] -> Int
length' xs = length'' xs 0 where
length'' :: [a] -> Int -> Int
length'' (x:xs) returner = length'' xs (returner + 1)
length'' _ returner = returner
-- 6. null
-- checks if a list is empty. If it is, it returns True, otherwise it returns False. Use this function instead of xs == [] (if you have a list called xs) | 341 | length' xs = length'' xs 0 where
length'' :: [a] -> Int -> Int
length'' (x:xs) returner = length'' xs (returner + 1)
length'' _ returner = returner
-- 6. null
-- checks if a list is empty. If it is, it returns True, otherwise it returns False. Use this function instead of xs == [] (if you have a list called xs) | 319 | false | true | 0 | 9 | 74 | 85 | 45 | 40 | null | null |
R-Morgan/dwmstatusH | src/DwmStatusH/SysFunctions.hs | gpl-3.0 | snatchTime :: IO String
snatchTime = do ct <- getClockTime
let timeStr = show ct
return timeStr | 128 | snatchTime :: IO String
snatchTime = do ct <- getClockTime
let timeStr = show ct
return timeStr | 128 | snatchTime = do ct <- getClockTime
let timeStr = show ct
return timeStr | 104 | false | true | 0 | 10 | 49 | 39 | 17 | 22 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_POST_COLOR_MATRIX_ALPHA_BIAS_SGI :: GLenum
gl_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB | 90 | gl_POST_COLOR_MATRIX_ALPHA_BIAS_SGI :: GLenum
gl_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB | 90 | gl_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB | 44 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
kRITZCREEK/dickminer | src/Dickmine/Parse.hs | bsd-3-clause | parseDateString :: String -> Maybe UTCTime
parseDateString ds = do
dateString <- parseWithPrefix "Date: " ds
parseTime defaultTimeLocale "%m/%d/%Y %I:%M:%S %p" dateString | 174 | parseDateString :: String -> Maybe UTCTime
parseDateString ds = do
dateString <- parseWithPrefix "Date: " ds
parseTime defaultTimeLocale "%m/%d/%Y %I:%M:%S %p" dateString | 174 | parseDateString ds = do
dateString <- parseWithPrefix "Date: " ds
parseTime defaultTimeLocale "%m/%d/%Y %I:%M:%S %p" dateString | 131 | false | true | 0 | 9 | 25 | 48 | 20 | 28 | null | null |
spinda/liquidhaskell | src/Language/Haskell/Liquid/Misc.hs | bsd-3-clause | getStdLibDir = (</> "std") <$> getDataDir | 47 | getStdLibDir = (</> "std") <$> getDataDir | 47 | getStdLibDir = (</> "std") <$> getDataDir | 47 | false | false | 0 | 6 | 11 | 14 | 8 | 6 | null | null |
ghc-android/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isTouchableMetaTyVar :: TcLevel -> TcTyVar -> Bool
isTouchableMetaTyVar ctxt_tclvl tv
= ASSERT2( isTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tv_tclvl }
-> ASSERT2( checkTcLevelInvariant ctxt_tclvl tv_tclvl,
ppr tv $$ ppr tv_tclvl $$ ppr ctxt_tclvl )
tv_tclvl `sameDepthAs` ctxt_tclvl
_ -> False | 377 | isTouchableMetaTyVar :: TcLevel -> TcTyVar -> Bool
isTouchableMetaTyVar ctxt_tclvl tv
= ASSERT2( isTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tv_tclvl }
-> ASSERT2( checkTcLevelInvariant ctxt_tclvl tv_tclvl,
ppr tv $$ ppr tv_tclvl $$ ppr ctxt_tclvl )
tv_tclvl `sameDepthAs` ctxt_tclvl
_ -> False | 377 | isTouchableMetaTyVar ctxt_tclvl tv
= ASSERT2( isTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tv_tclvl }
-> ASSERT2( checkTcLevelInvariant ctxt_tclvl tv_tclvl,
ppr tv $$ ppr tv_tclvl $$ ppr ctxt_tclvl )
tv_tclvl `sameDepthAs` ctxt_tclvl
_ -> False | 326 | false | true | 0 | 13 | 103 | 109 | 53 | 56 | null | null |
mainland/dph | icebox/examples/runbench.hs | bsd-3-clause | main
= do
args <- getArgs
benchsToRun <- selectBenchmarks benchmarks args
hw <- getHardwareSpec
putStrLn (dash "-- Data Parallel Haskell benchmarks ")
printf "** Host : %s\n" (uname hw)
printf "** Cores : %d\n" (ncores hw)
printf "** Threads/core : %d\n" (nthreads hw)
printf "** Runs/implementation: %d\n" noOfRuns
putStrLn dashAll
runBenchmarks hw benchsToRun
where
benchmarks = [ sumsq, dotp, smvm, quickhull ]
sumsq = BM { name = "SumSq"
, dir = "sumsq"
, dph = [ Imp { impName = "primitives"
, impCmd = "prim"
, impArgs = [ tenMillion ]
}
, Imp { impName = "vectorised"
, impCmd = "sumsq"
, impArgs = [ tenMillion ]
}
]
, seq = [ Imp { impName = "ref C"
, impCmd = "sumsq-c"
, impArgs = [ "%d", tenMillion ]
}
]
, par = [ {- no parallel reference implementation -} ]
}
dotp = BM { name = "DotP"
, dir = "dotp"
, dph = [ Imp { impName = "primitives"
, impCmd = "prim"
, impArgs = [ hundredMillion ]
}
, Imp { impName = "vectorised"
, impCmd = "dotp"
, impArgs = [ hundredMillion ]
}
]
, seq = [ {- no sequential reference implementation -} ]
, par = [ Imp { impName = "ref Haskell"
, impCmd = "DotP"
, impArgs = [ "%d +RTS -N%d -RTS", hundredMillion ]
}
, Imp { impName = "ref C"
, impCmd = "dotp-c"
, impArgs = [ "%d %d", hundredMillion ]
}
]
}
smvm = BM { name = "SMVM"
, dir = "smvm"
, dph = [ Imp { impName = "primitives"
, impCmd = "prim"
, impArgs = [ testmat ]
}
, Imp { impName = "vectorised"
, impCmd = "smvm"
, impArgs = [ testmat ]
}
]
, seq = [ Imp { impName = "ref C"
, impCmd = "smvm-c"
, impArgs = [ "%d", testmat ]
}
]
, par = [ {- no parallel reference implementation -} ]
}
where
testmat = "smvm" </> "test.mat"
quickhull = BM { name = "QuickHull"
, dir = "quickhull"
, dph = [ Imp { impName = "vectorised"
, impCmd = "quickhull"
, impArgs = [ oneMillion ]
}
]
, seq = [ Imp { impName = "ref Haskell"
, impCmd = "QuickHull"
, impArgs = [ "%d", oneMillion ]
}
]
, par = [ {- no parallel reference implementation -} ]
}
oneMillion = "1000000"
tenMillion = "10000000"
hundredMillion = "100000000" | 3,929 | main
= do
args <- getArgs
benchsToRun <- selectBenchmarks benchmarks args
hw <- getHardwareSpec
putStrLn (dash "-- Data Parallel Haskell benchmarks ")
printf "** Host : %s\n" (uname hw)
printf "** Cores : %d\n" (ncores hw)
printf "** Threads/core : %d\n" (nthreads hw)
printf "** Runs/implementation: %d\n" noOfRuns
putStrLn dashAll
runBenchmarks hw benchsToRun
where
benchmarks = [ sumsq, dotp, smvm, quickhull ]
sumsq = BM { name = "SumSq"
, dir = "sumsq"
, dph = [ Imp { impName = "primitives"
, impCmd = "prim"
, impArgs = [ tenMillion ]
}
, Imp { impName = "vectorised"
, impCmd = "sumsq"
, impArgs = [ tenMillion ]
}
]
, seq = [ Imp { impName = "ref C"
, impCmd = "sumsq-c"
, impArgs = [ "%d", tenMillion ]
}
]
, par = [ {- no parallel reference implementation -} ]
}
dotp = BM { name = "DotP"
, dir = "dotp"
, dph = [ Imp { impName = "primitives"
, impCmd = "prim"
, impArgs = [ hundredMillion ]
}
, Imp { impName = "vectorised"
, impCmd = "dotp"
, impArgs = [ hundredMillion ]
}
]
, seq = [ {- no sequential reference implementation -} ]
, par = [ Imp { impName = "ref Haskell"
, impCmd = "DotP"
, impArgs = [ "%d +RTS -N%d -RTS", hundredMillion ]
}
, Imp { impName = "ref C"
, impCmd = "dotp-c"
, impArgs = [ "%d %d", hundredMillion ]
}
]
}
smvm = BM { name = "SMVM"
, dir = "smvm"
, dph = [ Imp { impName = "primitives"
, impCmd = "prim"
, impArgs = [ testmat ]
}
, Imp { impName = "vectorised"
, impCmd = "smvm"
, impArgs = [ testmat ]
}
]
, seq = [ Imp { impName = "ref C"
, impCmd = "smvm-c"
, impArgs = [ "%d", testmat ]
}
]
, par = [ {- no parallel reference implementation -} ]
}
where
testmat = "smvm" </> "test.mat"
quickhull = BM { name = "QuickHull"
, dir = "quickhull"
, dph = [ Imp { impName = "vectorised"
, impCmd = "quickhull"
, impArgs = [ oneMillion ]
}
]
, seq = [ Imp { impName = "ref Haskell"
, impCmd = "QuickHull"
, impArgs = [ "%d", oneMillion ]
}
]
, par = [ {- no parallel reference implementation -} ]
}
oneMillion = "1000000"
tenMillion = "10000000"
hundredMillion = "100000000" | 3,929 | main
= do
args <- getArgs
benchsToRun <- selectBenchmarks benchmarks args
hw <- getHardwareSpec
putStrLn (dash "-- Data Parallel Haskell benchmarks ")
printf "** Host : %s\n" (uname hw)
printf "** Cores : %d\n" (ncores hw)
printf "** Threads/core : %d\n" (nthreads hw)
printf "** Runs/implementation: %d\n" noOfRuns
putStrLn dashAll
runBenchmarks hw benchsToRun
where
benchmarks = [ sumsq, dotp, smvm, quickhull ]
sumsq = BM { name = "SumSq"
, dir = "sumsq"
, dph = [ Imp { impName = "primitives"
, impCmd = "prim"
, impArgs = [ tenMillion ]
}
, Imp { impName = "vectorised"
, impCmd = "sumsq"
, impArgs = [ tenMillion ]
}
]
, seq = [ Imp { impName = "ref C"
, impCmd = "sumsq-c"
, impArgs = [ "%d", tenMillion ]
}
]
, par = [ {- no parallel reference implementation -} ]
}
dotp = BM { name = "DotP"
, dir = "dotp"
, dph = [ Imp { impName = "primitives"
, impCmd = "prim"
, impArgs = [ hundredMillion ]
}
, Imp { impName = "vectorised"
, impCmd = "dotp"
, impArgs = [ hundredMillion ]
}
]
, seq = [ {- no sequential reference implementation -} ]
, par = [ Imp { impName = "ref Haskell"
, impCmd = "DotP"
, impArgs = [ "%d +RTS -N%d -RTS", hundredMillion ]
}
, Imp { impName = "ref C"
, impCmd = "dotp-c"
, impArgs = [ "%d %d", hundredMillion ]
}
]
}
smvm = BM { name = "SMVM"
, dir = "smvm"
, dph = [ Imp { impName = "primitives"
, impCmd = "prim"
, impArgs = [ testmat ]
}
, Imp { impName = "vectorised"
, impCmd = "smvm"
, impArgs = [ testmat ]
}
]
, seq = [ Imp { impName = "ref C"
, impCmd = "smvm-c"
, impArgs = [ "%d", testmat ]
}
]
, par = [ {- no parallel reference implementation -} ]
}
where
testmat = "smvm" </> "test.mat"
quickhull = BM { name = "QuickHull"
, dir = "quickhull"
, dph = [ Imp { impName = "vectorised"
, impCmd = "quickhull"
, impArgs = [ oneMillion ]
}
]
, seq = [ Imp { impName = "ref Haskell"
, impCmd = "QuickHull"
, impArgs = [ "%d", oneMillion ]
}
]
, par = [ {- no parallel reference implementation -} ]
}
oneMillion = "1000000"
tenMillion = "10000000"
hundredMillion = "100000000" | 3,929 | false | false | 1 | 10 | 2,332 | 645 | 390 | 255 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 1121894 = 1845 | 34 | getValueFromProduct 1121894 = 1845 | 34 | getValueFromProduct 1121894 = 1845 | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
gcampax/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | -- | Retrieves the template of an unfolding if possible
-- maybeUnfoldingTemplate is used mainly wnen specialising, and we do
-- want to specialise DFuns, so it's important to return a template
-- for DFunUnfoldings
maybeUnfoldingTemplate :: Unfolding -> Maybe CoreExpr
maybeUnfoldingTemplate (CoreUnfolding { uf_tmpl = expr })
= Just expr | 341 | maybeUnfoldingTemplate :: Unfolding -> Maybe CoreExpr
maybeUnfoldingTemplate (CoreUnfolding { uf_tmpl = expr })
= Just expr | 125 | maybeUnfoldingTemplate (CoreUnfolding { uf_tmpl = expr })
= Just expr | 71 | true | true | 0 | 9 | 52 | 40 | 22 | 18 | null | null |
tolysz/prepare-ghcjs | spec-lts8/aeson/tests/Options.hs | bsd-3-clause | optsOmitNothingFields :: Options
optsOmitNothingFields = optsDefault
{ omitNothingFields = True
} | 145 | optsOmitNothingFields :: Options
optsOmitNothingFields = optsDefault
{ omitNothingFields = True
} | 145 | optsOmitNothingFields = optsDefault
{ omitNothingFields = True
} | 112 | false | true | 0 | 6 | 58 | 19 | 11 | 8 | null | null |
tangboyun/miranda | src/writeSheet.hs | gpl-3.0 | fOrignFile = "/home/tangboyun/miRNADB/microarray_033010_human_lncRNA_V2_transcript.fa" | 86 | fOrignFile = "/home/tangboyun/miRNADB/microarray_033010_human_lncRNA_V2_transcript.fa" | 86 | fOrignFile = "/home/tangboyun/miRNADB/microarray_033010_human_lncRNA_V2_transcript.fa" | 86 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/MoC/SY/Lib.hs | bsd-3-clause | moore34 ns od i = MoC.moore34 ns od (unit i) | 44 | moore34 ns od i = MoC.moore34 ns od (unit i) | 44 | moore34 ns od i = MoC.moore34 ns od (unit i) | 44 | false | false | 1 | 7 | 9 | 33 | 13 | 20 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_INVALID_POSITION :: Int
wxSTC_INVALID_POSITION = (-1) | 59 | wxSTC_INVALID_POSITION :: Int
wxSTC_INVALID_POSITION = (-1) | 59 | wxSTC_INVALID_POSITION = (-1) | 29 | false | true | 0 | 6 | 5 | 16 | 9 | 7 | null | null |
ekmett/ghc | compiler/nativeGen/PIC.hs | bsd-3-clause | howToAccessLabel
:: DynFlags -> Arch -> OS -> Module -> ReferenceKind -> CLabel -> LabelAccessStyle
-- Windows
-- In Windows speak, a "module" is a set of objects linked into the
-- same Portable Exectuable (PE) file. (both .exe and .dll files are PEs).
--
-- If we're compiling a multi-module program then symbols from other modules
-- are accessed by a symbol pointer named __imp_SYMBOL. At runtime we have the
-- following.
--
-- (in the local module)
-- __imp_SYMBOL: addr of SYMBOL
--
-- (in the other module)
-- SYMBOL: the real function / data.
--
-- To access the function at SYMBOL from our local module, we just need to
-- dereference the local __imp_SYMBOL.
--
-- If Opt_Static is set then we assume that all our code will be linked
-- into the same .exe file. In this case we always access symbols directly,
-- and never use __imp_SYMBOL.
--
howToAccessLabel dflags _ OSMinGW32 this_mod _ lbl
-- Assume all symbols will be in the same PE, so just access them directly.
| gopt Opt_Static dflags
= AccessDirectly
-- If the target symbol is in another PE we need to access it via the
-- appropriate __imp_SYMBOL pointer.
| labelDynamic dflags (thisPackage dflags) this_mod lbl
= AccessViaSymbolPtr
-- Target symbol is in the same PE as the caller, so just access it directly.
| otherwise
= AccessDirectly | 1,423 | howToAccessLabel
:: DynFlags -> Arch -> OS -> Module -> ReferenceKind -> CLabel -> LabelAccessStyle
howToAccessLabel dflags _ OSMinGW32 this_mod _ lbl
-- Assume all symbols will be in the same PE, so just access them directly.
| gopt Opt_Static dflags
= AccessDirectly
-- If the target symbol is in another PE we need to access it via the
-- appropriate __imp_SYMBOL pointer.
| labelDynamic dflags (thisPackage dflags) this_mod lbl
= AccessViaSymbolPtr
-- Target symbol is in the same PE as the caller, so just access it directly.
| otherwise
= AccessDirectly | 655 | howToAccessLabel dflags _ OSMinGW32 this_mod _ lbl
-- Assume all symbols will be in the same PE, so just access them directly.
| gopt Opt_Static dflags
= AccessDirectly
-- If the target symbol is in another PE we need to access it via the
-- appropriate __imp_SYMBOL pointer.
| labelDynamic dflags (thisPackage dflags) this_mod lbl
= AccessViaSymbolPtr
-- Target symbol is in the same PE as the caller, so just access it directly.
| otherwise
= AccessDirectly | 547 | true | true | 0 | 10 | 340 | 125 | 71 | 54 | null | null |
vbalalla/financial_contract_language | DSL.hs | mit | --printCal :: [String] -> x
--printCal ([]) = "\n"
--printCal (x:xs) = x ++ "\n" ++ (printCal xs)
calCond :: (Integer -> Bool) -> Integer -> Integer
calCond o i = if (o i) then -1 else i | 188 | calCond :: (Integer -> Bool) -> Integer -> Integer
calCond o i = if (o i) then -1 else i | 88 | calCond o i = if (o i) then -1 else i | 37 | true | true | 0 | 7 | 39 | 55 | 29 | 26 | null | null |
Philonous/pontarius-service | source/Transactions.hs | agpl-3.0 | onXmppStateChange _ = return () | 31 | onXmppStateChange _ = return () | 31 | onXmppStateChange _ = return () | 31 | false | false | 0 | 6 | 4 | 14 | 6 | 8 | null | null |
conal/ghc-mod | GHCMod.hs | bsd-3-clause | ----------------------------------------------------------------
defaultOptions :: Options
defaultOptions = Options {
convert = toPlain
, hlintOpts = []
, ghcOpts = []
, operators = False
} | 202 | defaultOptions :: Options
defaultOptions = Options {
convert = toPlain
, hlintOpts = []
, ghcOpts = []
, operators = False
} | 136 | defaultOptions = Options {
convert = toPlain
, hlintOpts = []
, ghcOpts = []
, operators = False
} | 110 | true | true | 0 | 8 | 36 | 49 | 27 | 22 | null | null |
rodrigogribeiro/mptc | test/Cases/DataConsInfoTest.hs | bsd-3-clause | l +-> r = TyFun l r | 19 | l +-> r = TyFun l r | 19 | l +-> r = TyFun l r | 19 | false | false | 3 | 5 | 6 | 22 | 8 | 14 | null | null |
Raveline/1HAD | src/HAD.hs | mit | checkFile :: String -> Int -> Int -> Int -> IO ()
checkFile fn y m d = let
modules2module = intercalate "." . (++ [fn])
in checkModule . modules2module $ modules y m d | 171 | checkFile :: String -> Int -> Int -> Int -> IO ()
checkFile fn y m d = let
modules2module = intercalate "." . (++ [fn])
in checkModule . modules2module $ modules y m d | 171 | checkFile fn y m d = let
modules2module = intercalate "." . (++ [fn])
in checkModule . modules2module $ modules y m d | 121 | false | true | 0 | 11 | 38 | 81 | 40 | 41 | null | null |
snoyberg/ghc | compiler/basicTypes/Name.hs | bsd-3-clause | pprExternal :: PprStyle -> Unique -> Module -> OccName -> Bool -> BuiltInSyntax -> SDoc
pprExternal sty uniq mod occ is_wired is_builtin
| codeStyle sty = ppr mod <> char '_' <> ppr_z_occ_name occ
-- In code style, always qualify
-- ToDo: maybe we could print all wired-in things unqualified
-- in code style, to reduce symbol table bloat?
| debugStyle sty = pp_mod <> ppr_occ_name occ
<> braces (hsep [if is_wired then text "(w)" else empty,
pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| BuiltInSyntax <- is_builtin = ppr_occ_name occ -- Never qualify builtin syntax
| otherwise =
if isHoleModule mod
then case qualName sty mod occ of
NameUnqual -> ppr_occ_name occ
_ -> braces (ppr (moduleName mod) <> dot <> ppr_occ_name occ)
else pprModulePrefix sty mod occ <> ppr_occ_name occ
where
pp_mod = sdocWithDynFlags $ \dflags ->
if gopt Opt_SuppressModulePrefixes dflags
then empty
else ppr mod <> dot | 1,181 | pprExternal :: PprStyle -> Unique -> Module -> OccName -> Bool -> BuiltInSyntax -> SDoc
pprExternal sty uniq mod occ is_wired is_builtin
| codeStyle sty = ppr mod <> char '_' <> ppr_z_occ_name occ
-- In code style, always qualify
-- ToDo: maybe we could print all wired-in things unqualified
-- in code style, to reduce symbol table bloat?
| debugStyle sty = pp_mod <> ppr_occ_name occ
<> braces (hsep [if is_wired then text "(w)" else empty,
pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| BuiltInSyntax <- is_builtin = ppr_occ_name occ -- Never qualify builtin syntax
| otherwise =
if isHoleModule mod
then case qualName sty mod occ of
NameUnqual -> ppr_occ_name occ
_ -> braces (ppr (moduleName mod) <> dot <> ppr_occ_name occ)
else pprModulePrefix sty mod occ <> ppr_occ_name occ
where
pp_mod = sdocWithDynFlags $ \dflags ->
if gopt Opt_SuppressModulePrefixes dflags
then empty
else ppr mod <> dot | 1,181 | pprExternal sty uniq mod occ is_wired is_builtin
| codeStyle sty = ppr mod <> char '_' <> ppr_z_occ_name occ
-- In code style, always qualify
-- ToDo: maybe we could print all wired-in things unqualified
-- in code style, to reduce symbol table bloat?
| debugStyle sty = pp_mod <> ppr_occ_name occ
<> braces (hsep [if is_wired then text "(w)" else empty,
pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| BuiltInSyntax <- is_builtin = ppr_occ_name occ -- Never qualify builtin syntax
| otherwise =
if isHoleModule mod
then case qualName sty mod occ of
NameUnqual -> ppr_occ_name occ
_ -> braces (ppr (moduleName mod) <> dot <> ppr_occ_name occ)
else pprModulePrefix sty mod occ <> ppr_occ_name occ
where
pp_mod = sdocWithDynFlags $ \dflags ->
if gopt Opt_SuppressModulePrefixes dflags
then empty
else ppr mod <> dot | 1,093 | false | true | 2 | 15 | 418 | 280 | 136 | 144 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Time.hs | gpl-3.0 | -- | Similar to 'fmap' but time is relative to the cycle (i.e. the
-- sam of the start of the arc)
mapCycle :: (Time -> Time) -> Arc -> Arc
mapCycle f (Arc s e) = Arc (sam' + f (s - sam')) (sam' + f (e - sam'))
where sam' = sam s
-- | @isIn a t@ is @True@ if @t@ is inside
-- the arc represented by @a@. | 313 | mapCycle :: (Time -> Time) -> Arc -> Arc
mapCycle f (Arc s e) = Arc (sam' + f (s - sam')) (sam' + f (e - sam'))
where sam' = sam s
-- | @isIn a t@ is @True@ if @t@ is inside
-- the arc represented by @a@. | 214 | mapCycle f (Arc s e) = Arc (sam' + f (s - sam')) (sam' + f (e - sam'))
where sam' = sam s
-- | @isIn a t@ is @True@ if @t@ is inside
-- the arc represented by @a@. | 173 | true | true | 0 | 10 | 81 | 98 | 50 | 48 | null | null |
plaprade/haskoin | haskoin-node/src/Network/Haskoin/Node/HeaderTree.hs | unlicense | getChainLowest :: MonadIO m => NodeBlock -> SqlPersistT m (Maybe NodeBlock)
getChainLowest nb = fmap (listToMaybe . map entityVal) $
select $ from $ \t -> do
where_ $ t ^. NodeBlockChain ==. val (nodeBlockChain nb)
orderBy [ asc $ t ^. NodeBlockHeight ]
limit 1
return t
-- | Get node height and chain common to both given. | 360 | getChainLowest :: MonadIO m => NodeBlock -> SqlPersistT m (Maybe NodeBlock)
getChainLowest nb = fmap (listToMaybe . map entityVal) $
select $ from $ \t -> do
where_ $ t ^. NodeBlockChain ==. val (nodeBlockChain nb)
orderBy [ asc $ t ^. NodeBlockHeight ]
limit 1
return t
-- | Get node height and chain common to both given. | 360 | getChainLowest nb = fmap (listToMaybe . map entityVal) $
select $ from $ \t -> do
where_ $ t ^. NodeBlockChain ==. val (nodeBlockChain nb)
orderBy [ asc $ t ^. NodeBlockHeight ]
limit 1
return t
-- | Get node height and chain common to both given. | 284 | false | true | 4 | 12 | 95 | 127 | 57 | 70 | null | null |
pascalpoizat/veca-haskell | src/Veca/Model.hs | apache-2.0 | isInfiniteInternalLabel :: VLabel -> Bool
isInfiniteInternalLabel (InternalLabel (TimeValue 0) InfiniteValue) = True | 116 | isInfiniteInternalLabel :: VLabel -> Bool
isInfiniteInternalLabel (InternalLabel (TimeValue 0) InfiniteValue) = True | 116 | isInfiniteInternalLabel (InternalLabel (TimeValue 0) InfiniteValue) = True | 74 | false | true | 0 | 9 | 11 | 32 | 16 | 16 | null | null |
phischu/fragnix | tests/packages/scotty/Network.HTTP.Types.Status.hs | bsd-3-clause | -- | Successful class
statusIsSuccessful :: Status -> Bool
statusIsSuccessful (Status {statusCode=code}) = code >= 200 && code < 300 | 132 | statusIsSuccessful :: Status -> Bool
statusIsSuccessful (Status {statusCode=code}) = code >= 200 && code < 300 | 110 | statusIsSuccessful (Status {statusCode=code}) = code >= 200 && code < 300 | 73 | true | true | 0 | 9 | 19 | 43 | 23 | 20 | null | null |
alanz/hroq | src/Data/Concurrent/Queue/Roq/App.hs | bsd-3-clause | -- ---------------------------------------------------------------------
{-
start(_, _) ->
case mnesia:table_info(schema, storage_type) of
ram_copies ->
?info("Changing MNESIA schema from ram_copies to disc_copies..."),
{atomic, ok} = mnesia:change_table_copy_type(schema, node(), disc_copies);
disc_copies ->
ok
end,
WaitForMnesia = get_wait_for_mnesia(),
if (WaitForMnesia == true) ->
AllTables = mnesia:system_info(tables),
?info("Wait tables ["++integer_to_list(length(AllTables))++"] mnesia..."),
ok = mnesia:wait_for_tables(AllTables, infinity),
?info("Wait tables ["++integer_to_list(length(AllTables))++"] mnesia... Done.");
true ->
?info("Not waiting for MNESIA to load all tables..."),
ok
end,
?info("Creating consumer local storage table..."),
ok = create_consumer_local_storage_table(),
?info("Creating queue meta table..."),
ok = create_queue_meta_table(),
AlarmFun = get_callback(alarms_callback),
QWFun = get_callback(queue_watch_callback),
eroq_sup:start_link(AlarmFun, QWFun).
stop(_) ->
ok.
-}
start_app :: Process ()
start_app = do
logm "HroqApp.start"
{-
case mnesia:table_info(schema, storage_type) of
ram_copies ->
?info("Changing MNESIA schema from ram_copies to disc_copies..."),
{atomic, ok} = mnesia:change_table_copy_type(schema, node(), disc_copies);
disc_copies ->
ok
end,
WaitForMnesia = get_wait_for_mnesia(),
if (WaitForMnesia == true) ->
AllTables = mnesia:system_info(tables),
?info("Wait tables ["++integer_to_list(length(AllTables))++"] mnesia..."),
ok = mnesia:wait_for_tables(AllTables, infinity),
?info("Wait tables ["++integer_to_list(length(AllTables))++"] mnesia... Done.");
true ->
?info("Not waiting for MNESIA to load all tables..."),
ok
end,
-}
logm ("Creating consumer local storage table...")
create_consumer_local_storage_table
logm ("Creating queue meta table...")
create_queue_meta_table
-- AlarmFun = get_callback(alarms_callback),
let alarmFun = get_callback "alarms_callback"
-- QWFun = get_callback(queue_watch_callback),
let qwFun = queueWatchNoOpCallbackClosure
-- let qwFun = get_callback "queue_watch_callback"
-- eroq_sup:start_link(AlarmFun, QWFun).
logm $ "HroqApp:launching supervisor"
supPid <- hroq_start_link alarmFun qwFun
-- supPid <- hroq_start_link undefined undefined
logm $ "HroqApp:launching supervisor done"
return ()
-- ---------------------------------------------------------------------
{-
create_queue_meta_table() ->
TableName = eroq_queue_meta_table,
case mnesia:create_table(TableName, [{attributes, record_info(fields, eroq_queue_meta)}, {type, set}, {disc_copies, [node()]}, {record_name, eroq_queue_meta}]) of
{atomic, ok} ->
ok;
{aborted,{already_exists,TableName}} ->
case mnesia:table_info(TableName, storage_type) of
disc_copies ->
ok;
_ ->
{atomic, ok} = mnesia:change_table_copy_type(TableName, node(), disc_copies),
ok
end
end.
-} | 3,249 | start_app :: Process ()
start_app = do
logm "HroqApp.start"
{-
case mnesia:table_info(schema, storage_type) of
ram_copies ->
?info("Changing MNESIA schema from ram_copies to disc_copies..."),
{atomic, ok} = mnesia:change_table_copy_type(schema, node(), disc_copies);
disc_copies ->
ok
end,
WaitForMnesia = get_wait_for_mnesia(),
if (WaitForMnesia == true) ->
AllTables = mnesia:system_info(tables),
?info("Wait tables ["++integer_to_list(length(AllTables))++"] mnesia..."),
ok = mnesia:wait_for_tables(AllTables, infinity),
?info("Wait tables ["++integer_to_list(length(AllTables))++"] mnesia... Done.");
true ->
?info("Not waiting for MNESIA to load all tables..."),
ok
end,
-}
logm ("Creating consumer local storage table...")
create_consumer_local_storage_table
logm ("Creating queue meta table...")
create_queue_meta_table
-- AlarmFun = get_callback(alarms_callback),
let alarmFun = get_callback "alarms_callback"
-- QWFun = get_callback(queue_watch_callback),
let qwFun = queueWatchNoOpCallbackClosure
-- let qwFun = get_callback "queue_watch_callback"
-- eroq_sup:start_link(AlarmFun, QWFun).
logm $ "HroqApp:launching supervisor"
supPid <- hroq_start_link alarmFun qwFun
-- supPid <- hroq_start_link undefined undefined
logm $ "HroqApp:launching supervisor done"
return ()
-- ---------------------------------------------------------------------
{-
create_queue_meta_table() ->
TableName = eroq_queue_meta_table,
case mnesia:create_table(TableName, [{attributes, record_info(fields, eroq_queue_meta)}, {type, set}, {disc_copies, [node()]}, {record_name, eroq_queue_meta}]) of
{atomic, ok} ->
ok;
{aborted,{already_exists,TableName}} ->
case mnesia:table_info(TableName, storage_type) of
disc_copies ->
ok;
_ ->
{atomic, ok} = mnesia:change_table_copy_type(TableName, node(), disc_copies),
ok
end
end.
-} | 2,089 | start_app = do
logm "HroqApp.start"
{-
case mnesia:table_info(schema, storage_type) of
ram_copies ->
?info("Changing MNESIA schema from ram_copies to disc_copies..."),
{atomic, ok} = mnesia:change_table_copy_type(schema, node(), disc_copies);
disc_copies ->
ok
end,
WaitForMnesia = get_wait_for_mnesia(),
if (WaitForMnesia == true) ->
AllTables = mnesia:system_info(tables),
?info("Wait tables ["++integer_to_list(length(AllTables))++"] mnesia..."),
ok = mnesia:wait_for_tables(AllTables, infinity),
?info("Wait tables ["++integer_to_list(length(AllTables))++"] mnesia... Done.");
true ->
?info("Not waiting for MNESIA to load all tables..."),
ok
end,
-}
logm ("Creating consumer local storage table...")
create_consumer_local_storage_table
logm ("Creating queue meta table...")
create_queue_meta_table
-- AlarmFun = get_callback(alarms_callback),
let alarmFun = get_callback "alarms_callback"
-- QWFun = get_callback(queue_watch_callback),
let qwFun = queueWatchNoOpCallbackClosure
-- let qwFun = get_callback "queue_watch_callback"
-- eroq_sup:start_link(AlarmFun, QWFun).
logm $ "HroqApp:launching supervisor"
supPid <- hroq_start_link alarmFun qwFun
-- supPid <- hroq_start_link undefined undefined
logm $ "HroqApp:launching supervisor done"
return ()
-- ---------------------------------------------------------------------
{-
create_queue_meta_table() ->
TableName = eroq_queue_meta_table,
case mnesia:create_table(TableName, [{attributes, record_info(fields, eroq_queue_meta)}, {type, set}, {disc_copies, [node()]}, {record_name, eroq_queue_meta}]) of
{atomic, ok} ->
ok;
{aborted,{already_exists,TableName}} ->
case mnesia:table_info(TableName, storage_type) of
disc_copies ->
ok;
_ ->
{atomic, ok} = mnesia:change_table_copy_type(TableName, node(), disc_copies),
ok
end
end.
-} | 2,065 | true | true | 0 | 10 | 694 | 111 | 53 | 58 | null | null |
bgamari/text | src/Data/Text/Lazy.hs | bsd-2-clause | -- | /O(n)/ A variant of 'foldr' that has no starting value argument,
-- and thus must be applied to a non-empty 'Text'. Subject to
-- fusion.
foldr1 :: (Char -> Char -> Char) -> Text -> Char
foldr1 f t = S.foldr1 f (stream t) | 227 | foldr1 :: (Char -> Char -> Char) -> Text -> Char
foldr1 f t = S.foldr1 f (stream t) | 83 | foldr1 f t = S.foldr1 f (stream t) | 34 | true | true | 0 | 8 | 46 | 51 | 27 | 24 | null | null |
haskell-distributed/distributed-process-client-server | src/Control/Distributed/Process/ManagedProcess/Server/Gen.hs | bsd-3-clause | -- | The server loop will execute against the supplied 'ProcessDefinition', allowing
-- the process to change its behaviour (in terms of message handlers, exit handling,
-- termination, unhandled message policy, etc)
become :: forall s . ProcessDefinition s -> GenProcess s (ProcessAction s)
become def = processState >>= \st -> return $ ProcessBecome def st | 358 | become :: forall s . ProcessDefinition s -> GenProcess s (ProcessAction s)
become def = processState >>= \st -> return $ ProcessBecome def st | 141 | become def = processState >>= \st -> return $ ProcessBecome def st | 66 | true | true | 0 | 9 | 55 | 61 | 31 | 30 | null | null |
jaburns/hask-collapse | BitString.hs | mit | packUnpack bits = bitsUnpack pad bytes == bits
where (pad,bytes) = bitsPack bits | 82 | packUnpack bits = bitsUnpack pad bytes == bits
where (pad,bytes) = bitsPack bits | 82 | packUnpack bits = bitsUnpack pad bytes == bits
where (pad,bytes) = bitsPack bits | 82 | false | false | 0 | 6 | 14 | 35 | 17 | 18 | null | null |
thoughtpolice/hs-asai | src/Control/Indexed/Monad.hs | mit | -- | This is @'Control.Monad.liftM2'@ for indexed @'Monad'@s.
liftIxM2 :: IxMonad m => (a -> b -> c) -> m t u a -> m s t b -> m s u c
liftIxM2 f e1 e2 = e1 !>>= \x -> e2 !>>= \y -> returnI (f x y) | 196 | liftIxM2 :: IxMonad m => (a -> b -> c) -> m t u a -> m s t b -> m s u c
liftIxM2 f e1 e2 = e1 !>>= \x -> e2 !>>= \y -> returnI (f x y) | 134 | liftIxM2 f e1 e2 = e1 !>>= \x -> e2 !>>= \y -> returnI (f x y) | 62 | true | true | 0 | 11 | 49 | 99 | 49 | 50 | null | null |
agentm/project-m36 | src/lib/ProjectM36/IsomorphicSchema.hs | unlicense | isomorphInRelVarNames :: SchemaIsomorph -> [RelVarName]
isomorphInRelVarNames (IsoRestrict rv _ _) = [rv] | 105 | isomorphInRelVarNames :: SchemaIsomorph -> [RelVarName]
isomorphInRelVarNames (IsoRestrict rv _ _) = [rv] | 105 | isomorphInRelVarNames (IsoRestrict rv _ _) = [rv] | 49 | false | true | 0 | 6 | 11 | 38 | 19 | 19 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | happyReduction_191 _ _ _ = notHappyAtAll | 41 | happyReduction_191 _ _ _ = notHappyAtAll | 41 | happyReduction_191 _ _ _ = notHappyAtAll | 41 | false | false | 0 | 5 | 6 | 13 | 6 | 7 | null | null |
owickstrom/GigSpider | src/GigSpider/Search.hs | mit | orEmpty :: Maybe String -> String
orEmpty = flip orElse "" | 58 | orEmpty :: Maybe String -> String
orEmpty = flip orElse "" | 58 | orEmpty = flip orElse "" | 24 | false | true | 0 | 7 | 10 | 31 | 12 | 19 | null | null |
EduardoGR/Understanding-Monads | src/Monad/While.hs | gpl-3.0 | initState _ = 0 | 18 | initState _ = 0 | 18 | initState _ = 0 | 18 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
Garriot/snaplet-mongoDB | src/Snap/Snaplet/MongoDB/Template.hs | bsd-3-clause | dropPrefix :: String -> String
dropPrefix = reverse . takeWhile (/= '.') . reverse | 82 | dropPrefix :: String -> String
dropPrefix = reverse . takeWhile (/= '.') . reverse | 82 | dropPrefix = reverse . takeWhile (/= '.') . reverse | 51 | false | true | 0 | 8 | 13 | 30 | 16 | 14 | null | null |
lifengsun/haskell-exercise | scheme/05/listparser.hs | gpl-3.0 | unpackStr notString = throwError $ TypeMismatch "string" notString | 66 | unpackStr notString = throwError $ TypeMismatch "string" notString | 66 | unpackStr notString = throwError $ TypeMismatch "string" notString | 66 | false | false | 0 | 6 | 7 | 18 | 8 | 10 | null | null |
isomorphism/webgl | src/Graphics/Rendering/WebGL/Constants.hs | mit | gl_RED_INTEGER :: GLenum
gl_RED_INTEGER = 0x8D94 | 48 | gl_RED_INTEGER :: GLenum
gl_RED_INTEGER = 0x8D94 | 48 | gl_RED_INTEGER = 0x8D94 | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
jecisc/TP_PF_L3 | PF-TP5/src/Main.hs | mit | nombreP :: Parser Litteral
nombreP = do num <- unOuPlus (carCond estChiffre)
espacesP
return (Entier (read num))
-- Question 10 | 155 | nombreP :: Parser Litteral
nombreP = do num <- unOuPlus (carCond estChiffre)
espacesP
return (Entier (read num))
-- Question 10 | 155 | nombreP = do num <- unOuPlus (carCond estChiffre)
espacesP
return (Entier (read num))
-- Question 10 | 128 | false | true | 0 | 12 | 47 | 58 | 25 | 33 | null | null |
beni55/haste-compiler | libraries/ghc-7.10/base/GHC/Arr.hs | bsd-3-clause | boundsSTArray :: STArray s i e -> (i,i)
boundsSTArray (STArray l u _ _) = (l,u) | 79 | boundsSTArray :: STArray s i e -> (i,i)
boundsSTArray (STArray l u _ _) = (l,u) | 79 | boundsSTArray (STArray l u _ _) = (l,u) | 39 | false | true | 0 | 9 | 15 | 55 | 27 | 28 | null | null |
ambiata/jetski | src/Jetski/Foreign/Return.hs | bsd-3-clause | retDouble :: Return Double
retDouble =
storableReturn ffi_type_double | 71 | retDouble :: Return Double
retDouble =
storableReturn ffi_type_double | 71 | retDouble =
storableReturn ffi_type_double | 44 | false | true | 0 | 5 | 9 | 17 | 8 | 9 | null | null |
lubomir/dot-race | fay-shared/SharedTypes.hs | bsd-3-clause | tshowI :: Int -> Text
tshowI = ffi "'' + %1" | 44 | tshowI :: Int -> Text
tshowI = ffi "'' + %1" | 44 | tshowI = ffi "'' + %1" | 22 | false | true | 0 | 7 | 10 | 25 | 10 | 15 | null | null |
deckool/my-hs-github | samples/Issues/ShowRepoIssues.hs | bsd-3-clause | formatIssue issue =
(Github.githubOwnerLogin $ Github.issueUser issue) ++
" opened this issue " ++
(show $ Github.fromGithubDate $ Github.issueCreatedAt issue) ++ "\n" ++
(Github.issueState issue) ++ " with " ++
(show $ Github.issueComments issue) ++ " comments" ++ "\n\n" ++
(Github.issueTitle issue) | 323 | formatIssue issue =
(Github.githubOwnerLogin $ Github.issueUser issue) ++
" opened this issue " ++
(show $ Github.fromGithubDate $ Github.issueCreatedAt issue) ++ "\n" ++
(Github.issueState issue) ++ " with " ++
(show $ Github.issueComments issue) ++ " comments" ++ "\n\n" ++
(Github.issueTitle issue) | 323 | formatIssue issue =
(Github.githubOwnerLogin $ Github.issueUser issue) ++
" opened this issue " ++
(show $ Github.fromGithubDate $ Github.issueCreatedAt issue) ++ "\n" ++
(Github.issueState issue) ++ " with " ++
(show $ Github.issueComments issue) ++ " comments" ++ "\n\n" ++
(Github.issueTitle issue) | 323 | false | false | 0 | 17 | 63 | 105 | 52 | 53 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.