predicate-typed-0.7.4.4: Predicates, Refinement types and Dsl
Safe HaskellNone
LanguageHaskell2010

Predicate.Data.Elr

Description

Elr related methods

Synopsis

destructors

data ENone' Source #

tries to extract a () from the ENone constructor

>>> pz @ENone' ENone
Val ()
>>> pz @ENone' (ERight 'a')
Fail "ENone' found ERight"

Instances

Instances details
Show ENone' Source # 
Instance details

Defined in Predicate.Data.Elr

P ENone' (Elr x y) Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP ENone' (Elr x y) Source #

Methods

eval :: MonadEval m => proxy ENone' -> POpts -> Elr x y -> m (TT (PP ENone' (Elr x y))) Source #

type PP ENone' (Elr x y) Source # 
Instance details

Defined in Predicate.Data.Elr

type PP ENone' (Elr x y) = ()

data ELeft' Source #

tries to extract a value from the ELeft constructor

>>> pz @(ELeft' >> Succ) (ELeft 20)
Val 21
>>> pz @(ELeft' >> Succ) (ERight 'a')
Fail "ELeft' found ERight"

Instances

Instances details
Show ELeft' Source # 
Instance details

Defined in Predicate.Data.Elr

Show a => P ELeft' (Elr a x) Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP ELeft' (Elr a x) Source #

Methods

eval :: MonadEval m => proxy ELeft' -> POpts -> Elr a x -> m (TT (PP ELeft' (Elr a x))) Source #

type PP ELeft' (Elr a x) Source # 
Instance details

Defined in Predicate.Data.Elr

type PP ELeft' (Elr a x) = a

data ERight' Source #

tries to extract a value from the ERight constructor

>>> pz @(ERight' >> Succ) (ERight 20)
Val 21
>>> pz @(ERight' >> Succ) (ELeft 'a')
Fail "ERight' found ELeft"

Instances

Instances details
Show ERight' Source # 
Instance details

Defined in Predicate.Data.Elr

Show a => P ERight' (Elr x a) Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP ERight' (Elr x a) Source #

Methods

eval :: MonadEval m => proxy ERight' -> POpts -> Elr x a -> m (TT (PP ERight' (Elr x a))) Source #

type PP ERight' (Elr x a) Source # 
Instance details

Defined in Predicate.Data.Elr

type PP ERight' (Elr x a) = a

data EBoth' Source #

tries to extract the values from the EBoth constructor

>>> pz @(EBoth' >> Second Succ) (EBoth 1 'a')
Val (1,'b')
>>> pz @(ERight' >> Succ) (ELeft 'a')
Fail "ERight' found ELeft"
>>> pz @(EBoth' >> Second Succ) (ERight 8)
Fail "EBoth' found ERight"

Instances

Instances details
Show EBoth' Source # 
Instance details

Defined in Predicate.Data.Elr

(Show a, Show b) => P EBoth' (Elr a b) Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP EBoth' (Elr a b) Source #

Methods

eval :: MonadEval m => proxy EBoth' -> POpts -> Elr a b -> m (TT (PP EBoth' (Elr a b))) Source #

type PP EBoth' (Elr a b) Source # 
Instance details

Defined in Predicate.Data.Elr

type PP EBoth' (Elr a b) = (a, b)

data ElrIn n p q r s t Source #

destructs an Elr value n ENone receives (PP s x) p ELeft a receives (PP s x,a) q ERight b receives (PP s x,b) r EBoth a b receives (PP s x,(a,b)) s points to the environment you want to pass in t points to the Elr value

>>> pz @(ElrIn Id '(Snd,L12) '(L11,Snd) Snd Fst Snd) ((999,'a'), EBoth 12 'x')
Val (12,'x')
>>> pz @(ElrIn Id '(Snd,L12) '(L11,Snd) Snd Fst Snd) ((999,'a'), ENone)
Val (999,'a')
>>> pz @(ElrIn Id '(Snd,L12) '(L11,Snd) Snd Fst Snd) ((999,'a'), ERight 'z')
Val (999,'z')
>>> pz @(ElrIn 999 Snd (Snd >> Len) (Snd >> Fst + Length Snd) () Id) (ELeft 13)
Val 13
>>> pz @(ElrIn 999 Snd (Snd >> Len) (Snd >> Fst + Length Snd) () Id) (ERight "abcdef")
Val 6
>>> pl @(ElrIn "none" "left" "right" "both" () Id) (ELeft (SG.Sum 12))
Present "left" (ElrIn(ELeft) "left" | Sum {getSum = 12})
Val "left"
>>> pl @(ElrIn '("",2) '(Snd,999) '("no value",Snd) Snd () Id) (EBoth "Ab" 13)
Present ("Ab",13) (ElrIn(EBoth) ("Ab",13) | ("Ab",13))
Val ("Ab",13)
>>> pl @(ElrIn '("",2) '(Snd,999) '("no value",Snd) Snd () Id) (ELeft "Ab")
Present ("Ab",999) (ElrIn(ELeft) ("Ab",999) | "Ab")
Val ("Ab",999)
>>> pl @(ElrIn '("",2) '(Snd,999) '("no value",Snd) Snd () Id) ENone
Present ("",2) (ElrIn(ENone) ("",2) | ())
Val ("",2)
>>> pl @(ElrIn (FailT _ "none found") '(Snd,"fromleft") '(888,Snd) Snd () Id)  ENone
Error none found (ElrIn(ENone) n failed)
Fail "none found"

Instances

Instances details
(Show a, Show b, Show (PP r (y, (a, b))), P n y, P p (y, a), P q (y, b), P r (y, (a, b)), PP n y ~ PP p (y, a), PP p (y, a) ~ PP q (y, b), PP q (y, b) ~ PP r (y, (a, b)), P s x, P t x, PP t x ~ Elr a b, PP s x ~ y) => P (ElrIn n p q r s t :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (ElrIn n p q r s t) x Source #

Methods

eval :: MonadEval m => proxy (ElrIn n p q r s t) -> POpts -> x -> m (TT (PP (ElrIn n p q r s t) x)) Source #

Show (ElrIn n p q r s t) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> ElrIn n p q r s t -> ShowS #

show :: ElrIn n p q r s t -> String #

showList :: [ElrIn n p q r s t] -> ShowS #

type PP (ElrIn n p q r s t :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (ElrIn n p q r s t :: Type) x = PP n (PP s x)

data ElrId n p q r Source #

simple version of ElrIn with Id as the Elr value and the environment set to ()

>>> pz @(ElrId '(999,"oops") '(Id,"fromleft") '(888,Id) Id) (EBoth 222 "ok")
Val (222,"ok")
>>> pz @(ElrId '(999,"oops") '(Id,"fromleft") '(888,Id) Id) (ERight "ok")
Val (888,"ok")
>>> pz @(ElrId '(999,"oops") '(Id,"fromleft") '(888,Id) Id) ENone
Val (999,"oops")
>>> pz @(ElrId '(999,"oops") '(Id,"fromleft") '(888,Id) Id) (ELeft 123)
Val (123,"fromleft")
>>> pl @(ElrId (FailT _ "none found") '(Id,"fromleft") '(888,Id) Id) ENone
Error none found (ElrIn(ENone) n failed)
Fail "none found"

Instances

Instances details
P (ElrIdT n p q r) x => P (ElrId n p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (ElrId n p q r) x Source #

Methods

eval :: MonadEval m => proxy (ElrId n p q r) -> POpts -> x -> m (TT (PP (ElrId n p q r) x)) Source #

Show (ElrId n p q r) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> ElrId n p q r -> ShowS #

show :: ElrId n p q r -> String #

showList :: [ElrId n p q r] -> ShowS #

type PP (ElrId n p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (ElrId n p q r :: Type) x

data ElrPair s t Source #

creates a pair where the values are filled in by s and t holds the Elr value

>>> pz @(ElrPair Fst Snd) ((999,"oops"),EBoth 2 "xx")
Val (2,"xx")
>>> pz @(ElrPair Fst Snd) ((999,"oops"),ENone)
Val (999,"oops")
>>> pz @(ElrPair Fst Snd) ((999,"oops"),ERight "ok")
Val (999,"ok")

Instances

Instances details
P (ElrPairT s t) x => P (ElrPair s t :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (ElrPair s t) x Source #

Methods

eval :: MonadEval m => proxy (ElrPair s t) -> POpts -> x -> m (TT (PP (ElrPair s t) x)) Source #

Show (ElrPair s t) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> ElrPair s t -> ShowS #

show :: ElrPair s t -> String #

showList :: [ElrPair s t] -> ShowS #

type PP (ElrPair s t :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (ElrPair s t :: Type) x

data ElrInSimple n p q r Source #

similar to ElrIn but without an environment s and uses Id for t

>>> pz @(ElrInSimple 999 Id Len (Fst + Length Snd)) (ELeft 13)
Val 13
>>> pz @(ElrInSimple 999 Id Len (Fst + Length Snd)) ENone
Val 999
>>> pz @(ElrInSimple 999 Id Len (Fst + Length Snd)) (ERight "this is a long string")
Val 21
>>> pz @(ElrInSimple 999 Id Len (Fst + Length Snd)) (EBoth 20 "somedata")
Val 28
>>> pz @(ElrInSimple (FailT _ "err") (MkLeft _ Id) (MkRight _ Id) (If (Fst > Length Snd) (MkLeft _ Fst) (MkRight _ Snd))) (ERight "this is a long string")
Val (Right "this is a long string")
>>> pz @(ElrInSimple (FailT _ "err") (MkLeft _ Id) (MkRight _ Id) (If (Fst > Length Snd) (MkLeft _ Fst) (MkRight _ Snd))) ENone
Fail "err"
>>> pz @(ElrInSimple (FailT _ "err") (MkLeft _ Id) (MkRight _ Id) (If (Fst > Length Snd) (MkLeft _ Fst) (MkRight _ Snd))) (EBoth 1 "this is a long string")
Val (Right "this is a long string")
>>> pz @(ElrInSimple (FailT _ "err") (MkLeft _ Id) (MkRight _ Id) (If (Fst > Length Snd) (MkLeft _ Fst) (MkRight _ Snd))) (EBoth 100 "this is a long string")
Val (Left 100)
>>> pl @(ElrInSimple "none" "left" "right" "both") (ELeft (SG.Sum 12))
Present "left" (ElrIn(ELeft) "left" | Sum {getSum = 12})
Val "left"
>>> pl @(ElrInSimple (FailT _ "err") (Id &&& 999) ("no value" &&& Id) Id) (EBoth "Ab" 13)
Present ("Ab",13) (ElrIn(EBoth) ("Ab",13) | ("Ab",13))
Val ("Ab",13)
>>> pl @(ElrInSimple (FailT _ "err") (Id &&& 999) ("no value" &&& Id) Id) (ELeft "Ab")
Present ("Ab",999) (ElrIn(ELeft) ("Ab",999) | "Ab")
Val ("Ab",999)
>>> pl @(ElrInSimple (FailT _ "err") (Id &&& 999) ("no value" &&& Id) Id) (ERight 13)
Present ("no value",13) (ElrIn(ERight) ("no value",13) | 13)
Val ("no value",13)

Instances

Instances details
P (ElrInSimpleT n p q r) x => P (ElrInSimple n p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (ElrInSimple n p q r) x Source #

Methods

eval :: MonadEval m => proxy (ElrInSimple n p q r) -> POpts -> x -> m (TT (PP (ElrInSimple n p q r) x)) Source #

Show (ElrInSimple n p q r) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> ElrInSimple n p q r -> ShowS #

show :: ElrInSimple n p q r -> String #

showList :: [ElrInSimple n p q r] -> ShowS #

type PP (ElrInSimple n p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (ElrInSimple n p q r :: Type) x

data PartitionElr Source #

similar to PartitionThese for Elr. returns a 4-tuple with the results so use Fst Snd Thd L4 to extract

>>> pz @PartitionElr [ELeft 'a', ENone, ERight 2, ELeft 'c', EBoth 'z' 1, ERight 4, EBoth 'a' 2, ERight 99, ENone]
Val ([(),()],"ac",[2,4,99],[('z',1),('a',2)])
>>> pz @PartitionElr [ELeft 4, ERight 'x', ERight 'y',EBoth 3 'b', ELeft 99, EBoth 5 'x']
Val ([],[4,99],"xy",[(3,'b'),(5,'x')])
>>> pz @PartitionElr [ENone,ELeft 1,ERight 'x',ELeft 4,ERight 'y',EBoth 9 'z',ELeft 10,EBoth 8 'y']
Val ([()],[1,4,10],"xy",[(9,'z'),(8,'y')])

Instances

Instances details
Show PartitionElr Source # 
Instance details

Defined in Predicate.Data.Elr

(Show a, Show b) => P PartitionElr [Elr a b] Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP PartitionElr [Elr a b] Source #

Methods

eval :: MonadEval m => proxy PartitionElr -> POpts -> [Elr a b] -> m (TT (PP PartitionElr [Elr a b])) Source #

type PP PartitionElr [Elr a b] Source # 
Instance details

Defined in Predicate.Data.Elr

type PP PartitionElr [Elr a b] = ([()], [a], [b], [(a, b)])

data ENoneDef p q r Source #

get ENone or run p: really only useful when p is set to Fail: where q is the environment and r is the Elr value

>>> pz @(ENoneDef (FailT _ "not ENone") () Id) ENone
Val ()
>>> pz @(ENoneDef (FailT _ "not ENone") () Id) (ELeft 1)
Fail "not ENone"
>>> pz @(ENoneDef (FailT _ Id) Fst Snd) ("not right",EBoth 1 2)
Fail "not right"

Instances

Instances details
P (ENoneDefT p q r) x => P (ENoneDef p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (ENoneDef p q r) x Source #

Methods

eval :: MonadEval m => proxy (ENoneDef p q r) -> POpts -> x -> m (TT (PP (ENoneDef p q r) x)) Source #

Show (ENoneDef p q r) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> ENoneDef p q r -> ShowS #

show :: ENoneDef p q r -> String #

showList :: [ENoneDef p q r] -> ShowS #

type PP (ENoneDef p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (ENoneDef p q r :: Type) x

data ELeftDef p q r Source #

get ELeft or use the default value p: q is the environment and r is the Elr value

>>> pz @(ELeftDef Id Fst Snd) (999,ENone)
Val 999
>>> pz @(ELeftDef 999 () Id) (ERight "sdf")
Val 999
>>> pz @(ELeftDef 999 () Id) (ELeft 1)
Val 1

Instances

Instances details
P (ELeftDefT p q r) x => P (ELeftDef p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (ELeftDef p q r) x Source #

Methods

eval :: MonadEval m => proxy (ELeftDef p q r) -> POpts -> x -> m (TT (PP (ELeftDef p q r) x)) Source #

Show (ELeftDef p q r) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> ELeftDef p q r -> ShowS #

show :: ELeftDef p q r -> String #

showList :: [ELeftDef p q r] -> ShowS #

type PP (ELeftDef p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (ELeftDef p q r :: Type) x

data ERightDef p q r Source #

get ERight or use the default value p: q is the environment and r is the Elr value

>>> pz @(ERightDef 999 () Id) ENone
Val 999
>>> pz @(ERightDef 999 () Id) (ELeft "sdf")
Val 999
>>> pz @(ERightDef 999 Fst Snd) (999,ERight 1)
Val 1

Instances

Instances details
P (ERightDefT p q r) x => P (ERightDef p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (ERightDef p q r) x Source #

Methods

eval :: MonadEval m => proxy (ERightDef p q r) -> POpts -> x -> m (TT (PP (ERightDef p q r) x)) Source #

Show (ERightDef p q r) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> ERightDef p q r -> ShowS #

show :: ERightDef p q r -> String #

showList :: [ERightDef p q r] -> ShowS #

type PP (ERightDef p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (ERightDef p q r :: Type) x

data EBothDef p q r Source #

get EBoth or use the default value p: q is the environment and r is the Elr value

>>> pz @(EBothDef '(999,"xx") () Id) ENone
Val (999,"xx")
>>> pz @(EBothDef '(999,"xx") () Id) (ERight "abc")
Val (999,"xx")
>>> pz @(EBothDef '(999,"xx") () Id) (ELeft 1)
Val (999,"xx")
>>> pz @(EBothDef '(999,"xx") () Id) (EBoth 1 "abc")
Val (1,"abc")
>>> pz @(EBothDef Id Fst Snd) ((999,"xx"),ENone)
Val (999,"xx")

Instances

Instances details
P (EBothDefT p q r) x => P (EBothDef p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (EBothDef p q r) x Source #

Methods

eval :: MonadEval m => proxy (EBothDef p q r) -> POpts -> x -> m (TT (PP (EBothDef p q r) x)) Source #

Show (EBothDef p q r) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> EBothDef p q r -> ShowS #

show :: EBothDef p q r -> String #

showList :: [EBothDef p q r] -> ShowS #

type PP (EBothDef p q r :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (EBothDef p q r :: Type) x

constructors

data MkENone (t :: Type) (t1 :: Type) Source #

ENone constructor

>>> pl @(MkENone () Id) 'x'
Present ENone (MkENone)
Val ENone

Instances

Instances details
P (MkENone t t1 :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (MkENone t t1) x Source #

Methods

eval :: MonadEval m => proxy (MkENone t t1) -> POpts -> x -> m (TT (PP (MkENone t t1) x)) Source #

Show (MkENone t t1) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> MkENone t t1 -> ShowS #

show :: MkENone t t1 -> String #

showList :: [MkENone t t1] -> ShowS #

type PP (MkENone t t1 :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (MkENone t t1 :: Type) x

data MkELeft (t :: Type) p Source #

ELeft constructor

>>> pl @(MkELeft () Id) 'x'
Present ELeft 'x' (MkELeft)
Val (ELeft 'x')
>>> pl @(MkELeft () Fst) ('x',True)
Present ELeft 'x' (MkELeft)
Val (ELeft 'x')
>>> pz @(MkELeft _ Id) 44
Val (ELeft 44)

Instances

Instances details
P (MkELeftT t p) x => P (MkELeft t p :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (MkELeft t p) x Source #

Methods

eval :: MonadEval m => proxy (MkELeft t p) -> POpts -> x -> m (TT (PP (MkELeft t p) x)) Source #

Show (MkELeft t p) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> MkELeft t p -> ShowS #

show :: MkELeft t p -> String #

showList :: [MkELeft t p] -> ShowS #

type PP (MkELeft t p :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (MkELeft t p :: Type) x

data MkERight (t :: Type) p Source #

ERight constructor

>>> pz @(MkERight _ Id) 44
Val (ERight 44)
>>> pz @(MkERight _ "Abc" <> MkELeft _ '[1,2] <> MkEBoth [3,4] "def") ()
Val (EBoth [1,2,3,4] "Abcdef")
>>> pl @(MkERight () Id) 'x'
Present ERight 'x' (MkERight)
Val (ERight 'x')

Instances

Instances details
P (MkERightT t p) x => P (MkERight t p :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (MkERight t p) x Source #

Methods

eval :: MonadEval m => proxy (MkERight t p) -> POpts -> x -> m (TT (PP (MkERight t p) x)) Source #

Show (MkERight t p) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> MkERight t p -> ShowS #

show :: MkERight t p -> String #

showList :: [MkERight t p] -> ShowS #

type PP (MkERight t p :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (MkERight t p :: Type) x

data MkEBoth p q Source #

EBoth constructor

>>> pz @(MkEBoth Fst Snd) (44,'x')
Val (EBoth 44 'x')
>>> pl @(MkEBoth Id 'True) 'x'
Present EBoth 'x' True (MkEBoth)
Val (EBoth 'x' True)
>>> pz @(MkENone _ _ <> MkELeft _ '[1] <> MkERight _ "abc" <> MkELeft _ '[2] <> MkEBoth '[3,4,5] "def") ()
Val (EBoth [1,2,3,4,5] "abcdef")

Instances

Instances details
(P p a, P q a) => P (MkEBoth p q :: Type) a Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (MkEBoth p q) a Source #

Methods

eval :: MonadEval m => proxy (MkEBoth p q) -> POpts -> a -> m (TT (PP (MkEBoth p q) a)) Source #

Show (MkEBoth p q) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> MkEBoth p q -> ShowS #

show :: MkEBoth p q -> String #

showList :: [MkEBoth p q] -> ShowS #

type PP (MkEBoth p q :: Type) a Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (MkEBoth p q :: Type) a = Elr (PP p a) (PP q a)

data MkENone' t t1 Source #

ENone constructor

>>> pz @(Proxy Int >> MkENone' UnproxyT 10) []
Val ENone

Instances

Instances details
P (MkENone' t t1 :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (MkENone' t t1) x Source #

Methods

eval :: MonadEval m => proxy (MkENone' t t1) -> POpts -> x -> m (TT (PP (MkENone' t t1) x)) Source #

Show (MkENone' t t1) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> MkENone' t t1 -> ShowS #

show :: MkENone' t t1 -> String #

showList :: [MkENone' t t1] -> ShowS #

type PP (MkENone' t t1 :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (MkENone' t t1 :: Type) x = Elr (PP t x) (PP t1 x)

data MkELeft' t p Source #

ELeft constructor

>>> pz @(Proxy Int >> MkELeft' UnproxyT 10) []
Val (ELeft 10)

Instances

Instances details
P p x => P (MkELeft' t p :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (MkELeft' t p) x Source #

Methods

eval :: MonadEval m => proxy (MkELeft' t p) -> POpts -> x -> m (TT (PP (MkELeft' t p) x)) Source #

Show (MkELeft' t p) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> MkELeft' t p -> ShowS #

show :: MkELeft' t p -> String #

showList :: [MkELeft' t p] -> ShowS #

type PP (MkELeft' t p :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (MkELeft' t p :: Type) x = Elr (PP p x) (PP t x)

data MkERight' t p Source #

similar to MkERight where t references the type

Instances

Instances details
P p x => P (MkERight' t p :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP (MkERight' t p) x Source #

Methods

eval :: MonadEval m => proxy (MkERight' t p) -> POpts -> x -> m (TT (PP (MkERight' t p) x)) Source #

Show (MkERight' t p) Source # 
Instance details

Defined in Predicate.Data.Elr

Methods

showsPrec :: Int -> MkERight' t p -> ShowS #

show :: MkERight' t p -> String #

showList :: [MkERight' t p] -> ShowS #

type PP (MkERight' t p :: Type) x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP (MkERight' t p :: Type) x = Elr (PP t x) (PP p x)

predicates

data IsENone Source #

predicate on ENone

>>> pz @IsENone ENone
Val True
>>> pz @IsENone (EBoth 1 'a')
Val False

Instances

Instances details
Show IsENone Source # 
Instance details

Defined in Predicate.Data.Elr

P IsENoneT x => P IsENone x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP IsENone x Source #

Methods

eval :: MonadEval m => proxy IsENone -> POpts -> x -> m (TT (PP IsENone x)) Source #

type PP IsENone x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP IsENone x

data IsELeft Source #

predicate on ELeft

>>> pz @IsELeft (ELeft "aBc")
Val True
>>> pz @IsELeft (EBoth 1 'a')
Val False
>>> pl @IsELeft (ELeft 12)
True (IsELeft | ELeft 12)
Val True

Instances

Instances details
Show IsELeft Source # 
Instance details

Defined in Predicate.Data.Elr

P IsELeftT x => P IsELeft x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP IsELeft x Source #

Methods

eval :: MonadEval m => proxy IsELeft -> POpts -> x -> m (TT (PP IsELeft x)) Source #

type PP IsELeft x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP IsELeft x

data IsERight Source #

predicate on ERight

>>> pl @IsERight (ELeft 12)
False (IsERight | ELeft 12)
Val False

Instances

Instances details
Show IsERight Source # 
Instance details

Defined in Predicate.Data.Elr

P IsERightT x => P IsERight x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP IsERight x Source #

Methods

eval :: MonadEval m => proxy IsERight -> POpts -> x -> m (TT (PP IsERight x)) Source #

type PP IsERight x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP IsERight x

data IsEBoth Source #

predicate on EBoth

>>> pl @IsEBoth (ELeft 12)
False (IsEBoth | ELeft 12)
Val False
>>> pz @IsEBoth (EBoth 1 'a')
Val True
>>> pl @IsEBoth (EBoth 'x' 12)
True (IsEBoth | EBoth 'x' 12)
Val True
>>> pl @IsEBoth (ERight (SG.Sum 12))
False (IsEBoth | ERight (Sum {getSum = 12}))
Val False
>>> pl @IsEBoth (EBoth 1 (SG.Sum 12))
True (IsEBoth | EBoth 1 (Sum {getSum = 12}))
Val True

Instances

Instances details
Show IsEBoth Source # 
Instance details

Defined in Predicate.Data.Elr

P IsEBothT x => P IsEBoth x Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP IsEBoth x Source #

Methods

eval :: MonadEval m => proxy IsEBoth -> POpts -> x -> m (TT (PP IsEBoth x)) Source #

type PP IsEBoth x Source # 
Instance details

Defined in Predicate.Data.Elr

type PP IsEBoth x

converters

data These2Elr Source #

converts These to Elr

>>> pz @These2Elr (These 12 'x')
Val (EBoth 12 'x')
>>> pz @These2Elr (This 123)
Val (ELeft 123)

Instances

Instances details
Show These2Elr Source # 
Instance details

Defined in Predicate.Data.Elr

P These2Elr (These a b) Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP These2Elr (These a b) Source #

Methods

eval :: MonadEval m => proxy These2Elr -> POpts -> These a b -> m (TT (PP These2Elr (These a b))) Source #

type PP These2Elr (These a b) Source # 
Instance details

Defined in Predicate.Data.Elr

type PP These2Elr (These a b) = Elr a b

data Elr2These Source #

converts Elr to These

>>> pz @Elr2These ENone
Val Nothing
>>> pz @Elr2These (ELeft 123)
Val (Just (This 123))

Instances

Instances details
Show Elr2These Source # 
Instance details

Defined in Predicate.Data.Elr

P Elr2These (Elr a b) Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP Elr2These (Elr a b) Source #

Methods

eval :: MonadEval m => proxy Elr2These -> POpts -> Elr a b -> m (TT (PP Elr2These (Elr a b))) Source #

type PP Elr2These (Elr a b) Source # 
Instance details

Defined in Predicate.Data.Elr

type PP Elr2These (Elr a b) = Maybe (These a b)

data Elr2Maybe Source #

converts Elr to a pair of Maybes

>>> pz @Elr2Maybe ENone
Val (Nothing,Nothing)
>>> pz @Elr2Maybe (ELeft 123)
Val (Just 123,Nothing)
>>> pz @Elr2Maybe (EBoth 'x' 123)
Val (Just 'x',Just 123)
>>> pz @Elr2Maybe (ERight 123)
Val (Nothing,Just 123)

Instances

Instances details
Show Elr2Maybe Source # 
Instance details

Defined in Predicate.Data.Elr

P Elr2Maybe (Elr a b) Source # 
Instance details

Defined in Predicate.Data.Elr

Associated Types

type PP Elr2Maybe (Elr a b) Source #

Methods

eval :: MonadEval m => proxy Elr2Maybe -> POpts -> Elr a b -> m (TT (PP Elr2Maybe (Elr a b))) Source #

type PP Elr2Maybe (Elr a b) Source # 
Instance details

Defined in Predicate.Data.Elr

type PP Elr2Maybe (Elr a b) = (Maybe a, Maybe b)