Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Additional functions/relations pertaining to locations and type-level lists of locations.
Synopsis
- class ExplicitMember (x :: k) (xs :: [k]) where
- explicitMember :: Member x xs
- class ExplicitSubset xs ys where
- explicitSubset :: Subset xs ys
- allOf :: forall ps. Subset ps ps
- singleton :: forall p. Member p (p ': '[])
- listedFirst :: forall p1 ps. Member p1 (p1 ': ps)
- listedSecond :: forall p2 p1 ps. Member p2 (p1 ': (p2 ': ps))
- listedThird :: forall p3 p2 p1 ps. Member p3 (p1 ': (p2 ': (p3 ': ps)))
- listedForth :: forall p4 p3 p2 p1 ps. Member p4 (p1 ': (p2 ': (p3 ': (p4 ': ps))))
- listedFifth :: forall p5 p4 p3 p2 p1 ps. Member p5 (p1 ': (p2 ': (p3 ': (p4 ': (p5 ': ps)))))
- listedSixth :: forall p6 p5 p4 p3 p2 p1 ps. Member p6 (p1 ': (p2 ': (p3 ': (p4 ': (p5 ': (p6 ': ps))))))
- quorum1 :: forall ps p a. KnownSymbols ps => Member p ps -> (forall q qs. (KnownSymbol q, KnownSymbols qs, ps ~ (q ': qs)) => a) -> a
- mkLoc :: String -> Q [Dec]
Misc
class ExplicitMember (x :: k) (xs :: [k]) where Source #
Quickly build membership proofs, when the membership can be directly observed by GHC.
explicitMember :: Member x xs Source #
Instances
ExplicitMember (x :: a) (x ': xs :: [a]) Source # | |
Defined in Choreography.Locations.Batteries explicitMember :: Member x (x ': xs) Source # | |
ExplicitMember x xs => ExplicitMember (x :: a) (y ': xs :: [a]) Source # | |
Defined in Choreography.Locations.Batteries explicitMember :: Member x (y ': xs) Source # |
class ExplicitSubset xs ys where Source #
Quickly build subset proofs, when the subset relation can be directly observed by GHC.
explicitSubset :: Subset xs ys Source #
Instances
ExplicitSubset ('[] :: [k]) (ys :: [k]) Source # | |
Defined in Choreography.Locations.Batteries explicitSubset :: Subset '[] ys Source # | |
(ExplicitSubset xs ys, ExplicitMember x ys) => ExplicitSubset (x ': xs :: [k]) (ys :: [k]) Source # | |
Defined in Choreography.Locations.Batteries explicitSubset :: Subset (x ': xs) ys Source # |
allOf :: forall ps. Subset ps ps Source #
Alias refl
. When used as an identifier, this is more descriptive.
Easy indexing with Member
objects.
listedFirst :: forall p1 ps. Member p1 (p1 ': ps) Source #
listedSecond :: forall p2 p1 ps. Member p2 (p1 ': (p2 ': ps)) Source #
A Member
value for the second item in a list.
listedThird :: forall p3 p2 p1 ps. Member p3 (p1 ': (p2 ': (p3 ': ps))) Source #
A Member
value for the third item in a list.
listedForth :: forall p4 p3 p2 p1 ps. Member p4 (p1 ': (p2 ': (p3 ': (p4 ': ps)))) Source #
A Member
value for the forth item in a list.
listedFifth :: forall p5 p4 p3 p2 p1 ps. Member p5 (p1 ': (p2 ': (p3 ': (p4 ': (p5 ': ps))))) Source #
A Member
value for the fifth item in a list.
listedSixth :: forall p6 p5 p4 p3 p2 p1 ps. Member p6 (p1 ': (p2 ': (p3 ': (p4 ': (p5 ': (p6 ': ps)))))) Source #
A Member
value for the sixth item in a list.
Context manipulation
quorum1 :: forall ps p a. KnownSymbols ps => Member p ps -> (forall q qs. (KnownSymbol q, KnownSymbols qs, ps ~ (q ': qs)) => a) -> a Source #
Use any membership proof to to safely call code that only works on a non-empy list.