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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ambiata/mafia | src/Mafia/Submodule.hs | bsd-3-clause | addSandboxSource :: Directory -> EitherT SubmoduleError IO ()
addSandboxSource dir = do
rel <- fromMaybe dir <$> makeRelativeToCurrentDirectory dir
liftIO (T.hPutStrLn stderr ("Sandbox: Adding " <> rel))
firstT SubmoduleCabalError $ sandbox_ "add-source" [dir] | 266 | addSandboxSource :: Directory -> EitherT SubmoduleError IO ()
addSandboxSource dir = do
rel <- fromMaybe dir <$> makeRelativeToCurrentDirectory dir
liftIO (T.hPutStrLn stderr ("Sandbox: Adding " <> rel))
firstT SubmoduleCabalError $ sandbox_ "add-source" [dir] | 266 | addSandboxSource dir = do
rel <- fromMaybe dir <$> makeRelativeToCurrentDirectory dir
liftIO (T.hPutStrLn stderr ("Sandbox: Adding " <> rel))
firstT SubmoduleCabalError $ sandbox_ "add-source" [dir] | 204 | false | true | 0 | 11 | 38 | 85 | 39 | 46 | null | null |
AlephAlpha/Samau | OldSamau/Eval.hs | gpl-2.0 | -- SmOperator '@'
smRoll (x1:x2:x3:s) = x3:x1:x2:s | 50 | smRoll (x1:x2:x3:s) = x3:x1:x2:s | 32 | smRoll (x1:x2:x3:s) = x3:x1:x2:s | 32 | true | false | 0 | 9 | 6 | 37 | 19 | 18 | null | null |
danstiner/hfmt | app/Main.hs | mit | main :: IO ()
main = do
options <- execParser Options.parser
result <- run options
exitWith $ exitCode (optAction options) result | 135 | main :: IO ()
main = do
options <- execParser Options.parser
result <- run options
exitWith $ exitCode (optAction options) result | 135 | main = do
options <- execParser Options.parser
result <- run options
exitWith $ exitCode (optAction options) result | 121 | false | true | 0 | 11 | 26 | 62 | 26 | 36 | null | null |
inchingforward/elm-lang.org | src/backend/Init/Helpers.hs | bsd-3-clause | makeForReal :: FilePath -> FilePath -> IO ()
makeForReal input output =
do compilerResult <-
runExceptT $
Utils.run "elm-make" [ "--yes", input, "--output=" ++ output ]
case compilerResult of
Left msg ->
do putStrLn (" problem compiling " ++ input ++ "\n")
hP... | 408 | makeForReal :: FilePath -> FilePath -> IO ()
makeForReal input output =
do compilerResult <-
runExceptT $
Utils.run "elm-make" [ "--yes", input, "--output=" ++ output ]
case compilerResult of
Left msg ->
do putStrLn (" problem compiling " ++ input ++ "\n")
hP... | 408 | makeForReal input output =
do compilerResult <-
runExceptT $
Utils.run "elm-make" [ "--yes", input, "--output=" ++ output ]
case compilerResult of
Left msg ->
do putStrLn (" problem compiling " ++ input ++ "\n")
hPutStrLn stderr msg
exitFailure
... | 363 | false | true | 0 | 15 | 146 | 121 | 56 | 65 | null | null |
karamellpelle/grid | source/Game/Values/Fancy.hs | gpl-3.0 | -- | (relative to Scene hth)
valueTextFontAY :: Float
valueTextFontAY =
0.4 | 79 | valueTextFontAY :: Float
valueTextFontAY =
0.4 | 50 | valueTextFontAY =
0.4 | 25 | true | true | 0 | 4 | 15 | 12 | 7 | 5 | null | null |
spl/emgm | src/Generics/EMGM/Data/Maybe.hs | bsd-3-clause | conNothing :: ConDescr
conNothing = ConDescr "Nothing" 0 False Prefix | 69 | conNothing :: ConDescr
conNothing = ConDescr "Nothing" 0 False Prefix | 69 | conNothing = ConDescr "Nothing" 0 False Prefix | 46 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
andyarvanitis/Idris-dev | src/Idris/IdeSlave.hs | bsd-3-clause | sexpToCommand (SexpList [SymbolAtom "error-string", StringAtom encoded]) = Just . ErrString . decodeErr $ encoded | 128 | sexpToCommand (SexpList [SymbolAtom "error-string", StringAtom encoded]) = Just . ErrString . decodeErr $ encoded | 128 | sexpToCommand (SexpList [SymbolAtom "error-string", StringAtom encoded]) = Just . ErrString . decodeErr $ encoded | 128 | false | false | 0 | 9 | 28 | 39 | 19 | 20 | null | null |
josefs/autosar | oldARSim/Main2.hs | bsd-3-clause | r1 re op pe = do Ok x <- rte_read re; Ok y <- rte_call op x; rte_write pe y; return () | 90 | r1 re op pe = do Ok x <- rte_read re; Ok y <- rte_call op x; rte_write pe y; return () | 90 | r1 re op pe = do Ok x <- rte_read re; Ok y <- rte_call op x; rte_write pe y; return () | 90 | false | false | 0 | 8 | 25 | 60 | 26 | 34 | null | null |
haskoin/secp256k1-haskell | src/Crypto/Secp256k1.hs | unlicense | exportSig :: Sig -> ByteString
exportSig (Sig in_sig) = unsafePerformIO $
unsafeUseByteString in_sig $ \(in_ptr, _) ->
alloca $ \out_len ->
allocaBytes 72 $ \out_ptr -> do
poke out_len 72
ret <- ecdsaSignatureSerializeDer ctx out_ptr out_len in_ptr
unless (isSuccess ret) $ error "could not seria... | 481 | exportSig :: Sig -> ByteString
exportSig (Sig in_sig) = unsafePerformIO $
unsafeUseByteString in_sig $ \(in_ptr, _) ->
alloca $ \out_len ->
allocaBytes 72 $ \out_ptr -> do
poke out_len 72
ret <- ecdsaSignatureSerializeDer ctx out_ptr out_len in_ptr
unless (isSuccess ret) $ error "could not seria... | 481 | exportSig (Sig in_sig) = unsafePerformIO $
unsafeUseByteString in_sig $ \(in_ptr, _) ->
alloca $ \out_len ->
allocaBytes 72 $ \out_ptr -> do
poke out_len 72
ret <- ecdsaSignatureSerializeDer ctx out_ptr out_len in_ptr
unless (isSuccess ret) $ error "could not serialize signature"
final_len <... | 450 | false | true | 6 | 12 | 97 | 142 | 65 | 77 | null | null |
anttisalonen/starrover | src/Civilization.hs | mit | findColony' :: E.FM CivKey Colony -> EmpireLocation -> Maybe Colony
findColony' _ [] = Nothing | 97 | findColony' :: E.FM CivKey Colony -> EmpireLocation -> Maybe Colony
findColony' _ [] = Nothing | 97 | findColony' _ [] = Nothing | 29 | false | true | 0 | 7 | 17 | 36 | 17 | 19 | null | null |
pminten/xhaskell | simple-cipher/simple-cipher_test.hs | mit | main :: IO ()
main = exitProperly $ runTestTT $ TestList
[ TestList caesarTests ] | 88 | main :: IO ()
main = exitProperly $ runTestTT $ TestList
[ TestList caesarTests ] | 88 | main = exitProperly $ runTestTT $ TestList
[ TestList caesarTests ] | 74 | false | true | 0 | 8 | 21 | 33 | 16 | 17 | null | null |
GaloisInc/halvm-ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | pprFields :: [(Name,Exp)] -> Doc
pprFields = sep . punctuate comma . map (\(s,e) -> ppr s <+> equals <+> ppr e) | 111 | pprFields :: [(Name,Exp)] -> Doc
pprFields = sep . punctuate comma . map (\(s,e) -> ppr s <+> equals <+> ppr e) | 111 | pprFields = sep . punctuate comma . map (\(s,e) -> ppr s <+> equals <+> ppr e) | 78 | false | true | 1 | 11 | 21 | 73 | 36 | 37 | null | null |
sdiehl/ghc | compiler/basicTypes/Literal.hs | bsd-3-clause | float2IntLit (LitFloat f) = mkLitIntUnchecked (truncate f) | 63 | float2IntLit (LitFloat f) = mkLitIntUnchecked (truncate f) | 63 | float2IntLit (LitFloat f) = mkLitIntUnchecked (truncate f) | 63 | false | false | 0 | 7 | 11 | 25 | 11 | 14 | null | null |
acowley/ghc | compiler/types/Type.hs | bsd-3-clause | substKiWith :: [KindVar] -> [Kind] -> Kind -> Kind
substKiWith = substTyWith | 76 | substKiWith :: [KindVar] -> [Kind] -> Kind -> Kind
substKiWith = substTyWith | 76 | substKiWith = substTyWith | 25 | false | true | 0 | 9 | 11 | 36 | 17 | 19 | null | null |
tjakway/ghcjvm | compiler/cmm/CLabel.hs | bsd-3-clause | mkStaticConEntryLabel :: Name -> CafInfo -> CLabel
mkConEntryLabel name c = IdLabel name c ConEntry | 110 | mkStaticConEntryLabel :: Name -> CafInfo -> CLabel
mkConEntryLabel name c = IdLabel name c ConEntry | 110 | mkConEntryLabel name c = IdLabel name c ConEntry | 59 | false | true | 0 | 6 | 25 | 31 | 15 | 16 | null | null |
IvanIvanov/haskell-lisp-interpreter | src/Parser.hs | mit | buildLambdaExpression :: Expression -> Expression
buildLambdaExpression (Pair _ (Pair parameters (Pair body Null))) =
Lambda (pairToList parameters) (analyzeExpression body) | 175 | buildLambdaExpression :: Expression -> Expression
buildLambdaExpression (Pair _ (Pair parameters (Pair body Null))) =
Lambda (pairToList parameters) (analyzeExpression body) | 175 | buildLambdaExpression (Pair _ (Pair parameters (Pair body Null))) =
Lambda (pairToList parameters) (analyzeExpression body) | 125 | false | true | 0 | 11 | 20 | 59 | 29 | 30 | null | null |
lorem-ipsum/adventofcode2015 | day05.hs | gpl-2.0 | main = do
input <- getContents
print $ length $ filter (True ==) $ map nice $ lines input
print $ length $ filter (True ==) $ map nice' $ lines input | 155 | main = do
input <- getContents
print $ length $ filter (True ==) $ map nice $ lines input
print $ length $ filter (True ==) $ map nice' $ lines input | 155 | main = do
input <- getContents
print $ length $ filter (True ==) $ map nice $ lines input
print $ length $ filter (True ==) $ map nice' $ lines input | 155 | false | false | 1 | 12 | 37 | 81 | 36 | 45 | null | null |
wavewave/lhc-analysis-collection | exe/2013-07-24-SimplifiedSUSYlepgluglu.hs | gpl-3.0 | mprocs = mkMultiProc pdir [sproc] | 33 | mprocs = mkMultiProc pdir [sproc] | 33 | mprocs = mkMultiProc pdir [sproc] | 33 | false | false | 0 | 6 | 4 | 14 | 7 | 7 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | mkMonadic str ty = Monadic (mkVarOccFS str) ty | 46 | mkMonadic str ty = Monadic (mkVarOccFS str) ty | 46 | mkMonadic str ty = Monadic (mkVarOccFS str) ty | 46 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
dblia/nosql-ganeti | src/Ganeti/Objects.hs | gpl-2.0 | roleDescription NRDrained = "drained" | 39 | roleDescription NRDrained = "drained" | 39 | roleDescription NRDrained = "drained" | 39 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
grctest/GRC-Netdata | getpeerinfo/getpeerinfo.hs | mit | jsonToStartingHeightList :: [GetPeerInfo] -> [StartingHeight_or_Trust]
jsonToStartingHeightList [] = [] | 103 | jsonToStartingHeightList :: [GetPeerInfo] -> [StartingHeight_or_Trust]
jsonToStartingHeightList [] = [] | 103 | jsonToStartingHeightList [] = [] | 32 | false | true | 0 | 6 | 8 | 28 | 15 | 13 | null | null |
olorin/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs | mpl-2.0 | -- | Undocumented member.
--
-- /Note:/ This 'Lens' automatically encodes and decodes Base64 data,
-- despite what the AWS documentation might say.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This 'Lens' acc... | 489 | bavValue :: Lens' BlobAttributeValue (Maybe ByteString)
bavValue = lens _bavValue (\ s a -> s{_bavValue = a}) . mapping _Base64 | 127 | bavValue = lens _bavValue (\ s a -> s{_bavValue = a}) . mapping _Base64 | 71 | true | true | 0 | 10 | 71 | 59 | 34 | 25 | null | null |
danr/hipspec | examples/old-examples/AppendLists.hs | gpl-3.0 | tailS _ = NilS | 14 | tailS _ = NilS | 14 | tailS _ = NilS | 14 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |'VG.zipWith6'
vg_zipWith6 = VG.zipWith6 | 43 | vg_zipWith6 = VG.zipWith6 | 25 | vg_zipWith6 = VG.zipWith6 | 25 | true | false | 0 | 5 | 4 | 9 | 5 | 4 | null | null |
spinda/liquidhaskell | tests/gsoc15/unknown/pos/RealProps1.hs | bsd-3-clause | mulId :: (Eq a, Fractional a) => a -> Bool
mulId x = x == 1 * x | 63 | mulId :: (Eq a, Fractional a) => a -> Bool
mulId x = x == 1 * x | 63 | mulId x = x == 1 * x | 20 | false | true | 0 | 6 | 17 | 41 | 21 | 20 | null | null |
softmechanics/digestive-functors-yesod | src/Text/Digestive/Forms/Yesod.hs | bsd-3-clause | fileParams :: [(ParamName, FileInfo)] -> [(ParamName, Input)]
fileParams = map (mapSnd Right) | 93 | fileParams :: [(ParamName, FileInfo)] -> [(ParamName, Input)]
fileParams = map (mapSnd Right) | 93 | fileParams = map (mapSnd Right) | 31 | false | true | 0 | 9 | 11 | 49 | 25 | 24 | null | null |
piyush-kurur/shakespeare | hamlet/Text/Hamlet.hs | bsd-2-clause | shamlet :: QuasiQuoter
shamlet = hamletWithSettings htmlRules defaultHamletSettings | 83 | shamlet :: QuasiQuoter
shamlet = hamletWithSettings htmlRules defaultHamletSettings | 83 | shamlet = hamletWithSettings htmlRules defaultHamletSettings | 60 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
matterhorn-chat/matterhorn | src/Matterhorn/Windows/ViewMessage.hs | bsd-3-clause | -- When we show the tabs, we need to reset the viewport scroll position
-- for viewports in that tab. This is because an older View Message
-- window used the same handle for the viewport and we don't want that
-- old state affecting this window. This also means that switching tabs
-- in an existing window resets this ... | 437 | onShow :: TeamId -> ViewMessageWindowTab -> MH ()
onShow tId VMTabMessage = resetVp $ ViewMessageArea tId | 105 | onShow tId VMTabMessage = resetVp $ ViewMessageArea tId | 55 | true | true | 0 | 8 | 77 | 41 | 22 | 19 | null | null |
romanb/amazonka | amazonka-datapipeline/gen/Network/AWS/DataPipeline/Types.hs | mpl-2.0 | -- | Connection information for the location where the task runner will publish
-- the output of the task.
toObjects :: Lens' TaskObject (HashMap Text PipelineObject)
toObjects = lens _toObjects (\s a -> s { _toObjects = a }) . _Map | 232 | toObjects :: Lens' TaskObject (HashMap Text PipelineObject)
toObjects = lens _toObjects (\s a -> s { _toObjects = a }) . _Map | 125 | toObjects = lens _toObjects (\s a -> s { _toObjects = a }) . _Map | 65 | true | true | 1 | 9 | 40 | 59 | 29 | 30 | null | null |
fmthoma/ghc | compiler/utils/Pretty.hs | bsd-3-clause | printDoc_ :: Mode -> Int -> Handle -> Doc -> IO ()
-- printDoc_ does not add a newline at the end, so that
-- successive calls can output stuff on the same line
-- Rather like putStr vs putStrLn
printDoc_ LeftMode _ hdl doc
= do { printLeftRender hdl doc; hFlush hdl } | 270 | printDoc_ :: Mode -> Int -> Handle -> Doc -> IO ()
printDoc_ LeftMode _ hdl doc
= do { printLeftRender hdl doc; hFlush hdl } | 126 | printDoc_ LeftMode _ hdl doc
= do { printLeftRender hdl doc; hFlush hdl } | 75 | true | true | 0 | 10 | 55 | 61 | 31 | 30 | null | null |
donnie4w/tim | protocols/gen-hs/Tim_Types.hs | apache-2.0 | default_TimRemoteUserBean :: TimRemoteUserBean
default_TimRemoteUserBean = TimRemoteUserBean{
timRemoteUserBean_error = P.Nothing,
timRemoteUserBean_ub = P.Nothing,
timRemoteUserBean_extraMap = P.Nothing} | 210 | default_TimRemoteUserBean :: TimRemoteUserBean
default_TimRemoteUserBean = TimRemoteUserBean{
timRemoteUserBean_error = P.Nothing,
timRemoteUserBean_ub = P.Nothing,
timRemoteUserBean_extraMap = P.Nothing} | 210 | default_TimRemoteUserBean = TimRemoteUserBean{
timRemoteUserBean_error = P.Nothing,
timRemoteUserBean_ub = P.Nothing,
timRemoteUserBean_extraMap = P.Nothing} | 163 | false | true | 0 | 7 | 20 | 37 | 22 | 15 | null | null |
jaccokrijnen/leksah | src/IDE/Pane/Workspace.hs | gpl-2.0 | dirToModulePath :: FilePath -> PackageM (Maybe [Text])
dirToModulePath fp = do
pkgDir <- ipdPackageDir <$> ask
srcDirs <- map (pkgDir <>) . ipdSrcDirs <$> ask
return $ do
srcDir <- find (`isPrefixOf` fp) srcDirs
let suffix = if srcDir == fp then "" else makeRelative srcDir fp
let dir... | 531 | dirToModulePath :: FilePath -> PackageM (Maybe [Text])
dirToModulePath fp = do
pkgDir <- ipdPackageDir <$> ask
srcDirs <- map (pkgDir <>) . ipdSrcDirs <$> ask
return $ do
srcDir <- find (`isPrefixOf` fp) srcDirs
let suffix = if srcDir == fp then "" else makeRelative srcDir fp
let dir... | 531 | dirToModulePath fp = do
pkgDir <- ipdPackageDir <$> ask
srcDirs <- map (pkgDir <>) . ipdSrcDirs <$> ask
return $ do
srcDir <- find (`isPrefixOf` fp) srcDirs
let suffix = if srcDir == fp then "" else makeRelative srcDir fp
let dirs = map (T.pack . capitalize) (splitDirectories suffi... | 476 | false | true | 1 | 17 | 145 | 188 | 92 | 96 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-printers/Language/Drasil/TeX/Print.hs | bsd-2-clause | bibTeXMonth L.Nov = S "nov" | 27 | bibTeXMonth L.Nov = S "nov" | 27 | bibTeXMonth L.Nov = S "nov" | 27 | false | false | 1 | 5 | 4 | 17 | 6 | 11 | null | null |
bergmark/http2 | Network/HTTP2/Types.hs | bsd-3-clause | fromFrameTypeId FrameWindowUpdate = 8 | 37 | fromFrameTypeId FrameWindowUpdate = 8 | 37 | fromFrameTypeId FrameWindowUpdate = 8 | 37 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
romhack/habsentminded | habsentmindedBt/src/Main.hs | mit | buildTree :: [Int] -> [Int] -> [a] -> HuffmanTree a
buildTree tL tR charMap = go 0
where
go off = Tree off (check (tL !! off)) (check (tR !! off))
where
check t = if t >= 0x80 then Leaf off (charMap !! (t - 0x80)) else go t
--takes size of list beginning from offset | 292 | buildTree :: [Int] -> [Int] -> [a] -> HuffmanTree a
buildTree tL tR charMap = go 0
where
go off = Tree off (check (tL !! off)) (check (tR !! off))
where
check t = if t >= 0x80 then Leaf off (charMap !! (t - 0x80)) else go t
--takes size of list beginning from offset | 292 | buildTree tL tR charMap = go 0
where
go off = Tree off (check (tL !! off)) (check (tR !! off))
where
check t = if t >= 0x80 then Leaf off (charMap !! (t - 0x80)) else go t
--takes size of list beginning from offset | 240 | false | true | 0 | 12 | 82 | 133 | 69 | 64 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/Utility/Tuple.hs | bsd-3-clause | at98 (_,_,_,_,_,_,_,x,_) = x | 28 | at98 (_,_,_,_,_,_,_,x,_) = x | 28 | at98 (_,_,_,_,_,_,_,x,_) = x | 28 | false | false | 0 | 6 | 3 | 36 | 22 | 14 | null | null |
fmap/https-everywhere-rules | src/Data/HTTPSEverywhere/Rules/Internal/Parser.hs | mit | parseCookieRule :: Element -> Maybe CookieRule
parseCookieRule element = CookieRule <$> do
hostMatches <- element ^. attr "host" . to (>>= match)
nameMatches <- element ^. attr "name" . to (>>= match)
return $ \Cookie{..} -> nameMatches (cs cookie_name) && hostMatches (cs cookie_domain) | 293 | parseCookieRule :: Element -> Maybe CookieRule
parseCookieRule element = CookieRule <$> do
hostMatches <- element ^. attr "host" . to (>>= match)
nameMatches <- element ^. attr "name" . to (>>= match)
return $ \Cookie{..} -> nameMatches (cs cookie_name) && hostMatches (cs cookie_domain) | 293 | parseCookieRule element = CookieRule <$> do
hostMatches <- element ^. attr "host" . to (>>= match)
nameMatches <- element ^. attr "name" . to (>>= match)
return $ \Cookie{..} -> nameMatches (cs cookie_name) && hostMatches (cs cookie_domain) | 246 | false | true | 0 | 14 | 48 | 120 | 56 | 64 | null | null |
mcschroeder/ghc | compiler/prelude/THNames.hs | bsd-3-clause | inlinableDataConName = thCon (fsLit "Inlinable") inlinableDataConKey | 68 | inlinableDataConName = thCon (fsLit "Inlinable") inlinableDataConKey | 68 | inlinableDataConName = thCon (fsLit "Inlinable") inlinableDataConKey | 68 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
eijian/raytracer | test/Main-t4.hs | bsd-3-clause | nloop = 2000000 :: Int | 22 | nloop = 2000000 :: Int | 22 | nloop = 2000000 :: Int | 22 | false | false | 2 | 5 | 4 | 15 | 5 | 10 | null | null |
mietek/stack | src/main/Main.hs | bsd-3-clause | dockerCleanupCmd :: Docker.CleanupOpts -> GlobalOpts -> IO ()
dockerCleanupCmd cleanupOpts go@GlobalOpts{..} = do
(manager,lc) <- liftIO $ loadConfigWithOpts go
runStackLoggingT manager globalLogLevel $ Docker.preventInContainer $
Docker.cleanup (lcConfig lc) cleanupOpts
-- | Execute a command | 311 | dockerCleanupCmd :: Docker.CleanupOpts -> GlobalOpts -> IO ()
dockerCleanupCmd cleanupOpts go@GlobalOpts{..} = do
(manager,lc) <- liftIO $ loadConfigWithOpts go
runStackLoggingT manager globalLogLevel $ Docker.preventInContainer $
Docker.cleanup (lcConfig lc) cleanupOpts
-- | Execute a command | 311 | dockerCleanupCmd cleanupOpts go@GlobalOpts{..} = do
(manager,lc) <- liftIO $ loadConfigWithOpts go
runStackLoggingT manager globalLogLevel $ Docker.preventInContainer $
Docker.cleanup (lcConfig lc) cleanupOpts
-- | Execute a command | 249 | false | true | 0 | 10 | 50 | 92 | 45 | 47 | null | null |
mmhat/h-gpgme | test/CryptoTest.hs | mit | withPassphraseCb :: String -> Ctx -> IO ()
withPassphraseCb passphrase ctx = do
setPassphraseCallback ctx (Just callback)
where
callback _ _ _ = return (Just passphrase) | 179 | withPassphraseCb :: String -> Ctx -> IO ()
withPassphraseCb passphrase ctx = do
setPassphraseCallback ctx (Just callback)
where
callback _ _ _ = return (Just passphrase) | 179 | withPassphraseCb passphrase ctx = do
setPassphraseCallback ctx (Just callback)
where
callback _ _ _ = return (Just passphrase) | 136 | false | true | 0 | 9 | 35 | 67 | 31 | 36 | null | null |
jparyani/capnproto-boostpython | compiler/src/CxxGenerator.hs | bsd-2-clause | blobTypeString (InlineListType t _) = blobTypeString t | 54 | blobTypeString (InlineListType t _) = blobTypeString t | 54 | blobTypeString (InlineListType t _) = blobTypeString t | 54 | false | false | 0 | 6 | 6 | 21 | 9 | 12 | null | null |
ben-schulz/Idris-dev | src/Idris/Delaborate.hs | bsd-3-clause | showbasic n = show n | 20 | showbasic n = show n | 20 | showbasic n = show n | 20 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
keera-studios/hsQt | Qtc/Gui/QGraphicsItemAnimation.hs | bsd-2-clause | setPosAt :: QGraphicsItemAnimation a -> ((Double, PointF)) -> IO ()
setPosAt x0 (x1, x2)
= withObjectPtr x0 $ \cobj_x0 ->
withCPointF x2 $ \cpointf_x2_x cpointf_x2_y ->
qtc_QGraphicsItemAnimation_setPosAt_qth cobj_x0 (toCDouble x1) cpointf_x2_x cpointf_x2_y | 268 | setPosAt :: QGraphicsItemAnimation a -> ((Double, PointF)) -> IO ()
setPosAt x0 (x1, x2)
= withObjectPtr x0 $ \cobj_x0 ->
withCPointF x2 $ \cpointf_x2_x cpointf_x2_y ->
qtc_QGraphicsItemAnimation_setPosAt_qth cobj_x0 (toCDouble x1) cpointf_x2_x cpointf_x2_y | 268 | setPosAt x0 (x1, x2)
= withObjectPtr x0 $ \cobj_x0 ->
withCPointF x2 $ \cpointf_x2_x cpointf_x2_y ->
qtc_QGraphicsItemAnimation_setPosAt_qth cobj_x0 (toCDouble x1) cpointf_x2_x cpointf_x2_y | 200 | false | true | 4 | 8 | 42 | 95 | 46 | 49 | null | null |
pseudonom/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | filterToDocument :: (PersistEntity val, PersistEntityBackend val ~ DB.MongoContext) => Filter val -> DB.Document
filterToDocument f =
case f of
Filter field v filt -> [filterToBSON (fieldName field) v filt]
BackendFilter mf -> mongoFilterToDoc mf
-- The empty filter case should never occur when th... | 829 | filterToDocument :: (PersistEntity val, PersistEntityBackend val ~ DB.MongoContext) => Filter val -> DB.Document
filterToDocument f =
case f of
Filter field v filt -> [filterToBSON (fieldName field) v filt]
BackendFilter mf -> mongoFilterToDoc mf
-- The empty filter case should never occur when th... | 829 | filterToDocument f =
case f of
Filter field v filt -> [filterToBSON (fieldName field) v filt]
BackendFilter mf -> mongoFilterToDoc mf
-- The empty filter case should never occur when the user uses ||.
-- An empty filter list will throw an exception in multiFilter
--
-- The altern... | 716 | false | true | 0 | 11 | 201 | 143 | 69 | 74 | null | null |
Nathan-Fenner/New-Nickel | ParseAST.hs | mit | parseExpressionReference :: Parse (Maybe (Expression Parsed))
parseExpressionReference = parseReference ##> \reference -> do
return $ Reference reference | 155 | parseExpressionReference :: Parse (Maybe (Expression Parsed))
parseExpressionReference = parseReference ##> \reference -> do
return $ Reference reference | 155 | parseExpressionReference = parseReference ##> \reference -> do
return $ Reference reference | 93 | false | true | 0 | 10 | 18 | 45 | 22 | 23 | null | null |
jonascarpay/visor | src/Visor.hs | bsd-3-clause | extractWidget :: forall w s m.
( Widget w, Monad m
) => Screenshot s -> m (WInput w)
extractWidget (Screenshot img) = WInput <$> sComputeP (sFromFunction fn)
where
ww = fromInteger$ natVal (Proxy :: Proxy (Width w))
wh = fromInteger$ natVal (Proxy :: Proxy (Height w))
iw = fromInteger$ natVal (Pr... | 793 | extractWidget :: forall w s m.
( Widget w, Monad m
) => Screenshot s -> m (WInput w)
extractWidget (Screenshot img) = WInput <$> sComputeP (sFromFunction fn)
where
ww = fromInteger$ natVal (Proxy :: Proxy (Width w))
wh = fromInteger$ natVal (Proxy :: Proxy (Height w))
iw = fromInteger$ natVal (Pro... | 792 | extractWidget (Screenshot img) = WInput <$> sComputeP (sFromFunction fn)
where
ww = fromInteger$ natVal (Proxy :: Proxy (Width w))
wh = fromInteger$ natVal (Proxy :: Proxy (Height w))
iw = fromInteger$ natVal (Proxy :: Proxy (ScreenWidth (Parent w)))
ih = fromInteger$ natVal (Proxy :: Proxy (Scr... | 703 | false | true | 0 | 14 | 185 | 405 | 208 | 197 | null | null |
OpenXT/manager | apptool/Import.hs | gpl-2.0 | inform :: MonadIO m => String -> m ()
inform = liftIO . hPutStrLn stderr | 72 | inform :: MonadIO m => String -> m ()
inform = liftIO . hPutStrLn stderr | 72 | inform = liftIO . hPutStrLn stderr | 34 | false | true | 1 | 9 | 14 | 41 | 17 | 24 | null | null |
alexander-at-github/eta | compiler/ETA/Main/HscMain.hs | bsd-3-clause | hscGetSafe :: HscEnv -> Module -> SrcSpan -> IO (Bool, [PackageKey])
hscGetSafe hsc_env m l = runHsc hsc_env $ do
dflags <- getDynFlags
(self, pkgs) <- hscCheckSafe' dflags m l
good <- isEmptyBag `fmap` getWarnings
clearWarnings -- don't want them printed...
let pkgs' | Just p <- self ... | 706 | hscGetSafe :: HscEnv -> Module -> SrcSpan -> IO (Bool, [PackageKey])
hscGetSafe hsc_env m l = runHsc hsc_env $ do
dflags <- getDynFlags
(self, pkgs) <- hscCheckSafe' dflags m l
good <- isEmptyBag `fmap` getWarnings
clearWarnings -- don't want them printed...
let pkgs' | Just p <- self ... | 706 | hscGetSafe hsc_env m l = runHsc hsc_env $ do
dflags <- getDynFlags
(self, pkgs) <- hscCheckSafe' dflags m l
good <- isEmptyBag `fmap` getWarnings
clearWarnings -- don't want them printed...
let pkgs' | Just p <- self = p:pkgs
| otherwise = pkgs
return (good, pkgs... | 637 | false | true | 0 | 16 | 173 | 149 | 73 | 76 | null | null |
noughtmare/yi | yi-keymap-vim/src/Yi/Keymap/Vim/Digraph.hs | gpl-2.0 | -- CYRILLIC SMALL LETTER E
switch 'j' 'u' = '\x044E' | 52 | switch 'j' 'u' = '\x044E' | 25 | switch 'j' 'u' = '\x044E' | 25 | true | false | 0 | 5 | 9 | 12 | 6 | 6 | null | null |
alvin777/haskell-bf | src/BF.hs | mit | pureEval' :: State -> String
pureEval' (State [] _ _ _ ) = [] | 61 | pureEval' :: State -> String
pureEval' (State [] _ _ _ ) = [] | 61 | pureEval' (State [] _ _ _ ) = [] | 32 | false | true | 0 | 10 | 13 | 40 | 18 | 22 | null | null |
alphalambda/codeworld | codeworld-compiler/src/CodeWorld/Compile/Stages.hs | apache-2.0 | varlessPatBinds _ = [] | 22 | varlessPatBinds _ = [] | 22 | varlessPatBinds _ = [] | 22 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
cdornan/keystore | src/Data/KeyStore/KS.hs | bsd-3-clause | encryptWithKeysKS :: Safeguard -> ClearText -> KS EncrypedCopy
encryptWithKeysKS nms ct =
do ec <- defaultEncryptedCopyKS nms
mb <- loadEncryptionKeyKS Encrypting ec
ek <- case mb of
Nothing -> errorKS "could not load keys"
Just ek -> return ek
ecd <- saveKS ek ct
return ec... | 514 | encryptWithKeysKS :: Safeguard -> ClearText -> KS EncrypedCopy
encryptWithKeysKS nms ct =
do ec <- defaultEncryptedCopyKS nms
mb <- loadEncryptionKeyKS Encrypting ec
ek <- case mb of
Nothing -> errorKS "could not load keys"
Just ek -> return ek
ecd <- saveKS ek ct
return ec... | 514 | encryptWithKeysKS nms ct =
do ec <- defaultEncryptedCopyKS nms
mb <- loadEncryptionKeyKS Encrypting ec
ek <- case mb of
Nothing -> errorKS "could not load keys"
Just ek -> return ek
ecd <- saveKS ek ct
return ec { _ec_secret_data = ecd }
----------------------------------... | 451 | false | true | 0 | 11 | 114 | 110 | 51 | 59 | null | null |
enolan/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | -- | The initial state for the compiler
idrisInit :: IState
idrisInit = IState initContext S.empty []
emptyContext emptyContext emptyContext [] emptyContext
emptyContext emptyContext emptyContext emptyContext
emptyContext emptyContext emptyContext emptyContext
... | 890 | idrisInit :: IState
idrisInit = IState initContext S.empty []
emptyContext emptyContext emptyContext [] emptyContext
emptyContext emptyContext emptyContext emptyContext
emptyContext emptyContext emptyContext emptyContext
emptyContext emptyConte... | 850 | idrisInit = IState initContext S.empty []
emptyContext emptyContext emptyContext [] emptyContext
emptyContext emptyContext emptyContext emptyContext
emptyContext emptyContext emptyContext emptyContext
emptyContext emptyContext emptyContext empt... | 830 | true | true | 0 | 7 | 282 | 283 | 130 | 153 | null | null |
23Skidoo/snap | src/Snap/Snaplet/Internal/Types.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Gets the base URL for the current snaplet. Directories get added to
-- the current snaplet path by calls to 'nestSnaplet'.
getSnapletRootURL :: (Monad (m b v), MonadSnaplet m) => m b v ByteString
getSnapletRootURL = liftM getRootURL ge... | 333 | getSnapletRootURL :: (Monad (m b v), MonadSnaplet m) => m b v ByteString
getSnapletRootURL = liftM getRootURL getOpaqueConfig | 125 | getSnapletRootURL = liftM getRootURL getOpaqueConfig | 52 | true | true | 0 | 9 | 42 | 54 | 27 | 27 | null | null |
wavewave/lhc-analysis-collection | exe/evchainRunLeptoQuark.hs | gpl-3.0 | leptons = [11,13,-11,-13] | 25 | leptons = [11,13,-11,-13] | 25 | leptons = [11,13,-11,-13] | 25 | false | false | 1 | 6 | 2 | 25 | 13 | 12 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/BatchJobDefinitionContainerProperties.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-ulimits
bjdcpUlimits :: Lens' BatchJobDefinitionContainerProperties (Maybe [BatchJobDefinitionUlimit])
bjdcpUlimits = lens _batchJobDefinitionContain... | 405 | bjdcpUlimits :: Lens' BatchJobDefinitionContainerProperties (Maybe [BatchJobDefinitionUlimit])
bjdcpUlimits = lens _batchJobDefinitionContainerPropertiesUlimits (\s a -> s { _batchJobDefinitionContainerPropertiesUlimits = a }) | 226 | bjdcpUlimits = lens _batchJobDefinitionContainerPropertiesUlimits (\s a -> s { _batchJobDefinitionContainerPropertiesUlimits = a }) | 131 | true | true | 0 | 9 | 21 | 49 | 27 | 22 | null | null |
gridaphobe/ghc | utils/ghctags/Main.hs | bsd-3-clause | safeLoad :: LoadHowMuch -> Ghc SuccessFlag
-- like GHC.load, but does not stop process on exception
safeLoad mode = do
_dflags <- getSessionDynFlags
ghandle (\(e :: SomeException) -> liftIO (print e) >> return Failed ) $
handleSourceError (\e -> printException e >> return Failed) $
load mode | 306 | safeLoad :: LoadHowMuch -> Ghc SuccessFlag
safeLoad mode = do
_dflags <- getSessionDynFlags
ghandle (\(e :: SomeException) -> liftIO (print e) >> return Failed ) $
handleSourceError (\e -> printException e >> return Failed) $
load mode | 249 | safeLoad mode = do
_dflags <- getSessionDynFlags
ghandle (\(e :: SomeException) -> liftIO (print e) >> return Failed ) $
handleSourceError (\e -> printException e >> return Failed) $
load mode | 206 | true | true | 0 | 15 | 60 | 98 | 47 | 51 | null | null |
poxu/pandoc | src/Text/Pandoc/Readers/Docx/Parse.hs | gpl-2.0 | archiveToStyles :: Archive -> (CharStyleMap, ParStyleMap)
archiveToStyles zf =
let stylesElem = findEntryByPath "word/styles.xml" zf >>=
(parseXMLDoc . UTF8.toStringLazy . fromEntry)
in
case stylesElem of
Nothing -> (M.empty, M.empty)
Just styElem ->
let namespaces = elemToNam... | 547 | archiveToStyles :: Archive -> (CharStyleMap, ParStyleMap)
archiveToStyles zf =
let stylesElem = findEntryByPath "word/styles.xml" zf >>=
(parseXMLDoc . UTF8.toStringLazy . fromEntry)
in
case stylesElem of
Nothing -> (M.empty, M.empty)
Just styElem ->
let namespaces = elemToNam... | 547 | archiveToStyles zf =
let stylesElem = findEntryByPath "word/styles.xml" zf >>=
(parseXMLDoc . UTF8.toStringLazy . fromEntry)
in
case stylesElem of
Nothing -> (M.empty, M.empty)
Just styElem ->
let namespaces = elemToNameSpaces styElem
in
( M.fromList $ buildBase... | 489 | false | true | 0 | 16 | 149 | 150 | 76 | 74 | null | null |
abakst/symmetry | checker/saved-quals/MultiVector.hs | mit | {-@ initVec2D :: forall <r :: Int -> Int -> Val Pid -> Prop>. s:State -> Vec2D <{\i j -> 0 <= i && i < r2 s && 0 <= j && j < Map_select (pidR2PtrW0 s) i},r> (Val Pid) @-}
initVec2D :: State -> Vec2D (Val Pid)
initVec2D = undefined | 245 | initVec2D :: State -> Vec2D (Val Pid)
initVec2D = undefined | 59 | initVec2D = undefined | 21 | true | true | 0 | 9 | 66 | 31 | 14 | 17 | null | null |
GaloisInc/saw-script | src/SAWScript/Builtins.hs | bsd-3-clause | offline_extcore :: FilePath -> ProofScript ()
offline_extcore path = proveWithPropExporter Prover.writeCoreProp path "." ".extcore" | 131 | offline_extcore :: FilePath -> ProofScript ()
offline_extcore path = proveWithPropExporter Prover.writeCoreProp path "." ".extcore" | 131 | offline_extcore path = proveWithPropExporter Prover.writeCoreProp path "." ".extcore" | 85 | false | true | 0 | 7 | 13 | 34 | 16 | 18 | null | null |
Numberartificial/workflow | snipets/src/Craft/Chapter13.hs | mit | -- Similarly,
vLookupFirst :: (Eq a,Show b) => [(a,b)] -> a -> String
vLookupFirst xs x = show (lookupFirst xs x) | 116 | vLookupFirst :: (Eq a,Show b) => [(a,b)] -> a -> String
vLookupFirst xs x = show (lookupFirst xs x) | 99 | vLookupFirst xs x = show (lookupFirst xs x) | 43 | true | true | 0 | 8 | 23 | 60 | 32 | 28 | null | null |
goldfirere/units | units-defs/Data/Units/SI/Prefixes.hs | bsd-3-clause | -- | A list of the names of all prefix types. Useful with
-- 'Data.Metrology.Parser.makeQuasiQuoter'.
siPrefixes :: [Name]
siPrefixes =
[ ''Deca, ''Hecto, ''Kilo, ''Mega, ''Giga, ''Tera, ''Peta, ''Exa
, ''Zetta, ''Yotta, ''Deci, ''Centi, ''Milli, ''Micro, ''Nano
, ''Pico, ''Femto, ''Atto, ''Zepto, ''Yocto
] | 316 | siPrefixes :: [Name]
siPrefixes =
[ ''Deca, ''Hecto, ''Kilo, ''Mega, ''Giga, ''Tera, ''Peta, ''Exa
, ''Zetta, ''Yotta, ''Deci, ''Centi, ''Milli, ''Micro, ''Nano
, ''Pico, ''Femto, ''Atto, ''Zepto, ''Yocto
] | 214 | siPrefixes =
[ ''Deca, ''Hecto, ''Kilo, ''Mega, ''Giga, ''Tera, ''Peta, ''Exa
, ''Zetta, ''Yotta, ''Deci, ''Centi, ''Milli, ''Micro, ''Nano
, ''Pico, ''Femto, ''Atto, ''Zepto, ''Yocto
] | 193 | true | true | 0 | 6 | 51 | 116 | 70 | 46 | null | null |
magicant/flesh | hspec-src/Flesh/Language/Parser/AliasSpec.hs | gpl-2.0 | spec :: Spec
spec = parallel $ do
-- TODO Test PushBackT instances
-- TODO Test ReparseT instances
describe "maybeAliasValue" $ do
prop "returns matching alias value" $ \s v ->
fmap (fmap snd) (testMaybeAliasValue s v s) === Just v
prop "returns nothing for unmatched name" $ \s v t ->
s /= t... | 396 | spec :: Spec
spec = parallel $ do
-- TODO Test PushBackT instances
-- TODO Test ReparseT instances
describe "maybeAliasValue" $ do
prop "returns matching alias value" $ \s v ->
fmap (fmap snd) (testMaybeAliasValue s v s) === Just v
prop "returns nothing for unmatched name" $ \s v t ->
s /= t... | 396 | spec = parallel $ do
-- TODO Test PushBackT instances
-- TODO Test ReparseT instances
describe "maybeAliasValue" $ do
prop "returns matching alias value" $ \s v ->
fmap (fmap snd) (testMaybeAliasValue s v s) === Just v
prop "returns nothing for unmatched name" $ \s v t ->
s /= t ==> testMayb... | 383 | false | true | 2 | 15 | 97 | 119 | 55 | 64 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT36.hs | gpl-3.0 | False || x = x | 14 | False || x = x | 14 | False || x = x | 14 | false | false | 0 | 5 | 4 | 16 | 6 | 10 | null | null |
uuhan/Idris-dev | src/Idris/WhoCalls.hs | bsd-3-clause | occurs n (P _ n' _) = n == n' | 29 | occurs n (P _ n' _) = n == n' | 29 | occurs n (P _ n' _) = n == n' | 29 | false | false | 0 | 7 | 9 | 25 | 12 | 13 | null | null |
mcschroeder/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | tcFunResultTy :: Type -> Type
tcFunResultTy ty = snd (tcSplitFunTy ty) | 70 | tcFunResultTy :: Type -> Type
tcFunResultTy ty = snd (tcSplitFunTy ty) | 70 | tcFunResultTy ty = snd (tcSplitFunTy ty) | 40 | false | true | 0 | 7 | 10 | 33 | 14 | 19 | null | null |
gcross/habit-of-fate | sources/library/HabitOfFate/Quests/DarkLord/Part2/Mage.hs | agpl-3.0 | introduction = Narrative
{ title = "The Haunted Lands"
, content = [story|
Supposedly the Order of the Paladins had taken care of the Dark Lord of this
place before, but unsurprisingly they bungled it up and now the Dark Lord was
back. Normally this would be none of the mage's business, but if rumours were to
be be... | 670 | introduction = Narrative
{ title = "The Haunted Lands"
, content = [story|
Supposedly the Order of the Paladins had taken care of the Dark Lord of this
place before, but unsurprisingly they bungled it up and now the Dark Lord was
back. Normally this would be none of the mage's business, but if rumours were to
be be... | 670 | introduction = Narrative
{ title = "The Haunted Lands"
, content = [story|
Supposedly the Order of the Paladins had taken care of the Dark Lord of this
place before, but unsurprisingly they bungled it up and now the Dark Lord was
back. Normally this would be none of the mage's business, but if rumours were to
be be... | 670 | false | false | 0 | 7 | 122 | 28 | 17 | 11 | null | null |
tomahawkins/improve | Language/ImProve/Code/Simulink.hs | bsd-3-clause | -- Simulink generation.
codeSimulink :: Name -> Statement -> IO ()
codeSimulink name stmt = do
net <- netlist stmt
writeFile (name ++ ".mdl") $ show $ mdl name $ (mdlBlocks $ blocks net) ++ (mdlLines $ nets net)
-- | Builds a netlist. | 239 | codeSimulink :: Name -> Statement -> IO ()
codeSimulink name stmt = do
net <- netlist stmt
writeFile (name ++ ".mdl") $ show $ mdl name $ (mdlBlocks $ blocks net) ++ (mdlLines $ nets net)
-- | Builds a netlist. | 215 | codeSimulink name stmt = do
net <- netlist stmt
writeFile (name ++ ".mdl") $ show $ mdl name $ (mdlBlocks $ blocks net) ++ (mdlLines $ nets net)
-- | Builds a netlist. | 172 | true | true | 0 | 13 | 48 | 98 | 46 | 52 | null | null |
s9gf4ult/hdbi | Database/HDBI/DriverUtils.hs | bsd-3-clause | addChild :: (Statement stmt) => (ChildList stmt) -> stmt -> IO ()
addChild mcl stmt = modifyMVar_ (clNextKey mcl) $ \key -> do
wp <- mkWeakPtr stmt $ Just $ childFinalizer mcl key stmt
atomically $ do
modifyTVar' (clList mcl) $ M.insert key wp
modifyTVar' (clCounter mcl) (+1)
return $ key + 1
{- | The ge... | 546 | addChild :: (Statement stmt) => (ChildList stmt) -> stmt -> IO ()
addChild mcl stmt = modifyMVar_ (clNextKey mcl) $ \key -> do
wp <- mkWeakPtr stmt $ Just $ childFinalizer mcl key stmt
atomically $ do
modifyTVar' (clList mcl) $ M.insert key wp
modifyTVar' (clCounter mcl) (+1)
return $ key + 1
{- | The ge... | 546 | addChild mcl stmt = modifyMVar_ (clNextKey mcl) $ \key -> do
wp <- mkWeakPtr stmt $ Just $ childFinalizer mcl key stmt
atomically $ do
modifyTVar' (clList mcl) $ M.insert key wp
modifyTVar' (clCounter mcl) (+1)
return $ key + 1
{- | The general finalizer for a child.
It is simply a filter that removes a... | 480 | false | true | 0 | 15 | 113 | 147 | 70 | 77 | null | null |
rahulmutt/ghcvm | compiler/Eta/Utils/FastBool.hs | bsd-3-clause | isFastTrue _ = panic "FastTypes: isFastTrue" | 44 | isFastTrue _ = panic "FastTypes: isFastTrue" | 44 | isFastTrue _ = panic "FastTypes: isFastTrue" | 44 | false | false | 0 | 5 | 5 | 12 | 5 | 7 | null | null |
SAdams601/HaRe | old/testing/duplication/LetIn1.hs | bsd-3-clause | --duplicate the local definition 'fred' with new name 'dref'
x = 5 | 67 | x = 5 | 5 | x = 5 | 5 | true | false | 1 | 5 | 12 | 11 | 4 | 7 | null | null |
rleshchinskiy/vector | Data/Vector/Generic.hs | bsd-3-clause | zipWithM_ f as bs = Bundle.zipWithM_ f (stream as) (stream bs) | 62 | zipWithM_ f as bs = Bundle.zipWithM_ f (stream as) (stream bs) | 62 | zipWithM_ f as bs = Bundle.zipWithM_ f (stream as) (stream bs) | 62 | false | false | 0 | 7 | 10 | 34 | 16 | 18 | null | null |
spechub/Hets | Comorphisms/HasCASL2IsabelleHOL.hs | gpl-2.0 | -- * translation of case alternatives
{- Annotation concerning Patterns:
Following the HasCASL-Summary and the limits of the encoding
from HasCASL to Isabelle/HOL patterns may take the form:
QualVar, QualOp, ApplTerm, TupleTerm and TypedTerm
-}
{- Input: List of case alternative (one pattern per ter... | 594 | arangeCaseAlts :: Env -> [ProgEq] -> [(IsaSign.Term, IsaSign.Term)]
arangeCaseAlts sign peqs
| all patIsVar peqs = map (transCaseAlt sign) peqs
| otherwise = sortCaseAlts sign peqs | 184 | arangeCaseAlts sign peqs
| all patIsVar peqs = map (transCaseAlt sign) peqs
| otherwise = sortCaseAlts sign peqs | 116 | true | true | 1 | 9 | 107 | 77 | 40 | 37 | null | null |
MoritzR/CurseOfDestiny | src/GameIO.hs | gpl-3.0 | chooseOne :: (Members [Trace, Input Int] r, Show a) => [a] -> Sem r (Maybe a)
chooseOne l = do
displayEnumeratedItems l
log' "Choose one: "
choice <- input
if choice < 1 || choice > length l
then return Nothing
else return $ Just (l !! (choice -1)) | 264 | chooseOne :: (Members [Trace, Input Int] r, Show a) => [a] -> Sem r (Maybe a)
chooseOne l = do
displayEnumeratedItems l
log' "Choose one: "
choice <- input
if choice < 1 || choice > length l
then return Nothing
else return $ Just (l !! (choice -1)) | 264 | chooseOne l = do
displayEnumeratedItems l
log' "Choose one: "
choice <- input
if choice < 1 || choice > length l
then return Nothing
else return $ Just (l !! (choice -1)) | 186 | false | true | 0 | 14 | 64 | 132 | 63 | 69 | null | null |
ankhers/haskell-ide-engine | src/Haskell/Ide/Engine/Transport/Pipes.hs | bsd-3-clause | channelToWire :: ChannelResponse -> WireResponse
channelToWire cr = WireResp $ toJSON $ coutResp cr | 99 | channelToWire :: ChannelResponse -> WireResponse
channelToWire cr = WireResp $ toJSON $ coutResp cr | 99 | channelToWire cr = WireResp $ toJSON $ coutResp cr | 50 | false | true | 0 | 6 | 13 | 29 | 14 | 15 | null | null |
tazjin/herbert | src/Server.hs | mit | signAndRespond :: AppState -> CSR -> SomeKeyPair -> ActionM ()
signAndRespond state csr key = do
ca <- update' state GetNextSerialNumber
cert <- liftIO $ signCSR csr ca key
update' state $ SetSignedCSR (csr ^. requestId) $ cert ^. certId
update' state $ InsertCertificate cert
json cert | 298 | signAndRespond :: AppState -> CSR -> SomeKeyPair -> ActionM ()
signAndRespond state csr key = do
ca <- update' state GetNextSerialNumber
cert <- liftIO $ signCSR csr ca key
update' state $ SetSignedCSR (csr ^. requestId) $ cert ^. certId
update' state $ InsertCertificate cert
json cert | 298 | signAndRespond state csr key = do
ca <- update' state GetNextSerialNumber
cert <- liftIO $ signCSR csr ca key
update' state $ SetSignedCSR (csr ^. requestId) $ cert ^. certId
update' state $ InsertCertificate cert
json cert | 235 | false | true | 0 | 12 | 58 | 112 | 50 | 62 | null | null |
igitur-ventures/s3 | main/s3.hs | bsd-2-clause | putFile :: Aws.Configuration -> S3.S3Configuration Aws.NormalQuery -> FilePath -> String -> IO ()
putFile cfg s3cfg bucket file = do
sz <- fileSize <$> getFileStatus file
withManager $ \mgr -> do
S3.PutObjectResponse { S3.porVersionId = vers } <-
Aws.pureAws cfg s3cfg mgr $
-- need to read file full... | 567 | putFile :: Aws.Configuration -> S3.S3Configuration Aws.NormalQuery -> FilePath -> String -> IO ()
putFile cfg s3cfg bucket file = do
sz <- fileSize <$> getFileStatus file
withManager $ \mgr -> do
S3.PutObjectResponse { S3.porVersionId = vers } <-
Aws.pureAws cfg s3cfg mgr $
-- need to read file full... | 567 | putFile cfg s3cfg bucket file = do
sz <- fileSize <$> getFileStatus file
withManager $ \mgr -> do
S3.PutObjectResponse { S3.porVersionId = vers } <-
Aws.pureAws cfg s3cfg mgr $
-- need to read file fully and know its size: https://forums.aws.amazon.com/message.jspa?messageID=554788
S3.putObjec... | 469 | false | true | 0 | 18 | 110 | 176 | 84 | 92 | null | null |
robstewart57/stack | src/main/Main.hs | bsd-3-clause | -- | Helper for build and install commands
buildCmd :: BuildOpts -> GlobalOpts -> IO ()
buildCmd opts go = do
when (any (("-prof" `elem`) . either (const []) id . parseArgs Escaping) (boptsGhcOptions opts)) $ do
hPutStrLn stderr "When building with stack, you should not use the -prof GHC option"
hPutStrLn std... | 1,070 | buildCmd :: BuildOpts -> GlobalOpts -> IO ()
buildCmd opts go = do
when (any (("-prof" `elem`) . either (const []) id . parseArgs Escaping) (boptsGhcOptions opts)) $ do
hPutStrLn stderr "When building with stack, you should not use the -prof GHC option"
hPutStrLn stderr "Instead, please use --enable-library-p... | 1,027 | buildCmd opts go = do
when (any (("-prof" `elem`) . either (const []) id . parseArgs Escaping) (boptsGhcOptions opts)) $ do
hPutStrLn stderr "When building with stack, you should not use the -prof GHC option"
hPutStrLn stderr "Instead, please use --enable-library-profiling and --enable-executable-profiling"
... | 982 | true | true | 0 | 17 | 224 | 273 | 126 | 147 | null | null |
wmarvel/haskellrogue | src/System/Random/PCG.hs | mit | mkPCGGen' :: IO PCGGen
mkPCGGen' = do
pTime <- getPOSIXTime
sTime <- getCPUTime
pure $ mkPCGGen (floor pTime) (fromInteger sTime) | 135 | mkPCGGen' :: IO PCGGen
mkPCGGen' = do
pTime <- getPOSIXTime
sTime <- getCPUTime
pure $ mkPCGGen (floor pTime) (fromInteger sTime) | 135 | mkPCGGen' = do
pTime <- getPOSIXTime
sTime <- getCPUTime
pure $ mkPCGGen (floor pTime) (fromInteger sTime) | 112 | false | true | 0 | 10 | 25 | 52 | 24 | 28 | null | null |
xmonad/xmonad-contrib | XMonad/Prelude.hs | bsd-3-clause | -- | Given a maximum length, splits a list into sublists
--
-- >>> chunksOf 5 (take 30 $ repeat 'a')
-- ["aaaaa","aaaaa","aaaaa","aaaaa","aaaaa","aaaaa"]
chunksOf :: Int -> [a] -> [[a]]
chunksOf _ [] = [] | 204 | chunksOf :: Int -> [a] -> [[a]]
chunksOf _ [] = [] | 50 | chunksOf _ [] = [] | 18 | true | true | 0 | 10 | 34 | 47 | 25 | 22 | null | null |
catamorphism/hplaylist | Utils.hs | gpl-3.0 | mapFile :: (String -> String) -> FilePath -> IO ()
mapFile f fp = do
h <- openFile fp ReadMode
contents <- hGetContents h
let res = map f (lines contents)
length res `seq` hClose h
removeFile fp
writeFile fp (unlines res) | 233 | mapFile :: (String -> String) -> FilePath -> IO ()
mapFile f fp = do
h <- openFile fp ReadMode
contents <- hGetContents h
let res = map f (lines contents)
length res `seq` hClose h
removeFile fp
writeFile fp (unlines res) | 233 | mapFile f fp = do
h <- openFile fp ReadMode
contents <- hGetContents h
let res = map f (lines contents)
length res `seq` hClose h
removeFile fp
writeFile fp (unlines res) | 182 | false | true | 0 | 13 | 53 | 118 | 52 | 66 | null | null |
genos/online_problems | exercism/haskell/simple-linked-list/src/LinkedList.hs | mit | fromList :: [a] -> LinkedList a
fromList = F.foldr' Pair Empty | 62 | fromList :: [a] -> LinkedList a
fromList = F.foldr' Pair Empty | 62 | fromList = F.foldr' Pair Empty | 30 | false | true | 0 | 7 | 10 | 35 | 15 | 20 | null | null |
Noeda/dfterm3 | src/Dfterm3/CP437ToUnicode.hs | isc | cp437ToUnicode 210 = '\x2565' | 29 | cp437ToUnicode 210 = '\x2565' | 29 | cp437ToUnicode 210 = '\x2565' | 29 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
phischu/fragnix | tests/packages/scotty/Data.ByteString.Lazy.hs | bsd-3-clause | -- reverse a list of possibly-empty chunks into a lazy ByteString
revChunks :: [P.ByteString] -> ByteString
revChunks cs = L.foldl' (flip chunk) Empty cs | 153 | revChunks :: [P.ByteString] -> ByteString
revChunks cs = L.foldl' (flip chunk) Empty cs | 87 | revChunks cs = L.foldl' (flip chunk) Empty cs | 45 | true | true | 0 | 8 | 23 | 45 | 21 | 24 | null | null |
snoyberg/ghc | testsuite/tests/dph/quickhull/TestData.hs | bsd-3-clause | toPairs (x:y:pts) = (x, y) : toPairs pts | 40 | toPairs (x:y:pts) = (x, y) : toPairs pts | 40 | toPairs (x:y:pts) = (x, y) : toPairs pts | 40 | false | false | 0 | 7 | 7 | 34 | 17 | 17 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/signum_1.hs | mit | esEsOrdering LT EQ = MyFalse | 28 | esEsOrdering LT EQ = MyFalse | 28 | esEsOrdering LT EQ = MyFalse | 28 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
garetxe/cabal | cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/Solver.hs | bsd-3-clause | -- Extended version of `db8` so that we have nested setup dependencies
db9 :: ExampleDb
db9 = db8 ++ [
Right $ exAv "E" 1 [ExAny "C"]
, Right $ exAv "E" 2 [ExAny "D"]
, Right $ exAv "F" 1 [] `withSetupDeps` [ExFix "E" 1]
, Right $ exAv "G" 1 [] `withSetupDeps` [ExFix "E" 2]
] | 288 | db9 :: ExampleDb
db9 = db8 ++ [
Right $ exAv "E" 1 [ExAny "C"]
, Right $ exAv "E" 2 [ExAny "D"]
, Right $ exAv "F" 1 [] `withSetupDeps` [ExFix "E" 1]
, Right $ exAv "G" 1 [] `withSetupDeps` [ExFix "E" 2]
] | 217 | db9 = db8 ++ [
Right $ exAv "E" 1 [ExAny "C"]
, Right $ exAv "E" 2 [ExAny "D"]
, Right $ exAv "F" 1 [] `withSetupDeps` [ExFix "E" 1]
, Right $ exAv "G" 1 [] `withSetupDeps` [ExFix "E" 2]
] | 200 | true | true | 2 | 10 | 69 | 124 | 62 | 62 | null | null |
bollmann/lunchtalk | src/Wishlist/Utils.hs | bsd-3-clause | log :: Show a => String -> Controller' st a -> Controller' st a
log msg action = do
liftIO $ putStrLn $ "> " ++ msg ++ "..."
val <- action `catchError` printError
liftIO $ putStrLn $ "< " ++ show val
return val
where
printError err = do
liftIO $ putStrLn $ "ERROR: " ++ show err
throwError err | 319 | log :: Show a => String -> Controller' st a -> Controller' st a
log msg action = do
liftIO $ putStrLn $ "> " ++ msg ++ "..."
val <- action `catchError` printError
liftIO $ putStrLn $ "< " ++ show val
return val
where
printError err = do
liftIO $ putStrLn $ "ERROR: " ++ show err
throwError err | 319 | log msg action = do
liftIO $ putStrLn $ "> " ++ msg ++ "..."
val <- action `catchError` printError
liftIO $ putStrLn $ "< " ++ show val
return val
where
printError err = do
liftIO $ putStrLn $ "ERROR: " ++ show err
throwError err | 255 | false | true | 0 | 10 | 86 | 131 | 60 | 71 | null | null |
simonmichael/shelltestrunner | src/shelltest.hs | gpl-3.0 | matches s (Lines _ p) = s == p | 38 | matches s (Lines _ p) = s == p | 38 | matches s (Lines _ p) = s == p | 38 | false | false | 0 | 6 | 16 | 25 | 11 | 14 | null | null |
HIPERFIT/futhark | src/Language/Futhark/TypeChecker/Match.hs | isc | patternToMatch (PatAscription p _ _) = patternToMatch p | 55 | patternToMatch (PatAscription p _ _) = patternToMatch p | 55 | patternToMatch (PatAscription p _ _) = patternToMatch p | 55 | false | false | 0 | 6 | 7 | 23 | 10 | 13 | null | null |
mstksg/auto | src/Control/Auto/Blip.hs | mit | -- | The non-serializing/non-resumable version of 'noLonger'.
noLonger_ :: (a -> Bool) -- ^ change condition
-> Auto m a (Blip a)
noLonger_ p = became_ (not . p) | 174 | noLonger_ :: (a -> Bool) -- ^ change condition
-> Auto m a (Blip a)
noLonger_ p = became_ (not . p) | 112 | noLonger_ p = became_ (not . p) | 31 | true | true | 0 | 9 | 41 | 55 | 27 | 28 | null | null |
linusyang/barrelfish | hake/RuleDefs.hs | mit | --
-- Look for a set of files: this is called using the "find" combinator
--
withSuffix :: [String] -> String -> String -> [String]
withSuffix af tf arg =
[ basename f | f <- af, f `isInSameDirAs` tf, isSuffixOf arg f ] | 223 | withSuffix :: [String] -> String -> String -> [String]
withSuffix af tf arg =
[ basename f | f <- af, f `isInSameDirAs` tf, isSuffixOf arg f ] | 146 | withSuffix af tf arg =
[ basename f | f <- af, f `isInSameDirAs` tf, isSuffixOf arg f ] | 91 | true | true | 0 | 8 | 47 | 72 | 39 | 33 | null | null |
dsorokin/aivika-experiment-chart | examples/SingleLaneTraffic/Experiment.hs | bsd-3-clause | waitTime = resultByName "waitTime" | 40 | waitTime = resultByName "waitTime" | 40 | waitTime = resultByName "waitTime" | 40 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
frodwith/baduk-formats | src/Codec/Baduk/Parser/Tygem.hs | bsd-3-clause | tag = (,) <$> (start *> name) <*> ((string "=") *> value <* end)
where start = string "\\["
end = string "\\]"
name = many1 upper
value = many (noneOf "\\") | 193 | tag = (,) <$> (start *> name) <*> ((string "=") *> value <* end)
where start = string "\\["
end = string "\\]"
name = many1 upper
value = many (noneOf "\\") | 193 | tag = (,) <$> (start *> name) <*> ((string "=") *> value <* end)
where start = string "\\["
end = string "\\]"
name = many1 upper
value = many (noneOf "\\") | 193 | false | false | 6 | 10 | 68 | 95 | 42 | 53 | null | null |
zeyuanxy/haskell-playground | write-yourself-a-scheme/chap5/main.hs | mit | eqv [(Number arg1) , (Number arg2) ] = return $ Bool $ arg1 == arg2 | 67 | eqv [(Number arg1) , (Number arg2) ] = return $ Bool $ arg1 == arg2 | 67 | eqv [(Number arg1) , (Number arg2) ] = return $ Bool $ arg1 == arg2 | 67 | false | false | 0 | 7 | 14 | 40 | 20 | 20 | null | null |
michalkonecny/aern2 | aern2-fun-univariate/src/AERN2/Poly/Power/MaximumIntAlt.hs | bsd-3-clause | isMoreAccurate :: MPBall -> Maybe MPBall -> Bool
isMoreAccurate _ Nothing = True | 81 | isMoreAccurate :: MPBall -> Maybe MPBall -> Bool
isMoreAccurate _ Nothing = True | 81 | isMoreAccurate _ Nothing = True | 32 | false | true | 0 | 8 | 13 | 33 | 14 | 19 | null | null |
zinfra/khan | khan/src/Khan/Model/Tag.hs | mpl-2.0 | instances :: Naming a => a -> Text -> [Text] -> AWS ()
instances n dom ids = do
say "Tagging: {}" [L ids]
send_ . CreateTags ids
$ map (uncurry ResourceTagSetItemType) (defaults n dom) | 202 | instances :: Naming a => a -> Text -> [Text] -> AWS ()
instances n dom ids = do
say "Tagging: {}" [L ids]
send_ . CreateTags ids
$ map (uncurry ResourceTagSetItemType) (defaults n dom) | 202 | instances n dom ids = do
say "Tagging: {}" [L ids]
send_ . CreateTags ids
$ map (uncurry ResourceTagSetItemType) (defaults n dom) | 147 | false | true | 0 | 10 | 52 | 92 | 43 | 49 | null | null |
lambdageek/insomnia | src/Insomnia/Typecheck/Module.hs | bsd-3-clause | inferModuleExpr pmod (ModuleSeal mdl mtypeSealed) = do
(mdl', mtnfInferred) <- inferModuleExpr pmod mdl
(mtypeSealed', mtnfSealed) <- checkModuleType mtypeSealed
<??@ ("while checking sealing signature of " <> formatErr pmod)
mtnfSealed' <- mayAscribeNF mtnfInferred mtnfSealed
... | 484 | inferModuleExpr pmod (ModuleSeal mdl mtypeSealed) = do
(mdl', mtnfInferred) <- inferModuleExpr pmod mdl
(mtypeSealed', mtnfSealed) <- checkModuleType mtypeSealed
<??@ ("while checking sealing signature of " <> formatErr pmod)
mtnfSealed' <- mayAscribeNF mtnfInferred mtnfSealed
... | 484 | inferModuleExpr pmod (ModuleSeal mdl mtypeSealed) = do
(mdl', mtnfInferred) <- inferModuleExpr pmod mdl
(mtypeSealed', mtnfSealed) <- checkModuleType mtypeSealed
<??@ ("while checking sealing signature of " <> formatErr pmod)
mtnfSealed' <- mayAscribeNF mtnfInferred mtnfSealed
... | 484 | false | false | 0 | 11 | 129 | 110 | 53 | 57 | null | null |
cmoresid/lightning-haskell | src/Web/Lightning.hs | bsd-3-clause | -- | Performs a lightning action (or 'LightningT' transformer actions) with
-- the specified lightning options.
runLightningWith :: MonadIO m => LightningOptions
-> LightningT m a
-> m (Either (APIError LightningError) a)
runLightningWith opts lightning =
dropResume <$> runRe... | 353 | runLightningWith :: MonadIO m => LightningOptions
-> LightningT m a
-> m (Either (APIError LightningError) a)
runLightningWith opts lightning =
dropResume <$> runResumeLightningtWith opts lightning | 241 | runLightningWith opts lightning =
dropResume <$> runResumeLightningtWith opts lightning | 89 | true | true | 0 | 12 | 84 | 64 | 31 | 33 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.