Copyright | Copyright 2011-2017 Neil Mitchell |
---|---|
License | BSD3 |
Maintainer | opensource@awakesecurity.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
This module contains a type representing a Ninja-style environment along with any supporting or related types.
Since: 0.1.0
- data Env k v
- makeEnv :: Env k v
- fromEnv :: Iso' (Env k v) (Maps k v)
- headEnv :: Env k v -> HashMap k v
- tailEnv :: Env k v -> Maybe (Env k v)
- scopeEnv :: Env k v -> Env k v
- addEnv :: Key k => k -> v -> Env k v -> Env k v
- askEnv :: Key k => Env k v -> k -> Maybe v
- type EnvConstraint c k v = (Key k, c k, c v, c (Maps k v))
- type Key k = (Eq k, Hashable k)
- type Maps k v = NonEmpty (HashMap k v)
Documentation
A Ninja-style environment, basically a nonempty list of hash tables.
Since: 0.1.0
(Monad m, EnvConstraint (Serial m) k v) => Serial m (Env k v) Source # | Uses the underlying Since: 0.1.0 |
(Monad m, EnvConstraint (CoSerial m) k v) => CoSerial m (Env k v) Source # | Uses the underlying Since: 0.1.0 |
(Eq v, Eq k) => Eq (Env k v) Source # | |
(Show v, Show k) => Show (Env k v) Source # | |
Generic (Env k v) Source # | |
(Key k, Arbitrary k, Arbitrary v) => Arbitrary (Env k v) Source # | Reasonable Since: 0.1.0 |
(Hashable k, Hashable v) => Hashable (Env k v) Source # | Default Since: 0.1.0 |
(ToJSONKey k, ToJSON v) => ToJSON (Env k v) Source # | Converts to a (nonempty) array of JSON objects. Since: 0.1.0 |
(Key k, FromJSONKey k, FromJSON v) => FromJSON (Env k v) Source # | Inverse of the Since: 0.1.0 |
(NFData k, NFData v) => NFData (Env k v) Source # | Default Since: 0.1.0 |
type Rep (Env k v) Source # | |
headEnv :: Env k v -> HashMap k v Source #
Get the first HashMap
in the underlying nonempty list.
Since: 0.1.0
addEnv :: Key k => k -> v -> Env k v -> Env k v Source #
Add the given key and value to the given Env
.
Since: 0.1.0
askEnv :: Key k => Env k v -> k -> Maybe v Source #
Look up the given key in the given Env
.
Since: 0.1.0