Copyright | (c) Evgeny Poberezkin |
---|---|
License | BSD3 |
Maintainer | evgeny@poberezkin.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module provides type families to combine/extract the individual states of parties as defined by command constructors intofrom the combined systemprotocol state defined as type-level list.
Synopsis
- type family P (partyCmd :: (party, s, s)) where ...
- type family Prj (parties :: [pk]) (state :: [k]) (party :: pk) :: k where ...
- type family Inj (parties :: [pk]) (state :: [k]) (p :: pk) (s' :: k) :: [k] where ...
- type NoParty p = (Text "Party " :<>: ShowType p) :<>: Text " is not found."
- type StateError = Text "Specified fewer protocol states than parties."
Documentation
type family P (partyCmd :: (party, s, s)) where ... Source #
Extracts party from command type parameter.
P '(p, _, _) = p |
type family Prj (parties :: [pk]) (state :: [k]) (party :: pk) :: k where ... Source #
Projects the state of one party from the list of states.
type family Inj (parties :: [pk]) (state :: [k]) (p :: pk) (s' :: k) :: [k] where ... Source #
Injects the state of some party into the party's position in the list of states.
type StateError = Text "Specified fewer protocol states than parties." Source #