yi-core-0.19.4: Yi editor core library
Safe HaskellNone
LanguageHaskell2010

Yi.Config.Simple.Types

Description

exports from Yi.Config.Simple which are useful to "core yi" rather than just config files.

Synopsis

Documentation

newtype ConfigM a Source #

The configuration monad. Run it with configMain.

Constructors

ConfigM 

Fields

Instances

Instances details
Applicative ConfigM Source # 
Instance details

Defined in Yi.Config.Simple.Types

Methods

pure :: a -> ConfigM a

(<*>) :: ConfigM (a -> b) -> ConfigM a -> ConfigM b

liftA2 :: (a -> b -> c) -> ConfigM a -> ConfigM b -> ConfigM c

(*>) :: ConfigM a -> ConfigM b -> ConfigM b

(<*) :: ConfigM a -> ConfigM b -> ConfigM a

Functor ConfigM Source # 
Instance details

Defined in Yi.Config.Simple.Types

Methods

fmap :: (a -> b) -> ConfigM a -> ConfigM b

(<$) :: a -> ConfigM b -> ConfigM a

Monad ConfigM Source # 
Instance details

Defined in Yi.Config.Simple.Types

Methods

(>>=) :: ConfigM a -> (a -> ConfigM b) -> ConfigM b

(>>) :: ConfigM a -> ConfigM b -> ConfigM b

return :: a -> ConfigM a

MonadState Config ConfigM Source # 
Instance details

Defined in Yi.Config.Simple.Types

Methods

get :: ConfigM Config

put :: Config -> ConfigM ()

state :: (Config -> (a, Config)) -> ConfigM a

MonadBase IO ConfigM Source # 
Instance details

Defined in Yi.Config.Simple.Types

Methods

liftBase :: IO α -> ConfigM α Source #

type Field a = Lens' Config a Source #

Fields that can be modified with all lens machinery.

customVariable :: YiConfigVariable a => Field a Source #

Accessor for any YiConfigVariable, to be used by modules defining YiConfigVariables. Such modules should provide a custom-named field. For instance, take the following hypothetical YiConfigVariable:

@newtype UserName = UserName { unUserName :: String } deriving(Typeable, Binary, Default) instance YiConfigVariable UserName

$(nameDeriveAccessors ''UserName (n -> Just (n ++ "A")))

userName :: Field String userName = unUserNameA . customVariable@

Here, the hypothetical library would provide the field userName to be used in preference to customVariable.