environment-effectful-0.1: Environment effects
Safe HaskellNone
LanguageGHC2021

Effectful.Environment.Static

Description

Static effects for System.Environment. The primary interface exists at: https://hackage.haskell.org/package/effectful-2.2.2.0/docs/Effectful-Environment.html.

This module exists to provide a static version of the Effectful.Environment.Dynamic, and to provide an Eff version of executablePath for base >= 4.17.

Since: 0.1

Synopsis

Effect

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

An effect for querying and modifying the system environment.

Instances

Instances details
type DispatchOf Environment 
Instance details

Defined in Effectful.Environment

data StaticRep Environment 
Instance details

Defined in Effectful.Environment

Functions

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.

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

Lifted lookupEnv.

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.

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

Handlers

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

Run the Environment effect.

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))))