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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
devonhollowood/adventofcode | 2015/day17/day17.hs | mit | ascCombos :: Int -> [Int] -> [[Int]]
ascCombos _ [] = [] | 56 | ascCombos :: Int -> [Int] -> [[Int]]
ascCombos _ [] = [] | 56 | ascCombos _ [] = [] | 19 | false | true | 0 | 8 | 11 | 37 | 20 | 17 | null | null |
adarqui/99problems-hs | Experimentation/P21.hs | gpl-3.0 | insertAt_rec a lst@(l:ls) n = l : insertAt_rec a ls (n - 1) | 59 | insertAt_rec a lst@(l:ls) n = l : insertAt_rec a ls (n - 1) | 59 | insertAt_rec a lst@(l:ls) n = l : insertAt_rec a ls (n - 1) | 59 | false | false | 0 | 8 | 12 | 41 | 21 | 20 | null | null |
fmapfmapfmap/amazonka | amazonka-ml/gen/Network/AWS/MachineLearning/CreateBatchPrediction.hs | mpl-2.0 | -- | A user-supplied ID that uniquely identifies the 'BatchPrediction'.
cbpBatchPredictionId :: Lens' CreateBatchPrediction Text
cbpBatchPredictionId = lens _cbpBatchPredictionId (\ s a -> s{_cbpBatchPredictionId = a}) | 218 | cbpBatchPredictionId :: Lens' CreateBatchPrediction Text
cbpBatchPredictionId = lens _cbpBatchPredictionId (\ s a -> s{_cbpBatchPredictionId = a}) | 146 | cbpBatchPredictionId = lens _cbpBatchPredictionId (\ s a -> s{_cbpBatchPredictionId = a}) | 89 | true | true | 0 | 9 | 25 | 40 | 22 | 18 | null | null |
jeyoor/haskell-learning-challenge | learn_haskell_github_courses/Cis194/src/Lecture01.hs | bsd-3-clause | intSeqSynonymLength (_ :< xs) = 1 + intSeqSynonymLength xs | 58 | intSeqSynonymLength (_ :< xs) = 1 + intSeqSynonymLength xs | 58 | intSeqSynonymLength (_ :< xs) = 1 + intSeqSynonymLength xs | 58 | false | false | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
GaloisInc/saw-script | src/SAWScript/HeapsterBuiltins.hs | bsd-3-clause | heapster_init_env_gen :: BuiltinContext -> Options -> DebugLevel ->
Text -> String -> TopLevel HeapsterEnv
heapster_init_env_gen _bic _opts dlevel mod_str llvm_filename =
do llvm_mod <- llvm_load_module llvm_filename
sc <- getSharedContext
let saw_mod_name = mkModuleName [mod_str]
mod_loaded <- liftIO $ scModuleIsLoaded sc saw_mod_name
if mod_loaded then
fail ("SAW module with name " ++ show mod_str ++ " already defined!")
else return ()
-- import Prelude by default
preludeMod <- liftIO $ scFindModule sc preludeModuleName
liftIO $ scLoadModule sc (insImport (const True) preludeMod $
emptyModule saw_mod_name)
mkHeapsterEnv dlevel saw_mod_name [llvm_mod] | 774 | heapster_init_env_gen :: BuiltinContext -> Options -> DebugLevel ->
Text -> String -> TopLevel HeapsterEnv
heapster_init_env_gen _bic _opts dlevel mod_str llvm_filename =
do llvm_mod <- llvm_load_module llvm_filename
sc <- getSharedContext
let saw_mod_name = mkModuleName [mod_str]
mod_loaded <- liftIO $ scModuleIsLoaded sc saw_mod_name
if mod_loaded then
fail ("SAW module with name " ++ show mod_str ++ " already defined!")
else return ()
-- import Prelude by default
preludeMod <- liftIO $ scFindModule sc preludeModuleName
liftIO $ scLoadModule sc (insImport (const True) preludeMod $
emptyModule saw_mod_name)
mkHeapsterEnv dlevel saw_mod_name [llvm_mod] | 774 | heapster_init_env_gen _bic _opts dlevel mod_str llvm_filename =
do llvm_mod <- llvm_load_module llvm_filename
sc <- getSharedContext
let saw_mod_name = mkModuleName [mod_str]
mod_loaded <- liftIO $ scModuleIsLoaded sc saw_mod_name
if mod_loaded then
fail ("SAW module with name " ++ show mod_str ++ " already defined!")
else return ()
-- import Prelude by default
preludeMod <- liftIO $ scFindModule sc preludeModuleName
liftIO $ scLoadModule sc (insImport (const True) preludeMod $
emptyModule saw_mod_name)
mkHeapsterEnv dlevel saw_mod_name [llvm_mod] | 642 | false | true | 0 | 13 | 200 | 189 | 88 | 101 | null | null |
phaul/chess | Chess/Move/Generator.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Conversion from Move to PseudoLegalMove
mkPseudo :: Move -> PseudoLegalMove
mkPseudo = PseudoLegalMove | 186 | mkPseudo :: Move -> PseudoLegalMove
mkPseudo = PseudoLegalMove | 62 | mkPseudo = PseudoLegalMove | 26 | true | true | 0 | 5 | 15 | 17 | 10 | 7 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/Typecheck/TCMonad.hs | bsd-3-clause | freshTyArgs :: Unif r => AnnSSA r -> Int -> IContext -> [BTVar r] -> RType r -> TCM r ([BTVar r], RType r)
--------------------------------------------------------------------------------
freshTyArgs a n ξ bs t
= do (βs, θ) <- freshSubst a n ξ bs
return $ (βs, apply θ t)
-------------------------------------------------------------------------------- | 366 | freshTyArgs :: Unif r => AnnSSA r -> Int -> IContext -> [BTVar r] -> RType r -> TCM r ([BTVar r], RType r)
freshTyArgs a n ξ bs t
= do (βs, θ) <- freshSubst a n ξ bs
return $ (βs, apply θ t)
-------------------------------------------------------------------------------- | 285 | freshTyArgs a n ξ bs t
= do (βs, θ) <- freshSubst a n ξ bs
return $ (βs, apply θ t)
-------------------------------------------------------------------------------- | 178 | true | true | 0 | 15 | 61 | 128 | 62 | 66 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/types/Type.hs | bsd-3-clause | -- Its important to use mkAppTys, rather than (foldl AppTy),
-- because the function part might well return a
-- partially-applied type constructor; indeed, usually will!
coreView _ = Nothing | 237 | coreView _ = Nothing | 36 | coreView _ = Nothing | 36 | true | false | 0 | 4 | 75 | 13 | 7 | 6 | null | null |
Persi/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | deadSimple (T_DollarSingleQuoted _ s) = [s] | 43 | deadSimple (T_DollarSingleQuoted _ s) = [s] | 43 | deadSimple (T_DollarSingleQuoted _ s) = [s] | 43 | false | false | 0 | 7 | 5 | 20 | 10 | 10 | null | null |
myfreeweb/http-link-header | library/Network/HTTP/Link/Writer.hs | unlicense | writeParamKey Anchor = "anchor" | 31 | writeParamKey Anchor = "anchor" | 31 | writeParamKey Anchor = "anchor" | 31 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
paholg/dotfiles | home/xmonad.hs | gpl-2.0 | my_pdfviewer = "okular" | 23 | my_pdfviewer = "okular" | 23 | my_pdfviewer = "okular" | 23 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
iqsf/HFitUI | src/WebUI/Widgets/UIWidget.hs | bsd-3-clause | -- | Установка ZIndex
zIndex :: Int -> WidgetUI -> UI WidgetUI
zIndex val widget =
applyStyleToWidget widget ("z-index:" ++ (show val) ++ ";") | 146 | zIndex :: Int -> WidgetUI -> UI WidgetUI
zIndex val widget =
applyStyleToWidget widget ("z-index:" ++ (show val) ++ ";") | 124 | zIndex val widget =
applyStyleToWidget widget ("z-index:" ++ (show val) ++ ";") | 83 | true | true | 0 | 10 | 27 | 56 | 26 | 30 | null | null |
markus-git/co-feldspar | src/Feldspar/Software/Optimize.hs | bsd-3-clause | simplifyUp (SymP t Not :$ (SymP _ Lt :$ a :$ b))
= simplifyUp $ SymP t Gte :$ a :$ b | 86 | simplifyUp (SymP t Not :$ (SymP _ Lt :$ a :$ b))
= simplifyUp $ SymP t Gte :$ a :$ b | 86 | simplifyUp (SymP t Not :$ (SymP _ Lt :$ a :$ b))
= simplifyUp $ SymP t Gte :$ a :$ b | 86 | false | false | 0 | 10 | 23 | 54 | 26 | 28 | null | null |
marcellussiegburg/autotool | collection/src/FD/Roll.hs | gpl-2.0 | random_subsequence xs = do
fs <- forM xs $ \ _ -> randomRIO (False,True)
return $ map fst $ filter snd $ zip xs fs
{-
roll_cnf conf = nub <$> ( forM [ 1 .. num_clauses conf ] $ \ i -> do
vs <- permIO $ map Variable [ 1 .. num_variables conf ]
l <- randomRIO $ num_literals_in_clause conf
forM (sort $ take l vs) $ \ v -> mkLiteral v <$> randomRIO (False,True)
)
-} | 394 | random_subsequence xs = do
fs <- forM xs $ \ _ -> randomRIO (False,True)
return $ map fst $ filter snd $ zip xs fs
{-
roll_cnf conf = nub <$> ( forM [ 1 .. num_clauses conf ] $ \ i -> do
vs <- permIO $ map Variable [ 1 .. num_variables conf ]
l <- randomRIO $ num_literals_in_clause conf
forM (sort $ take l vs) $ \ v -> mkLiteral v <$> randomRIO (False,True)
)
-} | 394 | random_subsequence xs = do
fs <- forM xs $ \ _ -> randomRIO (False,True)
return $ map fst $ filter snd $ zip xs fs
{-
roll_cnf conf = nub <$> ( forM [ 1 .. num_clauses conf ] $ \ i -> do
vs <- permIO $ map Variable [ 1 .. num_variables conf ]
l <- randomRIO $ num_literals_in_clause conf
forM (sort $ take l vs) $ \ v -> mkLiteral v <$> randomRIO (False,True)
)
-} | 394 | false | false | 0 | 11 | 108 | 64 | 30 | 34 | null | null |
w4ngyi/postgrest | src/PostgREST/PgQuery.hs | mit | pgFmtJsonbPath :: QualifiedIdentifier -> T.Text -> T.Text
pgFmtJsonbPath table p =
pgFmtJsonbPath' $ fromMaybe (ColIdentifier p) (parseJsonbPath p)
where
pgFmtJsonbPath' (ColIdentifier i) = fromQi table <> "." <> pgFmtIdent i
pgFmtJsonbPath' (KeyIdentifier i) = pgFmtLit i
pgFmtJsonbPath' (SingleArrow a b) =
pgFmtJsonbPath' a <> "->" <> pgFmtJsonbPath' b
pgFmtJsonbPath' (DoubleArrow a b) =
pgFmtJsonbPath' a <> "->>" <> pgFmtJsonbPath' b | 471 | pgFmtJsonbPath :: QualifiedIdentifier -> T.Text -> T.Text
pgFmtJsonbPath table p =
pgFmtJsonbPath' $ fromMaybe (ColIdentifier p) (parseJsonbPath p)
where
pgFmtJsonbPath' (ColIdentifier i) = fromQi table <> "." <> pgFmtIdent i
pgFmtJsonbPath' (KeyIdentifier i) = pgFmtLit i
pgFmtJsonbPath' (SingleArrow a b) =
pgFmtJsonbPath' a <> "->" <> pgFmtJsonbPath' b
pgFmtJsonbPath' (DoubleArrow a b) =
pgFmtJsonbPath' a <> "->>" <> pgFmtJsonbPath' b | 471 | pgFmtJsonbPath table p =
pgFmtJsonbPath' $ fromMaybe (ColIdentifier p) (parseJsonbPath p)
where
pgFmtJsonbPath' (ColIdentifier i) = fromQi table <> "." <> pgFmtIdent i
pgFmtJsonbPath' (KeyIdentifier i) = pgFmtLit i
pgFmtJsonbPath' (SingleArrow a b) =
pgFmtJsonbPath' a <> "->" <> pgFmtJsonbPath' b
pgFmtJsonbPath' (DoubleArrow a b) =
pgFmtJsonbPath' a <> "->>" <> pgFmtJsonbPath' b | 413 | false | true | 0 | 8 | 91 | 157 | 74 | 83 | null | null |
sinelaw/lamdu | test/InferAssert.hs | gpl-3.0 | canonizeInferred :: InferResults t -> InferResults t
canonizeInferred =
ExprUtil.randomizeParamIdsG (const ()) ExprUtil.debugNameGen Map.empty canonizePayload
where
canonizePayload gen guidMap (ival, ityp) =
( ExprUtil.randomizeParamIdsG (const ()) gen1 guidMap (\_ _ x -> x) ival
, ExprUtil.randomizeParamIdsG (const ()) gen2 guidMap (\_ _ x -> x) ityp
)
where
(gen1, gen2) = ExprUtil.ngSplit gen | 437 | canonizeInferred :: InferResults t -> InferResults t
canonizeInferred =
ExprUtil.randomizeParamIdsG (const ()) ExprUtil.debugNameGen Map.empty canonizePayload
where
canonizePayload gen guidMap (ival, ityp) =
( ExprUtil.randomizeParamIdsG (const ()) gen1 guidMap (\_ _ x -> x) ival
, ExprUtil.randomizeParamIdsG (const ()) gen2 guidMap (\_ _ x -> x) ityp
)
where
(gen1, gen2) = ExprUtil.ngSplit gen | 437 | canonizeInferred =
ExprUtil.randomizeParamIdsG (const ()) ExprUtil.debugNameGen Map.empty canonizePayload
where
canonizePayload gen guidMap (ival, ityp) =
( ExprUtil.randomizeParamIdsG (const ()) gen1 guidMap (\_ _ x -> x) ival
, ExprUtil.randomizeParamIdsG (const ()) gen2 guidMap (\_ _ x -> x) ityp
)
where
(gen1, gen2) = ExprUtil.ngSplit gen | 384 | false | true | 0 | 9 | 92 | 156 | 80 | 76 | null | null |
pbv/codex | src/Codex/Tester/Utils.hs | mit | -- | parse a command line string
parseArgs :: MonadIO m => String -> m [String]
parseArgs ""
= return [] | 106 | parseArgs :: MonadIO m => String -> m [String]
parseArgs ""
= return [] | 73 | parseArgs ""
= return [] | 26 | true | true | 0 | 8 | 22 | 37 | 18 | 19 | null | null |
sdiehl/ghc | testsuite/tests/parser/should_fail/readFailTraditionalRecords2.hs | bsd-3-clause | f (Foo { i = j }) = j | 21 | f (Foo { i = j }) = j | 21 | f (Foo { i = j }) = j | 21 | false | false | 0 | 8 | 8 | 22 | 11 | 11 | null | null |
kellino/TypeSystems | arith/Arith.hs | mit | isVal t = isNumeric t | 21 | isVal t = isNumeric t | 21 | isVal t = isNumeric t | 21 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
gust/feature-creature | users-service/src/Config/AppConfig.hs | mit | loadEnvVars :: AppName -> Environment -> IO ()
loadEnvVars appName env = dataDirectory appName >>= \dataDir -> do
let filePath = dataDir </> envName env <.> "env"
loadEnvFrom $ filePath
where
envName :: Environment -> FilePath
envName = T.unpack . toLower . T.pack . show
dataDirectory :: AppName -> IO FilePath
dataDirectory = getAppUserDataDirectory . T.unpack | 385 | loadEnvVars :: AppName -> Environment -> IO ()
loadEnvVars appName env = dataDirectory appName >>= \dataDir -> do
let filePath = dataDir </> envName env <.> "env"
loadEnvFrom $ filePath
where
envName :: Environment -> FilePath
envName = T.unpack . toLower . T.pack . show
dataDirectory :: AppName -> IO FilePath
dataDirectory = getAppUserDataDirectory . T.unpack | 385 | loadEnvVars appName env = dataDirectory appName >>= \dataDir -> do
let filePath = dataDir </> envName env <.> "env"
loadEnvFrom $ filePath
where
envName :: Environment -> FilePath
envName = T.unpack . toLower . T.pack . show
dataDirectory :: AppName -> IO FilePath
dataDirectory = getAppUserDataDirectory . T.unpack | 338 | false | true | 5 | 14 | 78 | 129 | 62 | 67 | null | null |
jberthold/rts-serialisation | Data/MemoCombinators.hs | bsd-3-clause | -- | Memoize the third argument of a function.
memoThird :: Memo c -> (a -> b -> c -> r) -> (a -> b -> c -> r)
memoThird c = (memoSecond c .) | 141 | memoThird :: Memo c -> (a -> b -> c -> r) -> (a -> b -> c -> r)
memoThird c = (memoSecond c .) | 94 | memoThird c = (memoSecond c .) | 30 | true | true | 0 | 12 | 34 | 69 | 34 | 35 | null | null |
anthezium/MonadicRP | src/RPListMoveTest.hs | gpl-3.0 | compactShow :: (Show a, Eq a) => [a] -> String
compactShow xs = intercalate ", " $ map (\xs -> show (length xs) ++ " x " ++ show (head xs)) $ group xs | 150 | compactShow :: (Show a, Eq a) => [a] -> String
compactShow xs = intercalate ", " $ map (\xs -> show (length xs) ++ " x " ++ show (head xs)) $ group xs | 150 | compactShow xs = intercalate ", " $ map (\xs -> show (length xs) ++ " x " ++ show (head xs)) $ group xs | 103 | false | true | 0 | 14 | 33 | 92 | 44 | 48 | null | null |
aochagavia/CompilerConstruction | funflow/src/FunFlow/TypeSystem.hs | apache-2.0 | {- W algorithm for Hilney Miler type inference -}
fresh :: State Int Type
fresh = Alpha <$> freshInt | 100 | fresh :: State Int Type
fresh = Alpha <$> freshInt | 50 | fresh = Alpha <$> freshInt | 26 | true | true | 2 | 6 | 18 | 28 | 12 | 16 | null | null |
elieux/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Base classes (Eq, Ord, Functor)
fmapName, eqClassName, eqName, ordClassName, geName, functorClassName :: Name
eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey | 181 | fmapName, eqClassName, eqName, ordClassName, geName, functorClassName :: Name
eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey | 146 | eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey | 68 | true | true | 0 | 7 | 31 | 35 | 23 | 12 | null | null |
oldmanmike/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | negateIntegerName = varQual gHC_INTEGER_TYPE (fsLit "negateInteger") negateIntegerIdKey | 95 | negateIntegerName = varQual gHC_INTEGER_TYPE (fsLit "negateInteger") negateIntegerIdKey | 95 | negateIntegerName = varQual gHC_INTEGER_TYPE (fsLit "negateInteger") negateIntegerIdKey | 95 | false | false | 0 | 7 | 14 | 19 | 9 | 10 | null | null |
DanielWaterworth/Idris-dev | src/Idris/WhoCalls.hs | bsd-3-clause | occurs n (Proj t _) = occurs n t | 32 | occurs n (Proj t _) = occurs n t | 32 | occurs n (Proj t _) = occurs n t | 32 | false | false | 0 | 6 | 8 | 26 | 11 | 15 | null | null |
ksaveljev/hNES | NES/EmulatorHelpers.hs | mit | loadY :: MonadEmulator m => m Word8
loadY = load8 Y | 51 | loadY :: MonadEmulator m => m Word8
loadY = load8 Y | 51 | loadY = load8 Y | 15 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
bos/statistics | Statistics/Distribution/Binomial.hs | bsd-2-clause | errMsg :: Int -> Double -> String
errMsg n p
= "Statistics.Distribution.Binomial.binomial: n=" ++ show n
++ " p=" ++ show p ++ "but n>=0 and p in [0,1]" | 156 | errMsg :: Int -> Double -> String
errMsg n p
= "Statistics.Distribution.Binomial.binomial: n=" ++ show n
++ " p=" ++ show p ++ "but n>=0 and p in [0,1]" | 156 | errMsg n p
= "Statistics.Distribution.Binomial.binomial: n=" ++ show n
++ " p=" ++ show p ++ "but n>=0 and p in [0,1]" | 122 | false | true | 6 | 8 | 32 | 55 | 23 | 32 | null | null |
junnf/Functional-Programming | codes/trigdeg.hs | unlicense | -- Lagged Difference of a time serie
-- lagddif [xi] = [x_i+1 - x_i]
lagdiff lst = zipWith (-) (tail lst) lst | 109 | lagdiff lst = zipWith (-) (tail lst) lst | 40 | lagdiff lst = zipWith (-) (tail lst) lst | 40 | true | false | 0 | 7 | 21 | 26 | 14 | 12 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/cabal-install/Distribution/Client/Sandbox/Timestamp.hs | bsd-3-clause | -- | The 'add-source-timestamps' file keeps the timestamps of all add-source
-- dependencies. It is initially populated by 'sandbox add-source' and kept
-- current by 'reinstallAddSourceDeps' and 'configure -w'. The user can install
-- add-source deps manually with 'cabal install' after having edited them, so we
-- can err on the side of caution sometimes.
-- FIXME: We should keep this info in the index file, together with build tree
-- refs.
timestampFileName :: FilePath
timestampFileName = "add-source-timestamps" | 520 | timestampFileName :: FilePath
timestampFileName = "add-source-timestamps" | 73 | timestampFileName = "add-source-timestamps" | 43 | true | true | 0 | 6 | 77 | 25 | 14 | 11 | null | null |
HIPERFIT/futhark | src/Futhark/Transform/Rename.hs | isc | -- | Perform a renaming using the 'Substitute' instance. This only
-- works if the argument does not itself perform any name binding, but
-- it can save on boilerplate for simple types.
substituteRename :: Substitute a => a -> RenameM a
substituteRename x = do
substs <- renamerSubstitutions
return $ substituteNames substs x
-- | Members of class 'Rename' can be uniquely renamed. | 387 | substituteRename :: Substitute a => a -> RenameM a
substituteRename x = do
substs <- renamerSubstitutions
return $ substituteNames substs x
-- | Members of class 'Rename' can be uniquely renamed. | 200 | substituteRename x = do
substs <- renamerSubstitutions
return $ substituteNames substs x
-- | Members of class 'Rename' can be uniquely renamed. | 149 | true | true | 0 | 8 | 69 | 51 | 25 | 26 | null | null |
michalkonecny/aern | aern-real/src/Numeric/AERN/RealArithmetic/RefinementOrderRounding/FieldOps.hs | bsd-3-clause | powerToNonnegIntIn :: (RoundedPowerToNonnegInt t) => t -> Int -> t
powerToNonnegIntIn a = powerToNonnegIntInEff (powerToNonnegIntDefaultEffort a) a | 147 | powerToNonnegIntIn :: (RoundedPowerToNonnegInt t) => t -> Int -> t
powerToNonnegIntIn a = powerToNonnegIntInEff (powerToNonnegIntDefaultEffort a) a | 147 | powerToNonnegIntIn a = powerToNonnegIntInEff (powerToNonnegIntDefaultEffort a) a | 80 | false | true | 0 | 7 | 16 | 42 | 21 | 21 | null | null |
Paow/encore | src/ir/AST/PrettyPrinter.hs | bsd-3-clause | ppVar :: VarDecl -> Doc
ppVar (VarType x ty) = ppName x <+> ":" <+> ppType ty | 77 | ppVar :: VarDecl -> Doc
ppVar (VarType x ty) = ppName x <+> ":" <+> ppType ty | 77 | ppVar (VarType x ty) = ppName x <+> ":" <+> ppType ty | 53 | false | true | 0 | 7 | 16 | 44 | 20 | 24 | null | null |
wouwouwou/2017_module_8 | src/haskell/PP-project-2017/lib/sprockell-2017/src/Sprockell/Simulation.hs | apache-2.0 | setupBuffering :: IO (BufferMode,BufferMode)
setupBuffering = do
oldin <- hGetBuffering stdin
oldout <- hGetBuffering stdout
hSetBuffering stdin NoBuffering -- needed to make charIO work nicely
hSetBuffering stdout NoBuffering
return (oldin,oldout) | 271 | setupBuffering :: IO (BufferMode,BufferMode)
setupBuffering = do
oldin <- hGetBuffering stdin
oldout <- hGetBuffering stdout
hSetBuffering stdin NoBuffering -- needed to make charIO work nicely
hSetBuffering stdout NoBuffering
return (oldin,oldout) | 271 | setupBuffering = do
oldin <- hGetBuffering stdin
oldout <- hGetBuffering stdout
hSetBuffering stdin NoBuffering -- needed to make charIO work nicely
hSetBuffering stdout NoBuffering
return (oldin,oldout) | 226 | false | true | 0 | 8 | 52 | 69 | 32 | 37 | null | null |
JPMoresmau/haskell-ide-engine | src/Haskell/Ide/Engine/Transport/JsonHttp.hs | bsd-3-clause | server :: HieServer plugins => Proxy plugins -> TChan ChannelRequest -> TChan ChannelResponse -> Server (PluginRoutes plugins)
server proxy cin cout = hieServer proxy cin cout | 176 | server :: HieServer plugins => Proxy plugins -> TChan ChannelRequest -> TChan ChannelResponse -> Server (PluginRoutes plugins)
server proxy cin cout = hieServer proxy cin cout | 176 | server proxy cin cout = hieServer proxy cin cout | 48 | false | true | 0 | 11 | 26 | 62 | 28 | 34 | null | null |
frsoares/hsimplesearch | src/Search/Interpreter.hs | gpl-2.0 | isExclude (QExclude _) = True | 29 | isExclude (QExclude _) = True | 29 | isExclude (QExclude _) = True | 29 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
mightymoose/liquidhaskell | benchmarks/text-0.11.2.3/Data/Text/Lazy.hs | bsd-3-clause | -- | /O(n)/ 'all' @p@ @t@ determines whether all characters in the
-- 'Text' @t@ satisify the predicate @p@. Subject to fusion.
all :: (Char -> Bool) -> Text -> Bool
all p t = S.all p (stream t) | 194 | all :: (Char -> Bool) -> Text -> Bool
all p t = S.all p (stream t) | 66 | all p t = S.all p (stream t) | 28 | true | true | 0 | 7 | 38 | 50 | 25 | 25 | null | null |
clample/lamdabtc | backend/test/Protocol/ServerTest.hs | bsd-3-clause | longerChain = testProperty
"We should use the correct active chain"
prop_longerChain | 88 | longerChain = testProperty
"We should use the correct active chain"
prop_longerChain | 88 | longerChain = testProperty
"We should use the correct active chain"
prop_longerChain | 88 | false | false | 0 | 4 | 14 | 12 | 5 | 7 | null | null |
Numberartificial/workflow | snipets/src/Craft/Chapter14_2.hs | mit | mapMaybe g (Just x) = Just (g x) | 32 | mapMaybe g (Just x) = Just (g x) | 32 | mapMaybe g (Just x) = Just (g x) | 32 | false | false | 0 | 7 | 7 | 28 | 12 | 16 | null | null |
brendanhay/gogol | gogol-androidmanagement/gen/Network/Google/AndroidManagement/Types/Product.hs | mpl-2.0 | -- | Whether configuring Wi-Fi access points is disabled.Note: If a network
-- connection can\'t be made at boot time and configuring Wi-Fi is disabled
-- then network escape hatch will be shown in order to refresh the device
-- policy (see networkEscapeHatchEnabled).
pWifiConfigDisabled :: Lens' Policy (Maybe Bool)
pWifiConfigDisabled
= lens _pWifiConfigDisabled
(\ s a -> s{_pWifiConfigDisabled = a}) | 412 | pWifiConfigDisabled :: Lens' Policy (Maybe Bool)
pWifiConfigDisabled
= lens _pWifiConfigDisabled
(\ s a -> s{_pWifiConfigDisabled = a}) | 143 | pWifiConfigDisabled
= lens _pWifiConfigDisabled
(\ s a -> s{_pWifiConfigDisabled = a}) | 94 | true | true | 0 | 8 | 67 | 52 | 28 | 24 | null | null |
keithodulaigh/Hets | QVTR/StatAna.hs | gpl-2.0 | collectRecursivePreds :: [RelVar] -> Maybe ObjectTemplate ->
[(String, String, OCL)]
collectRecursivePreds _ Nothing = [] | 146 | collectRecursivePreds :: [RelVar] -> Maybe ObjectTemplate ->
[(String, String, OCL)]
collectRecursivePreds _ Nothing = [] | 146 | collectRecursivePreds _ Nothing = [] | 36 | false | true | 0 | 8 | 39 | 44 | 24 | 20 | null | null |
samplecount/shake-language-c | src/Development/Shake/Language/C/Target/Android.hs | apache-2.0 | abiString (X86 _) = "x86" | 29 | abiString (X86 _) = "x86" | 29 | abiString (X86 _) = "x86" | 29 | false | false | 0 | 6 | 8 | 16 | 7 | 9 | null | null |
vikraman/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | isTypedSplice _ = False | 40 | isTypedSplice _ = False | 40 | isTypedSplice _ = False | 40 | false | false | 0 | 5 | 20 | 9 | 4 | 5 | null | null |
houshuang/frame | src/Data/Frame/Types.hs | mit | subsumes _ Any = True | 21 | subsumes _ Any = True | 21 | subsumes _ Any = True | 21 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
juliankopkalarsen/FpStats | GMM/src/LikSpecLang.hs | mit | (%) :: Expr a o -> Expr i a -> Expr i o
b % a = Pipe b a | 56 | (%) :: Expr a o -> Expr i a -> Expr i o
b % a = Pipe b a | 56 | b % a = Pipe b a | 16 | false | true | 0 | 9 | 19 | 52 | 23 | 29 | null | null |
rahulmutt/ghcvm | compiler/Eta/Utils/OrdList.hs | bsd-3-clause | foldrOL k z (Snoc xs x) = foldrOL k (k x z) xs | 46 | foldrOL k z (Snoc xs x) = foldrOL k (k x z) xs | 46 | foldrOL k z (Snoc xs x) = foldrOL k (k x z) xs | 46 | false | false | 0 | 7 | 12 | 36 | 17 | 19 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/FileMonitor.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Update the input value and the set of files monitored by the
-- 'FileMonitor', plus the cached value that may be returned in future.
--
-- This takes a snapshot of the state of the monitored files right now, so
-- 'checkFileMonitorChanged' will look for file system changes relative to
-- this snapshot.
--
-- This is typically done once the action has been completed successfully and
-- we have the action's result and we know what files it looked at. See
-- 'FileMonitor' for a full explanation.
--
-- If we do take the snapshot after the action has completed then we have a
-- problem. The problem is that files might have changed /while/ the action was
-- running but /after/ the action read them. If we take the snapshot after the
-- action completes then we will miss these changes. The solution is to record
-- a timestamp before beginning execution of the action and then we make the
-- conservative assumption that any file that has changed since then has
-- already changed, ie the file monitor state for these files will be such that
-- 'checkFileMonitorChanged' will report that they have changed.
--
-- So if you do use 'updateFileMonitor' after the action (so you can discover
-- the files used rather than predicting them in advance) then use
-- 'beginUpdateFileMonitor' to get a timestamp and pass that. Alternatively,
-- if you take the snapshot in advance of the action, or you're not monitoring
-- any files then you can use @Nothing@ for the timestamp parameter.
--
updateFileMonitor
:: (Binary a, Binary b)
=> FileMonitor a b -- ^ cache file path
-> FilePath -- ^ root directory
-> Maybe MonitorTimestamp -- ^ timestamp when the update action started
-> [MonitorFilePath] -- ^ files of interest relative to root
-> a -- ^ the current key value
-> b -- ^ the current result value
-> IO ()
updateFileMonitor monitor root startTime monitorFiles
cachedKey cachedResult = do
hashcache <- readCacheFileHashes monitor
msfs <- buildMonitorStateFileSet startTime hashcache root monitorFiles
rewriteCacheFile monitor msfs cachedKey cachedResult
-- | A timestamp to help with the problem of file changes during actions.
-- See 'updateFileMonitor' for details.
-- | 2,384 | updateFileMonitor
:: (Binary a, Binary b)
=> FileMonitor a b -- ^ cache file path
-> FilePath -- ^ root directory
-> Maybe MonitorTimestamp -- ^ timestamp when the update action started
-> [MonitorFilePath] -- ^ files of interest relative to root
-> a -- ^ the current key value
-> b -- ^ the current result value
-> IO ()
updateFileMonitor monitor root startTime monitorFiles
cachedKey cachedResult = do
hashcache <- readCacheFileHashes monitor
msfs <- buildMonitorStateFileSet startTime hashcache root monitorFiles
rewriteCacheFile monitor msfs cachedKey cachedResult
-- | A timestamp to help with the problem of file changes during actions.
-- See 'updateFileMonitor' for details.
-- | 813 | updateFileMonitor monitor root startTime monitorFiles
cachedKey cachedResult = do
hashcache <- readCacheFileHashes monitor
msfs <- buildMonitorStateFileSet startTime hashcache root monitorFiles
rewriteCacheFile monitor msfs cachedKey cachedResult
-- | A timestamp to help with the problem of file changes during actions.
-- See 'updateFileMonitor' for details.
-- | 394 | true | true | 0 | 14 | 498 | 158 | 92 | 66 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Compute/Types/Product.hs | mpl-2.0 | -- | The project ID. For example: my-example-project. Use the project ID to
-- make requests to Compute Engine.
pName :: Lens' Project (Maybe Text)
pName = lens _pName (\ s a -> s{_pName = a}) | 192 | pName :: Lens' Project (Maybe Text)
pName = lens _pName (\ s a -> s{_pName = a}) | 80 | pName = lens _pName (\ s a -> s{_pName = a}) | 44 | true | true | 2 | 9 | 35 | 56 | 26 | 30 | null | null |
facebookincubator/duckling | Duckling/Time/DE/Rules.hs | bsd-3-clause | ruleTimeofdayApproximately :: Rule
ruleTimeofdayApproximately = Rule
{ name = "<time-of-day> approximately"
, pattern =
[ Predicate isATimeOfDay
, regex "ca\\.?|circa|zirka|ungef(ä)hr|(in )?etwa"
]
, prod = \tokens -> case tokens of
(Token Time td:_) -> tt $ notLatent td
_ -> Nothing
} | 318 | ruleTimeofdayApproximately :: Rule
ruleTimeofdayApproximately = Rule
{ name = "<time-of-day> approximately"
, pattern =
[ Predicate isATimeOfDay
, regex "ca\\.?|circa|zirka|ungef(ä)hr|(in )?etwa"
]
, prod = \tokens -> case tokens of
(Token Time td:_) -> tt $ notLatent td
_ -> Nothing
} | 318 | ruleTimeofdayApproximately = Rule
{ name = "<time-of-day> approximately"
, pattern =
[ Predicate isATimeOfDay
, regex "ca\\.?|circa|zirka|ungef(ä)hr|(in )?etwa"
]
, prod = \tokens -> case tokens of
(Token Time td:_) -> tt $ notLatent td
_ -> Nothing
} | 283 | false | true | 0 | 14 | 73 | 93 | 47 | 46 | null | null |
facebookincubator/duckling | Duckling/Numeral/AR/EG/Rules.hs | bsd-3-clause | ruleInteger900 :: Rule
ruleInteger900 = Rule
{ name = "integer (900)"
, pattern =
[ regex "([تط]و?سعو?)مي[هةت]"
]
, prod = const $ integer 900
} | 160 | ruleInteger900 :: Rule
ruleInteger900 = Rule
{ name = "integer (900)"
, pattern =
[ regex "([تط]و?سعو?)مي[هةت]"
]
, prod = const $ integer 900
} | 160 | ruleInteger900 = Rule
{ name = "integer (900)"
, pattern =
[ regex "([تط]و?سعو?)مي[هةت]"
]
, prod = const $ integer 900
} | 137 | false | true | 0 | 9 | 41 | 48 | 26 | 22 | null | null |
bordaigorl/jamesbound | src/Language/PiCalc/Analysis/PetriNet.hs | gpl-2.0 | places :: Ord pl => PN pl -> Set pl
places pn = foldr Set.insert Set.empty $ concatMap extract $ rules pn
where extract (pre,post) = map fst $ pre ++ post | 157 | places :: Ord pl => PN pl -> Set pl
places pn = foldr Set.insert Set.empty $ concatMap extract $ rules pn
where extract (pre,post) = map fst $ pre ++ post | 156 | places pn = foldr Set.insert Set.empty $ concatMap extract $ rules pn
where extract (pre,post) = map fst $ pre ++ post | 120 | false | true | 0 | 8 | 34 | 86 | 39 | 47 | null | null |
julmue/UntypedLambda | test/Language/Lambda/Semantics/Named/BigStep/Tests.hs | bsd-3-clause | iszro_Tests = testGroup "iszro_Tests"
[ testCase "iszro_ 1" $
normalOrder (iszro_ # zro_) @=? tru_
, testCase "iszro_ 2" $
normalOrder (iszro_ # (scc_ # zro_)) @=? fls_
] | 198 | iszro_Tests = testGroup "iszro_Tests"
[ testCase "iszro_ 1" $
normalOrder (iszro_ # zro_) @=? tru_
, testCase "iszro_ 2" $
normalOrder (iszro_ # (scc_ # zro_)) @=? fls_
] | 198 | iszro_Tests = testGroup "iszro_Tests"
[ testCase "iszro_ 1" $
normalOrder (iszro_ # zro_) @=? tru_
, testCase "iszro_ 2" $
normalOrder (iszro_ # (scc_ # zro_)) @=? fls_
] | 198 | false | false | 0 | 12 | 56 | 67 | 33 | 34 | null | null |
spacekitteh/smcghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | -- Atomic read-modify-write
emitPrimOp dflags [res] FetchAddByteArrayOp_Int [mba, ix, n] =
doAtomicRMW res AMO_Add mba ix (bWord dflags) n | 142 | emitPrimOp dflags [res] FetchAddByteArrayOp_Int [mba, ix, n] =
doAtomicRMW res AMO_Add mba ix (bWord dflags) n | 114 | emitPrimOp dflags [res] FetchAddByteArrayOp_Int [mba, ix, n] =
doAtomicRMW res AMO_Add mba ix (bWord dflags) n | 114 | true | false | 0 | 7 | 22 | 53 | 25 | 28 | null | null |
ktvoelker/state-record | src/Data/Record/StateFields.hs | gpl-3.0 | proj :: (FieldReader f, MonadReader a m) => f a b -> Reader b x -> m x
proj f m = do
b <- askf f
let x = runReader m b
return x
-- | Like 'proj', but allows the subcomputation to share the underlying
-- monad of the enclosing computation. | 247 | proj :: (FieldReader f, MonadReader a m) => f a b -> Reader b x -> m x
proj f m = do
b <- askf f
let x = runReader m b
return x
-- | Like 'proj', but allows the subcomputation to share the underlying
-- monad of the enclosing computation. | 247 | proj f m = do
b <- askf f
let x = runReader m b
return x
-- | Like 'proj', but allows the subcomputation to share the underlying
-- monad of the enclosing computation. | 176 | false | true | 0 | 11 | 61 | 91 | 41 | 50 | null | null |
robdockins/orlin | src/Orlin/PureTypeSys.hs | bsd-2-clause | whnf pn x@(ExprIdent ident _) = return (Just (BlockIdent ident), x) | 67 | whnf pn x@(ExprIdent ident _) = return (Just (BlockIdent ident), x) | 67 | whnf pn x@(ExprIdent ident _) = return (Just (BlockIdent ident), x) | 67 | false | false | 0 | 9 | 10 | 40 | 20 | 20 | null | null |
nstott/GradeLevel | src/NLP/GradeLevel.hs | bsd-3-clause | colemanLiauIndex :: String -> Float
colemanLiauIndex str = (0.0588 * l) - (0.296 * s) - 15.8
where
l = 100.0 * (fromIntegral (length (filter isAlphaNum str)) / fromIntegral (totalWords str))
s = 100.0 * (fromIntegral (totalSentences str) / fromIntegral (totalWords str))
| 285 | colemanLiauIndex :: String -> Float
colemanLiauIndex str = (0.0588 * l) - (0.296 * s) - 15.8
where
l = 100.0 * (fromIntegral (length (filter isAlphaNum str)) / fromIntegral (totalWords str))
s = 100.0 * (fromIntegral (totalSentences str) / fromIntegral (totalWords str))
| 284 | colemanLiauIndex str = (0.0588 * l) - (0.296 * s) - 15.8
where
l = 100.0 * (fromIntegral (length (filter isAlphaNum str)) / fromIntegral (totalWords str))
s = 100.0 * (fromIntegral (totalSentences str) / fromIntegral (totalWords str))
| 248 | false | true | 7 | 11 | 56 | 135 | 62 | 73 | null | null |
nevrenato/HetsAlloy | CSMOF/Parser.hs | gpl-2.0 | equalClassName :: String -> NamedElement -> Bool
equalClassName name ne =
case ne of
(NamedElement _ _ (TType (Type _ (DClass _)))) -> namedElementName ne == name
_ -> False | 183 | equalClassName :: String -> NamedElement -> Bool
equalClassName name ne =
case ne of
(NamedElement _ _ (TType (Type _ (DClass _)))) -> namedElementName ne == name
_ -> False | 183 | equalClassName name ne =
case ne of
(NamedElement _ _ (TType (Type _ (DClass _)))) -> namedElementName ne == name
_ -> False | 134 | false | true | 3 | 12 | 39 | 72 | 37 | 35 | null | null |
ksaveljev/hake-2 | src/Game/Monsters/MBoss31.hs | bsd-3-clause | jorgFramesAttack1 :: V.Vector MFrameT
jorgFramesAttack1 =
V.fromList [ MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
] | 506 | jorgFramesAttack1 :: V.Vector MFrameT
jorgFramesAttack1 =
V.fromList [ MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
] | 506 | jorgFramesAttack1 =
V.fromList [ MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
, MFrameT (Just GameAI.aiCharge) 0 (Just jorgFireBullet)
] | 468 | false | true | 0 | 10 | 143 | 165 | 82 | 83 | null | null |
rahulmutt/ghcvm | compiler/Eta/TypeCheck/TcRnTypes.hs | bsd-3-clause | pprArisingAt :: CtLoc -> SDoc
pprArisingAt (CtLoc { ctl_origin = o, ctl_env = lcl})
= sep [ pprCtOrigin o
, text "at" <+> ppr (tcl_loc lcl)] | 150 | pprArisingAt :: CtLoc -> SDoc
pprArisingAt (CtLoc { ctl_origin = o, ctl_env = lcl})
= sep [ pprCtOrigin o
, text "at" <+> ppr (tcl_loc lcl)] | 150 | pprArisingAt (CtLoc { ctl_origin = o, ctl_env = lcl})
= sep [ pprCtOrigin o
, text "at" <+> ppr (tcl_loc lcl)] | 120 | false | true | 6 | 10 | 35 | 73 | 34 | 39 | null | null |
jfdm/hUML | src/ClassDiagram/Lexer.hs | bsd-3-clause | -- | Lex keywords
reserved :: String -> Parser ()
reserved = Tok.reserved lexer | 79 | reserved :: String -> Parser ()
reserved = Tok.reserved lexer | 61 | reserved = Tok.reserved lexer | 29 | true | true | 0 | 8 | 13 | 32 | 14 | 18 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/Query/Query.hs | gpl-2.0 | queryInner _ _ (Query qkind _ _) _ =
return . Bad . GenericError $ "Query '" ++ show qkind ++ "' not supported" | 113 | queryInner _ _ (Query qkind _ _) _ =
return . Bad . GenericError $ "Query '" ++ show qkind ++ "' not supported" | 113 | queryInner _ _ (Query qkind _ _) _ =
return . Bad . GenericError $ "Query '" ++ show qkind ++ "' not supported" | 113 | false | false | 0 | 9 | 25 | 48 | 23 | 25 | null | null |
alonho/bottle | src/Graphics/UI/Bottle/Widget.hs | gpl-3.0 | -- ^ If doesn't take focus, event map is ignored
strongerEvents :: EventHandlers f -> Widget f -> Widget f
strongerEvents = atEventMap . mappend | 144 | strongerEvents :: EventHandlers f -> Widget f -> Widget f
strongerEvents = atEventMap . mappend | 95 | strongerEvents = atEventMap . mappend | 37 | true | true | 1 | 8 | 24 | 40 | 17 | 23 | null | null |
mokus0/s-expression | src/Text/SExpr/Parse.hs | bsd-3-clause | -- <decimal> :: <decimal-digit>+ ;
fromDec :: Num a => String -> a
fromDec = foldl' (\x c -> x * 10 + fromIntegral (digitToInt c)) 0 | 134 | fromDec :: Num a => String -> a
fromDec = foldl' (\x c -> x * 10 + fromIntegral (digitToInt c)) 0 | 97 | fromDec = foldl' (\x c -> x * 10 + fromIntegral (digitToInt c)) 0 | 65 | true | true | 0 | 11 | 28 | 61 | 29 | 32 | null | null |
nsmryan/Misc | src/PipeOperators.hs | bsd-3-clause | probably' prob loc ind = do
let len = S.length ind
if len > loc
then do
let (top, bottom) = S.splitAt loc ind
yield . Piece $ top
yield . Location $ S.index bottom 0
loc' <- lift $ geo0 prob
probably' prob loc' $ S.drop 1 bottom
else do
yield $ Piece ind
yield Flush
ind' <- await
probably' prob (loc - len) ind' | 378 | probably' prob loc ind = do
let len = S.length ind
if len > loc
then do
let (top, bottom) = S.splitAt loc ind
yield . Piece $ top
yield . Location $ S.index bottom 0
loc' <- lift $ geo0 prob
probably' prob loc' $ S.drop 1 bottom
else do
yield $ Piece ind
yield Flush
ind' <- await
probably' prob (loc - len) ind' | 378 | probably' prob loc ind = do
let len = S.length ind
if len > loc
then do
let (top, bottom) = S.splitAt loc ind
yield . Piece $ top
yield . Location $ S.index bottom 0
loc' <- lift $ geo0 prob
probably' prob loc' $ S.drop 1 bottom
else do
yield $ Piece ind
yield Flush
ind' <- await
probably' prob (loc - len) ind' | 378 | false | false | 0 | 14 | 131 | 167 | 75 | 92 | null | null |
alexvong1995/pandoc | src/Text/Pandoc/Templates.hs | gpl-2.0 | replaceVar (v:vs) new (Object o) =
Object $ H.adjust (\x -> replaceVar vs new x) v o | 86 | replaceVar (v:vs) new (Object o) =
Object $ H.adjust (\x -> replaceVar vs new x) v o | 86 | replaceVar (v:vs) new (Object o) =
Object $ H.adjust (\x -> replaceVar vs new x) v o | 86 | false | false | 0 | 9 | 18 | 54 | 27 | 27 | null | null |
DanielWaterworth/Idris-dev | src/Idris/Core/Elaborate.hs | bsd-3-clause | -- Insert a 'proofSearchFail' error if necessary to shortcut any further
-- fruitless searching
proofFail :: Elab' aux a -> Elab' aux a
proofFail e = do s <- get
case runStateT e s of
OK (a, s') -> do put s'
return $! a
Error err -> lift $ Error (ProofSearchFail err) | 367 | proofFail :: Elab' aux a -> Elab' aux a
proofFail e = do s <- get
case runStateT e s of
OK (a, s') -> do put s'
return $! a
Error err -> lift $ Error (ProofSearchFail err) | 271 | proofFail e = do s <- get
case runStateT e s of
OK (a, s') -> do put s'
return $! a
Error err -> lift $ Error (ProofSearchFail err) | 231 | true | true | 0 | 13 | 152 | 99 | 46 | 53 | null | null |
jekor/jigplate | jigplate.hs | mit | showJig ((JigFragment s):x) = s ++ showJig x | 44 | showJig ((JigFragment s):x) = s ++ showJig x | 44 | showJig ((JigFragment s):x) = s ++ showJig x | 44 | false | false | 2 | 8 | 7 | 32 | 14 | 18 | null | null |
keera-studios/hsQt | Qtc/ClassTypes/Gui.hs | bsd-2-clause | qTableViewListFromPtrList :: [Ptr (TQTableView a)] -> IO [QTableView a]
qTableViewListFromPtrList p
= objectListFromPtrList qtc_QTableView_getFinalizer p | 155 | qTableViewListFromPtrList :: [Ptr (TQTableView a)] -> IO [QTableView a]
qTableViewListFromPtrList p
= objectListFromPtrList qtc_QTableView_getFinalizer p | 155 | qTableViewListFromPtrList p
= objectListFromPtrList qtc_QTableView_getFinalizer p | 83 | false | true | 0 | 9 | 16 | 44 | 21 | 23 | null | null |
dpwright/z80 | tests/tests.hs | mit | main :: IO ()
main = defaultMain $ testGroup "Tests" [
testGroup "Load Group"
[ testCase "LD r, r'" $ ld H E $?= [0x63]
, testCase "LD r, n" $ ld E 0xa5 $?= [0x1e, 0xa5]
, testCase "LD r, (HL)" $ ld C [HL] $?= [0x4e]
, testCase "LD r, (IX+d)" $ ld B [IX + 0x19] $?= [0xdd, 0x46, 0x19]
, testCase "LD r, (IY+d)" $ ld B [IY + 0x19] $?= [0xfd, 0x46, 0x19]
, testCase "LD (HL), r" $ ld [HL] B $?= [0x70]
, testCase "LD (IX+d), r" $ ld [IX + 0x6] C $?= [0xdd, 0x71, 0x06]
, testCase "LD (IY+d), r" $ ld [IY + 0x4] C $?= [0xfd, 0x71, 0x04]
, testCase "LD (HL), n" $ ld [HL] 0x28 $?= [0x36, 0x28]
, testCase "LD (IX+d), n" $ ld [IX + 0x5] 0x5a $?= [0xdd, 0x36, 0x05, 0x5a]
, testCase "LD (IY+d), n" $ ld [IY + 0x10] 0x97 $?= [0xfd, 0x36, 0x10, 0x97]
, testCase "LD A, (BC)" $ ld A [BC] $?= [0x0a]
, testCase "LD A, (DE)" $ ld A [DE] $?= [0x1a]
, testCase "LD A, (nn)" $ ld A [0x8832] $?= [0x3a, 0x32, 0x88]
, testCase "LD (BC), A" $ ld [BC] A $?= [0x02]
, testCase "LD (DE), A" $ ld [DE] A $?= [0x12]
, testCase "LD (nn), A" $ ld [0x3141] A $?= [0x32, 0x41, 0x31]
, testCase "LD A, I" $ ld A I $?= [0xed, 0x57]
, testCase "LD A, R" $ ld A R $?= [0xed, 0x5f]
, testCase "LD I, A" $ ld I A $?= [0xed, 0x47]
, testCase "LD R, A" $ ld R A $?= [0xed, 0x4f]
, testCase "LD dd, nn" $ ld HL 0x5000 $?= [0x21, 0x00, 0x50]
, testCase "LD IX, nn" $ ld IX 0x45A2 $?= [0xdd, 0x21, 0xA2, 0x45]
, testCase "LD IY, nn" $ ld IY 0x7733 $?= [0xfd, 0x21, 0x33, 0x77]
, testCase "LD HL, (nn)" $ ld HL [0x4545] $?= [0x2a, 0x45, 0x45]
, testCase "LD dd, (nn)" $ ld BC [0x2130] $?= [0xed, 0x4b, 0x30, 0x21]
, testCase "LD IX, (nn)" $ ld IX [0x6666] $?= [0xdd, 0x2a, 0x66, 0x66]
, testCase "LD IY, (nn)" $ ld IY [0x6666] $?= [0xfd, 0x2a, 0x66, 0x66]
, testCase "LD (nn), HL" $ ld [0xb229] HL $?= [0x22, 0x29, 0xb2]
, testCase "LD (nn), dd" $ ld [0x1000] BC $?= [0xed, 0x43, 0x00, 0x10]
, testCase "LD (nn), IX" $ ld [0x4392] IX $?= [0xdd, 0x22, 0x92, 0x43]
, testCase "LD (nn), IY" $ ld [0x8838] IY $?= [0xfd, 0x22, 0x38, 0x88]
, testCase "LD SP, HL" $ ld SP HL $?= [0xf9]
, testCase "LD SP, IX" $ ld SP IX $?= [0xdd, 0xf9]
, testCase "LD SP, IY" $ ld SP IY $?= [0xfd, 0xf9]
, testCase "PUSH qq" $ push AF $?= [0xf5]
, testCase "PUSH IX" $ push IX $?= [0xdd, 0xe5]
, testCase "PUSH IY" $ push IY $?= [0xfd, 0xe5]
, testCase "POP qq" $ pop HL $?= [0xe1]
, testCase "POP IX" $ pop IX $?= [0xdd, 0xe1]
, testCase "POP IY" $ pop IY $?= [0xfd, 0xe1]
],
testGroup "Exchange, Block Transfer, and Search Group"
[ testCase "EX DE, HL" $ ex DE HL $?= [0xeb]
, testCase "EX AF, AF'" $ ex AF AF' $?= [0x08]
, testCase "EXX" $ exx $?= [0xd9]
, testCase "EX (SP), HL" $ ex [SP] HL $?= [0xe3]
, testCase "EX (SP), IX" $ ex [SP] IX $?= [0xdd, 0xe3]
, testCase "EX (SP), IY" $ ex [SP] IY $?= [0xfd, 0xe3]
, testCase "LDI" $ ldi $?= [0xed, 0xa0]
, testCase "LDIR" $ ldir $?= [0xed, 0xb0]
, testCase "LDD" $ ldd $?= [0xed, 0xa8]
, testCase "LDDR" $ lddr $?= [0xed, 0xb8]
, testCase "CPI" $ cpi $?= [0xed, 0xa1]
, testCase "CPIR" $ cpir $?= [0xed, 0xb1]
, testCase "CPD" $ cpd $?= [0xed, 0xa9]
, testCase "CPDR" $ cpdr $?= [0xed, 0xb9]
],
testGroup "8-Bit Arithmetic Group"
[ testCase "ADD A, r" $ add A C $?= [0x81]
, testCase "ADD A, n" $ add A 0x33 $?= [0xc6, 0x33]
, testCase "ADD A, (HL)" $ add A [HL] $?= [0x86]
, testCase "ADD A, (IX+d)"$ add A [IX + 0x05] $?= [0xdd, 0x86, 0x05]
, testCase "ADD A, (IY+d)"$ add A [IY + 0x05] $?= [0xfd, 0x86, 0x05]
, testCase "ADC A, (HL)" $ adc A [HL] $?= [0x8e]
, testCase "SUB D" $ sub D $?= [0x92]
, testCase "SBC A, (HL)" $ sbc A [HL] $?= [0x9e]
, testCase "AND B" $ and B $?= [0xa0]
, testCase "OR H" $ or H $?= [0xb4]
, testCase "XOR n" $ xor 0x5d $?= [0xee, 0x5d]
, testCase "CP (HL)" $ cp [HL] $?= [0xbe]
, testCase "INC r" $ inc D $?= [0x14]
, testCase "INC (HL)" $ inc [HL] $?= [0x34]
, testCase "INC (IX+d)" $ inc [IX + 0x10] $?= [0xdd, 0x34, 0x10]
, testCase "INC (IY+d)" $ inc [IY + 0x10] $?= [0xfd, 0x34, 0x10]
, testCase "DEC r" $ dec D $?= [0x15]
],
testGroup "General-Purpose Arithmetic and CPU Control Groups"
[ testCase "DAA" $ daa $?= [0x27]
, testCase "CPL" $ cpl $?= [0x2f]
, testCase "NEG" $ neg $?= [0xed, 0x44]
, testCase "CCF" $ ccf $?= [0x3f]
, testCase "SCF" $ scf $?= [0x37]
, testCase "NOP" $ nop $?= [0x00]
, testCase "HALT" $ halt $?= [0x76]
, testCase "DI" $ di $?= [0xf3]
, testCase "EI" $ ei $?= [0xfb]
, testCase "IM 0" $ im 0 $?= [0xed, 0x46]
, testCase "IM 1" $ im 1 $?= [0xed, 0x56]
, testCase "IM 2" $ im 2 $?= [0xed, 0x5e]
],
testGroup "16-Bit Arithmetic Group"
[ testCase "ADD HL, ss" $ add HL DE $?= [0x19]
, testCase "ADC HL, ss" $ adc HL BC $?= [0xed, 0x4a]
, testCase "SBC HL, ss" $ sbc HL DE $?= [0xed, 0x52]
, testCase "INC HL" $ inc HL $?= [0x23]
, testCase "INC IX" $ inc IX $?= [0xdd, 0x23]
, testCase "INC IY" $ inc IY $?= [0xfd, 0x23]
, testCase "DEC IX" $ dec IX $?= [0xdd, 0x2b]
, testCase "DEC IY" $ dec IY $?= [0xfd, 0x2b]
],
testGroup "Rotate and Shift Group"
[ testCase "RLCA" $ rlca $?= [0x07]
, testCase "RLA" $ rla $?= [0x17]
, testCase "RRCA" $ rrca $?= [0x0f]
, testCase "RRA" $ rra $?= [0x1f]
, testCase "RLC H" $ rlc H $?= [0xcb, 0x04]
, testCase "RLC (HL)" $ rlc [HL] $?= [0xcb, 0x06]
, testCase "RLC (IX+d)" $ rlc [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x06]
, testCase "RLC (IY+d)" $ rlc [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x06]
, testCase "RL H" $ rl H $?= [0xcb, 0x14]
, testCase "RL (HL)" $ rl [HL] $?= [0xcb, 0x16]
, testCase "RL (IX+d)" $ rl [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x16]
, testCase "RL (IY+d)" $ rl [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x16]
, testCase "RRC H" $ rrc H $?= [0xcb, 0x0c]
, testCase "RRC (HL)" $ rrc [HL] $?= [0xcb, 0x0e]
, testCase "RRC (IX+d)" $ rrc [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x0e]
, testCase "RRC (IY+d)" $ rrc [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x0e]
, testCase "RR H" $ rr H $?= [0xcb, 0x1c]
, testCase "RR (HL)" $ rr [HL] $?= [0xcb, 0x1e]
, testCase "RR (IX+d)" $ rr [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x1e]
, testCase "RR (IY+d)" $ rr [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x1e]
, testCase "SLA H" $ sla H $?= [0xcb, 0x24]
, testCase "SLA (HL)" $ sla [HL] $?= [0xcb, 0x26]
, testCase "SLA (IX+d)" $ sla [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x26]
, testCase "SLA (IY+d)" $ sla [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x26]
, testCase "SRA H" $ sra H $?= [0xcb, 0x2c]
, testCase "SRA (HL)" $ sra [HL] $?= [0xcb, 0x2e]
, testCase "SRA (IX+d)" $ sra [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x2e]
, testCase "SRA (IY+d)" $ sra [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x2e]
, testCase "SRL H" $ srl H $?= [0xcb, 0x3c]
, testCase "SRL (HL)" $ srl [HL] $?= [0xcb, 0x3e]
, testCase "SRL (IX+d)" $ srl [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x3e]
, testCase "SRL (IY+d)" $ srl [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x3e]
, testCase "RLD" $ rld $?= [0xed, 0x6f]
, testCase "RRD" $ rrd $?= [0xed, 0x67]
],
testGroup "Bit Set, Reset, and Test Group"
[ testCase "BIT b, r" $ bit 2 B $?= [0xcb, 0x50]
, testCase "BIT b, (HL)" $ bit 4 [HL] $?= [0xcb, 0x66]
, testCase "BIT b, (IX+d)"$ bit 6 [IX + 0x04] $?= [0xdd, 0xcb, 0x04, 0x76]
, testCase "BIT b, (IY+d)"$ bit 6 [IY + 0x04] $?= [0xfd, 0xcb, 0x04, 0x76]
, testCase "SET b, r" $ set 4 A $?= [0xcb, 0xe7]
, testCase "SET b, (HL)" $ set 4 [HL] $?= [0xcb, 0xe6]
, testCase "SET b, (IX+d)"$ set 0 [IX + 0x03] $?= [0xdd, 0xcb, 0x03, 0xc6]
, testCase "SET b, (IY+d)"$ set 0 [IY + 0x03] $?= [0xfd, 0xcb, 0x03, 0xc6]
, testCase "RES b, r" $ res 6 D $?= [0xcb, 0xb2]
],
testGroup "Jump Group"
[ testCase "JP nn" $ jp 0x8832 $?= [0xc3, 0x32, 0x88]
, testCase "JP cc,nn" $ jp C 0x1520 $?= [0xda, 0x20, 0x15]
, testCase "JP (HL)" $ jp [HL] $?= [0xe9]
, testCase "JR e" $ jr $+ 5 $?= [0x18, 3]
, testCase "JR C,e" $ pad 4 (jr C $- 4) $?= [0, 0, 0, 0, 0x38, -6]
, testCase "JR NC,e" $ jr NC $+ 0 $?= [0x30, -2]
, testCase "JR Z,e" $ jr Z $+ 5 $?= [0x28, 3]
, testCase "JR NZ,e" $ pad 4 (jr NZ $- 4) $?= [0, 0, 0, 0, 0x20, -6]
, testCase "DJNZ" $ djnz $+ 5 $?= [0x10, 3]
],
testGroup "Call and Return Group"
[ testCase "CALL nn" $ call 0x2135 $?= [0xcd, 0x35, 0x21]
, testCase "CALL cc,nn" $ call NC 0x2135 $?= [0xd4, 0x35, 0x21]
, testCase "RET" $ ret $?= [0xc9]
, testCase "RET cc" $ ret M $?= [0xf8]
, testCase "RETI" $ reti $?= [0xed, 0x4d]
, testCase "RETN" $ retn $?= [0xed, 0x45]
, testCase "RST p" $ rst 0x18 $?= [0xdf]
],
testGroup "Input and Output Group"
[ testCase "IN A, (n)" $ in_ A [0x01] $?= [0xdb, 0x01]
, testCase "IN r, (C)" $ in_ D [C] $?= [0xed, 0x50]
, testCase "INI" $ ini $?= [0xed, 0xa2]
, testCase "INIR" $ inir $?= [0xed, 0xb2]
, testCase "IND" $ ind $?= [0xed, 0xaa]
, testCase "INDR" $ indr $?= [0xed, 0xba]
, testCase "OUT (n), A" $ out [0x01] A $?= [0xd3, 0x01]
, testCase "OUT (C), r" $ out [C] D $?= [0xed, 0x51]
, testCase "OUTI" $ outi $?= [0xed, 0xa3]
, testCase "OTIR" $ otir $?= [0xed, 0xb3]
, testCase "OUTD" $ outd $?= [0xed, 0xab]
, testCase "OTDR" $ otdr $?= [0xed, 0xbb]
]
] | 11,781 | main :: IO ()
main = defaultMain $ testGroup "Tests" [
testGroup "Load Group"
[ testCase "LD r, r'" $ ld H E $?= [0x63]
, testCase "LD r, n" $ ld E 0xa5 $?= [0x1e, 0xa5]
, testCase "LD r, (HL)" $ ld C [HL] $?= [0x4e]
, testCase "LD r, (IX+d)" $ ld B [IX + 0x19] $?= [0xdd, 0x46, 0x19]
, testCase "LD r, (IY+d)" $ ld B [IY + 0x19] $?= [0xfd, 0x46, 0x19]
, testCase "LD (HL), r" $ ld [HL] B $?= [0x70]
, testCase "LD (IX+d), r" $ ld [IX + 0x6] C $?= [0xdd, 0x71, 0x06]
, testCase "LD (IY+d), r" $ ld [IY + 0x4] C $?= [0xfd, 0x71, 0x04]
, testCase "LD (HL), n" $ ld [HL] 0x28 $?= [0x36, 0x28]
, testCase "LD (IX+d), n" $ ld [IX + 0x5] 0x5a $?= [0xdd, 0x36, 0x05, 0x5a]
, testCase "LD (IY+d), n" $ ld [IY + 0x10] 0x97 $?= [0xfd, 0x36, 0x10, 0x97]
, testCase "LD A, (BC)" $ ld A [BC] $?= [0x0a]
, testCase "LD A, (DE)" $ ld A [DE] $?= [0x1a]
, testCase "LD A, (nn)" $ ld A [0x8832] $?= [0x3a, 0x32, 0x88]
, testCase "LD (BC), A" $ ld [BC] A $?= [0x02]
, testCase "LD (DE), A" $ ld [DE] A $?= [0x12]
, testCase "LD (nn), A" $ ld [0x3141] A $?= [0x32, 0x41, 0x31]
, testCase "LD A, I" $ ld A I $?= [0xed, 0x57]
, testCase "LD A, R" $ ld A R $?= [0xed, 0x5f]
, testCase "LD I, A" $ ld I A $?= [0xed, 0x47]
, testCase "LD R, A" $ ld R A $?= [0xed, 0x4f]
, testCase "LD dd, nn" $ ld HL 0x5000 $?= [0x21, 0x00, 0x50]
, testCase "LD IX, nn" $ ld IX 0x45A2 $?= [0xdd, 0x21, 0xA2, 0x45]
, testCase "LD IY, nn" $ ld IY 0x7733 $?= [0xfd, 0x21, 0x33, 0x77]
, testCase "LD HL, (nn)" $ ld HL [0x4545] $?= [0x2a, 0x45, 0x45]
, testCase "LD dd, (nn)" $ ld BC [0x2130] $?= [0xed, 0x4b, 0x30, 0x21]
, testCase "LD IX, (nn)" $ ld IX [0x6666] $?= [0xdd, 0x2a, 0x66, 0x66]
, testCase "LD IY, (nn)" $ ld IY [0x6666] $?= [0xfd, 0x2a, 0x66, 0x66]
, testCase "LD (nn), HL" $ ld [0xb229] HL $?= [0x22, 0x29, 0xb2]
, testCase "LD (nn), dd" $ ld [0x1000] BC $?= [0xed, 0x43, 0x00, 0x10]
, testCase "LD (nn), IX" $ ld [0x4392] IX $?= [0xdd, 0x22, 0x92, 0x43]
, testCase "LD (nn), IY" $ ld [0x8838] IY $?= [0xfd, 0x22, 0x38, 0x88]
, testCase "LD SP, HL" $ ld SP HL $?= [0xf9]
, testCase "LD SP, IX" $ ld SP IX $?= [0xdd, 0xf9]
, testCase "LD SP, IY" $ ld SP IY $?= [0xfd, 0xf9]
, testCase "PUSH qq" $ push AF $?= [0xf5]
, testCase "PUSH IX" $ push IX $?= [0xdd, 0xe5]
, testCase "PUSH IY" $ push IY $?= [0xfd, 0xe5]
, testCase "POP qq" $ pop HL $?= [0xe1]
, testCase "POP IX" $ pop IX $?= [0xdd, 0xe1]
, testCase "POP IY" $ pop IY $?= [0xfd, 0xe1]
],
testGroup "Exchange, Block Transfer, and Search Group"
[ testCase "EX DE, HL" $ ex DE HL $?= [0xeb]
, testCase "EX AF, AF'" $ ex AF AF' $?= [0x08]
, testCase "EXX" $ exx $?= [0xd9]
, testCase "EX (SP), HL" $ ex [SP] HL $?= [0xe3]
, testCase "EX (SP), IX" $ ex [SP] IX $?= [0xdd, 0xe3]
, testCase "EX (SP), IY" $ ex [SP] IY $?= [0xfd, 0xe3]
, testCase "LDI" $ ldi $?= [0xed, 0xa0]
, testCase "LDIR" $ ldir $?= [0xed, 0xb0]
, testCase "LDD" $ ldd $?= [0xed, 0xa8]
, testCase "LDDR" $ lddr $?= [0xed, 0xb8]
, testCase "CPI" $ cpi $?= [0xed, 0xa1]
, testCase "CPIR" $ cpir $?= [0xed, 0xb1]
, testCase "CPD" $ cpd $?= [0xed, 0xa9]
, testCase "CPDR" $ cpdr $?= [0xed, 0xb9]
],
testGroup "8-Bit Arithmetic Group"
[ testCase "ADD A, r" $ add A C $?= [0x81]
, testCase "ADD A, n" $ add A 0x33 $?= [0xc6, 0x33]
, testCase "ADD A, (HL)" $ add A [HL] $?= [0x86]
, testCase "ADD A, (IX+d)"$ add A [IX + 0x05] $?= [0xdd, 0x86, 0x05]
, testCase "ADD A, (IY+d)"$ add A [IY + 0x05] $?= [0xfd, 0x86, 0x05]
, testCase "ADC A, (HL)" $ adc A [HL] $?= [0x8e]
, testCase "SUB D" $ sub D $?= [0x92]
, testCase "SBC A, (HL)" $ sbc A [HL] $?= [0x9e]
, testCase "AND B" $ and B $?= [0xa0]
, testCase "OR H" $ or H $?= [0xb4]
, testCase "XOR n" $ xor 0x5d $?= [0xee, 0x5d]
, testCase "CP (HL)" $ cp [HL] $?= [0xbe]
, testCase "INC r" $ inc D $?= [0x14]
, testCase "INC (HL)" $ inc [HL] $?= [0x34]
, testCase "INC (IX+d)" $ inc [IX + 0x10] $?= [0xdd, 0x34, 0x10]
, testCase "INC (IY+d)" $ inc [IY + 0x10] $?= [0xfd, 0x34, 0x10]
, testCase "DEC r" $ dec D $?= [0x15]
],
testGroup "General-Purpose Arithmetic and CPU Control Groups"
[ testCase "DAA" $ daa $?= [0x27]
, testCase "CPL" $ cpl $?= [0x2f]
, testCase "NEG" $ neg $?= [0xed, 0x44]
, testCase "CCF" $ ccf $?= [0x3f]
, testCase "SCF" $ scf $?= [0x37]
, testCase "NOP" $ nop $?= [0x00]
, testCase "HALT" $ halt $?= [0x76]
, testCase "DI" $ di $?= [0xf3]
, testCase "EI" $ ei $?= [0xfb]
, testCase "IM 0" $ im 0 $?= [0xed, 0x46]
, testCase "IM 1" $ im 1 $?= [0xed, 0x56]
, testCase "IM 2" $ im 2 $?= [0xed, 0x5e]
],
testGroup "16-Bit Arithmetic Group"
[ testCase "ADD HL, ss" $ add HL DE $?= [0x19]
, testCase "ADC HL, ss" $ adc HL BC $?= [0xed, 0x4a]
, testCase "SBC HL, ss" $ sbc HL DE $?= [0xed, 0x52]
, testCase "INC HL" $ inc HL $?= [0x23]
, testCase "INC IX" $ inc IX $?= [0xdd, 0x23]
, testCase "INC IY" $ inc IY $?= [0xfd, 0x23]
, testCase "DEC IX" $ dec IX $?= [0xdd, 0x2b]
, testCase "DEC IY" $ dec IY $?= [0xfd, 0x2b]
],
testGroup "Rotate and Shift Group"
[ testCase "RLCA" $ rlca $?= [0x07]
, testCase "RLA" $ rla $?= [0x17]
, testCase "RRCA" $ rrca $?= [0x0f]
, testCase "RRA" $ rra $?= [0x1f]
, testCase "RLC H" $ rlc H $?= [0xcb, 0x04]
, testCase "RLC (HL)" $ rlc [HL] $?= [0xcb, 0x06]
, testCase "RLC (IX+d)" $ rlc [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x06]
, testCase "RLC (IY+d)" $ rlc [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x06]
, testCase "RL H" $ rl H $?= [0xcb, 0x14]
, testCase "RL (HL)" $ rl [HL] $?= [0xcb, 0x16]
, testCase "RL (IX+d)" $ rl [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x16]
, testCase "RL (IY+d)" $ rl [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x16]
, testCase "RRC H" $ rrc H $?= [0xcb, 0x0c]
, testCase "RRC (HL)" $ rrc [HL] $?= [0xcb, 0x0e]
, testCase "RRC (IX+d)" $ rrc [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x0e]
, testCase "RRC (IY+d)" $ rrc [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x0e]
, testCase "RR H" $ rr H $?= [0xcb, 0x1c]
, testCase "RR (HL)" $ rr [HL] $?= [0xcb, 0x1e]
, testCase "RR (IX+d)" $ rr [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x1e]
, testCase "RR (IY+d)" $ rr [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x1e]
, testCase "SLA H" $ sla H $?= [0xcb, 0x24]
, testCase "SLA (HL)" $ sla [HL] $?= [0xcb, 0x26]
, testCase "SLA (IX+d)" $ sla [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x26]
, testCase "SLA (IY+d)" $ sla [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x26]
, testCase "SRA H" $ sra H $?= [0xcb, 0x2c]
, testCase "SRA (HL)" $ sra [HL] $?= [0xcb, 0x2e]
, testCase "SRA (IX+d)" $ sra [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x2e]
, testCase "SRA (IY+d)" $ sra [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x2e]
, testCase "SRL H" $ srl H $?= [0xcb, 0x3c]
, testCase "SRL (HL)" $ srl [HL] $?= [0xcb, 0x3e]
, testCase "SRL (IX+d)" $ srl [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x3e]
, testCase "SRL (IY+d)" $ srl [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x3e]
, testCase "RLD" $ rld $?= [0xed, 0x6f]
, testCase "RRD" $ rrd $?= [0xed, 0x67]
],
testGroup "Bit Set, Reset, and Test Group"
[ testCase "BIT b, r" $ bit 2 B $?= [0xcb, 0x50]
, testCase "BIT b, (HL)" $ bit 4 [HL] $?= [0xcb, 0x66]
, testCase "BIT b, (IX+d)"$ bit 6 [IX + 0x04] $?= [0xdd, 0xcb, 0x04, 0x76]
, testCase "BIT b, (IY+d)"$ bit 6 [IY + 0x04] $?= [0xfd, 0xcb, 0x04, 0x76]
, testCase "SET b, r" $ set 4 A $?= [0xcb, 0xe7]
, testCase "SET b, (HL)" $ set 4 [HL] $?= [0xcb, 0xe6]
, testCase "SET b, (IX+d)"$ set 0 [IX + 0x03] $?= [0xdd, 0xcb, 0x03, 0xc6]
, testCase "SET b, (IY+d)"$ set 0 [IY + 0x03] $?= [0xfd, 0xcb, 0x03, 0xc6]
, testCase "RES b, r" $ res 6 D $?= [0xcb, 0xb2]
],
testGroup "Jump Group"
[ testCase "JP nn" $ jp 0x8832 $?= [0xc3, 0x32, 0x88]
, testCase "JP cc,nn" $ jp C 0x1520 $?= [0xda, 0x20, 0x15]
, testCase "JP (HL)" $ jp [HL] $?= [0xe9]
, testCase "JR e" $ jr $+ 5 $?= [0x18, 3]
, testCase "JR C,e" $ pad 4 (jr C $- 4) $?= [0, 0, 0, 0, 0x38, -6]
, testCase "JR NC,e" $ jr NC $+ 0 $?= [0x30, -2]
, testCase "JR Z,e" $ jr Z $+ 5 $?= [0x28, 3]
, testCase "JR NZ,e" $ pad 4 (jr NZ $- 4) $?= [0, 0, 0, 0, 0x20, -6]
, testCase "DJNZ" $ djnz $+ 5 $?= [0x10, 3]
],
testGroup "Call and Return Group"
[ testCase "CALL nn" $ call 0x2135 $?= [0xcd, 0x35, 0x21]
, testCase "CALL cc,nn" $ call NC 0x2135 $?= [0xd4, 0x35, 0x21]
, testCase "RET" $ ret $?= [0xc9]
, testCase "RET cc" $ ret M $?= [0xf8]
, testCase "RETI" $ reti $?= [0xed, 0x4d]
, testCase "RETN" $ retn $?= [0xed, 0x45]
, testCase "RST p" $ rst 0x18 $?= [0xdf]
],
testGroup "Input and Output Group"
[ testCase "IN A, (n)" $ in_ A [0x01] $?= [0xdb, 0x01]
, testCase "IN r, (C)" $ in_ D [C] $?= [0xed, 0x50]
, testCase "INI" $ ini $?= [0xed, 0xa2]
, testCase "INIR" $ inir $?= [0xed, 0xb2]
, testCase "IND" $ ind $?= [0xed, 0xaa]
, testCase "INDR" $ indr $?= [0xed, 0xba]
, testCase "OUT (n), A" $ out [0x01] A $?= [0xd3, 0x01]
, testCase "OUT (C), r" $ out [C] D $?= [0xed, 0x51]
, testCase "OUTI" $ outi $?= [0xed, 0xa3]
, testCase "OTIR" $ otir $?= [0xed, 0xb3]
, testCase "OUTD" $ outd $?= [0xed, 0xab]
, testCase "OTDR" $ otdr $?= [0xed, 0xbb]
]
] | 11,781 | main = defaultMain $ testGroup "Tests" [
testGroup "Load Group"
[ testCase "LD r, r'" $ ld H E $?= [0x63]
, testCase "LD r, n" $ ld E 0xa5 $?= [0x1e, 0xa5]
, testCase "LD r, (HL)" $ ld C [HL] $?= [0x4e]
, testCase "LD r, (IX+d)" $ ld B [IX + 0x19] $?= [0xdd, 0x46, 0x19]
, testCase "LD r, (IY+d)" $ ld B [IY + 0x19] $?= [0xfd, 0x46, 0x19]
, testCase "LD (HL), r" $ ld [HL] B $?= [0x70]
, testCase "LD (IX+d), r" $ ld [IX + 0x6] C $?= [0xdd, 0x71, 0x06]
, testCase "LD (IY+d), r" $ ld [IY + 0x4] C $?= [0xfd, 0x71, 0x04]
, testCase "LD (HL), n" $ ld [HL] 0x28 $?= [0x36, 0x28]
, testCase "LD (IX+d), n" $ ld [IX + 0x5] 0x5a $?= [0xdd, 0x36, 0x05, 0x5a]
, testCase "LD (IY+d), n" $ ld [IY + 0x10] 0x97 $?= [0xfd, 0x36, 0x10, 0x97]
, testCase "LD A, (BC)" $ ld A [BC] $?= [0x0a]
, testCase "LD A, (DE)" $ ld A [DE] $?= [0x1a]
, testCase "LD A, (nn)" $ ld A [0x8832] $?= [0x3a, 0x32, 0x88]
, testCase "LD (BC), A" $ ld [BC] A $?= [0x02]
, testCase "LD (DE), A" $ ld [DE] A $?= [0x12]
, testCase "LD (nn), A" $ ld [0x3141] A $?= [0x32, 0x41, 0x31]
, testCase "LD A, I" $ ld A I $?= [0xed, 0x57]
, testCase "LD A, R" $ ld A R $?= [0xed, 0x5f]
, testCase "LD I, A" $ ld I A $?= [0xed, 0x47]
, testCase "LD R, A" $ ld R A $?= [0xed, 0x4f]
, testCase "LD dd, nn" $ ld HL 0x5000 $?= [0x21, 0x00, 0x50]
, testCase "LD IX, nn" $ ld IX 0x45A2 $?= [0xdd, 0x21, 0xA2, 0x45]
, testCase "LD IY, nn" $ ld IY 0x7733 $?= [0xfd, 0x21, 0x33, 0x77]
, testCase "LD HL, (nn)" $ ld HL [0x4545] $?= [0x2a, 0x45, 0x45]
, testCase "LD dd, (nn)" $ ld BC [0x2130] $?= [0xed, 0x4b, 0x30, 0x21]
, testCase "LD IX, (nn)" $ ld IX [0x6666] $?= [0xdd, 0x2a, 0x66, 0x66]
, testCase "LD IY, (nn)" $ ld IY [0x6666] $?= [0xfd, 0x2a, 0x66, 0x66]
, testCase "LD (nn), HL" $ ld [0xb229] HL $?= [0x22, 0x29, 0xb2]
, testCase "LD (nn), dd" $ ld [0x1000] BC $?= [0xed, 0x43, 0x00, 0x10]
, testCase "LD (nn), IX" $ ld [0x4392] IX $?= [0xdd, 0x22, 0x92, 0x43]
, testCase "LD (nn), IY" $ ld [0x8838] IY $?= [0xfd, 0x22, 0x38, 0x88]
, testCase "LD SP, HL" $ ld SP HL $?= [0xf9]
, testCase "LD SP, IX" $ ld SP IX $?= [0xdd, 0xf9]
, testCase "LD SP, IY" $ ld SP IY $?= [0xfd, 0xf9]
, testCase "PUSH qq" $ push AF $?= [0xf5]
, testCase "PUSH IX" $ push IX $?= [0xdd, 0xe5]
, testCase "PUSH IY" $ push IY $?= [0xfd, 0xe5]
, testCase "POP qq" $ pop HL $?= [0xe1]
, testCase "POP IX" $ pop IX $?= [0xdd, 0xe1]
, testCase "POP IY" $ pop IY $?= [0xfd, 0xe1]
],
testGroup "Exchange, Block Transfer, and Search Group"
[ testCase "EX DE, HL" $ ex DE HL $?= [0xeb]
, testCase "EX AF, AF'" $ ex AF AF' $?= [0x08]
, testCase "EXX" $ exx $?= [0xd9]
, testCase "EX (SP), HL" $ ex [SP] HL $?= [0xe3]
, testCase "EX (SP), IX" $ ex [SP] IX $?= [0xdd, 0xe3]
, testCase "EX (SP), IY" $ ex [SP] IY $?= [0xfd, 0xe3]
, testCase "LDI" $ ldi $?= [0xed, 0xa0]
, testCase "LDIR" $ ldir $?= [0xed, 0xb0]
, testCase "LDD" $ ldd $?= [0xed, 0xa8]
, testCase "LDDR" $ lddr $?= [0xed, 0xb8]
, testCase "CPI" $ cpi $?= [0xed, 0xa1]
, testCase "CPIR" $ cpir $?= [0xed, 0xb1]
, testCase "CPD" $ cpd $?= [0xed, 0xa9]
, testCase "CPDR" $ cpdr $?= [0xed, 0xb9]
],
testGroup "8-Bit Arithmetic Group"
[ testCase "ADD A, r" $ add A C $?= [0x81]
, testCase "ADD A, n" $ add A 0x33 $?= [0xc6, 0x33]
, testCase "ADD A, (HL)" $ add A [HL] $?= [0x86]
, testCase "ADD A, (IX+d)"$ add A [IX + 0x05] $?= [0xdd, 0x86, 0x05]
, testCase "ADD A, (IY+d)"$ add A [IY + 0x05] $?= [0xfd, 0x86, 0x05]
, testCase "ADC A, (HL)" $ adc A [HL] $?= [0x8e]
, testCase "SUB D" $ sub D $?= [0x92]
, testCase "SBC A, (HL)" $ sbc A [HL] $?= [0x9e]
, testCase "AND B" $ and B $?= [0xa0]
, testCase "OR H" $ or H $?= [0xb4]
, testCase "XOR n" $ xor 0x5d $?= [0xee, 0x5d]
, testCase "CP (HL)" $ cp [HL] $?= [0xbe]
, testCase "INC r" $ inc D $?= [0x14]
, testCase "INC (HL)" $ inc [HL] $?= [0x34]
, testCase "INC (IX+d)" $ inc [IX + 0x10] $?= [0xdd, 0x34, 0x10]
, testCase "INC (IY+d)" $ inc [IY + 0x10] $?= [0xfd, 0x34, 0x10]
, testCase "DEC r" $ dec D $?= [0x15]
],
testGroup "General-Purpose Arithmetic and CPU Control Groups"
[ testCase "DAA" $ daa $?= [0x27]
, testCase "CPL" $ cpl $?= [0x2f]
, testCase "NEG" $ neg $?= [0xed, 0x44]
, testCase "CCF" $ ccf $?= [0x3f]
, testCase "SCF" $ scf $?= [0x37]
, testCase "NOP" $ nop $?= [0x00]
, testCase "HALT" $ halt $?= [0x76]
, testCase "DI" $ di $?= [0xf3]
, testCase "EI" $ ei $?= [0xfb]
, testCase "IM 0" $ im 0 $?= [0xed, 0x46]
, testCase "IM 1" $ im 1 $?= [0xed, 0x56]
, testCase "IM 2" $ im 2 $?= [0xed, 0x5e]
],
testGroup "16-Bit Arithmetic Group"
[ testCase "ADD HL, ss" $ add HL DE $?= [0x19]
, testCase "ADC HL, ss" $ adc HL BC $?= [0xed, 0x4a]
, testCase "SBC HL, ss" $ sbc HL DE $?= [0xed, 0x52]
, testCase "INC HL" $ inc HL $?= [0x23]
, testCase "INC IX" $ inc IX $?= [0xdd, 0x23]
, testCase "INC IY" $ inc IY $?= [0xfd, 0x23]
, testCase "DEC IX" $ dec IX $?= [0xdd, 0x2b]
, testCase "DEC IY" $ dec IY $?= [0xfd, 0x2b]
],
testGroup "Rotate and Shift Group"
[ testCase "RLCA" $ rlca $?= [0x07]
, testCase "RLA" $ rla $?= [0x17]
, testCase "RRCA" $ rrca $?= [0x0f]
, testCase "RRA" $ rra $?= [0x1f]
, testCase "RLC H" $ rlc H $?= [0xcb, 0x04]
, testCase "RLC (HL)" $ rlc [HL] $?= [0xcb, 0x06]
, testCase "RLC (IX+d)" $ rlc [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x06]
, testCase "RLC (IY+d)" $ rlc [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x06]
, testCase "RL H" $ rl H $?= [0xcb, 0x14]
, testCase "RL (HL)" $ rl [HL] $?= [0xcb, 0x16]
, testCase "RL (IX+d)" $ rl [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x16]
, testCase "RL (IY+d)" $ rl [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x16]
, testCase "RRC H" $ rrc H $?= [0xcb, 0x0c]
, testCase "RRC (HL)" $ rrc [HL] $?= [0xcb, 0x0e]
, testCase "RRC (IX+d)" $ rrc [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x0e]
, testCase "RRC (IY+d)" $ rrc [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x0e]
, testCase "RR H" $ rr H $?= [0xcb, 0x1c]
, testCase "RR (HL)" $ rr [HL] $?= [0xcb, 0x1e]
, testCase "RR (IX+d)" $ rr [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x1e]
, testCase "RR (IY+d)" $ rr [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x1e]
, testCase "SLA H" $ sla H $?= [0xcb, 0x24]
, testCase "SLA (HL)" $ sla [HL] $?= [0xcb, 0x26]
, testCase "SLA (IX+d)" $ sla [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x26]
, testCase "SLA (IY+d)" $ sla [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x26]
, testCase "SRA H" $ sra H $?= [0xcb, 0x2c]
, testCase "SRA (HL)" $ sra [HL] $?= [0xcb, 0x2e]
, testCase "SRA (IX+d)" $ sra [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x2e]
, testCase "SRA (IY+d)" $ sra [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x2e]
, testCase "SRL H" $ srl H $?= [0xcb, 0x3c]
, testCase "SRL (HL)" $ srl [HL] $?= [0xcb, 0x3e]
, testCase "SRL (IX+d)" $ srl [IX + 0x02] $?= [0xdd, 0xcb, 0x02, 0x3e]
, testCase "SRL (IY+d)" $ srl [IY + 0x02] $?= [0xfd, 0xcb, 0x02, 0x3e]
, testCase "RLD" $ rld $?= [0xed, 0x6f]
, testCase "RRD" $ rrd $?= [0xed, 0x67]
],
testGroup "Bit Set, Reset, and Test Group"
[ testCase "BIT b, r" $ bit 2 B $?= [0xcb, 0x50]
, testCase "BIT b, (HL)" $ bit 4 [HL] $?= [0xcb, 0x66]
, testCase "BIT b, (IX+d)"$ bit 6 [IX + 0x04] $?= [0xdd, 0xcb, 0x04, 0x76]
, testCase "BIT b, (IY+d)"$ bit 6 [IY + 0x04] $?= [0xfd, 0xcb, 0x04, 0x76]
, testCase "SET b, r" $ set 4 A $?= [0xcb, 0xe7]
, testCase "SET b, (HL)" $ set 4 [HL] $?= [0xcb, 0xe6]
, testCase "SET b, (IX+d)"$ set 0 [IX + 0x03] $?= [0xdd, 0xcb, 0x03, 0xc6]
, testCase "SET b, (IY+d)"$ set 0 [IY + 0x03] $?= [0xfd, 0xcb, 0x03, 0xc6]
, testCase "RES b, r" $ res 6 D $?= [0xcb, 0xb2]
],
testGroup "Jump Group"
[ testCase "JP nn" $ jp 0x8832 $?= [0xc3, 0x32, 0x88]
, testCase "JP cc,nn" $ jp C 0x1520 $?= [0xda, 0x20, 0x15]
, testCase "JP (HL)" $ jp [HL] $?= [0xe9]
, testCase "JR e" $ jr $+ 5 $?= [0x18, 3]
, testCase "JR C,e" $ pad 4 (jr C $- 4) $?= [0, 0, 0, 0, 0x38, -6]
, testCase "JR NC,e" $ jr NC $+ 0 $?= [0x30, -2]
, testCase "JR Z,e" $ jr Z $+ 5 $?= [0x28, 3]
, testCase "JR NZ,e" $ pad 4 (jr NZ $- 4) $?= [0, 0, 0, 0, 0x20, -6]
, testCase "DJNZ" $ djnz $+ 5 $?= [0x10, 3]
],
testGroup "Call and Return Group"
[ testCase "CALL nn" $ call 0x2135 $?= [0xcd, 0x35, 0x21]
, testCase "CALL cc,nn" $ call NC 0x2135 $?= [0xd4, 0x35, 0x21]
, testCase "RET" $ ret $?= [0xc9]
, testCase "RET cc" $ ret M $?= [0xf8]
, testCase "RETI" $ reti $?= [0xed, 0x4d]
, testCase "RETN" $ retn $?= [0xed, 0x45]
, testCase "RST p" $ rst 0x18 $?= [0xdf]
],
testGroup "Input and Output Group"
[ testCase "IN A, (n)" $ in_ A [0x01] $?= [0xdb, 0x01]
, testCase "IN r, (C)" $ in_ D [C] $?= [0xed, 0x50]
, testCase "INI" $ ini $?= [0xed, 0xa2]
, testCase "INIR" $ inir $?= [0xed, 0xb2]
, testCase "IND" $ ind $?= [0xed, 0xaa]
, testCase "INDR" $ indr $?= [0xed, 0xba]
, testCase "OUT (n), A" $ out [0x01] A $?= [0xd3, 0x01]
, testCase "OUT (C), r" $ out [C] D $?= [0xed, 0x51]
, testCase "OUTI" $ outi $?= [0xed, 0xa3]
, testCase "OTIR" $ otir $?= [0xed, 0xb3]
, testCase "OUTD" $ outd $?= [0xed, 0xab]
, testCase "OTDR" $ otdr $?= [0xed, 0xbb]
]
] | 11,767 | false | true | 2 | 14 | 4,830 | 4,353 | 2,326 | 2,027 | null | null |
gabesoft/kapi | src/Handlers/Common.hs | bsd-3-clause | -- ^
-- Create a single record
createSingle
:: RecordDefinition
-> (Text -> String)
-> Record
-> Api (Headers '[ Header "Location" String, Header "Link" String] (ApiData ApiResult))
createSingle def getLink input =
runSingle (dbInsert def input) (mkCreateSingleResult getLink) | 286 | createSingle
:: RecordDefinition
-> (Text -> String)
-> Record
-> Api (Headers '[ Header "Location" String, Header "Link" String] (ApiData ApiResult))
createSingle def getLink input =
runSingle (dbInsert def input) (mkCreateSingleResult getLink) | 255 | createSingle def getLink input =
runSingle (dbInsert def input) (mkCreateSingleResult getLink) | 96 | true | true | 0 | 14 | 48 | 97 | 48 | 49 | null | null |
matterhorn-chat/matterhorn | src/Matterhorn/Login.hs | bsd-3-clause | credentialsForm :: State -> Widget Name
credentialsForm st =
hCenter $ hLimit uiWidth $ vLimit 15 $
border $
vBox [ renderText "Please enter your Mattermost credentials to log in."
, padTop (Pad 1) $ renderForm (st^.loginForm)
, hCenter $ renderText "Press Enter to log in or Esc to exit."
] | 330 | credentialsForm :: State -> Widget Name
credentialsForm st =
hCenter $ hLimit uiWidth $ vLimit 15 $
border $
vBox [ renderText "Please enter your Mattermost credentials to log in."
, padTop (Pad 1) $ renderForm (st^.loginForm)
, hCenter $ renderText "Press Enter to log in or Esc to exit."
] | 330 | credentialsForm st =
hCenter $ hLimit uiWidth $ vLimit 15 $
border $
vBox [ renderText "Please enter your Mattermost credentials to log in."
, padTop (Pad 1) $ renderForm (st^.loginForm)
, hCenter $ renderText "Press Enter to log in or Esc to exit."
] | 290 | false | true | 0 | 11 | 89 | 88 | 42 | 46 | null | null |
achirkin/qua-kit | apps/hs/qua-server/src/Application.hs | mit | -- | Run DB queries
db :: ReaderT SqlBackend (HandlerT App IO) a -> IO a
db = handler . runDB | 93 | db :: ReaderT SqlBackend (HandlerT App IO) a -> IO a
db = handler . runDB | 73 | db = handler . runDB | 20 | true | true | 0 | 9 | 20 | 44 | 20 | 24 | null | null |
elieux/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | failM_RDR = nameRdrName failMName | 47 | failM_RDR = nameRdrName failMName | 47 | failM_RDR = nameRdrName failMName | 47 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
david-caro/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkConditionalAndOrs5 = verify checkConditionalAndOrs "[ -z 3 -o a = b ]" | 80 | prop_checkConditionalAndOrs5 = verify checkConditionalAndOrs "[ -z 3 -o a = b ]" | 80 | prop_checkConditionalAndOrs5 = verify checkConditionalAndOrs "[ -z 3 -o a = b ]" | 80 | false | false | 0 | 5 | 11 | 11 | 5 | 6 | null | null |
ahmadsalim/p3-tool | p3-tool/TVL/Pretty.hs | gpl-3.0 | prettySetExpr (SRange b1 b2) = brackets (prettySetExprBound b1 <+> text ".." <+> prettySetExprBound b2) | 103 | prettySetExpr (SRange b1 b2) = brackets (prettySetExprBound b1 <+> text ".." <+> prettySetExprBound b2) | 103 | prettySetExpr (SRange b1 b2) = brackets (prettySetExprBound b1 <+> text ".." <+> prettySetExprBound b2) | 103 | false | false | 0 | 9 | 13 | 40 | 18 | 22 | null | null |
mzini/termlib | Termlib/Trs.hs | gpl-3.0 | unions :: [Trs] -> Trs
unions = List.foldl union empty | 54 | unions :: [Trs] -> Trs
unions = List.foldl union empty | 54 | unions = List.foldl union empty | 31 | false | true | 0 | 6 | 9 | 25 | 13 | 12 | null | null |
abakst/liquidhaskell | tests/pos/transpose.hs | bsd-3-clause | transpose n m ([] : _) = liquidError "transpose1" | 55 | transpose n m ([] : _) = liquidError "transpose1" | 55 | transpose n m ([] : _) = liquidError "transpose1" | 55 | false | false | 0 | 7 | 14 | 28 | 12 | 16 | null | null |
thewoolleyman/haskellbook | 10/10/haskell-club/ch10exercises.hs | unlicense | myMap :: (a -> b) -> [a] -> [b]
myMap f = foldr (\x acc -> f x : acc) [] | 72 | myMap :: (a -> b) -> [a] -> [b]
myMap f = foldr (\x acc -> f x : acc) [] | 72 | myMap f = foldr (\x acc -> f x : acc) [] | 40 | false | true | 0 | 9 | 20 | 59 | 31 | 28 | null | null |
ejlilley/AbstractMusic | Examples.hs | gpl-3.0 | somelength = AbstractDur3 4.56 | 30 | somelength = AbstractDur3 4.56 | 30 | somelength = AbstractDur3 4.56 | 30 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
isomorphism/hackage2 | Distribution/Server/Packages/Downloads.hs | bsd-3-clause | initialDownloadCounts :: DownloadCounts
initialDownloadCounts = emptyDownloadCounts | 83 | initialDownloadCounts :: DownloadCounts
initialDownloadCounts = emptyDownloadCounts | 83 | initialDownloadCounts = emptyDownloadCounts | 43 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
Raynes/fsutils | src/System/Path.hs | mit | -- | Remove useless paths from a list of paths.
filterUseless :: [FilePath] -> [FilePath]
filterUseless = (\\ [".", ".."]) | 122 | filterUseless :: [FilePath] -> [FilePath]
filterUseless = (\\ [".", ".."]) | 74 | filterUseless = (\\ [".", ".."]) | 32 | true | true | 0 | 8 | 19 | 39 | 21 | 18 | null | null |
shmookey/pure | install/Installer.hs | bsd-3-clause | guessInitSystem :: Installer InitSystem
guessInitSystem =
do
hasSystemd <- FS.isDirectory "/usr/lib/systemd"
hasUpstart <- FS.isDirectory "/usr/share/upstart"
hasSysVInit <- FS.isDirectory "/etc/init.d"
hasLaunchd <- FS.isFile "/sbin/launchd"
return $
if hasSystemd then Systemd
else if hasLaunchd then Launchd
else if hasUpstart then Upstart
else if hasSysVInit then SysVInit
else OtherInit | 447 | guessInitSystem :: Installer InitSystem
guessInitSystem =
do
hasSystemd <- FS.isDirectory "/usr/lib/systemd"
hasUpstart <- FS.isDirectory "/usr/share/upstart"
hasSysVInit <- FS.isDirectory "/etc/init.d"
hasLaunchd <- FS.isFile "/sbin/launchd"
return $
if hasSystemd then Systemd
else if hasLaunchd then Launchd
else if hasUpstart then Upstart
else if hasSysVInit then SysVInit
else OtherInit | 447 | guessInitSystem =
do
hasSystemd <- FS.isDirectory "/usr/lib/systemd"
hasUpstart <- FS.isDirectory "/usr/share/upstart"
hasSysVInit <- FS.isDirectory "/etc/init.d"
hasLaunchd <- FS.isFile "/sbin/launchd"
return $
if hasSystemd then Systemd
else if hasLaunchd then Launchd
else if hasUpstart then Upstart
else if hasSysVInit then SysVInit
else OtherInit | 407 | false | true | 0 | 11 | 101 | 101 | 50 | 51 | null | null |
green-haskell/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | pprCLbl (RtsLabel (RtsApInfoTable upd_reqd arity))
= hcat [ptext (sLit "stg_ap_"), text (show arity),
ptext (if upd_reqd
then (sLit "_upd_info")
else (sLit "_noupd_info"))
] | 247 | pprCLbl (RtsLabel (RtsApInfoTable upd_reqd arity))
= hcat [ptext (sLit "stg_ap_"), text (show arity),
ptext (if upd_reqd
then (sLit "_upd_info")
else (sLit "_noupd_info"))
] | 247 | pprCLbl (RtsLabel (RtsApInfoTable upd_reqd arity))
= hcat [ptext (sLit "stg_ap_"), text (show arity),
ptext (if upd_reqd
then (sLit "_upd_info")
else (sLit "_noupd_info"))
] | 247 | false | false | 0 | 11 | 96 | 79 | 40 | 39 | null | null |
gsdlab/clafer | src/Language/Clafer/Generator/Graph.hs | mit | graphCVLElement :: Element -> Maybe String -> Map.Map Span [Ir] -> String
graphCVLElement (Subclafer _ clafer) parent' irMap = graphCVLClafer clafer parent' irMap | 163 | graphCVLElement :: Element -> Maybe String -> Map.Map Span [Ir] -> String
graphCVLElement (Subclafer _ clafer) parent' irMap = graphCVLClafer clafer parent' irMap | 163 | graphCVLElement (Subclafer _ clafer) parent' irMap = graphCVLClafer clafer parent' irMap | 89 | false | true | 0 | 9 | 23 | 58 | 28 | 30 | null | null |
WraithM/peertrader-backend | src/PeerTrader/Socket/Activity.hs | bsd-3-clause | -- Need status
investmentJSON :: Investment -> Value
investmentJSON (Investment _ t _ ir) = investJSON t ir | 108 | investmentJSON :: Investment -> Value
investmentJSON (Investment _ t _ ir) = investJSON t ir | 92 | investmentJSON (Investment _ t _ ir) = investJSON t ir | 54 | true | true | 0 | 7 | 18 | 36 | 18 | 18 | null | null |
laanwj/Purecoin | Purecoin/Core/Script.hs | mit | reverseReplicateM :: (MonadPlus m) => Integer -> m a -> m [a]
-- reverseReplicateM n cmd | 0 <= n = reverse <$> replicateM n cmd
-- | otherwise = fail "reverseReplicateM given negative number"
reverseReplicateM n cmd = go n []
where
go 0 l = return l
go m l | 0 < m = do { i <- cmd; go (m-1) (i:l) }
| otherwise = fail "reverseReplicateM given negative number" | 402 | reverseReplicateM :: (MonadPlus m) => Integer -> m a -> m [a]
reverseReplicateM n cmd = go n []
where
go 0 l = return l
go m l | 0 < m = do { i <- cmd; go (m-1) (i:l) }
| otherwise = fail "reverseReplicateM given negative number" | 247 | reverseReplicateM n cmd = go n []
where
go 0 l = return l
go m l | 0 < m = do { i <- cmd; go (m-1) (i:l) }
| otherwise = fail "reverseReplicateM given negative number" | 185 | true | true | 3 | 12 | 115 | 130 | 64 | 66 | null | null |
ocharles/hackage-server | Distribution/Server/Framework/Auth.hs | bsd-3-clause | adminRealm = RealmName "Hackage admin" | 40 | adminRealm = RealmName "Hackage admin" | 40 | adminRealm = RealmName "Hackage admin" | 40 | false | false | 1 | 5 | 6 | 13 | 4 | 9 | null | null |
urbanslug/ghc | testsuite/tests/gadt/T1999a.hs | bsd-3-clause | eqUnConstr :: EqTypes (s a) (s b) -> EqTypes a b
eqUnConstr (EqConstr eq) = eq | 78 | eqUnConstr :: EqTypes (s a) (s b) -> EqTypes a b
eqUnConstr (EqConstr eq) = eq | 78 | eqUnConstr (EqConstr eq) = eq | 29 | false | true | 0 | 8 | 15 | 46 | 22 | 24 | null | null |
ghcjs/ghcjs | src/Gen2/Compactor.hs | mit | staticIdentsV f (StaticThunk (Just (i, args))) =
StaticThunk . Just <$> liftA2 (,) (f i) (traverse (staticIdentsA f) args) | 124 | staticIdentsV f (StaticThunk (Just (i, args))) =
StaticThunk . Just <$> liftA2 (,) (f i) (traverse (staticIdentsA f) args) | 124 | staticIdentsV f (StaticThunk (Just (i, args))) =
StaticThunk . Just <$> liftA2 (,) (f i) (traverse (staticIdentsA f) args) | 124 | false | false | 0 | 10 | 20 | 67 | 34 | 33 | null | null |
markuspf/Idris-dev | src/IRTS/Compiler.hs | bsd-3-clause | irMain :: TT Name -> Idris LDecl
irMain tm = do
i <- irTerm (sMN 0 "runMain") M.empty [] tm
return $ LFun [] (sMN 0 "runMain") [] (LForce i) | 148 | irMain :: TT Name -> Idris LDecl
irMain tm = do
i <- irTerm (sMN 0 "runMain") M.empty [] tm
return $ LFun [] (sMN 0 "runMain") [] (LForce i) | 148 | irMain tm = do
i <- irTerm (sMN 0 "runMain") M.empty [] tm
return $ LFun [] (sMN 0 "runMain") [] (LForce i) | 115 | false | true | 0 | 10 | 37 | 86 | 40 | 46 | null | null |
alessandroleite/hephaestus-pl | src/graphusion/src/Data/FDTMC.hs | lgpl-3.0 | -- sem isso usa o formato científico...
transitionToString (FeatureExpression e) = show e | 89 | transitionToString (FeatureExpression e) = show e | 49 | transitionToString (FeatureExpression e) = show e | 49 | true | false | 0 | 7 | 12 | 19 | 9 | 10 | null | null |
brendanhay/gogol | gogol-run/gen/Network/Google/Resource/Run/Projects/Locations/Services/Create.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
plscUploadType :: Lens' ProjectsLocationsServicesCreate (Maybe Text)
plscUploadType
= lens _plscUploadType
(\ s a -> s{_plscUploadType = a}) | 219 | plscUploadType :: Lens' ProjectsLocationsServicesCreate (Maybe Text)
plscUploadType
= lens _plscUploadType
(\ s a -> s{_plscUploadType = a}) | 148 | plscUploadType
= lens _plscUploadType
(\ s a -> s{_plscUploadType = a}) | 79 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
olsner/ghc | compiler/main/HscTypes.hs | bsd-3-clause | -- | Constructs an empty PackageIfaceTable
emptyPackageIfaceTable :: PackageIfaceTable
emptyPackageIfaceTable = emptyModuleEnv | 126 | emptyPackageIfaceTable :: PackageIfaceTable
emptyPackageIfaceTable = emptyModuleEnv | 83 | emptyPackageIfaceTable = emptyModuleEnv | 39 | true | true | 0 | 4 | 11 | 12 | 7 | 5 | null | null |
apyrgio/ganeti | test/hs/Test/Ganeti/Locking/Waiting.hs | bsd-2-clause | -- | Fold a sequence of requests to transform a waiting strucutre onto the
-- empty waiting. As we consider all exported transformations, any waiting
-- structure can be obtained this way.
foldUpdates :: (Lock a, Ord b, Ord c)
=> [UpdateRequest a b c] -> LockWaiting a b c
foldUpdates = foldl asWaitingTrans emptyWaiting | 332 | foldUpdates :: (Lock a, Ord b, Ord c)
=> [UpdateRequest a b c] -> LockWaiting a b c
foldUpdates = foldl asWaitingTrans emptyWaiting | 143 | foldUpdates = foldl asWaitingTrans emptyWaiting | 47 | true | true | 0 | 8 | 66 | 61 | 32 | 29 | null | null |
prl-tokyo/bigul-configuration-adaptation | Transformations/src/BiFlux/DTD/TypeDef.hs | mit | ppRepStructGeneric modname (Defined n) = pK1R <+> ppHName modname n | 78 | ppRepStructGeneric modname (Defined n) = pK1R <+> ppHName modname n | 78 | ppRepStructGeneric modname (Defined n) = pK1R <+> ppHName modname n | 78 | false | false | 0 | 7 | 20 | 26 | 12 | 14 | null | null |
expipiplus1/vulkan | generate-new/src/Render/Utils.hs | bsd-3-clause | chooseAlign :: Int -> (Doc ann, TH.Name, Doc ann -> Doc ann)
chooseAlign align = if align <= 8
then ("allocaBytes", 'allocaBytes, id)
else ("allocaBytesAligned", 'allocaBytesAligned, (<+> viaShow align)) | 207 | chooseAlign :: Int -> (Doc ann, TH.Name, Doc ann -> Doc ann)
chooseAlign align = if align <= 8
then ("allocaBytes", 'allocaBytes, id)
else ("allocaBytesAligned", 'allocaBytesAligned, (<+> viaShow align)) | 207 | chooseAlign align = if align <= 8
then ("allocaBytes", 'allocaBytes, id)
else ("allocaBytesAligned", 'allocaBytesAligned, (<+> viaShow align)) | 146 | false | true | 0 | 8 | 32 | 81 | 46 | 35 | null | null |
vesalvojdani/haskell-fm | Side.hs | gpl-2.0 | updSigma f = modify $ \(x,y,z) -> (f x,y,z) | 47 | updSigma f = modify $ \(x,y,z) -> (f x,y,z) | 47 | updSigma f = modify $ \(x,y,z) -> (f x,y,z) | 47 | false | false | 1 | 9 | 12 | 43 | 22 | 21 | null | null |
neosam/haskelltodo | src/Todo/Changelog.hs | bsd-3-clause | {-| Turns a LogEntry and its parent to a List.
Starting with the most recent LogEntry. -}
parentEntryToEntryList :: ParentLogEntry -> [LogEntry]
parentEntryToEntryList (StartLogEntry _) = [] | 194 | parentEntryToEntryList :: ParentLogEntry -> [LogEntry]
parentEntryToEntryList (StartLogEntry _) = [] | 100 | parentEntryToEntryList (StartLogEntry _) = [] | 45 | true | true | 0 | 6 | 30 | 34 | 17 | 17 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/main/TidyPgm.hs | bsd-3-clause | getClassImplicitBinds :: Class -> [CoreBind]
getClassImplicitBinds cls
= [ NonRec op (mkDictSelRhs cls val_index)
| (op, val_index) <- classAllSelIds cls `zip` [0..] ] | 173 | getClassImplicitBinds :: Class -> [CoreBind]
getClassImplicitBinds cls
= [ NonRec op (mkDictSelRhs cls val_index)
| (op, val_index) <- classAllSelIds cls `zip` [0..] ] | 173 | getClassImplicitBinds cls
= [ NonRec op (mkDictSelRhs cls val_index)
| (op, val_index) <- classAllSelIds cls `zip` [0..] ] | 128 | false | true | 0 | 10 | 28 | 69 | 35 | 34 | null | null |
micknelso/language-c | src/Language/CFamily/C/TravMonad.hs | bsd-3-clause | addRef :: (MonadCError m, MonadSymtab m, CNode u, CNode d) => u -> d -> m ()
addRef use def =
case (nodeInfo use, nodeInfo def) of
(NodeInfo _ _ useName, NodeInfo _ _ defName) ->
withDefTable
(\dt ->
((),
dt { refTable = insert (nameId useName) defName (refTable dt) }
)
)
(_, _) -> return () -- Don't have Names for both, so can't record. | 395 | addRef :: (MonadCError m, MonadSymtab m, CNode u, CNode d) => u -> d -> m ()
addRef use def =
case (nodeInfo use, nodeInfo def) of
(NodeInfo _ _ useName, NodeInfo _ _ defName) ->
withDefTable
(\dt ->
((),
dt { refTable = insert (nameId useName) defName (refTable dt) }
)
)
(_, _) -> return () -- Don't have Names for both, so can't record. | 395 | addRef use def =
case (nodeInfo use, nodeInfo def) of
(NodeInfo _ _ useName, NodeInfo _ _ defName) ->
withDefTable
(\dt ->
((),
dt { refTable = insert (nameId useName) defName (refTable dt) }
)
)
(_, _) -> return () -- Don't have Names for both, so can't record. | 318 | false | true | 2 | 13 | 122 | 163 | 84 | 79 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.