boots-app-0.2.0.1: Factory for quickly building an application

Copyright2019 Daniel YU
LicenseMIT
Maintainerleptonyu@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Boots

Contents

Description

A quick out-of-box factory using to build application with many useful builtin components, based on boots.

  1. Builtin configuration, use salak.
  2. Builtin logger functions, use fast-logger as backend.
  3. Builtin health check, support health check registration.
  4. Builtin random support, use splitmix as backend.
  5. Define standard application values, such that name, version.
Synopsis

Environment

bootApp Source #

Arguments

:: String

name

-> Version

version

-> Factory IO (AppEnv ()) env

Generate env

-> Factory IO (AppEnv env) (IO ())

Application body.

-> IO () 

An out-of-box application booter, with builtin components. Also supports a default commandline handling.

Monad App

data AppT env m a Source #

Application monad transformation.

Instances
Monad m => MonadReader env (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

ask :: AppT env m env #

local :: (env -> env) -> AppT env m a -> AppT env m a #

reader :: (env -> a) -> AppT env m a #

(HasRandom env, MonadIO n) => MonadRandom env (AppT env n) Source # 
Instance details

Defined in Boots.Random

Methods

nextW64 :: AppT env n Word64 Source #

MonadTrans (AppT env) Source # 
Instance details

Defined in Boots.App.Internal

Methods

lift :: Monad m => m a -> AppT env m a #

Monad m => Monad (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

(>>=) :: AppT env m a -> (a -> AppT env m b) -> AppT env m b #

(>>) :: AppT env m a -> AppT env m b -> AppT env m b #

return :: a -> AppT env m a #

fail :: String -> AppT env m a #

Functor m => Functor (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

fmap :: (a -> b) -> AppT env m a -> AppT env m b #

(<$) :: a -> AppT env m b -> AppT env m a #

Applicative m => Applicative (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

pure :: a -> AppT env m a #

(<*>) :: AppT env m (a -> b) -> AppT env m a -> AppT env m b #

liftA2 :: (a -> b -> c) -> AppT env m a -> AppT env m b -> AppT env m c #

(*>) :: AppT env m a -> AppT env m b -> AppT env m b #

(<*) :: AppT env m a -> AppT env m b -> AppT env m a #

MonadIO m => MonadIO (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

liftIO :: IO a -> AppT env m a #

MonadMask m => MonadMask (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

mask :: ((forall a. AppT env m a -> AppT env m a) -> AppT env m b) -> AppT env m b #

uninterruptibleMask :: ((forall a. AppT env m a -> AppT env m a) -> AppT env m b) -> AppT env m b #

generalBracket :: AppT env m a -> (a -> ExitCase b -> AppT env m c) -> (a -> AppT env m b) -> AppT env m (b, c) #

MonadCatch m => MonadCatch (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

catch :: Exception e => AppT env m a -> (e -> AppT env m a) -> AppT env m a #

MonadThrow m => MonadThrow (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

throwM :: Exception e => e -> AppT env m a #

MonadUnliftIO m => MonadUnliftIO (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

askUnliftIO :: AppT env m (UnliftIO (AppT env m)) #

withRunInIO :: ((forall a. AppT env m a -> IO a) -> IO b) -> AppT env m b #

(HasSalak env, Monad m) => MonadSalak (AppT env m) Source # 
Instance details

Defined in Boots.Factory.Salak

Methods

askSourcePack :: AppT env m SourcePack #

askReload :: AppT env m (IO ReloadResult) #

setLogF :: (CallStack -> Text -> IO ()) -> AppT env m () #

logSalak :: Text -> AppT env m () #

require :: (MonadThrow (AppT env m), MonadIO (AppT env m), FromProp (AppT env m) a) => Text -> AppT env m a #

type App env = AppT env IO Source #

Simple IO monad.

runAppT :: env -> AppT env m a -> m a Source #

Run application monad transformation.

withAppT :: (env -> env) -> AppT env m a -> AppT env m a Source #

Execute a computation in a modified environment.

class Monad m => MonadReader r (m :: Type -> Type) | m -> r where #

See examples in Control.Monad.Reader. Note, the partially applied function type (->) r is a simple reader monad. See the instance declaration below.

Minimal complete definition

(ask | reader), local

Methods

ask :: m r #

Retrieves the monad environment.

local #

Arguments

:: (r -> r)

The function to modify the environment.

-> m a

Reader to run in the modified environment.

-> m a 

Executes a computation in a modified environment.

reader #

Arguments

:: (r -> a)

The selector function to apply to the environment.

-> m a 

Retrieves a function of the current environment.

Instances
MonadReader r m => MonadReader r (ResourceT m) 
Instance details

Defined in Control.Monad.Trans.Resource.Internal

Methods

ask :: ResourceT m r #

local :: (r -> r) -> ResourceT m a -> ResourceT m a #

reader :: (r -> a) -> ResourceT m a #

MonadReader r m => MonadReader r (MaybeT m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: MaybeT m r #

local :: (r -> r) -> MaybeT m a -> MaybeT m a #

reader :: (r -> a) -> MaybeT m a #

MonadReader r m => MonadReader r (ListT m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: ListT m r #

local :: (r -> r) -> ListT m a -> ListT m a #

reader :: (r -> a) -> ListT m a #

Monad m => MonadReader SourcePack (RunSalakT m) 
Instance details

Defined in Salak.Internal

Methods

ask :: RunSalakT m SourcePack #

local :: (SourcePack -> SourcePack) -> RunSalakT m a -> RunSalakT m a #

reader :: (SourcePack -> a) -> RunSalakT m a #

Monad m => MonadReader SourcePack (Prop m) 
Instance details

Defined in Salak.Internal.Prop

Methods

ask :: Prop m SourcePack #

local :: (SourcePack -> SourcePack) -> Prop m a -> Prop m a #

reader :: (SourcePack -> a) -> Prop m a #

Monad m => MonadReader env (AppT env m) Source # 
Instance details

Defined in Boots.App.Internal

Methods

ask :: AppT env m env #

local :: (env -> env) -> AppT env m a -> AppT env m a #

reader :: (env -> a) -> AppT env m a #

(Monoid w, MonadReader r m) => MonadReader r (WriterT w m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: WriterT w m r #

local :: (r -> r) -> WriterT w m a -> WriterT w m a #

reader :: (r -> a) -> WriterT w m a #

(Monoid w, MonadReader r m) => MonadReader r (WriterT w m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: WriterT w m r #

local :: (r -> r) -> WriterT w m a -> WriterT w m a #

reader :: (r -> a) -> WriterT w m a #

MonadReader r m => MonadReader r (StateT s m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: StateT s m r #

local :: (r -> r) -> StateT s m a -> StateT s m a #

reader :: (r -> a) -> StateT s m a #

MonadReader r m => MonadReader r (StateT s m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: StateT s m r #

local :: (r -> r) -> StateT s m a -> StateT s m a #

reader :: (r -> a) -> StateT s m a #

MonadReader r m => MonadReader r (IdentityT m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: IdentityT m r #

local :: (r -> r) -> IdentityT m a -> IdentityT m a #

reader :: (r -> a) -> IdentityT m a #

MonadReader r m => MonadReader r (ExceptT e m)

Since: mtl-2.2

Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: ExceptT e m r #

local :: (r -> r) -> ExceptT e m a -> ExceptT e m a #

reader :: (r -> a) -> ExceptT e m a #

(Error e, MonadReader r m) => MonadReader r (ErrorT e m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: ErrorT e m r #

local :: (r -> r) -> ErrorT e m a -> ErrorT e m a #

reader :: (r -> a) -> ErrorT e m a #

Monad m => MonadReader r (ReaderT r m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: ReaderT r m r #

local :: (r -> r) -> ReaderT r m a -> ReaderT r m a #

reader :: (r -> a) -> ReaderT r m a #

(Stream s, MonadReader r m) => MonadReader r (ParsecT e s m) 
Instance details

Defined in Text.Megaparsec.Internal

Methods

ask :: ParsecT e s m r #

local :: (r -> r) -> ParsecT e s m a -> ParsecT e s m a #

reader :: (r -> a) -> ParsecT e s m a #

MonadReader r m => MonadReader r (ConduitT i o m) 
Instance details

Defined in Data.Conduit.Internal.Conduit

Methods

ask :: ConduitT i o m r #

local :: (r -> r) -> ConduitT i o m a -> ConduitT i o m a #

reader :: (r -> a) -> ConduitT i o m a #

MonadReader r ((->) r :: Type -> Type) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: r -> r #

local :: (r -> r) -> (r -> a) -> r -> a #

reader :: (r -> a) -> r -> a #

MonadReader r' m => MonadReader r' (ContT r m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: ContT r m r' #

local :: (r' -> r') -> ContT r m a -> ContT r m a #

reader :: (r' -> a) -> ContT r m a #

(Monad m, Monoid w) => MonadReader r (RWST r w s m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: RWST r w s m r #

local :: (r -> r) -> RWST r w s m a -> RWST r w s m a #

reader :: (r -> a) -> RWST r w s m a #

(Monad m, Monoid w) => MonadReader r (RWST r w s m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: RWST r w s m r #

local :: (r -> r) -> RWST r w s m a -> RWST r w s m a #

reader :: (r -> a) -> RWST r w s m a #

MonadReader r m => MonadReader r (Pipe l i o u m) 
Instance details

Defined in Data.Conduit.Internal.Pipe

Methods

ask :: Pipe l i o u m r #

local :: (r -> r) -> Pipe l i o u m a -> Pipe l i o u m a #

reader :: (r -> a) -> Pipe l i o u m a #

asks #

Arguments

:: MonadReader r m 
=> (r -> a)

The selector function to apply to the environment.

-> m a 

Retrieves a function of the current environment.

Utilities

natA :: MonadMask m => Factory (AppT env m) env component -> Factory m env component Source #

Nature transform from AppT env m to m.

delay :: MonadMask m => AppT env m () -> Factory m env () Source #

Add a delayed action into the factory.

produceA :: MonadMask m => AppT env m res -> (res -> AppT env m ()) -> Factory m env res Source #

Produce res under environment env.

Factory Instances

Application

class HasApp env ext where Source #

Environment values with AppEnv.

Methods

askApp :: Lens' env (AppEnv ext) Source #

Instances
HasApp (AppEnv ext) ext Source # 
Instance details

Defined in Boots.Factory.Application

Methods

askApp :: Lens' (AppEnv ext) (AppEnv ext) Source #

data AppEnv ext Source #

Application environment.

Constructors

AppEnv 

Fields

Instances
HasHealth (AppEnv ext) Source # 
Instance details

Defined in Boots.Factory.Application

Methods

askHealth :: Lens' (AppEnv ext) (IO Health) Source #

HasSalak (AppEnv ext) Source # 
Instance details

Defined in Boots.Factory.Application

Methods

askSalak :: Lens' (AppEnv ext) Salak Source #

HasLogger (AppEnv ext) Source # 
Instance details

Defined in Boots.Factory.Application

HasRandom (AppEnv ext) Source # 
Instance details

Defined in Boots.Factory.Application

Methods

askRandom :: Lens' (AppEnv ext) RD Source #

HasApp (AppEnv ext) ext Source # 
Instance details

Defined in Boots.Factory.Application

Methods

askApp :: Lens' (AppEnv ext) (AppEnv ext) Source #

askExt :: Lens' (AppEnv ext) ext Source #

buildApp :: (MonadIO m, MonadMask m) => String -> Version -> ParseCommandLine -> ext -> Factory m () (AppEnv ext) Source #

Factory used to build AppEnv.

Configuration

class HasSalak env where Source #

Environment values with Salak.

Methods

askSalak :: Lens' env Salak Source #

Instances
HasSalak Salak Source # 
Instance details

Defined in Boots.Factory.Salak

HasSalak (AppEnv ext) Source # 
Instance details

Defined in Boots.Factory.Application

Methods

askSalak :: Lens' (AppEnv ext) Salak Source #

class Monad m => MonadSalak (m :: Type -> Type) where #

Core type class of salak, which provide function to parse properties.

Minimal complete definition

askSourcePack

Methods

askSourcePack :: m SourcePack #

Monad has the ability to get a SourcePack instance.

askReload :: m (IO ReloadResult) #

Get reload action which used for reload profiles

setLogF :: (CallStack -> Text -> IO ()) -> m () #

logSalak :: Text -> m () #

require :: (MonadThrow m, MonadIO m, FromProp m a) => Text -> m a #

Parse properties using FromProp. For example:

a :: Bool              <- require "bool.key"
b :: Maybe Int         <- require "int.optional.key"
c :: Either String Int <- require "int.error.key"
d :: IO Int            <- require "int.reloadable.key"

require supports parse IO values, which actually wrap a MVar variable and can be reseted by reloading configurations. Normal value will not be affected by reloading configurations.

Instances
MonadIO m => MonadSalak (LoadSalakT m) 
Instance details

Defined in Salak.Internal

MonadIO m => MonadSalak (RunSalakT m) 
Instance details

Defined in Salak.Internal

(HasSalak env, MonadMask m) => MonadSalak (Factory m env) Source # 
Instance details

Defined in Boots.Factory.Salak

Methods

askSourcePack :: Factory m env SourcePack #

askReload :: Factory m env (IO ReloadResult) #

setLogF :: (CallStack -> Text -> IO ()) -> Factory m env () #

logSalak :: Text -> Factory m env () #

require :: (MonadThrow (Factory m env), MonadIO (Factory m env), FromProp (Factory m env) a) => Text -> Factory m env a #

(HasSalak env, Monad m) => MonadSalak (AppT env m) Source # 
Instance details

Defined in Boots.Factory.Salak

Methods

askSourcePack :: AppT env m SourcePack #

askReload :: AppT env m (IO ReloadResult) #

setLogF :: (CallStack -> Text -> IO ()) -> AppT env m () #

logSalak :: Text -> AppT env m () #

require :: (MonadThrow (AppT env m), MonadIO (AppT env m), FromProp (AppT env m) a) => Text -> AppT env m a #

Monad m => MonadSalak (ReaderT SourcePack m) 
Instance details

Defined in Salak.Internal.Prop

buildSalak :: (MonadIO m, MonadCatch m) => String -> Factory m () Salak Source #

Factory which loads configurations, and produces a configuration instance.

Utilities

tryBuildByKey Source #

Arguments

:: (MonadMask m, MonadIO m, HasSalak env) 
=> Bool

Default value.

-> Text

Configuration key.

-> Factory m env ()

Target factory.

-> Factory m env ()

Launch the target factory if configuration is setted to be true.

A helper function used for try to build a factory if configuration set true.

Logger

class HasLogger env where Source #

Environment providing a logging function.

Instances
HasLogger LogFunc Source # 
Instance details

Defined in Boots.Factory.Logger

HasLogger (AppEnv ext) Source # 
Instance details

Defined in Boots.Factory.Application

data LogConfig Source #

Logger configuation used to customizing LogFunc.

Constructors

LogConfig 

Fields

Instances
Default LogConfig Source # 
Instance details

Defined in Boots.Factory.Logger

Methods

def :: LogConfig #

MonadIO m => FromProp m LogConfig Source # 
Instance details

Defined in Boots.Factory.Logger

Methods

fromProp :: Prop m LogConfig #

data LogFunc Source #

A closable logging function. Also supporting change log level and count failed logs.

Constructors

LogFunc 

Fields

Instances
HasLogger LogFunc Source # 
Instance details

Defined in Boots.Factory.Logger

addTrace :: ToLogStr msg => msg -> LogFunc -> LogFunc Source #

Add additional trace info into log.

buildLogger :: (MonadIO m, MonadMask m, HasSalak env) => Text -> Factory m env LogFunc Source #

Factory which produces a LogFunc.

Log Functions

logTrace :: (MonadLog e m, HasCallStack) => LogStr -> m () Source #

Logs a LevelTrace message.

logDebug :: (MonadLog e m, HasCallStack) => LogStr -> m () Source #

Logs a LevelDebug message.

logInfo :: (MonadLog e m, HasCallStack) => LogStr -> m () Source #

Logs a LevelInfo message.

logWarn :: (MonadLog e m, HasCallStack) => LogStr -> m () Source #

Logs a LevelWarn message.

logError :: (MonadLog e m, HasCallStack) => LogStr -> m () Source #

Logs a LevelError message.

logFatal :: (MonadLog e m, HasCallStack) => LogStr -> m () Source #

Logs a LevelFatal message.

logCS :: CallStack -> LogLevel -> LogStr -> LogFunc -> IO () Source #

Logs a message with location given by CallStack.

data LogLevel Source #

Log level.

Instances
Eq LogLevel Source # 
Instance details

Defined in Boots.Factory.Logger

Ord LogLevel Source # 
Instance details

Defined in Boots.Factory.Logger

Show LogLevel Source # 
Instance details

Defined in Boots.Factory.Logger

FromProp m LogLevel Source # 
Instance details

Defined in Boots.Factory.Logger

Methods

fromProp :: Prop m LogLevel #

Reexport log functions

class ToLogStr msg where #

Types that can be converted to a LogStr. Instances for types from the text library use a UTF-8 encoding. Instances for numerical types use a decimal encoding.

Methods

toLogStr :: msg -> LogStr #

Instances
ToLogStr Double

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Double -> LogStr #

ToLogStr Float

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Float -> LogStr #

ToLogStr Int

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Int -> LogStr #

ToLogStr Int8

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Int8 -> LogStr #

ToLogStr Int16

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Int16 -> LogStr #

ToLogStr Int32

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Int32 -> LogStr #

ToLogStr Int64

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Int64 -> LogStr #

ToLogStr Integer

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Integer -> LogStr #

ToLogStr Word

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Word -> LogStr #

ToLogStr Word8

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Word8 -> LogStr #

ToLogStr Word16

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Word16 -> LogStr #

ToLogStr Word32

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Word32 -> LogStr #

ToLogStr Word64

Since: fast-logger-2.4.14

Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Word64 -> LogStr #

ToLogStr String 
Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: String -> LogStr #

ToLogStr ByteString 
Instance details

Defined in System.Log.FastLogger.LogStr

ToLogStr ByteString 
Instance details

Defined in System.Log.FastLogger.LogStr

ToLogStr Builder 
Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Builder -> LogStr #

ToLogStr Text 
Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Text -> LogStr #

ToLogStr LogStr 
Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: LogStr -> LogStr #

ToLogStr Text 
Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: Text -> LogStr #

data LogStr #

Log message builder. Use (<>) to append two LogStr in O(1).

Instances
Eq LogStr 
Instance details

Defined in System.Log.FastLogger.LogStr

Methods

(==) :: LogStr -> LogStr -> Bool #

(/=) :: LogStr -> LogStr -> Bool #

Show LogStr 
Instance details

Defined in System.Log.FastLogger.LogStr

IsString LogStr 
Instance details

Defined in System.Log.FastLogger.LogStr

Methods

fromString :: String -> LogStr #

Semigroup LogStr 
Instance details

Defined in System.Log.FastLogger.LogStr

Monoid LogStr 
Instance details

Defined in System.Log.FastLogger.LogStr

ToLogStr LogStr 
Instance details

Defined in System.Log.FastLogger.LogStr

Methods

toLogStr :: LogStr -> LogStr #

Components

Health Check

data Health Source #

Health detail.

Constructors

Health 
Instances
Eq Health Source # 
Instance details

Defined in Boots.Health

Methods

(==) :: Health -> Health -> Bool #

(/=) :: Health -> Health -> Bool #

Show Health Source # 
Instance details

Defined in Boots.Health

Generic Health Source # 
Instance details

Defined in Boots.Health

Associated Types

type Rep Health :: Type -> Type #

Methods

from :: Health -> Rep Health x #

to :: Rep Health x -> Health #

HasHealth (IO Health) Source # 
Instance details

Defined in Boots.Health

type Rep Health Source # 
Instance details

Defined in Boots.Health

data HealthStatus Source #

Health status.

Constructors

UP 
DOWN 
Instances
Eq HealthStatus Source # 
Instance details

Defined in Boots.Health

Show HealthStatus Source # 
Instance details

Defined in Boots.Health

Generic HealthStatus Source # 
Instance details

Defined in Boots.Health

Associated Types

type Rep HealthStatus :: Type -> Type #

type Rep HealthStatus Source # 
Instance details

Defined in Boots.Health

type Rep HealthStatus = D1 (MetaData "HealthStatus" "Boots.Health" "boots-app-0.2.0.1-Kg6LM9U8tYyBUPFnxuhaBl" False) (C1 (MetaCons "UP" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "DOWN" PrefixI False) (U1 :: Type -> Type))

class HasHealth env where Source #

Environment values with health checker `IO Health`.

Methods

askHealth :: Lens' env (IO Health) Source #

Instances
HasHealth (IO Health) Source # 
Instance details

Defined in Boots.Health

HasHealth (AppEnv ext) Source # 
Instance details

Defined in Boots.Factory.Application

Methods

askHealth :: Lens' (AppEnv ext) (IO Health) Source #

emptyHealth :: IO Health Source #

Default health detail.

registerHealth Source #

Arguments

:: (MonadMask n, HasHealth env) 
=> Text

Component name.

-> IO HealthStatus

Check action.

-> Factory n env () 

Register a health checker.

newtype RD Source #

Random value generator.

Constructors

RD 

Fields

Instances
HasRandom RD Source # 
Instance details

Defined in Boots.Random

class HasRandom env where Source #

Environment values with RD.

Methods

askRandom :: Lens' env RD Source #

Instances
HasRandom RD Source # 
Instance details

Defined in Boots.Random

HasRandom (AppEnv ext) Source # 
Instance details

Defined in Boots.Factory.Application

Methods

askRandom :: Lens' (AppEnv ext) RD Source #

class Monad m => MonadRandom env m | m -> env where Source #

Methods

nextW64 :: m Word64 Source #

Instances
(HasRandom env, MonadIO n) => MonadRandom env (AppT env n) Source # 
Instance details

Defined in Boots.Random

Methods

nextW64 :: AppT env n Word64 Source #

(HasRandom env, MonadMask n, MonadIO n) => MonadRandom env (Factory n env) Source # 
Instance details

Defined in Boots.Random

Methods

nextW64 :: Factory n env Word64 Source #

newRD :: RDType -> IO RD Source #

Create a new random value generator.

data RDType Source #

Seed container type.

Constructors

RDIORef 
RDMVar 
Instances
FromProp m RDType Source # 
Instance details

Defined in Boots.Random

Methods

fromProp :: Prop m RDType #

makeRD :: SMGen -> IO RD Source #

Create random value generator with a seed.

makeRD0 :: SMGen -> (RD -> IO a) -> IO a Source #

Create a thread unsafe RD, which should be used only in single thread. It is faster than RD generated by newRD and makeRD.

forkRD :: RD -> IO RD Source #

Fork a new RD from old RD.

hex32 :: IsString a => Word64 -> a Source #

Convert Word64 into 32 bit hex.

hex64 :: IsString a => Word64 -> a Source #

Convert Word64 into 64 bit hex.

nextWord64 :: SMGen -> (Word64, SMGen) #

Generate a Word64.

>>> take 3 $ map (printf "%x") $ unfoldr (Just . nextWord64) (mkSMGen 1337) :: [String]
["b5c19e300e8b07b3","d600e0e216c0ac76","c54efc3b3cc5af29"]

splitSMGen :: SMGen -> (SMGen, SMGen) #

Split a generator into a two uncorrelated generators.

CLI

data CLI Source #

Options parsed from arguments.

Constructors

CLI 

Fields

interruptCli :: MonadThrow m => m a Source #

Normal interrupt cli.

runCLI :: Version -> (ParseCommandLine -> IO ()) -> IO () Source #

Run cli.

Reexport

whenJust :: Applicative f => Maybe a -> (a -> f ()) -> f () Source #

mapLeft :: (a -> c) -> Either a b -> Either c b Source #

when :: Applicative f => Bool -> f () -> f () #

Conditional execution of Applicative expressions. For example,

when debug (putStrLn "Debugging")

will output the string Debugging if the Boolean value debug is True, and otherwise do nothing.

unless :: Applicative f => Bool -> f () -> f () #

The reverse of when.

class IsString a where #

Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).

Methods

fromString :: String -> a #

Instances
IsString ByteString 
Instance details

Defined in Data.ByteString.Lazy.Internal

IsString ByteString 
Instance details

Defined in Data.ByteString.Internal

IsString LogStr 
Instance details

Defined in System.Log.FastLogger.LogStr

Methods

fromString :: String -> LogStr #

a ~ Char => IsString [a]

(a ~ Char) context was introduced in 4.9.0.0

Since: base-2.1

Instance details

Defined in Data.String

Methods

fromString :: String -> [a] #

IsString a => IsString (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.String

Methods

fromString :: String -> Identity a #

a ~ Char => IsString (Seq a)

Since: containers-0.5.7

Instance details

Defined in Data.Sequence.Internal

Methods

fromString :: String -> Seq a #

a ~ Char => IsString (DList a) 
Instance details

Defined in Data.DList

Methods

fromString :: String -> DList a #

(IsString a, Hashable a) => IsString (Hashed a) 
Instance details

Defined in Data.Hashable.Class

Methods

fromString :: String -> Hashed a #

(MonadIO m, FromProp m a) => IsString (Prop m a)

Automatic convert literal string into an instance of Prop m a.

Instance details

Defined in Salak.Internal.Prop

Methods

fromString :: String -> Prop m a #

IsString a => IsString (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.String

Methods

fromString :: String -> Const a b #

(a ~ Tokens s, IsString a, Eq a, Stream s, Ord e) => IsString (ParsecT e s m a)

Since: megaparsec-6.3.0

Instance details

Defined in Text.Megaparsec.Internal

Methods

fromString :: String -> ParsecT e s m a #

view :: Getting a s a -> s -> a #

view is a synonym for (^.):

>>> view _1 (1, 2)
1

The reason it's not in Lens.Micro is that view in lens has a more general signature:

view :: MonadReader s m => Getting a s a -> m a

So, you would be able to use this view with functions, but not in various reader monads. For most people this shouldn't be an issue; if it is for you, use view from microlens-mtl.

over :: ASetter s t a b -> (a -> b) -> s -> t #

over is a synonym for (%~).

Getting fmap in a roundabout way:

over mapped :: Functor f => (a -> b) -> f a -> f b
over mapped = fmap

Applying a function to both components of a pair:

over both :: (a -> b) -> (a, a) -> (b, b)
over both = \f t -> (f (fst t), f (snd t))

Using over _2 as a replacement for second:

>>> over _2 show (10,20)
(10,"20")

type Lens' s a = Lens s s a a #

This is a type alias for monomorphic lenses which don't change the type of the container (or of the value inside).

lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b #

lens creates a Lens from a getter and a setter. The resulting lens isn't the most effective one (because of having to traverse the structure twice when modifying), but it shouldn't matter much.

A (partial) lens for list indexing:

ix :: Int -> Lens' [a] a
ix i = lens (!! i)                                   -- getter
            (\s b -> take i s ++ b : drop (i+1) s)   -- setter

Usage:

>>> [1..9] ^. ix 3
4

>>> [1..9] & ix 3 %~ negate
[1,2,3,-4,5,6,7,8,9]

When getting, the setter is completely unused; when setting, the getter is unused. Both are used only when the value is being modified. For instance, here we define a lens for the 1st element of a list, but instead of a legitimate getter we use undefined. Then we use the resulting lens for setting and it works, which proves that the getter wasn't used:

>>> [1,2,3] & lens undefined (\s b -> b : tail s) .~ 10
[10,2,3]

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

>>> 5 & (+1) & show
"6"

Since: base-4.8.0.0

class Semigroup a => Monoid a where #

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:

The method names refer to the monoid of lists under concatenation, but there are many other instances.

Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product.

NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.

Minimal complete definition

mempty

Methods

mempty :: a #

Identity of mappend

mappend :: a -> a -> a #

An associative operation

NOTE: This method is redundant and has the default implementation mappend = '(<>)' since base-4.11.0.0.

mconcat :: [a] -> a #

Fold a list using the monoid.

For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.

Instances
Monoid Ordering

Since: base-2.1

Instance details

Defined in GHC.Base

Monoid ()

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: () #

mappend :: () -> () -> () #

mconcat :: [()] -> () #

Monoid All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: All #

mappend :: All -> All -> All #

mconcat :: [All] -> All #

Monoid Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Any #

mappend :: Any -> Any -> Any #

mconcat :: [Any] -> Any #

Monoid ByteString 
Instance details

Defined in Data.ByteString.Lazy.Internal

Monoid ByteString 
Instance details

Defined in Data.ByteString.Internal

Monoid Builder 
Instance details

Defined in Data.ByteString.Builder.Internal

Monoid IntSet 
Instance details

Defined in Data.IntSet.Internal

Monoid LogStr 
Instance details

Defined in System.Log.FastLogger.LogStr

Monoid PrefsMod 
Instance details

Defined in Options.Applicative.Builder

Monoid ParseError 
Instance details

Defined in Options.Applicative.Types

Monoid Completer 
Instance details

Defined in Options.Applicative.Types

Monoid ParserHelp 
Instance details

Defined in Options.Applicative.Help.Types

Monoid [a]

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: [a] #

mappend :: [a] -> [a] -> [a] #

mconcat :: [[a]] -> [a] #

Semigroup a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S."

Since 4.11.0: constraint on inner a value generalised from Monoid to Semigroup.

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: Maybe a #

mappend :: Maybe a -> Maybe a -> Maybe a #

mconcat :: [Maybe a] -> Maybe a #

Monoid a => Monoid (IO a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

mempty :: IO a #

mappend :: IO a -> IO a -> IO a #

mconcat :: [IO a] -> IO a #

Monoid p => Monoid (Par1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: Par1 p #

mappend :: Par1 p -> Par1 p -> Par1 p #

mconcat :: [Par1 p] -> Par1 p #

(Ord a, Bounded a) => Monoid (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mempty :: Min a #

mappend :: Min a -> Min a -> Min a #

mconcat :: [Min a] -> Min a #

(Ord a, Bounded a) => Monoid (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mempty :: Max a #

mappend :: Max a -> Max a -> Max a #

mconcat :: [Max a] -> Max a #

Monoid m => Monoid (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Semigroup a => Monoid (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mempty :: Option a #

mappend :: Option a -> Option a -> Option a #

mconcat :: [Option a] -> Option a #

Monoid a => Monoid (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

mempty :: Identity a #

mappend :: Identity a -> Identity a -> Identity a #

mconcat :: [Identity a] -> Identity a #

Monoid (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

mempty :: First a #

mappend :: First a -> First a -> First a #

mconcat :: [First a] -> First a #

Monoid (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

mempty :: Last a #

mappend :: Last a -> Last a -> Last a #

mconcat :: [Last a] -> Last a #

Monoid a => Monoid (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Dual a #

mappend :: Dual a -> Dual a -> Dual a #

mconcat :: [Dual a] -> Dual a #

Monoid (Endo a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Endo a #

mappend :: Endo a -> Endo a -> Endo a #

mconcat :: [Endo a] -> Endo a #

Num a => Monoid (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Sum a #

mappend :: Sum a -> Sum a -> Sum a #

mconcat :: [Sum a] -> Sum a #

Num a => Monoid (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Product a #

mappend :: Product a -> Product a -> Product a #

mconcat :: [Product a] -> Product a #

Monoid (IntMap a) 
Instance details

Defined in Data.IntMap.Internal

Methods

mempty :: IntMap a #

mappend :: IntMap a -> IntMap a -> IntMap a #

mconcat :: [IntMap a] -> IntMap a #

Monoid (Seq a) 
Instance details

Defined in Data.Sequence.Internal

Methods

mempty :: Seq a #

mappend :: Seq a -> Seq a -> Seq a #

mconcat :: [Seq a] -> Seq a #

Ord a => Monoid (Set a) 
Instance details

Defined in Data.Set.Internal

Methods

mempty :: Set a #

mappend :: Set a -> Set a -> Set a #

mconcat :: [Set a] -> Set a #

Monoid (DList a) 
Instance details

Defined in Data.DList

Methods

mempty :: DList a #

mappend :: DList a -> DList a -> DList a #

mconcat :: [DList a] -> DList a #

Monoid (Hints t) 
Instance details

Defined in Text.Megaparsec.Internal

Methods

mempty :: Hints t #

mappend :: Hints t -> Hints t -> Hints t #

mconcat :: [Hints t] -> Hints t #

Monoid (InfoMod a) 
Instance details

Defined in Options.Applicative.Builder

Methods

mempty :: InfoMod a #

mappend :: InfoMod a -> InfoMod a -> InfoMod a #

mconcat :: [InfoMod a] -> InfoMod a #

Monoid (DefaultProp a) 
Instance details

Defined in Options.Applicative.Builder.Internal

Monoid (Array a) 
Instance details

Defined in Data.Primitive.Array

Methods

mempty :: Array a #

mappend :: Array a -> Array a -> Array a #

mconcat :: [Array a] -> Array a #

(Hashable a, Eq a) => Monoid (HashSet a) 
Instance details

Defined in Data.HashSet.Base

Methods

mempty :: HashSet a #

mappend :: HashSet a -> HashSet a -> HashSet a #

mconcat :: [HashSet a] -> HashSet a #

Monoid (MergeSet a) 
Instance details

Defined in Data.Set.Internal

Methods

mempty :: MergeSet a #

mappend :: MergeSet a -> MergeSet a -> MergeSet a #

mconcat :: [MergeSet a] -> MergeSet a #

Monoid b => Monoid (a -> b)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: a -> b #

mappend :: (a -> b) -> (a -> b) -> a -> b #

mconcat :: [a -> b] -> a -> b #

Monoid (U1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: U1 p #

mappend :: U1 p -> U1 p -> U1 p #

mconcat :: [U1 p] -> U1 p #

(Monoid a, Monoid b) => Monoid (a, b)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: (a, b) #

mappend :: (a, b) -> (a, b) -> (a, b) #

mconcat :: [(a, b)] -> (a, b) #

Monoid a => Monoid (ST s a)

Since: base-4.11.0.0

Instance details

Defined in GHC.ST

Methods

mempty :: ST s a #

mappend :: ST s a -> ST s a -> ST s a #

mconcat :: [ST s a] -> ST s a #

Monoid (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

mempty :: Proxy s #

mappend :: Proxy s -> Proxy s -> Proxy s #

mconcat :: [Proxy s] -> Proxy s #

Ord k => Monoid (Map k v) 
Instance details

Defined in Data.Map.Internal

Methods

mempty :: Map k v #

mappend :: Map k v -> Map k v -> Map k v #

mconcat :: [Map k v] -> Map k v #

(Stream s, Ord e) => Monoid (ParseError s e) 
Instance details

Defined in Text.Megaparsec.Error

Methods

mempty :: ParseError s e #

mappend :: ParseError s e -> ParseError s e -> ParseError s e #

mconcat :: [ParseError s e] -> ParseError s e #

Monoid (Mod f a) 
Instance details

Defined in Options.Applicative.Builder.Internal

Methods

mempty :: Mod f a #

mappend :: Mod f a -> Mod f a -> Mod f a #

mconcat :: [Mod f a] -> Mod f a #

(Eq k, Hashable k) => Monoid (HashMap k v) 
Instance details

Defined in Data.HashMap.Base

Methods

mempty :: HashMap k v #

mappend :: HashMap k v -> HashMap k v -> HashMap k v #

mconcat :: [HashMap k v] -> HashMap k v #

Applicative f => Monoid (Traversed a f) 
Instance details

Defined in Lens.Micro

Methods

mempty :: Traversed a f #

mappend :: Traversed a f -> Traversed a f -> Traversed a f #

mconcat :: [Traversed a f] -> Traversed a f #

Monoid (f p) => Monoid (Rec1 f p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: Rec1 f p #

mappend :: Rec1 f p -> Rec1 f p -> Rec1 f p #

mconcat :: [Rec1 f p] -> Rec1 f p #

(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: (a, b, c) #

mappend :: (a, b, c) -> (a, b, c) -> (a, b, c) #

mconcat :: [(a, b, c)] -> (a, b, c) #

Monoid a => Monoid (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

mempty :: Const a b #

mappend :: Const a b -> Const a b -> Const a b #

mconcat :: [Const a b] -> Const a b #

(Applicative f, Monoid a) => Monoid (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

mempty :: Ap f a #

mappend :: Ap f a -> Ap f a -> Ap f a #

mconcat :: [Ap f a] -> Ap f a #

Alternative f => Monoid (Alt f a)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Alt f a #

mappend :: Alt f a -> Alt f a -> Alt f a #

mconcat :: [Alt f a] -> Alt f a #

Monoid c => Monoid (K1 i c p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: K1 i c p #

mappend :: K1 i c p -> K1 i c p -> K1 i c p #

mconcat :: [K1 i c p] -> K1 i c p #

(Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: (f :*: g) p #

mappend :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

mconcat :: [(f :*: g) p] -> (f :*: g) p #

(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: (a, b, c, d) #

mappend :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

mconcat :: [(a, b, c, d)] -> (a, b, c, d) #

Monad m => Monoid (ConduitT i o m ()) 
Instance details

Defined in Data.Conduit.Internal.Conduit

Methods

mempty :: ConduitT i o m () #

mappend :: ConduitT i o m () -> ConduitT i o m () -> ConduitT i o m () #

mconcat :: [ConduitT i o m ()] -> ConduitT i o m () #

(Stream s, Monoid a) => Monoid (ParsecT e s m a)

Since: megaparsec-5.3.0

Instance details

Defined in Text.Megaparsec.Internal

Methods

mempty :: ParsecT e s m a #

mappend :: ParsecT e s m a -> ParsecT e s m a -> ParsecT e s m a #

mconcat :: [ParsecT e s m a] -> ParsecT e s m a #

Monoid (f p) => Monoid (M1 i c f p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: M1 i c f p #

mappend :: M1 i c f p -> M1 i c f p -> M1 i c f p #

mconcat :: [M1 i c f p] -> M1 i c f p #

Monoid (f (g p)) => Monoid ((f :.: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: (f :.: g) p #

mappend :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

mconcat :: [(f :.: g) p] -> (f :.: g) p #

(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: (a, b, c, d, e) #

mappend :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

mconcat :: [(a, b, c, d, e)] -> (a, b, c, d, e) #

Monad m => Monoid (Pipe l i o u m ()) 
Instance details

Defined in Data.Conduit.Internal.Pipe

Methods

mempty :: Pipe l i o u m () #

mappend :: Pipe l i o u m () -> Pipe l i o u m () -> Pipe l i o u m () #

mconcat :: [Pipe l i o u m ()] -> Pipe l i o u m () #

data Proxy (t :: k) :: forall k. k -> Type #

Proxy is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).

Historically, Proxy :: Proxy a is a safer alternative to the 'undefined :: a' idiom.

>>> Proxy :: Proxy (Void, Int -> Int)
Proxy

Proxy can even hold types of higher kinds,

>>> Proxy :: Proxy Either
Proxy
>>> Proxy :: Proxy Functor
Proxy
>>> Proxy :: Proxy complicatedStructure
Proxy

Constructors

Proxy 
Instances
Generic1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Proxy :: k -> Type #

Methods

from1 :: Proxy a -> Rep1 Proxy a #

to1 :: Rep1 Proxy a -> Proxy a #

Monad (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #

(>>) :: Proxy a -> Proxy b -> Proxy b #

return :: a -> Proxy a #

fail :: String -> Proxy a #

Functor (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b #

(<$) :: a -> Proxy b -> Proxy a #

Applicative (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a #

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b #

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #

(*>) :: Proxy a -> Proxy b -> Proxy b #

(<*) :: Proxy a -> Proxy b -> Proxy a #

Foldable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m #

foldMap :: Monoid m => (a -> m) -> Proxy a -> m #

foldr :: (a -> b -> b) -> b -> Proxy a -> b #

foldr' :: (a -> b -> b) -> b -> Proxy a -> b #

foldl :: (b -> a -> b) -> b -> Proxy a -> b #

foldl' :: (b -> a -> b) -> b -> Proxy a -> b #

foldr1 :: (a -> a -> a) -> Proxy a -> a #

foldl1 :: (a -> a -> a) -> Proxy a -> a #

toList :: Proxy a -> [a] #

null :: Proxy a -> Bool #

length :: Proxy a -> Int #

elem :: Eq a => a -> Proxy a -> Bool #

maximum :: Ord a => Proxy a -> a #

minimum :: Ord a => Proxy a -> a #

sum :: Num a => Proxy a -> a #

product :: Num a => Proxy a -> a #

Traversable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) #

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) #

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) #

sequence :: Monad m => Proxy (m a) -> m (Proxy a) #

Eq1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool #

Ord1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering #

Read1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a] #

Show1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS #

Alternative (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

empty :: Proxy a #

(<|>) :: Proxy a -> Proxy a -> Proxy a #

some :: Proxy a -> Proxy [a] #

many :: Proxy a -> Proxy [a] #

MonadPlus (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

mzero :: Proxy a #

mplus :: Proxy a -> Proxy a -> Proxy a #

Hashable1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Proxy a -> Int #

Bounded (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

minBound :: Proxy t #

maxBound :: Proxy t #

Enum (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

succ :: Proxy s -> Proxy s #

pred :: Proxy s -> Proxy s #

toEnum :: Int -> Proxy s #

fromEnum :: Proxy s -> Int #

enumFrom :: Proxy s -> [Proxy s] #

enumFromThen :: Proxy s -> Proxy s -> [Proxy s] #

enumFromTo :: Proxy s -> Proxy s -> [Proxy s] #

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] #

Eq (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(==) :: Proxy s -> Proxy s -> Bool #

(/=) :: Proxy s -> Proxy s -> Bool #

Ord (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

compare :: Proxy s -> Proxy s -> Ordering #

(<) :: Proxy s -> Proxy s -> Bool #

(<=) :: Proxy s -> Proxy s -> Bool #

(>) :: Proxy s -> Proxy s -> Bool #

(>=) :: Proxy s -> Proxy s -> Bool #

max :: Proxy s -> Proxy s -> Proxy s #

min :: Proxy s -> Proxy s -> Proxy s #

Read (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Show (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS #

show :: Proxy s -> String #

showList :: [Proxy s] -> ShowS #

Ix (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

range :: (Proxy s, Proxy s) -> [Proxy s] #

index :: (Proxy s, Proxy s) -> Proxy s -> Int #

unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int

inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool #

rangeSize :: (Proxy s, Proxy s) -> Int #

unsafeRangeSize :: (Proxy s, Proxy s) -> Int

Generic (Proxy t) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type #

Methods

from :: Proxy t -> Rep (Proxy t) x #

to :: Rep (Proxy t) x -> Proxy t #

Semigroup (Proxy s)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s #

sconcat :: NonEmpty (Proxy s) -> Proxy s #

stimes :: Integral b => b -> Proxy s -> Proxy s #

Monoid (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

mempty :: Proxy s #

mappend :: Proxy s -> Proxy s -> Proxy s #

mconcat :: [Proxy s] -> Proxy s #

Hashable (Proxy a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Proxy a -> Int #

hash :: Proxy a -> Int #

type Rep1 (Proxy :: k -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep1 (Proxy :: k -> Type) = D1 (MetaData "Proxy" "Data.Proxy" "base" False) (C1 (MetaCons "Proxy" PrefixI False) (U1 :: k -> Type))
type Rep (Proxy t)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep (Proxy t) = D1 (MetaData "Proxy" "Data.Proxy" "base" False) (C1 (MetaCons "Proxy" PrefixI False) (U1 :: Type -> Type))

class Default a where #

A class for types with a default value.

Minimal complete definition

Nothing

Methods

def :: a #

The default value for this type.

Instances
Default Double 
Instance details

Defined in Data.Default.Class

Methods

def :: Double #

Default Float 
Instance details

Defined in Data.Default.Class

Methods

def :: Float #

Default Int 
Instance details

Defined in Data.Default.Class

Methods

def :: Int #

Default Int8 
Instance details

Defined in Data.Default.Class

Methods

def :: Int8 #

Default Int16 
Instance details

Defined in Data.Default.Class

Methods

def :: Int16 #

Default Int32 
Instance details

Defined in Data.Default.Class

Methods

def :: Int32 #

Default Int64 
Instance details

Defined in Data.Default.Class

Methods

def :: Int64 #

Default Integer 
Instance details

Defined in Data.Default.Class

Methods

def :: Integer #

Default Ordering 
Instance details

Defined in Data.Default.Class

Methods

def :: Ordering #

Default Word 
Instance details

Defined in Data.Default.Class

Methods

def :: Word #

Default Word8 
Instance details

Defined in Data.Default.Class

Methods

def :: Word8 #

Default Word16 
Instance details

Defined in Data.Default.Class

Methods

def :: Word16 #

Default Word32 
Instance details

Defined in Data.Default.Class

Methods

def :: Word32 #

Default Word64 
Instance details

Defined in Data.Default.Class

Methods

def :: Word64 #

Default () 
Instance details

Defined in Data.Default.Class

Methods

def :: () #

Default All 
Instance details

Defined in Data.Default.Class

Methods

def :: All #

Default Any 
Instance details

Defined in Data.Default.Class

Methods

def :: Any #

Default CShort 
Instance details

Defined in Data.Default.Class

Methods

def :: CShort #

Default CUShort 
Instance details

Defined in Data.Default.Class

Methods

def :: CUShort #

Default CInt 
Instance details

Defined in Data.Default.Class

Methods

def :: CInt #

Default CUInt 
Instance details

Defined in Data.Default.Class

Methods

def :: CUInt #

Default CLong 
Instance details

Defined in Data.Default.Class

Methods

def :: CLong #

Default CULong 
Instance details

Defined in Data.Default.Class

Methods

def :: CULong #

Default CLLong 
Instance details

Defined in Data.Default.Class

Methods

def :: CLLong #

Default CULLong 
Instance details

Defined in Data.Default.Class

Methods

def :: CULLong #

Default CFloat 
Instance details

Defined in Data.Default.Class

Methods

def :: CFloat #

Default CDouble 
Instance details

Defined in Data.Default.Class

Methods

def :: CDouble #

Default CPtrdiff 
Instance details

Defined in Data.Default.Class

Methods

def :: CPtrdiff #

Default CSize 
Instance details

Defined in Data.Default.Class

Methods

def :: CSize #

Default CSigAtomic 
Instance details

Defined in Data.Default.Class

Methods

def :: CSigAtomic #

Default CClock 
Instance details

Defined in Data.Default.Class

Methods

def :: CClock #

Default CTime 
Instance details

Defined in Data.Default.Class

Methods

def :: CTime #

Default CUSeconds 
Instance details

Defined in Data.Default.Class

Methods

def :: CUSeconds #

Default CSUSeconds 
Instance details

Defined in Data.Default.Class

Methods

def :: CSUSeconds #

Default CIntPtr 
Instance details

Defined in Data.Default.Class

Methods

def :: CIntPtr #

Default CUIntPtr 
Instance details

Defined in Data.Default.Class

Methods

def :: CUIntPtr #

Default CIntMax 
Instance details

Defined in Data.Default.Class

Methods

def :: CIntMax #

Default CUIntMax 
Instance details

Defined in Data.Default.Class

Methods

def :: CUIntMax #

Default SrcLoc Source # 
Instance details

Defined in Boots.Factory.Logger

Methods

def :: SrcLoc #

Default PropConfig 
Instance details

Defined in Salak

Methods

def :: PropConfig #

Default LogConfig Source # 
Instance details

Defined in Boots.Factory.Logger

Methods

def :: LogConfig #

Default [a] 
Instance details

Defined in Data.Default.Class

Methods

def :: [a] #

Default (Maybe a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Maybe a #

Integral a => Default (Ratio a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Ratio a #

Default a => Default (IO a) 
Instance details

Defined in Data.Default.Class

Methods

def :: IO a #

(Default a, RealFloat a) => Default (Complex a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Complex a #

Default (First a) 
Instance details

Defined in Data.Default.Class

Methods

def :: First a #

Default (Last a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Last a #

Default a => Default (Dual a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Dual a #

Default (Endo a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Endo a #

Num a => Default (Sum a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Sum a #

Num a => Default (Product a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Product a #

Default r => Default (e -> r) 
Instance details

Defined in Data.Default.Class

Methods

def :: e -> r #

(Default a, Default b) => Default (a, b) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b) #

(Default a, Default b, Default c) => Default (a, b, c) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c) #

(Default a, Default b, Default c, Default d) => Default (a, b, c, d) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c, d) #

(Default a, Default b, Default c, Default d, Default e) => Default (a, b, c, d, e) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c, d, e) #

(Default a, Default b, Default c, Default d, Default e, Default f) => Default (a, b, c, d, e, f) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c, d, e, f) #

(Default a, Default b, Default c, Default d, Default e, Default f, Default g) => Default (a, b, c, d, e, f, g) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c, d, e, f, g) #