| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Conformance.Story.Identity
Description
Run-scoped identities. Allocation belongs to actions and context setup; observing a result only looks up identities and cannot allocate them.
Synopsis
- data Identities identity
- empty :: Identities identity
- identify :: Ord identity => identity -> Identities identity -> (Integer, Identities identity)
- bind :: Ord identity => identity -> Integer -> Identities identity -> Either String (Identities identity)
- observe :: Ord identity => identity -> Identities identity -> Either String Integer
- bindings :: Identities identity -> [(identity, Integer)]
Documentation
data Identities identity Source #
Instances
| Show identity => Show (Identities identity) Source # | |
Defined in Conformance.Story.Identity Methods showsPrec :: Int -> Identities identity -> ShowS Source # show :: Identities identity -> String Source # showList :: [Identities identity] -> ShowS Source # | |
| Eq identity => Eq (Identities identity) Source # | |
Defined in Conformance.Story.Identity Methods (==) :: Identities identity -> Identities identity -> Bool Source # (/=) :: Identities identity -> Identities identity -> Bool Source # | |
empty :: Identities identity Source #
identify :: Ord identity => identity -> Identities identity -> (Integer, Identities identity) Source #
bind :: Ord identity => identity -> Integer -> Identities identity -> Either String (Identities identity) Source #
Bind a concrete identity to the abstract identity a scenario names.
Allocation during context and action construction, like identify, but the
scenario chooses the identifier instead of the order of encounter. Re-binding
the same pair is accepted; binding a second concrete identity to an identifier
already taken, or re-binding one already bound to a different identifier, is
refused — either would make an observation mean two things.
observe :: Ord identity => identity -> Identities identity -> Either String Integer Source #
bindings :: Identities identity -> [(identity, Integer)] Source #