| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Effectful.Environment.Dynamic
Description
Dynamic effects for System.Environment. For static effects, see https://hackage.haskell.org/package/effectful-2.2.2.0/docs/Effectful-Environment.html.
Since: 0.1
Synopsis
- data Environment (a :: Type -> Type) b where
- 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)]
- getArgs :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => Eff es [String]
- getProgName :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => Eff es String
- executablePath :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => Eff es QueryExePath
- getExecutablePath :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => Eff es FilePath
- getEnv :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => String -> Eff es String
- lookupEnv :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => String -> Eff es (Maybe String)
- setEnv :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => String -> String -> Eff es ()
- unsetEnv :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => String -> Eff es ()
- withArgs :: forall (es :: [Effect]) a. (Environment :> es, HasCallStack) => [String] -> Eff es a -> Eff es a
- withProgName :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => String -> Eff es () -> Eff es ()
- getEnvironment :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => Eff es [(String, String)]
- runEnvironment :: forall (es :: [Effect]) a. (HasCallStack, IOE :> es) => Eff (Environment ': es) a -> Eff es a
- data QueryExePath
- = NoQuery
- | QueryResult (Maybe FilePath)
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
| ShowEffect Environment Source # | Since: 0.1 |
Defined in Effectful.Environment.Dynamic Methods showEffectCons :: forall (m :: Type -> Type) a. Environment m a -> String Source # | |
| type DispatchOf Environment Source # | Since: 0.1 |
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 |