{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE NoStarIsType #-}
{-# LANGUAGE EmptyDataDeriving #-}
module Predicate.Data.These (
IsThis
, IsThat
, IsThese
, MkThis
, MkThis'
, MkThat
, MkThat'
, MkThese
, This'
, That'
, These'
, ThisDef
, ThisFail
, ThatDef
, ThatFail
, TheseDef
, TheseFail
, Thiss
, Thats
, Theses
, Theres
, Heres
, TheseIn
, TheseId
, PartitionThese
, TheseX
, ZipThese
, Assoc
, Unassoc
) where
import Predicate.Core
import Predicate.Misc
import Predicate.Util
import Data.Proxy (Proxy(Proxy))
import Data.Kind (Type)
import Data.These (partitionThese, These(..))
import qualified Data.These.Combinators as TheseC
data PartitionThese deriving Int -> PartitionThese -> ShowS
[PartitionThese] -> ShowS
PartitionThese -> String
(Int -> PartitionThese -> ShowS)
-> (PartitionThese -> String)
-> ([PartitionThese] -> ShowS)
-> Show PartitionThese
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PartitionThese] -> ShowS
$cshowList :: [PartitionThese] -> ShowS
show :: PartitionThese -> String
$cshow :: PartitionThese -> String
showsPrec :: Int -> PartitionThese -> ShowS
$cshowsPrec :: Int -> PartitionThese -> ShowS
Show
instance ( Show a
, Show b
) => P PartitionThese [These a b] where
type PP PartitionThese [These a b] = ([a], [b], [(a, b)])
eval :: proxy PartitionThese
-> POpts -> [These a b] -> m (TT (PP PartitionThese [These a b]))
eval proxy PartitionThese
_ POpts
opts [These a b]
as =
let msg0 :: String
msg0 = String
"PartitionThese"
b :: ([a], [b], [(a, b)])
b = [These a b] -> ([a], [b], [(a, b)])
forall a b. [These a b] -> ([a], [b], [(a, b)])
partitionThese [These a b]
as
in TT ([a], [b], [(a, b)]) -> m (TT ([a], [b], [(a, b)]))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT ([a], [b], [(a, b)]) -> m (TT ([a], [b], [(a, b)])))
-> TT ([a], [b], [(a, b)]) -> m (TT ([a], [b], [(a, b)]))
forall a b. (a -> b) -> a -> b
$ POpts
-> Val ([a], [b], [(a, b)])
-> String
-> [Tree PE]
-> TT ([a], [b], [(a, b)])
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (([a], [b], [(a, b)]) -> Val ([a], [b], [(a, b)])
forall a. a -> Val a
Val ([a], [b], [(a, b)])
b) (POpts -> String -> ([a], [b], [(a, b)]) -> [These a b] -> String
forall a1 a2.
(Show a1, Show a2) =>
POpts -> String -> a1 -> a2 -> String
show3 POpts
opts String
msg0 ([a], [b], [(a, b)])
b [These a b]
as) []
data Thiss deriving Int -> Thiss -> ShowS
[Thiss] -> ShowS
Thiss -> String
(Int -> Thiss -> ShowS)
-> (Thiss -> String) -> ([Thiss] -> ShowS) -> Show Thiss
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Thiss] -> ShowS
$cshowList :: [Thiss] -> ShowS
show :: Thiss -> String
$cshow :: Thiss -> String
showsPrec :: Int -> Thiss -> ShowS
$cshowsPrec :: Int -> Thiss -> ShowS
Show
type ThissT = PartitionThese >> Fst
instance P ThissT x => P Thiss x where
type PP Thiss x = PP ThissT x
eval :: proxy Thiss -> POpts -> x -> m (TT (PP Thiss x))
eval proxy Thiss
_ = Proxy ThissT -> POpts -> x -> m (TT (PP ThissT x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy ThissT
forall k (t :: k). Proxy t
Proxy @ThissT)
data Thats deriving Int -> Thats -> ShowS
[Thats] -> ShowS
Thats -> String
(Int -> Thats -> ShowS)
-> (Thats -> String) -> ([Thats] -> ShowS) -> Show Thats
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Thats] -> ShowS
$cshowList :: [Thats] -> ShowS
show :: Thats -> String
$cshow :: Thats -> String
showsPrec :: Int -> Thats -> ShowS
$cshowsPrec :: Int -> Thats -> ShowS
Show
type ThatsT = PartitionThese >> Snd
instance P ThatsT x => P Thats x where
type PP Thats x = PP ThatsT x
eval :: proxy Thats -> POpts -> x -> m (TT (PP Thats x))
eval proxy Thats
_ = Proxy ThatsT -> POpts -> x -> m (TT (PP ThatsT x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy ThatsT
forall k (t :: k). Proxy t
Proxy @ThatsT)
data Theses deriving Int -> Theses -> ShowS
[Theses] -> ShowS
Theses -> String
(Int -> Theses -> ShowS)
-> (Theses -> String) -> ([Theses] -> ShowS) -> Show Theses
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Theses] -> ShowS
$cshowList :: [Theses] -> ShowS
show :: Theses -> String
$cshow :: Theses -> String
showsPrec :: Int -> Theses -> ShowS
$cshowsPrec :: Int -> Theses -> ShowS
Show
type ThesesT = PartitionThese >> Thd
instance P ThesesT x => P Theses x where
type PP Theses x = PP ThesesT x
eval :: proxy Theses -> POpts -> x -> m (TT (PP Theses x))
eval proxy Theses
_ = Proxy ThesesT -> POpts -> x -> m (TT (PP ThesesT x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy ThesesT
forall k (t :: k). Proxy t
Proxy @ThesesT)
data Heres deriving Int -> Heres -> ShowS
[Heres] -> ShowS
Heres -> String
(Int -> Heres -> ShowS)
-> (Heres -> String) -> ([Heres] -> ShowS) -> Show Heres
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Heres] -> ShowS
$cshowList :: [Heres] -> ShowS
show :: Heres -> String
$cshow :: Heres -> String
showsPrec :: Int -> Heres -> ShowS
$cshowsPrec :: Int -> Heres -> ShowS
Show
instance ( Show a
, Show b
) => P Heres [These a b] where
type PP Heres [These a b] = [a]
eval :: proxy Heres
-> POpts -> [These a b] -> m (TT (PP Heres [These a b]))
eval proxy Heres
_ POpts
opts [These a b]
as =
let msg0 :: String
msg0 = String
"Heres"
b :: [a]
b = [These a b] -> [a]
forall a b. [These a b] -> [a]
TheseC.catHere [These a b]
as
in TT [a] -> m (TT [a])
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT [a] -> m (TT [a])) -> TT [a] -> m (TT [a])
forall a b. (a -> b) -> a -> b
$ POpts -> Val [a] -> String -> [Tree PE] -> TT [a]
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts ([a] -> Val [a]
forall a. a -> Val a
Val [a]
b) (POpts -> String -> [a] -> [These a b] -> String
forall a1 a2.
(Show a1, Show a2) =>
POpts -> String -> a1 -> a2 -> String
show3 POpts
opts String
msg0 [a]
b [These a b]
as) []
data Theres deriving Int -> Theres -> ShowS
[Theres] -> ShowS
Theres -> String
(Int -> Theres -> ShowS)
-> (Theres -> String) -> ([Theres] -> ShowS) -> Show Theres
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Theres] -> ShowS
$cshowList :: [Theres] -> ShowS
show :: Theres -> String
$cshow :: Theres -> String
showsPrec :: Int -> Theres -> ShowS
$cshowsPrec :: Int -> Theres -> ShowS
Show
instance ( Show a
, Show b
) => P Theres [These a b] where
type PP Theres [These a b] = [b]
eval :: proxy Theres
-> POpts -> [These a b] -> m (TT (PP Theres [These a b]))
eval proxy Theres
_ POpts
opts [These a b]
as =
let msg0 :: String
msg0 = String
"Theres"
b :: [b]
b = [These a b] -> [b]
forall a b. [These a b] -> [b]
TheseC.catThere [These a b]
as
in TT [b] -> m (TT [b])
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT [b] -> m (TT [b])) -> TT [b] -> m (TT [b])
forall a b. (a -> b) -> a -> b
$ POpts -> Val [b] -> String -> [Tree PE] -> TT [b]
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts ([b] -> Val [b]
forall a. a -> Val a
Val [b]
b) (POpts -> String -> [b] -> [These a b] -> String
forall a1 a2.
(Show a1, Show a2) =>
POpts -> String -> a1 -> a2 -> String
show3 POpts
opts String
msg0 [b]
b [These a b]
as) []
data TheseX p q r s deriving Int -> TheseX p q r s -> ShowS
[TheseX p q r s] -> ShowS
TheseX p q r s -> String
(Int -> TheseX p q r s -> ShowS)
-> (TheseX p q r s -> String)
-> ([TheseX p q r s] -> ShowS)
-> Show (TheseX p q r s)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k) k (r :: k) k (s :: k).
Int -> TheseX p q r s -> ShowS
forall k (p :: k) k (q :: k) k (r :: k) k (s :: k).
[TheseX p q r s] -> ShowS
forall k (p :: k) k (q :: k) k (r :: k) k (s :: k).
TheseX p q r s -> String
showList :: [TheseX p q r s] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k) k (r :: k) k (s :: k).
[TheseX p q r s] -> ShowS
show :: TheseX p q r s -> String
$cshow :: forall k (p :: k) k (q :: k) k (r :: k) k (s :: k).
TheseX p q r s -> String
showsPrec :: Int -> TheseX p q r s -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k) k (r :: k) k (s :: k).
Int -> TheseX p q r s -> ShowS
Show
instance ( P s x
, P p (x,a)
, P q (x,b)
, P r (x,(a,b))
, PP s x ~ These a b
, PP p (x,a) ~ c
, PP q (x,b) ~ c
, PP r (x,(a,b)) ~ c
) => P (TheseX p q r s) x where
type PP (TheseX p q r s) x = TheseXT (PP s x) x p
eval :: proxy (TheseX p q r s)
-> POpts -> x -> m (TT (PP (TheseX p q r s) x))
eval proxy (TheseX p q r s)
_ POpts
opts x
x = do
let msg0 :: String
msg0 = String
"TheseX"
TT (These a b)
ss <- Proxy s -> POpts -> x -> m (TT (PP s x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy s
forall k (t :: k). Proxy t
Proxy @s) POpts
opts x
x
case Inline
-> POpts
-> String
-> TT (These a b)
-> [Tree PE]
-> Either (TT c) (These a b)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (These a b)
ss [] of
Left TT c
e -> TT c -> m (TT c)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure TT c
e
Right (This a
a) -> do
let msg1 :: String
msg1 = String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"(This)"
TT c
pp <- Proxy p -> POpts -> (x, a) -> m (TT (PP p (x, a)))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts (x
x,a
a)
TT c -> m (TT c)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT c -> m (TT c)) -> TT c -> m (TT c)
forall a b. (a -> b) -> a -> b
$ case Inline -> POpts -> String -> TT c -> [Tree PE] -> Either (TT c) c
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg1 TT c
pp [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
ss] of
Left TT c
e -> TT c
e
Right c
_ -> POpts -> TT c -> String -> [Tree PE] -> TT c
forall a. POpts -> TT a -> String -> [Tree PE] -> TT a
mkNodeCopy POpts
opts TT c
pp String
msg1 [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
ss, TT c -> Tree PE
forall a. TT a -> Tree PE
hh TT c
pp]
Right (That b
b) -> do
let msg1 :: String
msg1 = String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"(That)"
TT c
qq <- Proxy q -> POpts -> (x, b) -> m (TT (PP q (x, b)))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts (x
x,b
b)
TT c -> m (TT c)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT c -> m (TT c)) -> TT c -> m (TT c)
forall a b. (a -> b) -> a -> b
$ case Inline -> POpts -> String -> TT c -> [Tree PE] -> Either (TT c) c
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg1 TT c
qq [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
ss] of
Left TT c
e -> TT c
e
Right c
_ -> POpts -> TT c -> String -> [Tree PE] -> TT c
forall a. POpts -> TT a -> String -> [Tree PE] -> TT a
mkNodeCopy POpts
opts TT c
qq String
msg1 [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
ss, TT c -> Tree PE
forall a. TT a -> Tree PE
hh TT c
qq]
Right (These a
a b
b) -> do
let msg1 :: String
msg1 = String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"(These)"
TT c
rr <- Proxy r -> POpts -> (x, (a, b)) -> m (TT (PP r (x, (a, b))))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy r
forall k (t :: k). Proxy t
Proxy @r) POpts
opts (x
x,(a
a,b
b))
TT c -> m (TT c)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT c -> m (TT c)) -> TT c -> m (TT c)
forall a b. (a -> b) -> a -> b
$ case Inline -> POpts -> String -> TT c -> [Tree PE] -> Either (TT c) c
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg1 TT c
rr [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
ss] of
Left TT c
e -> TT c
e
Right c
_ -> POpts -> TT c -> String -> [Tree PE] -> TT c
forall a. POpts -> TT a -> String -> [Tree PE] -> TT a
mkNodeCopy POpts
opts TT c
rr String
msg1 [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
ss, TT c -> Tree PE
forall a. TT a -> Tree PE
hh TT c
rr]
type family TheseXT lr x p where
TheseXT (These a _b) x p = PP p (x,a)
data MkThis' t p deriving Int -> MkThis' t p -> ShowS
[MkThis' t p] -> ShowS
MkThis' t p -> String
(Int -> MkThis' t p -> ShowS)
-> (MkThis' t p -> String)
-> ([MkThis' t p] -> ShowS)
-> Show (MkThis' t p)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (t :: k) k (p :: k). Int -> MkThis' t p -> ShowS
forall k (t :: k) k (p :: k). [MkThis' t p] -> ShowS
forall k (t :: k) k (p :: k). MkThis' t p -> String
showList :: [MkThis' t p] -> ShowS
$cshowList :: forall k (t :: k) k (p :: k). [MkThis' t p] -> ShowS
show :: MkThis' t p -> String
$cshow :: forall k (t :: k) k (p :: k). MkThis' t p -> String
showsPrec :: Int -> MkThis' t p -> ShowS
$cshowsPrec :: forall k (t :: k) k (p :: k). Int -> MkThis' t p -> ShowS
Show
instance ( P p x
, Show (PP p x)
) => P (MkThis' t p) x where
type PP (MkThis' t p) x = These (PP p x) (PP t x)
eval :: proxy (MkThis' t p) -> POpts -> x -> m (TT (PP (MkThis' t p) x))
eval proxy (MkThis' t p)
_ POpts
opts x
x = do
let msg0 :: String
msg0 = String
"MkThis"
TT (PP p x)
pp <- Proxy p -> POpts -> x -> m (TT (PP p x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts x
x
TT (These (PP p x) (PP t x)) -> m (TT (These (PP p x) (PP t x)))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (These (PP p x) (PP t x)) -> m (TT (These (PP p x) (PP t x))))
-> TT (These (PP p x) (PP t x)) -> m (TT (These (PP p x) (PP t x)))
forall a b. (a -> b) -> a -> b
$ case Inline
-> POpts
-> String
-> TT (PP p x)
-> [Tree PE]
-> Either (TT (These (PP p x) (PP t x))) (PP p x)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (PP p x)
pp [] of
Left TT (These (PP p x) (PP t x))
e -> TT (These (PP p x) (PP t x))
e
Right PP p x
p ->
let d :: These (PP p x) (PP t x)
d = PP p x -> These (PP p x) (PP t x)
forall a b. a -> These a b
This PP p x
p
in POpts
-> Val (These (PP p x) (PP t x))
-> String
-> [Tree PE]
-> TT (These (PP p x) (PP t x))
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (These (PP p x) (PP t x) -> Val (These (PP p x) (PP t x))
forall a. a -> Val a
Val These (PP p x) (PP t x)
d) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" This " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> POpts -> PP p x -> String
forall a. Show a => POpts -> a -> String
showL POpts
opts PP p x
p) [TT (PP p x) -> Tree PE
forall a. TT a -> Tree PE
hh TT (PP p x)
pp]
data MkThis (t :: Type) p deriving Int -> MkThis t p -> ShowS
[MkThis t p] -> ShowS
MkThis t p -> String
(Int -> MkThis t p -> ShowS)
-> (MkThis t p -> String)
-> ([MkThis t p] -> ShowS)
-> Show (MkThis t p)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall t k (p :: k). Int -> MkThis t p -> ShowS
forall t k (p :: k). [MkThis t p] -> ShowS
forall t k (p :: k). MkThis t p -> String
showList :: [MkThis t p] -> ShowS
$cshowList :: forall t k (p :: k). [MkThis t p] -> ShowS
show :: MkThis t p -> String
$cshow :: forall t k (p :: k). MkThis t p -> String
showsPrec :: Int -> MkThis t p -> ShowS
$cshowsPrec :: forall t k (p :: k). Int -> MkThis t p -> ShowS
Show
type MkThisT (t :: Type) p = MkThis' (Hole t) p
instance P (MkThisT t p) x => P (MkThis t p) x where
type PP (MkThis t p) x = PP (MkThisT t p) x
eval :: proxy (MkThis t p) -> POpts -> x -> m (TT (PP (MkThis t p) x))
eval proxy (MkThis t p)
_ = Proxy (MkThisT t p) -> POpts -> x -> m (TT (PP (MkThisT t p) x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy (MkThisT t p)
forall k (t :: k). Proxy t
Proxy @(MkThisT t p))
data MkThat' t p deriving Int -> MkThat' t p -> ShowS
[MkThat' t p] -> ShowS
MkThat' t p -> String
(Int -> MkThat' t p -> ShowS)
-> (MkThat' t p -> String)
-> ([MkThat' t p] -> ShowS)
-> Show (MkThat' t p)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (t :: k) k (p :: k). Int -> MkThat' t p -> ShowS
forall k (t :: k) k (p :: k). [MkThat' t p] -> ShowS
forall k (t :: k) k (p :: k). MkThat' t p -> String
showList :: [MkThat' t p] -> ShowS
$cshowList :: forall k (t :: k) k (p :: k). [MkThat' t p] -> ShowS
show :: MkThat' t p -> String
$cshow :: forall k (t :: k) k (p :: k). MkThat' t p -> String
showsPrec :: Int -> MkThat' t p -> ShowS
$cshowsPrec :: forall k (t :: k) k (p :: k). Int -> MkThat' t p -> ShowS
Show
instance ( Show (PP p x)
, P p x
) => P (MkThat' t p) x where
type PP (MkThat' t p) x = These (PP t x) (PP p x)
eval :: proxy (MkThat' t p) -> POpts -> x -> m (TT (PP (MkThat' t p) x))
eval proxy (MkThat' t p)
_ POpts
opts x
x = do
let msg0 :: String
msg0 = String
"MkThat"
TT (PP p x)
pp <- Proxy p -> POpts -> x -> m (TT (PP p x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts x
x
TT (These (PP t x) (PP p x)) -> m (TT (These (PP t x) (PP p x)))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (These (PP t x) (PP p x)) -> m (TT (These (PP t x) (PP p x))))
-> TT (These (PP t x) (PP p x)) -> m (TT (These (PP t x) (PP p x)))
forall a b. (a -> b) -> a -> b
$ case Inline
-> POpts
-> String
-> TT (PP p x)
-> [Tree PE]
-> Either (TT (These (PP t x) (PP p x))) (PP p x)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (PP p x)
pp [] of
Left TT (These (PP t x) (PP p x))
e -> TT (These (PP t x) (PP p x))
e
Right PP p x
p ->
let d :: These (PP t x) (PP p x)
d = PP p x -> These (PP t x) (PP p x)
forall a b. b -> These a b
That PP p x
p
in POpts
-> Val (These (PP t x) (PP p x))
-> String
-> [Tree PE]
-> TT (These (PP t x) (PP p x))
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (These (PP t x) (PP p x) -> Val (These (PP t x) (PP p x))
forall a. a -> Val a
Val These (PP t x) (PP p x)
d) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" That " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> POpts -> PP p x -> String
forall a. Show a => POpts -> a -> String
showL POpts
opts PP p x
p) [TT (PP p x) -> Tree PE
forall a. TT a -> Tree PE
hh TT (PP p x)
pp]
data MkThat (t :: Type) p deriving Int -> MkThat t p -> ShowS
[MkThat t p] -> ShowS
MkThat t p -> String
(Int -> MkThat t p -> ShowS)
-> (MkThat t p -> String)
-> ([MkThat t p] -> ShowS)
-> Show (MkThat t p)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall t k (p :: k). Int -> MkThat t p -> ShowS
forall t k (p :: k). [MkThat t p] -> ShowS
forall t k (p :: k). MkThat t p -> String
showList :: [MkThat t p] -> ShowS
$cshowList :: forall t k (p :: k). [MkThat t p] -> ShowS
show :: MkThat t p -> String
$cshow :: forall t k (p :: k). MkThat t p -> String
showsPrec :: Int -> MkThat t p -> ShowS
$cshowsPrec :: forall t k (p :: k). Int -> MkThat t p -> ShowS
Show
type MkThatT (t :: Type) p = MkThat' (Hole t) p
instance P (MkThatT t p) x => P (MkThat t p) x where
type PP (MkThat t p) x = PP (MkThatT t p) x
eval :: proxy (MkThat t p) -> POpts -> x -> m (TT (PP (MkThat t p) x))
eval proxy (MkThat t p)
_ = Proxy (MkThatT t p) -> POpts -> x -> m (TT (PP (MkThatT t p) x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy (MkThatT t p)
forall k (t :: k). Proxy t
Proxy @(MkThatT t p))
data MkThese p q deriving Int -> MkThese p q -> ShowS
[MkThese p q] -> ShowS
MkThese p q -> String
(Int -> MkThese p q -> ShowS)
-> (MkThese p q -> String)
-> ([MkThese p q] -> ShowS)
-> Show (MkThese p q)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k). Int -> MkThese p q -> ShowS
forall k (p :: k) k (q :: k). [MkThese p q] -> ShowS
forall k (p :: k) k (q :: k). MkThese p q -> String
showList :: [MkThese p q] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k). [MkThese p q] -> ShowS
show :: MkThese p q -> String
$cshow :: forall k (p :: k) k (q :: k). MkThese p q -> String
showsPrec :: Int -> MkThese p q -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k). Int -> MkThese p q -> ShowS
Show
instance ( P p a
, P q a
, Show (PP p a)
, Show (PP q a)
) => P (MkThese p q) a where
type PP (MkThese p q) a = These (PP p a) (PP q a)
eval :: proxy (MkThese p q) -> POpts -> a -> m (TT (PP (MkThese p q) a))
eval proxy (MkThese p q)
_ POpts
opts a
a = do
let msg0 :: String
msg0 = String
"MkThese"
Either
(TT (These (PP p a) (PP q a)))
(PP p a, PP q a, TT (PP p a), TT (PP q a))
lr <- Inline
-> String
-> Proxy p
-> Proxy q
-> POpts
-> a
-> [Tree PE]
-> m (Either
(TT (These (PP p a) (PP q a)))
(PP p a, PP q a, TT (PP p a), TT (PP q a)))
forall k1 k2 (p :: k1) a (q :: k2) (m :: Type -> Type)
(proxy1 :: k1 -> Type) (proxy2 :: k2 -> Type) x.
(P p a, P q a, MonadEval m) =>
Inline
-> String
-> proxy1 p
-> proxy2 q
-> POpts
-> a
-> [Tree PE]
-> m (Either (TT x) (PP p a, PP q a, TT (PP p a), TT (PP q a)))
runPQ Inline
NoInline String
msg0 (Proxy p
forall k (t :: k). Proxy t
Proxy @p) (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts a
a []
TT (These (PP p a) (PP q a)) -> m (TT (These (PP p a) (PP q a)))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (These (PP p a) (PP q a)) -> m (TT (These (PP p a) (PP q a))))
-> TT (These (PP p a) (PP q a)) -> m (TT (These (PP p a) (PP q a)))
forall a b. (a -> b) -> a -> b
$ case Either
(TT (These (PP p a) (PP q a)))
(PP p a, PP q a, TT (PP p a), TT (PP q a))
lr of
Left TT (These (PP p a) (PP q a))
e -> TT (These (PP p a) (PP q a))
e
Right (PP p a
p,PP q a
q,TT (PP p a)
pp,TT (PP q a)
qq) ->
let d :: These (PP p a) (PP q a)
d = PP p a -> PP q a -> These (PP p a) (PP q a)
forall a b. a -> b -> These a b
These PP p a
p PP q a
q
in POpts
-> Val (These (PP p a) (PP q a))
-> String
-> [Tree PE]
-> TT (These (PP p a) (PP q a))
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (These (PP p a) (PP q a) -> Val (These (PP p a) (PP q a))
forall a. a -> Val a
Val These (PP p a) (PP q a)
d) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> POpts -> These (PP p a) (PP q a) -> String
forall a. Show a => POpts -> a -> String
showL POpts
opts These (PP p a) (PP q a)
d) [TT (PP p a) -> Tree PE
forall a. TT a -> Tree PE
hh TT (PP p a)
pp, TT (PP q a) -> Tree PE
forall a. TT a -> Tree PE
hh TT (PP q a)
qq]
data IsTh (th :: These x y) deriving Int -> IsTh th -> ShowS
[IsTh th] -> ShowS
IsTh th -> String
(Int -> IsTh th -> ShowS)
-> (IsTh th -> String) -> ([IsTh th] -> ShowS) -> Show (IsTh th)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall x y (th :: These x y). Int -> IsTh th -> ShowS
forall x y (th :: These x y). [IsTh th] -> ShowS
forall x y (th :: These x y). IsTh th -> String
showList :: [IsTh th] -> ShowS
$cshowList :: forall x y (th :: These x y). [IsTh th] -> ShowS
show :: IsTh th -> String
$cshow :: forall x y (th :: These x y). IsTh th -> String
showsPrec :: Int -> IsTh th -> ShowS
$cshowsPrec :: forall x y (th :: These x y). Int -> IsTh th -> ShowS
Show
instance ( x ~ These a b
, Show a
, Show b
, GetThese th
) => P (IsTh (th :: These x1 x2)) x where
type PP (IsTh th) x = Bool
eval :: proxy (IsTh th) -> POpts -> x -> m (TT (PP (IsTh th) x))
eval proxy (IsTh th)
_ POpts
opts x
x =
let msg0 :: String
msg0 = String
"Is"
(String
t,These a b -> Bool
f) = forall w v. GetThese th => (String, These w v -> Bool)
forall k (th :: k) w v. GetThese th => (String, These w v -> Bool)
getThese @th
b :: Bool
b = These a b -> Bool
f x
These a b
x
in TT Bool -> m (TT Bool)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT Bool -> m (TT Bool)) -> TT Bool -> m (TT Bool)
forall a b. (a -> b) -> a -> b
$ POpts -> Bool -> String -> [Tree PE] -> TT Bool
mkNodeB POpts
opts Bool
b (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
t String -> ShowS
forall a. Semigroup a => a -> a -> a
<> POpts -> String -> x -> String
forall a. Show a => POpts -> String -> a -> String
showVerbose POpts
opts String
" | " x
x) []
data IsThis deriving Int -> IsThis -> ShowS
[IsThis] -> ShowS
IsThis -> String
(Int -> IsThis -> ShowS)
-> (IsThis -> String) -> ([IsThis] -> ShowS) -> Show IsThis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IsThis] -> ShowS
$cshowList :: [IsThis] -> ShowS
show :: IsThis -> String
$cshow :: IsThis -> String
showsPrec :: Int -> IsThis -> ShowS
$cshowsPrec :: Int -> IsThis -> ShowS
Show
type IsThisT = IsTh ('This '())
instance P IsThisT x => P IsThis x where
type PP IsThis x = PP IsThisT x
eval :: proxy IsThis -> POpts -> x -> m (TT (PP IsThis x))
eval proxy IsThis
_ = Proxy IsThisT -> POpts -> x -> m (TT (PP IsThisT x))
forall k (m :: Type -> Type) (p :: k) a (proxy :: k -> Type).
(MonadEval m, P p a, PP p a ~ Bool) =>
proxy p -> POpts -> a -> m (TT (PP p a))
evalBool (Proxy IsThisT
forall k (t :: k). Proxy t
Proxy @IsThisT)
data IsThat deriving Int -> IsThat -> ShowS
[IsThat] -> ShowS
IsThat -> String
(Int -> IsThat -> ShowS)
-> (IsThat -> String) -> ([IsThat] -> ShowS) -> Show IsThat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IsThat] -> ShowS
$cshowList :: [IsThat] -> ShowS
show :: IsThat -> String
$cshow :: IsThat -> String
showsPrec :: Int -> IsThat -> ShowS
$cshowsPrec :: Int -> IsThat -> ShowS
Show
type IsThatT = IsTh ('That '())
instance P IsThatT x => P IsThat x where
type PP IsThat x = PP IsThatT x
eval :: proxy IsThat -> POpts -> x -> m (TT (PP IsThat x))
eval proxy IsThat
_ = Proxy IsThatT -> POpts -> x -> m (TT (PP IsThatT x))
forall k (m :: Type -> Type) (p :: k) a (proxy :: k -> Type).
(MonadEval m, P p a, PP p a ~ Bool) =>
proxy p -> POpts -> a -> m (TT (PP p a))
evalBool (Proxy IsThatT
forall k (t :: k). Proxy t
Proxy @IsThatT)
data IsThese deriving Int -> IsThese -> ShowS
[IsThese] -> ShowS
IsThese -> String
(Int -> IsThese -> ShowS)
-> (IsThese -> String) -> ([IsThese] -> ShowS) -> Show IsThese
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IsThese] -> ShowS
$cshowList :: [IsThese] -> ShowS
show :: IsThese -> String
$cshow :: IsThese -> String
showsPrec :: Int -> IsThese -> ShowS
$cshowsPrec :: Int -> IsThese -> ShowS
Show
type IsTheseT = IsTh ('These '() '())
instance P IsTheseT x => P IsThese x where
type PP IsThese x = PP IsTheseT x
eval :: proxy IsThese -> POpts -> x -> m (TT (PP IsThese x))
eval proxy IsThese
_ = Proxy IsTheseT -> POpts -> x -> m (TT (PP IsTheseT x))
forall k (m :: Type -> Type) (p :: k) a (proxy :: k -> Type).
(MonadEval m, P p a, PP p a ~ Bool) =>
proxy p -> POpts -> a -> m (TT (PP p a))
evalBool (Proxy IsTheseT
forall k (t :: k). Proxy t
Proxy @IsTheseT)
data TheseIn p q r deriving Int -> TheseIn p q r -> ShowS
[TheseIn p q r] -> ShowS
TheseIn p q r -> String
(Int -> TheseIn p q r -> ShowS)
-> (TheseIn p q r -> String)
-> ([TheseIn p q r] -> ShowS)
-> Show (TheseIn p q r)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k) k (r :: k).
Int -> TheseIn p q r -> ShowS
forall k (p :: k) k (q :: k) k (r :: k). [TheseIn p q r] -> ShowS
forall k (p :: k) k (q :: k) k (r :: k). TheseIn p q r -> String
showList :: [TheseIn p q r] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k) k (r :: k). [TheseIn p q r] -> ShowS
show :: TheseIn p q r -> String
$cshow :: forall k (p :: k) k (q :: k) k (r :: k). TheseIn p q r -> String
showsPrec :: Int -> TheseIn p q r -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k) k (r :: k).
Int -> TheseIn p q r -> ShowS
Show
instance ( Show a
, Show b
, Show (PP p a)
, P p a
, P q b
, P r (a,b)
, PP p a ~ PP q b
, PP p a ~ PP r (a,b)
, PP q b ~ PP r (a,b)
) => P (TheseIn p q r) (These a b) where
type PP (TheseIn p q r) (These a b) = PP p a
eval :: proxy (TheseIn p q r)
-> POpts -> These a b -> m (TT (PP (TheseIn p q r) (These a b)))
eval proxy (TheseIn p q r)
_ POpts
opts These a b
th = do
let msg0 :: String
msg0 = String
"TheseIn"
case These a b
th of
This a
a -> do
let msg1 :: String
msg1 = String
"This "
msg2 :: String
msg2 = String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
msg1
TT (PP r (a, b))
pp <- Proxy p -> POpts -> a -> m (TT (PP p a))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts a
a
TT (PP r (a, b)) -> m (TT (PP r (a, b)))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (PP r (a, b)) -> m (TT (PP r (a, b))))
-> TT (PP r (a, b)) -> m (TT (PP r (a, b)))
forall a b. (a -> b) -> a -> b
$ case Inline
-> POpts
-> String
-> TT (PP r (a, b))
-> [Tree PE]
-> Either (TT (PP r (a, b))) (PP r (a, b))
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts (String
msg2 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"p failed") TT (PP r (a, b))
pp [] of
Left TT (PP r (a, b))
e -> TT (PP r (a, b))
e
Right PP r (a, b)
c -> POpts
-> Val (PP r (a, b)) -> String -> [Tree PE] -> TT (PP r (a, b))
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (PP r (a, b) -> Val (PP r (a, b))
forall a. a -> Val a
Val PP r (a, b)
c) (POpts -> String -> PP r (a, b) -> String -> a -> String
forall a1 a2.
(Show a1, Show a2) =>
POpts -> String -> a1 -> String -> a2 -> String
show3' POpts
opts String
msg0 PP r (a, b)
c String
msg1 a
a) [TT (PP r (a, b)) -> Tree PE
forall a. TT a -> Tree PE
hh TT (PP r (a, b))
pp]
That b
b -> do
let msg1 :: String
msg1 = String
"That "
msg2 :: String
msg2 = String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
msg1
TT (PP r (a, b))
qq <- Proxy q -> POpts -> b -> m (TT (PP q b))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts b
b
TT (PP r (a, b)) -> m (TT (PP r (a, b)))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (PP r (a, b)) -> m (TT (PP r (a, b))))
-> TT (PP r (a, b)) -> m (TT (PP r (a, b)))
forall a b. (a -> b) -> a -> b
$ case Inline
-> POpts
-> String
-> TT (PP r (a, b))
-> [Tree PE]
-> Either (TT (PP r (a, b))) (PP r (a, b))
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts (String
msg2 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"q failed") TT (PP r (a, b))
qq [] of
Left TT (PP r (a, b))
e -> TT (PP r (a, b))
e
Right PP r (a, b)
c -> POpts
-> Val (PP r (a, b)) -> String -> [Tree PE] -> TT (PP r (a, b))
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (PP r (a, b) -> Val (PP r (a, b))
forall a. a -> Val a
Val PP r (a, b)
c) (POpts -> String -> PP r (a, b) -> String -> b -> String
forall a1 a2.
(Show a1, Show a2) =>
POpts -> String -> a1 -> String -> a2 -> String
show3' POpts
opts String
msg0 PP r (a, b)
c String
msg1 b
b) [TT (PP r (a, b)) -> Tree PE
forall a. TT a -> Tree PE
hh TT (PP r (a, b))
qq]
These a
a b
b -> do
let msg1 :: String
msg1 = String
"These "
msg2 :: String
msg2 = String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
msg1
TT (PP r (a, b))
rr <- Proxy r -> POpts -> (a, b) -> m (TT (PP r (a, b)))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy r
forall k (t :: k). Proxy t
Proxy @r) POpts
opts (a
a,b
b)
TT (PP r (a, b)) -> m (TT (PP r (a, b)))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (PP r (a, b)) -> m (TT (PP r (a, b))))
-> TT (PP r (a, b)) -> m (TT (PP r (a, b)))
forall a b. (a -> b) -> a -> b
$ case Inline
-> POpts
-> String
-> TT (PP r (a, b))
-> [Tree PE]
-> Either (TT (PP r (a, b))) (PP r (a, b))
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts (String
msg2 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"r failed") TT (PP r (a, b))
rr [] of
Left TT (PP r (a, b))
e -> TT (PP r (a, b))
e
Right PP r (a, b)
c -> POpts
-> Val (PP r (a, b)) -> String -> [Tree PE] -> TT (PP r (a, b))
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (PP r (a, b) -> Val (PP r (a, b))
forall a. a -> Val a
Val PP r (a, b)
c) (POpts -> String -> PP r (a, b) -> These a b -> String
forall a1 a2.
(Show a1, Show a2) =>
POpts -> String -> a1 -> a2 -> String
show3 POpts
opts String
msg0 PP r (a, b)
c (a -> b -> These a b
forall a b. a -> b -> These a b
These a
a b
b)) [TT (PP r (a, b)) -> Tree PE
forall a. TT a -> Tree PE
hh TT (PP r (a, b))
rr]
data TheseId p q deriving Int -> TheseId p q -> ShowS
[TheseId p q] -> ShowS
TheseId p q -> String
(Int -> TheseId p q -> ShowS)
-> (TheseId p q -> String)
-> ([TheseId p q] -> ShowS)
-> Show (TheseId p q)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k). Int -> TheseId p q -> ShowS
forall k (p :: k) k (q :: k). [TheseId p q] -> ShowS
forall k (p :: k) k (q :: k). TheseId p q -> String
showList :: [TheseId p q] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k). [TheseId p q] -> ShowS
show :: TheseId p q -> String
$cshow :: forall k (p :: k) k (q :: k). TheseId p q -> String
showsPrec :: Int -> TheseId p q -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k). Int -> TheseId p q -> ShowS
Show
type TheseIdT p q = TheseIn '(Id, q) '(p, Id) Id
instance P (TheseIdT p q) x => P (TheseId p q) x where
type PP (TheseId p q) x = PP (TheseIdT p q) x
eval :: proxy (TheseId p q) -> POpts -> x -> m (TT (PP (TheseId p q) x))
eval proxy (TheseId p q)
_ = Proxy (TheseIdT p q) -> POpts -> x -> m (TT (PP (TheseIdT p q) x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy (TheseIdT p q)
forall k (t :: k). Proxy t
Proxy @(TheseIdT p q))
data ZipThese p q deriving Int -> ZipThese p q -> ShowS
[ZipThese p q] -> ShowS
ZipThese p q -> String
(Int -> ZipThese p q -> ShowS)
-> (ZipThese p q -> String)
-> ([ZipThese p q] -> ShowS)
-> Show (ZipThese p q)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k). Int -> ZipThese p q -> ShowS
forall k (p :: k) k (q :: k). [ZipThese p q] -> ShowS
forall k (p :: k) k (q :: k). ZipThese p q -> String
showList :: [ZipThese p q] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k). [ZipThese p q] -> ShowS
show :: ZipThese p q -> String
$cshow :: forall k (p :: k) k (q :: k). ZipThese p q -> String
showsPrec :: Int -> ZipThese p q -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k). Int -> ZipThese p q -> ShowS
Show
instance ( PP p a ~ [x]
, PP q a ~ [y]
, P p a
, P q a
, Show x
, Show y
) => P (ZipThese p q) a where
type PP (ZipThese p q) a = [These (ExtractAFromList (PP p a)) (ExtractAFromList (PP q a))]
eval :: proxy (ZipThese p q) -> POpts -> a -> m (TT (PP (ZipThese p q) a))
eval proxy (ZipThese p q)
_ POpts
opts a
a = do
let msg0 :: String
msg0 = String
"ZipThese"
Either (TT [These x y]) ([x], [y], TT [x], TT [y])
lr <- Inline
-> String
-> Proxy p
-> Proxy q
-> POpts
-> a
-> [Tree PE]
-> m (Either
(TT [These x y]) (PP p a, PP q a, TT (PP p a), TT (PP q a)))
forall k1 k2 (p :: k1) a (q :: k2) (m :: Type -> Type)
(proxy1 :: k1 -> Type) (proxy2 :: k2 -> Type) x.
(P p a, P q a, MonadEval m) =>
Inline
-> String
-> proxy1 p
-> proxy2 q
-> POpts
-> a
-> [Tree PE]
-> m (Either (TT x) (PP p a, PP q a, TT (PP p a), TT (PP q a)))
runPQ Inline
NoInline String
msg0 (Proxy p
forall k (t :: k). Proxy t
Proxy @p) (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts a
a []
TT [These x y] -> m (TT [These x y])
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT [These x y] -> m (TT [These x y]))
-> TT [These x y] -> m (TT [These x y])
forall a b. (a -> b) -> a -> b
$ case Either (TT [These x y]) ([x], [y], TT [x], TT [y])
lr of
Left TT [These x y]
e -> TT [These x y]
e
Right ([x]
p,[y]
q,TT [x]
pp,TT [y]
qq) ->
let hhs :: [Tree PE]
hhs = [TT [x] -> Tree PE
forall a. TT a -> Tree PE
hh TT [x]
pp, TT [y] -> Tree PE
forall a. TT a -> Tree PE
hh TT [y]
qq]
in case POpts
-> String
-> [x]
-> [y]
-> [Tree PE]
-> Either (TT [These x y]) ([x], [y])
forall (t :: Type -> Type) (u :: Type -> Type) a b x.
(Foldable t, Foldable u) =>
POpts
-> String -> t a -> u b -> [Tree PE] -> Either (TT x) ([a], [b])
chkSize2 POpts
opts String
msg0 [x]
p [y]
q [Tree PE]
hhs of
Left TT [These x y]
e -> TT [These x y]
e
Right ([x], [y])
_ ->
let d :: [These x y]
d = [x] -> [y] -> [These x y]
forall a b. [a] -> [b] -> [These a b]
simpleAlign [x]
p [y]
q
in POpts -> Val [These x y] -> String -> [Tree PE] -> TT [These x y]
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts ([These x y] -> Val [These x y]
forall a. a -> Val a
Val [These x y]
d) (POpts -> String -> [These x y] -> String -> [x] -> String
forall a1 a2.
(Show a1, Show a2) =>
POpts -> String -> a1 -> String -> a2 -> String
show3' POpts
opts String
msg0 [These x y]
d String
"p=" [x]
p String -> ShowS
forall a. Semigroup a => a -> a -> a
<> POpts -> String -> [y] -> String
forall a. Show a => POpts -> String -> a -> String
showVerbose POpts
opts String
" | q=" [y]
q) [Tree PE]
hhs
simpleAlign :: [a] -> [b] -> [These a b]
simpleAlign :: [a] -> [b] -> [These a b]
simpleAlign [a]
as [] = (a -> These a b) -> [a] -> [These a b]
forall a b. (a -> b) -> [a] -> [b]
map a -> These a b
forall a b. a -> These a b
This [a]
as
simpleAlign [] [b]
bs = (b -> These a b) -> [b] -> [These a b]
forall a b. (a -> b) -> [a] -> [b]
map b -> These a b
forall a b. b -> These a b
That [b]
bs
simpleAlign (a
a:[a]
as) (b
b:[b]
bs) = a -> b -> These a b
forall a b. a -> b -> These a b
These a
a b
b These a b -> [These a b] -> [These a b]
forall a. a -> [a] -> [a]
: [a] -> [b] -> [These a b]
forall a b. [a] -> [b] -> [These a b]
simpleAlign [a]
as [b]
bs
data ThisDef p q deriving Int -> ThisDef p q -> ShowS
[ThisDef p q] -> ShowS
ThisDef p q -> String
(Int -> ThisDef p q -> ShowS)
-> (ThisDef p q -> String)
-> ([ThisDef p q] -> ShowS)
-> Show (ThisDef p q)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k). Int -> ThisDef p q -> ShowS
forall k (p :: k) k (q :: k). [ThisDef p q] -> ShowS
forall k (p :: k) k (q :: k). ThisDef p q -> String
showList :: [ThisDef p q] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k). [ThisDef p q] -> ShowS
show :: ThisDef p q -> String
$cshow :: forall k (p :: k) k (q :: k). ThisDef p q -> String
showsPrec :: Int -> ThisDef p q -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k). Int -> ThisDef p q -> ShowS
Show
instance ( PP q x ~ These a b
, PP p x ~ a
, P q x
, P p x
) => P (ThisDef p q) x where
type PP (ThisDef p q) x = ThisT (PP q x)
eval :: proxy (ThisDef p q) -> POpts -> x -> m (TT (PP (ThisDef p q) x))
eval proxy (ThisDef p q)
_ POpts
opts x
x = do
let msg0 :: String
msg0 = String
"ThisDef"
TT (These a b)
qq <- Proxy q -> POpts -> x -> m (TT (PP q x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts x
x
case Inline
-> POpts
-> String
-> TT (These a b)
-> [Tree PE]
-> Either (TT a) (These a b)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (These a b)
qq [] of
Left TT a
e -> TT a -> m (TT a)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure TT a
e
Right These a b
q ->
case These a b
q of
This a
a -> TT a -> m (TT a)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT a -> m (TT a)) -> TT a -> m (TT a)
forall a b. (a -> b) -> a -> b
$ POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (a -> Val a
forall a. a -> Val a
Val a
a) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" This") [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq]
These a b
_ -> do
TT a
pp <- Proxy p -> POpts -> x -> m (TT (PP p x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts x
x
TT a -> m (TT a)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT a -> m (TT a)) -> TT a -> m (TT a)
forall a b. (a -> b) -> a -> b
$ case Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT a) a
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT a
pp [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq] of
Left TT a
e -> TT a
e
Right a
p -> POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (a -> Val a
forall a. a -> Val a
Val a
p) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> These a b -> String
forall a b. These a b -> String
showThese These a b
q) [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq, TT a -> Tree PE
forall a. TT a -> Tree PE
hh TT a
pp]
data ThatDef p q deriving Int -> ThatDef p q -> ShowS
[ThatDef p q] -> ShowS
ThatDef p q -> String
(Int -> ThatDef p q -> ShowS)
-> (ThatDef p q -> String)
-> ([ThatDef p q] -> ShowS)
-> Show (ThatDef p q)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k). Int -> ThatDef p q -> ShowS
forall k (p :: k) k (q :: k). [ThatDef p q] -> ShowS
forall k (p :: k) k (q :: k). ThatDef p q -> String
showList :: [ThatDef p q] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k). [ThatDef p q] -> ShowS
show :: ThatDef p q -> String
$cshow :: forall k (p :: k) k (q :: k). ThatDef p q -> String
showsPrec :: Int -> ThatDef p q -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k). Int -> ThatDef p q -> ShowS
Show
instance ( PP q x ~ These a b
, PP p x ~ b
, P q x
, P p x
) => P (ThatDef p q) x where
type PP (ThatDef p q) x = ThatT (PP q x)
eval :: proxy (ThatDef p q) -> POpts -> x -> m (TT (PP (ThatDef p q) x))
eval proxy (ThatDef p q)
_ POpts
opts x
x = do
let msg0 :: String
msg0 = String
"ThatDef"
TT (These a b)
qq <- Proxy q -> POpts -> x -> m (TT (PP q x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts x
x
case Inline
-> POpts
-> String
-> TT (These a b)
-> [Tree PE]
-> Either (TT b) (These a b)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (These a b)
qq [] of
Left TT b
e -> TT b -> m (TT b)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure TT b
e
Right These a b
q ->
case These a b
q of
That b
a -> TT b -> m (TT b)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT b -> m (TT b)) -> TT b -> m (TT b)
forall a b. (a -> b) -> a -> b
$ POpts -> Val b -> String -> [Tree PE] -> TT b
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (b -> Val b
forall a. a -> Val a
Val b
a) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" That") [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq]
These a b
_ -> do
TT b
pp <- Proxy p -> POpts -> x -> m (TT (PP p x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts x
x
TT b -> m (TT b)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT b -> m (TT b)) -> TT b -> m (TT b)
forall a b. (a -> b) -> a -> b
$ case Inline -> POpts -> String -> TT b -> [Tree PE] -> Either (TT b) b
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT b
pp [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq] of
Left TT b
e -> TT b
e
Right b
p -> POpts -> Val b -> String -> [Tree PE] -> TT b
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (b -> Val b
forall a. a -> Val a
Val b
p) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> These a b -> String
forall a b. These a b -> String
showThese These a b
q) [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq, TT b -> Tree PE
forall a. TT a -> Tree PE
hh TT b
pp]
data TheseDef p q deriving Int -> TheseDef p q -> ShowS
[TheseDef p q] -> ShowS
TheseDef p q -> String
(Int -> TheseDef p q -> ShowS)
-> (TheseDef p q -> String)
-> ([TheseDef p q] -> ShowS)
-> Show (TheseDef p q)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k). Int -> TheseDef p q -> ShowS
forall k (p :: k) k (q :: k). [TheseDef p q] -> ShowS
forall k (p :: k) k (q :: k). TheseDef p q -> String
showList :: [TheseDef p q] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k). [TheseDef p q] -> ShowS
show :: TheseDef p q -> String
$cshow :: forall k (p :: k) k (q :: k). TheseDef p q -> String
showsPrec :: Int -> TheseDef p q -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k). Int -> TheseDef p q -> ShowS
Show
instance ( PP q x ~ These a b
, PP p x ~ (a,b)
, P q x
, P p x
) => P (TheseDef p q) x where
type PP (TheseDef p q) x = TheseT (PP q x)
eval :: proxy (TheseDef p q) -> POpts -> x -> m (TT (PP (TheseDef p q) x))
eval proxy (TheseDef p q)
_ POpts
opts x
x = do
let msg0 :: String
msg0 = String
"TheseDef"
TT (These a b)
qq <- Proxy q -> POpts -> x -> m (TT (PP q x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts x
x
case Inline
-> POpts
-> String
-> TT (These a b)
-> [Tree PE]
-> Either (TT (a, b)) (These a b)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (These a b)
qq [] of
Left TT (a, b)
e -> TT (a, b) -> m (TT (a, b))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure TT (a, b)
e
Right These a b
q ->
case These a b
q of
These a
a b
b -> TT (a, b) -> m (TT (a, b))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (a, b) -> m (TT (a, b))) -> TT (a, b) -> m (TT (a, b))
forall a b. (a -> b) -> a -> b
$ POpts -> Val (a, b) -> String -> [Tree PE] -> TT (a, b)
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts ((a, b) -> Val (a, b)
forall a. a -> Val a
Val (a
a,b
b)) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" These") [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq]
These a b
_ -> do
TT (a, b)
pp <- Proxy p -> POpts -> x -> m (TT (PP p x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts x
x
TT (a, b) -> m (TT (a, b))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (a, b) -> m (TT (a, b))) -> TT (a, b) -> m (TT (a, b))
forall a b. (a -> b) -> a -> b
$ case Inline
-> POpts
-> String
-> TT (a, b)
-> [Tree PE]
-> Either (TT (a, b)) (a, b)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (a, b)
pp [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq] of
Left TT (a, b)
e -> TT (a, b)
e
Right (a, b)
p -> POpts -> Val (a, b) -> String -> [Tree PE] -> TT (a, b)
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts ((a, b) -> Val (a, b)
forall a. a -> Val a
Val (a, b)
p) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> These a b -> String
forall a b. These a b -> String
showThese These a b
q) [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq, TT (a, b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (a, b)
pp]
data ThisFail p q deriving Int -> ThisFail p q -> ShowS
[ThisFail p q] -> ShowS
ThisFail p q -> String
(Int -> ThisFail p q -> ShowS)
-> (ThisFail p q -> String)
-> ([ThisFail p q] -> ShowS)
-> Show (ThisFail p q)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k). Int -> ThisFail p q -> ShowS
forall k (p :: k) k (q :: k). [ThisFail p q] -> ShowS
forall k (p :: k) k (q :: k). ThisFail p q -> String
showList :: [ThisFail p q] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k). [ThisFail p q] -> ShowS
show :: ThisFail p q -> String
$cshow :: forall k (p :: k) k (q :: k). ThisFail p q -> String
showsPrec :: Int -> ThisFail p q -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k). Int -> ThisFail p q -> ShowS
Show
instance ( PP p x ~ String
, PP q x ~ These a b
, P p x
, P q x
)
=> P (ThisFail p q) x where
type PP (ThisFail p q) x = ThisT (PP q x)
eval :: proxy (ThisFail p q) -> POpts -> x -> m (TT (PP (ThisFail p q) x))
eval proxy (ThisFail p q)
_ POpts
opts x
x = do
let msg0 :: String
msg0 = String
"ThisFail"
TT (These a b)
qq <- Proxy q -> POpts -> x -> m (TT (PP q x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts x
x
case Inline
-> POpts
-> String
-> TT (These a b)
-> [Tree PE]
-> Either (TT a) (These a b)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (These a b)
qq [] of
Left TT a
e -> TT a -> m (TT a)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure TT a
e
Right These a b
q ->
case These a b
q of
This a
a -> TT a -> m (TT a)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT a -> m (TT a)) -> TT a -> m (TT a)
forall a b. (a -> b) -> a -> b
$ POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (a -> Val a
forall a. a -> Val a
Val a
a) String
"This" [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq]
These a b
_ -> do
TT String
pp <- Proxy p -> POpts -> x -> m (TT (PP p x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts x
x
TT a -> m (TT a)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT a -> m (TT a)) -> TT a -> m (TT a)
forall a b. (a -> b) -> a -> b
$ case Inline
-> POpts
-> String
-> TT String
-> [Tree PE]
-> Either (TT a) String
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT String
pp [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq] of
Left TT a
e -> TT a
e
Right String
p -> POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (String -> Val a
forall a. String -> Val a
Fail String
p) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> These a b -> String
forall a b. These a b -> String
showThese These a b
q) [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq, TT String -> Tree PE
forall a. TT a -> Tree PE
hh TT String
pp]
data ThatFail p q deriving Int -> ThatFail p q -> ShowS
[ThatFail p q] -> ShowS
ThatFail p q -> String
(Int -> ThatFail p q -> ShowS)
-> (ThatFail p q -> String)
-> ([ThatFail p q] -> ShowS)
-> Show (ThatFail p q)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k). Int -> ThatFail p q -> ShowS
forall k (p :: k) k (q :: k). [ThatFail p q] -> ShowS
forall k (p :: k) k (q :: k). ThatFail p q -> String
showList :: [ThatFail p q] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k). [ThatFail p q] -> ShowS
show :: ThatFail p q -> String
$cshow :: forall k (p :: k) k (q :: k). ThatFail p q -> String
showsPrec :: Int -> ThatFail p q -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k). Int -> ThatFail p q -> ShowS
Show
instance ( PP p x ~ String
, PP q x ~ These a b
, P p x
, P q x
)
=> P (ThatFail p q) x where
type PP (ThatFail p q) x = ThatT (PP q x)
eval :: proxy (ThatFail p q) -> POpts -> x -> m (TT (PP (ThatFail p q) x))
eval proxy (ThatFail p q)
_ POpts
opts x
x = do
let msg0 :: String
msg0 = String
"ThatFail"
TT (These a b)
qq <- Proxy q -> POpts -> x -> m (TT (PP q x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts x
x
case Inline
-> POpts
-> String
-> TT (These a b)
-> [Tree PE]
-> Either (TT b) (These a b)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (These a b)
qq [] of
Left TT b
e -> TT b -> m (TT b)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure TT b
e
Right These a b
q ->
case These a b
q of
That b
a -> TT b -> m (TT b)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT b -> m (TT b)) -> TT b -> m (TT b)
forall a b. (a -> b) -> a -> b
$ POpts -> Val b -> String -> [Tree PE] -> TT b
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (b -> Val b
forall a. a -> Val a
Val b
a) String
"That" [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq]
These a b
_ -> do
TT String
pp <- Proxy p -> POpts -> x -> m (TT (PP p x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts x
x
TT b -> m (TT b)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT b -> m (TT b)) -> TT b -> m (TT b)
forall a b. (a -> b) -> a -> b
$ case Inline
-> POpts
-> String
-> TT String
-> [Tree PE]
-> Either (TT b) String
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT String
pp [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq] of
Left TT b
e -> TT b
e
Right String
p -> POpts -> Val b -> String -> [Tree PE] -> TT b
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (String -> Val b
forall a. String -> Val a
Fail String
p) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> These a b -> String
forall a b. These a b -> String
showThese These a b
q) [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq, TT String -> Tree PE
forall a. TT a -> Tree PE
hh TT String
pp]
data TheseFail p q deriving Int -> TheseFail p q -> ShowS
[TheseFail p q] -> ShowS
TheseFail p q -> String
(Int -> TheseFail p q -> ShowS)
-> (TheseFail p q -> String)
-> ([TheseFail p q] -> ShowS)
-> Show (TheseFail p q)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (p :: k) k (q :: k). Int -> TheseFail p q -> ShowS
forall k (p :: k) k (q :: k). [TheseFail p q] -> ShowS
forall k (p :: k) k (q :: k). TheseFail p q -> String
showList :: [TheseFail p q] -> ShowS
$cshowList :: forall k (p :: k) k (q :: k). [TheseFail p q] -> ShowS
show :: TheseFail p q -> String
$cshow :: forall k (p :: k) k (q :: k). TheseFail p q -> String
showsPrec :: Int -> TheseFail p q -> ShowS
$cshowsPrec :: forall k (p :: k) k (q :: k). Int -> TheseFail p q -> ShowS
Show
instance ( PP p x ~ String
, PP q x ~ These a b
, P p x
, P q x
)
=> P (TheseFail p q) x where
type PP (TheseFail p q) x = TheseT (PP q x)
eval :: proxy (TheseFail p q)
-> POpts -> x -> m (TT (PP (TheseFail p q) x))
eval proxy (TheseFail p q)
_ POpts
opts x
x = do
let msg0 :: String
msg0 = String
"TheseFail"
TT (These a b)
qq <- Proxy q -> POpts -> x -> m (TT (PP q x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy q
forall k (t :: k). Proxy t
Proxy @q) POpts
opts x
x
case Inline
-> POpts
-> String
-> TT (These a b)
-> [Tree PE]
-> Either (TT (a, b)) (These a b)
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT (These a b)
qq [] of
Left TT (a, b)
e -> TT (a, b) -> m (TT (a, b))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure TT (a, b)
e
Right These a b
q ->
case These a b
q of
These a
a b
b -> TT (a, b) -> m (TT (a, b))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (a, b) -> m (TT (a, b))) -> TT (a, b) -> m (TT (a, b))
forall a b. (a -> b) -> a -> b
$ POpts -> Val (a, b) -> String -> [Tree PE] -> TT (a, b)
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts ((a, b) -> Val (a, b)
forall a. a -> Val a
Val (a
a,b
b)) String
"These" [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq]
These a b
_ -> do
TT String
pp <- Proxy p -> POpts -> x -> m (TT (PP p x))
forall k (p :: k) a (m :: Type -> Type) (proxy :: k -> Type).
(P p a, MonadEval m) =>
proxy p -> POpts -> a -> m (TT (PP p a))
eval (Proxy p
forall k (t :: k). Proxy t
Proxy @p) POpts
opts x
x
TT (a, b) -> m (TT (a, b))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (a, b) -> m (TT (a, b))) -> TT (a, b) -> m (TT (a, b))
forall a b. (a -> b) -> a -> b
$ case Inline
-> POpts
-> String
-> TT String
-> [Tree PE]
-> Either (TT (a, b)) String
forall a x.
Inline -> POpts -> String -> TT a -> [Tree PE] -> Either (TT x) a
getValueLR Inline
NoInline POpts
opts String
msg0 TT String
pp [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq] of
Left TT (a, b)
e -> TT (a, b)
e
Right String
p -> POpts -> Val (a, b) -> String -> [Tree PE] -> TT (a, b)
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (String -> Val (a, b)
forall a. String -> Val a
Fail String
p) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> These a b -> String
forall a b. These a b -> String
showThese These a b
q) [TT (These a b) -> Tree PE
forall a. TT a -> Tree PE
hh TT (These a b)
qq, TT String -> Tree PE
forall a. TT a -> Tree PE
hh TT String
pp]
data Assoc deriving Int -> Assoc -> ShowS
[Assoc] -> ShowS
Assoc -> String
(Int -> Assoc -> ShowS)
-> (Assoc -> String) -> ([Assoc] -> ShowS) -> Show Assoc
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Assoc] -> ShowS
$cshowList :: [Assoc] -> ShowS
show :: Assoc -> String
$cshow :: Assoc -> String
showsPrec :: Int -> Assoc -> ShowS
$cshowsPrec :: Int -> Assoc -> ShowS
Show
class AssocC p where
assoc :: p (p a b) c -> p a (p b c)
unassoc :: p a (p b c) -> p (p a b) c
instance AssocC Either where
assoc :: Either (Either a b) c -> Either a (Either b c)
assoc (Left (Left a
a)) = a -> Either a (Either b c)
forall a b. a -> Either a b
Left a
a
assoc (Left (Right b
b)) = Either b c -> Either a (Either b c)
forall a b. b -> Either a b
Right (b -> Either b c
forall a b. a -> Either a b
Left b
b)
assoc (Right c
b) = Either b c -> Either a (Either b c)
forall a b. b -> Either a b
Right (c -> Either b c
forall a b. b -> Either a b
Right c
b)
unassoc :: Either a (Either b c) -> Either (Either a b) c
unassoc (Left a
a) = Either a b -> Either (Either a b) c
forall a b. a -> Either a b
Left (a -> Either a b
forall a b. a -> Either a b
Left a
a)
unassoc (Right (Left b
b)) = Either a b -> Either (Either a b) c
forall a b. a -> Either a b
Left (b -> Either a b
forall a b. b -> Either a b
Right b
b)
unassoc (Right (Right c
b)) = c -> Either (Either a b) c
forall a b. b -> Either a b
Right c
b
instance AssocC These where
assoc :: These (These a b) c -> These a (These b c)
assoc (This (This a
a)) = a -> These a (These b c)
forall a b. a -> These a b
This a
a
assoc (This (That b
b)) = These b c -> These a (These b c)
forall a b. b -> These a b
That (b -> These b c
forall a b. a -> These a b
This b
b)
assoc (That c
b) = These b c -> These a (These b c)
forall a b. b -> These a b
That (c -> These b c
forall a b. b -> These a b
That c
b)
assoc (These (This a
a) c
c) = a -> These b c -> These a (These b c)
forall a b. a -> b -> These a b
These a
a (c -> These b c
forall a b. b -> These a b
That c
c)
assoc (These (That b
b) c
c) = These b c -> These a (These b c)
forall a b. b -> These a b
That (b -> c -> These b c
forall a b. a -> b -> These a b
These b
b c
c)
assoc (These (These a
a b
b) c
c) = a -> These b c -> These a (These b c)
forall a b. a -> b -> These a b
These a
a (b -> c -> These b c
forall a b. a -> b -> These a b
These b
b c
c)
assoc (This (These a
a b
b)) = a -> These b c -> These a (These b c)
forall a b. a -> b -> These a b
These a
a (b -> These b c
forall a b. a -> These a b
This b
b)
unassoc :: These a (These b c) -> These (These a b) c
unassoc (This a
a) = These a b -> These (These a b) c
forall a b. a -> These a b
This (a -> These a b
forall a b. a -> These a b
This a
a)
unassoc (That (This b
b)) = These a b -> These (These a b) c
forall a b. a -> These a b
This (b -> These a b
forall a b. b -> These a b
That b
b)
unassoc (That (That c
b)) = c -> These (These a b) c
forall a b. b -> These a b
That c
b
unassoc (These a
a (That c
c)) = These a b -> c -> These (These a b) c
forall a b. a -> b -> These a b
These (a -> These a b
forall a b. a -> These a b
This a
a) c
c
unassoc (That (These b
b c
c)) = These a b -> c -> These (These a b) c
forall a b. a -> b -> These a b
These (b -> These a b
forall a b. b -> These a b
That b
b) c
c
unassoc (These a
a (These b
b c
c)) = These a b -> c -> These (These a b) c
forall a b. a -> b -> These a b
These (a -> b -> These a b
forall a b. a -> b -> These a b
These a
a b
b) c
c
unassoc (These a
a (This b
b)) = These a b -> These (These a b) c
forall a b. a -> These a b
This (a -> b -> These a b
forall a b. a -> b -> These a b
These a
a b
b)
instance AssocC (,) where
assoc :: ((a, b), c) -> (a, (b, c))
assoc ((a
a,b
b),c
c) = (a
a,(b
b,c
c))
unassoc :: (a, (b, c)) -> ((a, b), c)
unassoc (a
a,(b
b,c
c)) = ((a
a,b
b),c
c)
instance ( AssocC p
, Show (p (p a b) c)
, Show (p a (p b c))
) => P Assoc (p (p a b) c) where
type PP Assoc (p (p a b) c) = p a (p b c)
eval :: proxy Assoc
-> POpts -> p (p a b) c -> m (TT (PP Assoc (p (p a b) c)))
eval proxy Assoc
_ POpts
opts p (p a b) c
pabc =
let msg0 :: String
msg0 = String
"Assoc"
d :: p a (p b c)
d = p (p a b) c -> p a (p b c)
forall (p :: Type -> Type -> Type) a b c.
AssocC p =>
p (p a b) c -> p a (p b c)
assoc p (p a b) c
pabc
in TT (p a (p b c)) -> m (TT (p a (p b c)))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (p a (p b c)) -> m (TT (p a (p b c))))
-> TT (p a (p b c)) -> m (TT (p a (p b c)))
forall a b. (a -> b) -> a -> b
$ POpts
-> Val (p a (p b c)) -> String -> [Tree PE] -> TT (p a (p b c))
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (p a (p b c) -> Val (p a (p b c))
forall a. a -> Val a
Val p a (p b c)
d) (POpts -> String -> p a (p b c) -> p (p a b) c -> String
forall a1 a2.
(Show a1, Show a2) =>
POpts -> String -> a1 -> a2 -> String
show3 POpts
opts String
msg0 p a (p b c)
d p (p a b) c
pabc) []
data Unassoc deriving Int -> Unassoc -> ShowS
[Unassoc] -> ShowS
Unassoc -> String
(Int -> Unassoc -> ShowS)
-> (Unassoc -> String) -> ([Unassoc] -> ShowS) -> Show Unassoc
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Unassoc] -> ShowS
$cshowList :: [Unassoc] -> ShowS
show :: Unassoc -> String
$cshow :: Unassoc -> String
showsPrec :: Int -> Unassoc -> ShowS
$cshowsPrec :: Int -> Unassoc -> ShowS
Show
instance ( AssocC p
, Show (p (p a b) c)
, Show (p a (p b c))
) => P Unassoc (p a (p b c)) where
type PP Unassoc (p a (p b c)) = p (p a b) c
eval :: proxy Unassoc
-> POpts -> p a (p b c) -> m (TT (PP Unassoc (p a (p b c))))
eval proxy Unassoc
_ POpts
opts p a (p b c)
pabc =
let msg0 :: String
msg0 = String
"Unassoc"
d :: p (p a b) c
d = p a (p b c) -> p (p a b) c
forall (p :: Type -> Type -> Type) a b c.
AssocC p =>
p a (p b c) -> p (p a b) c
unassoc p a (p b c)
pabc
in TT (p (p a b) c) -> m (TT (p (p a b) c))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (p (p a b) c) -> m (TT (p (p a b) c)))
-> TT (p (p a b) c) -> m (TT (p (p a b) c))
forall a b. (a -> b) -> a -> b
$ POpts
-> Val (p (p a b) c) -> String -> [Tree PE] -> TT (p (p a b) c)
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (p (p a b) c -> Val (p (p a b) c)
forall a. a -> Val a
Val p (p a b) c
d) (POpts -> String -> p (p a b) c -> p a (p b c) -> String
forall a1 a2.
(Show a1, Show a2) =>
POpts -> String -> a1 -> a2 -> String
show3 POpts
opts String
msg0 p (p a b) c
d p a (p b c)
pabc) []
data This' deriving Int -> This' -> ShowS
[This'] -> ShowS
This' -> String
(Int -> This' -> ShowS)
-> (This' -> String) -> ([This'] -> ShowS) -> Show This'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [This'] -> ShowS
$cshowList :: [This'] -> ShowS
show :: This' -> String
$cshow :: This' -> String
showsPrec :: Int -> This' -> ShowS
$cshowsPrec :: Int -> This' -> ShowS
Show
instance Show a => P This' (These a x) where
type PP This' (These a x) = a
eval :: proxy This' -> POpts -> These a x -> m (TT (PP This' (These a x)))
eval proxy This'
_ POpts
opts These a x
lr =
let msg0 :: String
msg0 = String
"This'"
in TT a -> m (TT a)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT a -> m (TT a)) -> TT a -> m (TT a)
forall a b. (a -> b) -> a -> b
$ case These a x
lr of
These a
_ x
_ -> POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (String -> Val a
forall a. String -> Val a
Fail (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" found These")) String
"" []
That x
_ -> POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (String -> Val a
forall a. String -> Val a
Fail (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" found That")) String
"" []
This a
a -> POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (a -> Val a
forall a. a -> Val a
Val a
a) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> POpts -> a -> String
forall a. Show a => POpts -> a -> String
showL POpts
opts a
a) []
data That' deriving Int -> That' -> ShowS
[That'] -> ShowS
That' -> String
(Int -> That' -> ShowS)
-> (That' -> String) -> ([That'] -> ShowS) -> Show That'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [That'] -> ShowS
$cshowList :: [That'] -> ShowS
show :: That' -> String
$cshow :: That' -> String
showsPrec :: Int -> That' -> ShowS
$cshowsPrec :: Int -> That' -> ShowS
Show
instance Show a => P That' (These x a) where
type PP That' (These x a) = a
eval :: proxy That' -> POpts -> These x a -> m (TT (PP That' (These x a)))
eval proxy That'
_ POpts
opts These x a
lr =
let msg0 :: String
msg0 = String
"That'"
in TT a -> m (TT a)
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT a -> m (TT a)) -> TT a -> m (TT a)
forall a b. (a -> b) -> a -> b
$ case These x a
lr of
These x
_ a
_ -> POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (String -> Val a
forall a. String -> Val a
Fail (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" found These")) String
"" []
This x
_ -> POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (String -> Val a
forall a. String -> Val a
Fail (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" found This")) String
"" []
That a
a -> POpts -> Val a -> String -> [Tree PE] -> TT a
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (a -> Val a
forall a. a -> Val a
Val a
a) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> POpts -> a -> String
forall a. Show a => POpts -> a -> String
showL POpts
opts a
a) []
data These' deriving Int -> These' -> ShowS
[These'] -> ShowS
These' -> String
(Int -> These' -> ShowS)
-> (These' -> String) -> ([These'] -> ShowS) -> Show These'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [These'] -> ShowS
$cshowList :: [These'] -> ShowS
show :: These' -> String
$cshow :: These' -> String
showsPrec :: Int -> These' -> ShowS
$cshowsPrec :: Int -> These' -> ShowS
Show
instance ( Show a
, Show b
) => P These' (These a b) where
type PP These' (These a b) = (a,b)
eval :: proxy These'
-> POpts -> These a b -> m (TT (PP These' (These a b)))
eval proxy These'
_ POpts
opts These a b
lr =
let msg0 :: String
msg0 = String
"These'"
in TT (a, b) -> m (TT (a, b))
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (TT (a, b) -> m (TT (a, b))) -> TT (a, b) -> m (TT (a, b))
forall a b. (a -> b) -> a -> b
$ case These a b
lr of
This a
_ -> POpts -> Val (a, b) -> String -> [Tree PE] -> TT (a, b)
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (String -> Val (a, b)
forall a. String -> Val a
Fail (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" found This")) String
"" []
That b
_ -> POpts -> Val (a, b) -> String -> [Tree PE] -> TT (a, b)
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts (String -> Val (a, b)
forall a. String -> Val a
Fail (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" found That")) String
"" []
These a
a b
b -> POpts -> Val (a, b) -> String -> [Tree PE] -> TT (a, b)
forall a. POpts -> Val a -> String -> [Tree PE] -> TT a
mkNode POpts
opts ((a, b) -> Val (a, b)
forall a. a -> Val a
Val (a
a,b
b)) (String
msg0 String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
" " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> POpts -> (a, b) -> String
forall a. Show a => POpts -> a -> String
showL POpts
opts (a
a,b
b)) []