effectful-2.6.0.0: An easy to use, performant extensible effects library.
Safe HaskellNone
LanguageHaskell2010

Effectful.Environment

Synopsis

Effect

data Environment (a :: Type -> Type) b Source #

An effect for querying and modifying the system environment.

Instances

Instances details
type DispatchOf Environment Source # 
Instance details

Defined in Effectful.Environment

data StaticRep Environment Source # 
Instance details

Defined in Effectful.Environment

Handlers

runEnvironment :: forall (es :: [Effect]) a. (HasCallStack, IOE :> es) => Eff (Environment ': es) a -> Eff es a Source #

Run the Environment effect.

Querying the environment

getArgs :: forall (es :: [Effect]). Environment :> es => Eff es [String] Source #

Lifted getArgs.

getProgName :: forall (es :: [Effect]). Environment :> es => Eff es String Source #

Lifted getProgName.

getEnv :: forall (es :: [Effect]). Environment :> es => String -> Eff es String Source #

Lifted getEnv.

getEnvironment :: forall (es :: [Effect]). Environment :> es => Eff es [(String, String)] Source #

lookupEnv :: forall (es :: [Effect]). Environment :> es => String -> Eff es (Maybe String) Source #

Lifted lookupEnv.

Modifying the environment

setEnv :: forall (es :: [Effect]). Environment :> es => String -> String -> Eff es () Source #

Lifted setEnv.

unsetEnv :: forall (es :: [Effect]). Environment :> es => String -> Eff es () Source #

Lifted unsetEnv.

withArgs :: forall (es :: [Effect]) a. Environment :> es => [String] -> Eff es a -> Eff es a Source #

Lifted withArgs.

withProgName :: forall (es :: [Effect]) a. Environment :> es => String -> Eff es a -> Eff es a Source #

Lifted withProgName.