| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- data Environment (a :: Type -> Type) b
- getArgs :: forall (es :: [Effect]). Environment :> es => Eff es [String]
- getProgName :: forall (es :: [Effect]). Environment :> es => Eff es String
- executablePath :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => Eff es QueryExePath
- getExecutablePath :: forall (es :: [Effect]). Environment :> es => Eff es FilePath
- getEnv :: forall (es :: [Effect]). Environment :> es => String -> Eff es String
- lookupEnv :: forall (es :: [Effect]). Environment :> es => String -> Eff es (Maybe String)
- setEnv :: forall (es :: [Effect]). Environment :> es => String -> String -> Eff es ()
- unsetEnv :: forall (es :: [Effect]). Environment :> es => String -> Eff es ()
- withArgs :: forall (es :: [Effect]) a. Environment :> es => [String] -> Eff es a -> Eff es a
- withProgName :: forall (es :: [Effect]) a. Environment :> es => String -> Eff es a -> Eff es a
- getEnvironment :: forall (es :: [Effect]). Environment :> es => 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 Source #
An effect for querying and modifying the system environment.
Instances
| type DispatchOf Environment Source # | |
Defined in Effectful.Environment | |
| data StaticRep Environment Source # | |
Defined in Effectful.Environment | |
Functions
getProgName :: forall (es :: [Effect]). Environment :> es => Eff es String Source #
Lifted getProgName.
executablePath :: forall (es :: [Effect]). (Environment :> es, HasCallStack) => Eff es QueryExePath Source #
getExecutablePath :: forall (es :: [Effect]). Environment :> es => Eff es FilePath Source #
Lifted getExecutablePath.
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 #
Lifted getEnvironment.
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 |