environment-effectful-0.1: Environment effects
Safe HaskellNone
LanguageGHC2021

Effectful.Environment.Dynamic

Description

Synopsis

Effect

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

Dynamic effects for System.Environment.

Since: 0.1

Constructors

GetArgs :: forall (a :: Type -> Type). Environment a [String] 
GetProgName :: forall (a :: Type -> Type). Environment a [Char] 
ExecutablePath :: forall (a :: Type -> Type). Environment a QueryExePath 
GetExecutablePath :: forall (a :: Type -> Type). Environment a [Char] 
GetEnv :: forall (a :: Type -> Type). String -> Environment a [Char] 
LookupEnv :: forall (a :: Type -> Type). String -> Environment a (Maybe String) 
SetEnv :: forall (a :: Type -> Type). String -> String -> Environment a () 
UnsetEnv :: forall (a :: Type -> Type). String -> Environment a () 
WithArgs :: forall (a :: Type -> Type) b. [String] -> a b -> Environment a b 
WithProgName :: forall (a :: Type -> Type). String -> a () -> Environment a () 
GetEnvironment :: forall (a :: Type -> Type). Environment a [(String, String)] 

Instances

Instances details
ShowEffect Environment Source #

Since: 0.1

Instance details

Defined in Effectful.Environment.Dynamic

Methods

showEffectCons :: forall (m :: Type -> Type) a. Environment m a -> String Source #

type DispatchOf Environment Source #

Since: 0.1

Instance details

Defined in Effectful.Environment.Dynamic

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

Lifted getArgs.

Since: 0.1

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

Lifted getProgName.

Since: 0.1

executablePath :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => Eff es QueryExePath Source #

Lifted executablePath.

Since: 0.1

getExecutablePath :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => Eff es FilePath Source #

Lifted getExecutablePath.

Since: 0.1

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

Lifted getEnv.

Since: 0.1

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

Lifted lookupEnv.

Since: 0.1

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

Lifted setEnv.

Since: 0.1

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

Lifted unsetEnv.

Since: 0.1

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

Lifted withArgs.

Since: 0.1

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

Lifted withProgName.

Since: 0.1

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

Lifted getEnvironment.

Since: 0.1

Handlers

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

Runs Environment in IO.

Since: 0.1

Types

data QueryExePath Source #

Result of querying for the executable path.

Since: 0.1

Constructors

NoQuery

If the system does not provide a reliable way to determine the current executable.

Since: 0.1

QueryResult (Maybe FilePath)

The result of querying the executable name.

Since: 0.1

Instances

Instances details
NFData QueryExePath Source #

Since: 0.1

Instance details

Defined in Effectful.Environment.Utils

Methods

rnf :: QueryExePath -> () #

Generic QueryExePath Source # 
Instance details

Defined in Effectful.Environment.Utils

Associated Types

type Rep QueryExePath

Since: environment-effectful-0.1

Instance details

Defined in Effectful.Environment.Utils

type Rep QueryExePath = D1 ('MetaData "QueryExePath" "Effectful.Environment.Utils" "environment-effectful-0.1-inplace" 'False) (C1 ('MetaCons "NoQuery" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "QueryResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FilePath))))
Show QueryExePath Source #

Since: 0.1

Instance details

Defined in Effectful.Environment.Utils

Eq QueryExePath Source #

Since: 0.1

Instance details

Defined in Effectful.Environment.Utils

Ord QueryExePath Source #

Since: 0.1

Instance details

Defined in Effectful.Environment.Utils

type Rep QueryExePath Source #

Since: 0.1

Instance details

Defined in Effectful.Environment.Utils

type Rep QueryExePath = D1 ('MetaData "QueryExePath" "Effectful.Environment.Utils" "environment-effectful-0.1-inplace" 'False) (C1 ('MetaCons "NoQuery" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "QueryResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FilePath))))