chatty-0.7.0.1: Some monad transformers and typeclasses for abstraction of global dependencies.

Safe HaskellSafe
LanguageHaskell2010

Text.Chatty.Expansion.Vars

Contents

Synopsis

Documentation

data EnvVar Source #

Some environment variable

Constructors

NotSet

Not set.

Literal String

An embeddable string.

Show a => Scalar a

Something we can show.

Array [EnvVar]

Array of that

Instances

newtype ExpanderT m a Source #

Environment storage and variable expander.

Constructors

Expander 

Fields

Instances

MonadTrans ExpanderT Source # 

Methods

lift :: Monad m => m a -> ExpanderT m a #

Monad m => Monad (ExpanderT m) Source # 

Methods

(>>=) :: ExpanderT m a -> (a -> ExpanderT m b) -> ExpanderT m b #

(>>) :: ExpanderT m a -> ExpanderT m b -> ExpanderT m b #

return :: a -> ExpanderT m a #

fail :: String -> ExpanderT m a #

Monad m => Functor (ExpanderT m) Source # 

Methods

fmap :: (a -> b) -> ExpanderT m a -> ExpanderT m b #

(<$) :: a -> ExpanderT m b -> ExpanderT m a #

Monad m => Applicative (ExpanderT m) Source # 

Methods

pure :: a -> ExpanderT m a #

(<*>) :: ExpanderT m (a -> b) -> ExpanderT m a -> ExpanderT m b #

(*>) :: ExpanderT m a -> ExpanderT m b -> ExpanderT m b #

(<*) :: ExpanderT m a -> ExpanderT m b -> ExpanderT m a #

MonadIO m => MonadIO (ExpanderT m) Source # 

Methods

liftIO :: IO a -> ExpanderT m a #

ChExpand m => ChExpand (ExpanderT m) Source # 
Monad m => ChExpanderEnv (ExpanderT m) Source # 

localEnvironment :: Functor m => ExpanderT m a -> m a Source #

Run this function inside a blank environment.

forkEnvironment :: (Functor m, Monad m, MonadIO m) => ExpanderT m a -> m a Source #

Run this function in a locally modifiable, but not exported environment

exportAll :: (Monad m, MonadIO m) => ExpanderT m () Source #

Export this local environment.

expandVars :: (Monad m, Functor m, ChExpanderEnv m) => String -> m String Source #

Expand $variables

isAnum :: Char -> Bool Source #

Is alphanumeric?

class Monad ee => ChExpanderEnv ee where Source #

Typeclass for all environment storages.

Minimal complete definition

mgetv, mputv

Methods

mgetv :: String -> ee EnvVar Source #

Get environment variable

mputv :: String -> EnvVar -> ee () Source #

Put environment variable

Orphan instances