{-# OPTIONS -fno-warn-missing-pattern-synonym-signatures #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -O2 #-}
module PlutusCore.Default.Universe
( DefaultUni (..)
, pattern DefaultUniList
, pattern DefaultUniPair
, module Export
) where
import PlutusCore.Builtin
import PlutusCore.Data
import PlutusCore.Evaluation.Machine.Exception
import PlutusCore.Evaluation.Result
import Control.Applicative
import Data.ByteString qualified as BS
import Data.Int
import Data.IntCast (intCastEq)
import Data.Proxy
import Data.Text qualified as Text
import GHC.Exts (inline, oneShot)
import Universe as Export
data DefaultUni a where
DefaultUniInteger :: DefaultUni (Esc Integer)
DefaultUniByteString :: DefaultUni (Esc BS.ByteString)
DefaultUniString :: DefaultUni (Esc Text.Text)
DefaultUniUnit :: DefaultUni (Esc ())
DefaultUniBool :: DefaultUni (Esc Bool)
DefaultUniProtoList :: DefaultUni (Esc [])
DefaultUniProtoPair :: DefaultUni (Esc (,))
DefaultUniApply :: !(DefaultUni (Esc f)) -> !(DefaultUni (Esc a)) -> DefaultUni (Esc (f a))
DefaultUniData :: DefaultUni (Esc Data)
pattern $bDefaultUniList :: DefaultUni (Esc a1) -> DefaultUni a
$mDefaultUniList :: forall r a.
DefaultUni a
-> (forall k1 k2 (f :: k1 -> k2) (a1 :: k1).
(a ~ Esc (f a1), Esc f ~ Esc []) =>
DefaultUni (Esc a1) -> r)
-> (Void# -> r)
-> r
DefaultUniList uniA =
DefaultUniProtoList `DefaultUniApply` uniA
pattern $bDefaultUniPair :: DefaultUni (Esc a2) -> DefaultUni (Esc a1) -> DefaultUni a
$mDefaultUniPair :: forall r a.
DefaultUni a
-> (forall k1 k2 (f1 :: k1 -> k2) (a1 :: k1) k3 k4 (f2 :: k3 -> k4)
(a2 :: k3).
(a ~ Esc (f1 a1), Esc f1 ~ Esc (f2 a2), Esc f2 ~ Esc (,)) =>
DefaultUni (Esc a2) -> DefaultUni (Esc a1) -> r)
-> (Void# -> r)
-> r
DefaultUniPair uniA uniB =
DefaultUniProtoPair `DefaultUniApply` uniA `DefaultUniApply` uniB
deriveGEq ''DefaultUni
deriveGCompare ''DefaultUni
noMoreTypeFunctions :: DefaultUni (Esc (f :: a -> b -> c -> d)) -> any
noMoreTypeFunctions :: DefaultUni (Esc f) -> any
noMoreTypeFunctions (DefaultUni (Esc f)
f `DefaultUniApply` DefaultUni (Esc a)
_) = DefaultUni (Esc f) -> any
forall a b c d (f :: a -> b -> c -> d) any.
DefaultUni (Esc f) -> any
noMoreTypeFunctions DefaultUni (Esc f)
DefaultUni (Esc f)
f
instance ToKind DefaultUni where
toSingKind :: DefaultUni (Esc a) -> SingKind k
toSingKind DefaultUni (Esc a)
DefaultUniInteger = SingKind k
forall k. KnownKind k => SingKind k
knownKind
toSingKind DefaultUni (Esc a)
DefaultUniByteString = SingKind k
forall k. KnownKind k => SingKind k
knownKind
toSingKind DefaultUni (Esc a)
DefaultUniString = SingKind k
forall k. KnownKind k => SingKind k
knownKind
toSingKind DefaultUni (Esc a)
DefaultUniUnit = SingKind k
forall k. KnownKind k => SingKind k
knownKind
toSingKind DefaultUni (Esc a)
DefaultUniBool = SingKind k
forall k. KnownKind k => SingKind k
knownKind
toSingKind DefaultUni (Esc a)
DefaultUniProtoList = SingKind k
forall k. KnownKind k => SingKind k
knownKind
toSingKind DefaultUni (Esc a)
DefaultUniProtoPair = SingKind k
forall k. KnownKind k => SingKind k
knownKind
toSingKind (DefaultUniApply DefaultUni (Esc f)
uniF DefaultUni (Esc a)
_) = case DefaultUni (Esc f) -> SingKind (k -> k)
forall (uni :: * -> *) k (a :: k).
ToKind uni =>
uni (Esc a) -> SingKind k
toSingKind DefaultUni (Esc f)
uniF of SingKind k
_ `SingKindArrow` SingKind l
cod -> SingKind k
SingKind l
cod
toSingKind DefaultUni (Esc a)
DefaultUniData = SingKind k
forall k. KnownKind k => SingKind k
knownKind
instance HasUniApply DefaultUni where
matchUniApply :: DefaultUni tb
-> r
-> (forall k l (f :: k -> l) (a :: k).
(tb ~ Esc (f a)) =>
DefaultUni (Esc f) -> DefaultUni (Esc a) -> r)
-> r
matchUniApply (DefaultUniApply DefaultUni (Esc f)
f DefaultUni (Esc a)
a) r
_ forall k l (f :: k -> l) (a :: k).
(tb ~ Esc (f a)) =>
DefaultUni (Esc f) -> DefaultUni (Esc a) -> r
h = DefaultUni (Esc f) -> DefaultUni (Esc a) -> r
forall k l (f :: k -> l) (a :: k).
(tb ~ Esc (f a)) =>
DefaultUni (Esc f) -> DefaultUni (Esc a) -> r
h DefaultUni (Esc f)
f DefaultUni (Esc a)
a
matchUniApply DefaultUni tb
_ r
z forall k l (f :: k -> l) (a :: k).
(tb ~ Esc (f a)) =>
DefaultUni (Esc f) -> DefaultUni (Esc a) -> r
_ = r
z
instance GShow DefaultUni where gshowsPrec :: Int -> DefaultUni a -> ShowS
gshowsPrec = Int -> DefaultUni a -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec
instance Show (DefaultUni a) where
show :: DefaultUni a -> String
show DefaultUni a
DefaultUniInteger = String
"integer"
show DefaultUni a
DefaultUniByteString = String
"bytestring"
show DefaultUni a
DefaultUniString = String
"string"
show DefaultUni a
DefaultUniUnit = String
"unit"
show DefaultUni a
DefaultUniBool = String
"bool"
show DefaultUni a
DefaultUniProtoList = String
"list"
show DefaultUni a
DefaultUniProtoPair = String
"pair"
show (DefaultUni (Esc f)
uniF `DefaultUniApply` DefaultUni (Esc a)
uniB) = case DefaultUni (Esc f)
uniF of
DefaultUni (Esc f)
DefaultUniProtoList -> [String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [String
"list (", DefaultUni (Esc a) -> String
forall a. Show a => a -> String
show DefaultUni (Esc a)
uniB, String
")"]
DefaultUni (Esc f)
DefaultUniProtoPair -> [String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [String
"pair (", DefaultUni (Esc a) -> String
forall a. Show a => a -> String
show DefaultUni (Esc a)
uniB, String
")"]
DefaultUni (Esc f)
DefaultUniProtoPair `DefaultUniApply` DefaultUni (Esc a)
uniA -> [String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [String
"pair (", DefaultUni (Esc a) -> String
forall a. Show a => a -> String
show DefaultUni (Esc a)
uniA, String
") (", DefaultUni (Esc a) -> String
forall a. Show a => a -> String
show DefaultUni (Esc a)
uniB, String
")"]
DefaultUni (Esc f)
uniG `DefaultUniApply` DefaultUni (Esc a)
_ `DefaultUniApply` DefaultUni (Esc a)
_ -> DefaultUni (Esc f) -> String
forall a b c d (f :: a -> b -> c -> d) any.
DefaultUni (Esc f) -> any
noMoreTypeFunctions DefaultUni (Esc f)
DefaultUni (Esc f)
uniG
show DefaultUni a
DefaultUniData = String
"data"
instance DefaultUni `Contains` Integer where knownUni :: DefaultUni (Esc Integer)
knownUni = DefaultUni (Esc Integer)
DefaultUniInteger
instance DefaultUni `Contains` BS.ByteString where knownUni :: DefaultUni (Esc ByteString)
knownUni = DefaultUni (Esc ByteString)
DefaultUniByteString
instance DefaultUni `Contains` Text.Text where knownUni :: DefaultUni (Esc Text)
knownUni = DefaultUni (Esc Text)
DefaultUniString
instance DefaultUni `Contains` () where knownUni :: DefaultUni (Esc ())
knownUni = DefaultUni (Esc ())
DefaultUniUnit
instance DefaultUni `Contains` Bool where knownUni :: DefaultUni (Esc Bool)
knownUni = DefaultUni (Esc Bool)
DefaultUniBool
instance DefaultUni `Contains` [] where knownUni :: DefaultUni (Esc [])
knownUni = DefaultUni (Esc [])
DefaultUniProtoList
instance DefaultUni `Contains` (,) where knownUni :: DefaultUni (Esc (,))
knownUni = DefaultUni (Esc (,))
DefaultUniProtoPair
instance DefaultUni `Contains` Data where knownUni :: DefaultUni (Esc Data)
knownUni = DefaultUni (Esc Data)
DefaultUniData
instance (DefaultUni `Contains` f, DefaultUni `Contains` a) => DefaultUni `Contains` f a where
knownUni :: DefaultUni (Esc (f a))
knownUni = DefaultUni (Esc f)
forall k (uni :: * -> *) (a :: k). Contains uni a => uni (Esc a)
knownUni DefaultUni (Esc f) -> DefaultUni (Esc a) -> DefaultUni (Esc (f a))
forall k k (f :: k -> k) (a :: k).
DefaultUni (Esc f) -> DefaultUni (Esc a) -> DefaultUni (Esc (f a))
`DefaultUniApply` DefaultUni (Esc a)
forall k (uni :: * -> *) (a :: k). Contains uni a => uni (Esc a)
knownUni
instance KnownBuiltinTypeAst DefaultUni Integer => KnownTypeAst DefaultUni Integer
instance KnownBuiltinTypeAst DefaultUni BS.ByteString => KnownTypeAst DefaultUni BS.ByteString
instance KnownBuiltinTypeAst DefaultUni Text.Text => KnownTypeAst DefaultUni Text.Text
instance KnownBuiltinTypeAst DefaultUni () => KnownTypeAst DefaultUni ()
instance KnownBuiltinTypeAst DefaultUni Bool => KnownTypeAst DefaultUni Bool
instance KnownBuiltinTypeAst DefaultUni [a] => KnownTypeAst DefaultUni [a]
instance KnownBuiltinTypeAst DefaultUni (a, b) => KnownTypeAst DefaultUni (a, b)
instance KnownBuiltinTypeAst DefaultUni Data => KnownTypeAst DefaultUni Data
instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term Integer
instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term BS.ByteString
instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term Text.Text
instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term ()
instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term Bool
instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term Data
instance (HasConstantIn DefaultUni term, DefaultUni `Contains` [a]) =>
MakeKnownIn DefaultUni term [a]
instance (HasConstantIn DefaultUni term, DefaultUni `Contains` (a, b)) =>
MakeKnownIn DefaultUni term (a, b)
instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term Integer
instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term BS.ByteString
instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term Text.Text
instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term ()
instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term Bool
instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term Data
instance (HasConstantIn DefaultUni term, DefaultUni `Contains` [a]) =>
ReadKnownIn DefaultUni term [a]
instance (HasConstantIn DefaultUni term, DefaultUni `Contains` (a, b)) =>
ReadKnownIn DefaultUni term (a, b)
instance TestTypesFromTheUniverseAreAllKnown DefaultUni
instance KnownTypeAst DefaultUni Int64 where
toTypeAst :: proxy Int64 -> Type TyName DefaultUni ()
toTypeAst proxy Int64
_ = Proxy Integer -> Type TyName DefaultUni ()
forall a (uni :: * -> *) (x :: a) (proxy :: a -> *).
KnownTypeAst uni x =>
proxy x -> Type TyName uni ()
toTypeAst (Proxy Integer -> Type TyName DefaultUni ())
-> Proxy Integer -> Type TyName DefaultUni ()
forall a b. (a -> b) -> a -> b
$ Proxy Integer
forall k (t :: k). Proxy t
Proxy @Integer
instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term Int64 where
makeKnown :: Maybe cause -> Int64 -> MakeKnownM cause term
makeKnown Maybe cause
mayCause = Maybe cause -> Integer -> MakeKnownM cause term
forall (uni :: * -> *) val a cause.
MakeKnownIn uni val a =>
Maybe cause -> a -> MakeKnownM cause val
makeKnown Maybe cause
mayCause (Integer -> MakeKnownM cause term)
-> (Int64 -> Integer) -> Int64 -> MakeKnownM cause term
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int64 -> Integer
forall a. Integral a => a -> Integer
toInteger
{-# INLINE makeKnown #-}
instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term Int64 where
readKnown :: Maybe cause -> term -> ReadKnownM cause Int64
readKnown Maybe cause
mayCause term
term =
(Maybe cause -> term -> ReadKnownM cause Integer)
-> Maybe cause -> term -> ReadKnownM cause Integer
forall a. a -> a
inline Maybe cause -> term -> ReadKnownM cause Integer
forall val a cause.
KnownBuiltinType val a =>
Maybe cause -> val -> ReadKnownM cause a
readKnownConstant Maybe cause
mayCause term
term ReadKnownM cause Integer
-> (Integer -> ReadKnownM cause Int64) -> ReadKnownM cause Int64
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (Integer -> ReadKnownM cause Int64)
-> Integer -> ReadKnownM cause Int64
oneShot \(Integer
i :: Integer) ->
if Int64 -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int64
forall a. Bounded a => a
minBound :: Int64) Integer -> Integer -> Bool
forall a. Ord a => a -> a -> Bool
<= Integer
i Bool -> Bool -> Bool
&& Integer
i Integer -> Integer -> Bool
forall a. Ord a => a -> a -> Bool
<= Int64 -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int64
forall a. Bounded a => a
maxBound :: Int64)
then Int64 -> ReadKnownM cause Int64
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int64 -> ReadKnownM cause Int64)
-> Int64 -> ReadKnownM cause Int64
forall a b. (a -> b) -> a -> b
$ Integer -> Int64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Integer
i
else AReview KnownTypeError ()
-> () -> Maybe cause -> ReadKnownM cause Int64
forall exc e t term (m :: * -> *) x.
(exc ~ ErrorWithCause e term, MonadError exc m) =>
AReview e t -> t -> Maybe term -> m x
throwingWithCause AReview KnownTypeError ()
forall err. AsEvaluationFailure err => Prism' err ()
_EvaluationFailure () Maybe cause
mayCause
{-# INLINE readKnown #-}
instance KnownTypeAst DefaultUni Int where
toTypeAst :: proxy Int -> Type TyName DefaultUni ()
toTypeAst proxy Int
_ = Proxy Integer -> Type TyName DefaultUni ()
forall a (uni :: * -> *) (x :: a) (proxy :: a -> *).
KnownTypeAst uni x =>
proxy x -> Type TyName uni ()
toTypeAst (Proxy Integer -> Type TyName DefaultUni ())
-> Proxy Integer -> Type TyName DefaultUni ()
forall a b. (a -> b) -> a -> b
$ Proxy Integer
forall k (t :: k). Proxy t
Proxy @Integer
instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term Int where
makeKnown :: Maybe cause -> Int -> MakeKnownM cause term
makeKnown Maybe cause
mayCause = Maybe cause -> Int64 -> MakeKnownM cause term
forall (uni :: * -> *) val a cause.
MakeKnownIn uni val a =>
Maybe cause -> a -> MakeKnownM cause val
makeKnown Maybe cause
mayCause (Int64 -> MakeKnownM cause term)
-> (Int -> Int64) -> Int -> MakeKnownM cause term
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Integral Int, Integral Int64, IsIntTypeEq Int Int64 ~ 'True) =>
Int -> Int64
forall a b.
(Integral a, Integral b, IsIntTypeEq a b ~ 'True) =>
a -> b
intCastEq @Int @Int64
{-# INLINE makeKnown #-}
instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term Int where
readKnown :: Maybe cause -> term -> ReadKnownM cause Int
readKnown Maybe cause
mayCause term
term = (Integral Int64, Integral Int, IsIntTypeEq Int64 Int ~ 'True) =>
Int64 -> Int
forall a b.
(Integral a, Integral b, IsIntTypeEq a b ~ 'True) =>
a -> b
intCastEq @Int64 @Int (Int64 -> Int)
-> Either (ErrorWithCause KnownTypeError cause) Int64
-> ReadKnownM cause Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe cause
-> term -> Either (ErrorWithCause KnownTypeError cause) Int64
forall (uni :: * -> *) val a cause.
ReadKnownIn uni val a =>
Maybe cause -> val -> ReadKnownM cause a
readKnown Maybe cause
mayCause term
term
{-# INLINE readKnown #-}
instance Closed DefaultUni where
type DefaultUni `Everywhere` constr =
( constr `Permits` Integer
, constr `Permits` BS.ByteString
, constr `Permits` Text.Text
, constr `Permits` ()
, constr `Permits` Bool
, constr `Permits` []
, constr `Permits` (,)
, constr `Permits` Data
)
encodeUni :: DefaultUni a -> [Int]
encodeUni DefaultUni a
DefaultUniInteger = [Int
0]
encodeUni DefaultUni a
DefaultUniByteString = [Int
1]
encodeUni DefaultUni a
DefaultUniString = [Int
2]
encodeUni DefaultUni a
DefaultUniUnit = [Int
3]
encodeUni DefaultUni a
DefaultUniBool = [Int
4]
encodeUni DefaultUni a
DefaultUniProtoList = [Int
5]
encodeUni DefaultUni a
DefaultUniProtoPair = [Int
6]
encodeUni (DefaultUniApply DefaultUni (Esc f)
uniF DefaultUni (Esc a)
uniA) = Int
7 Int -> [Int] -> [Int]
forall a. a -> [a] -> [a]
: DefaultUni (Esc f) -> [Int]
forall (uni :: * -> *) a. Closed uni => uni a -> [Int]
encodeUni DefaultUni (Esc f)
uniF [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ DefaultUni (Esc a) -> [Int]
forall (uni :: * -> *) a. Closed uni => uni a -> [Int]
encodeUni DefaultUni (Esc a)
uniA
encodeUni DefaultUni a
DefaultUniData = [Int
8]
withDecodedUni :: (forall k (a :: k).
Typeable k =>
DefaultUni (Esc a) -> DecodeUniM r)
-> DecodeUniM r
withDecodedUni forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k = DecodeUniM Int
peelUniTag DecodeUniM Int -> (Int -> DecodeUniM r) -> DecodeUniM r
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
Int
0 -> DefaultUni (Esc Integer) -> DecodeUniM r
forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k DefaultUni (Esc Integer)
DefaultUniInteger
Int
1 -> DefaultUni (Esc ByteString) -> DecodeUniM r
forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k DefaultUni (Esc ByteString)
DefaultUniByteString
Int
2 -> DefaultUni (Esc Text) -> DecodeUniM r
forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k DefaultUni (Esc Text)
DefaultUniString
Int
3 -> DefaultUni (Esc ()) -> DecodeUniM r
forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k DefaultUni (Esc ())
DefaultUniUnit
Int
4 -> DefaultUni (Esc Bool) -> DecodeUniM r
forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k DefaultUni (Esc Bool)
DefaultUniBool
Int
5 -> DefaultUni (Esc []) -> DecodeUniM r
forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k DefaultUni (Esc [])
DefaultUniProtoList
Int
6 -> DefaultUni (Esc (,)) -> DecodeUniM r
forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k DefaultUni (Esc (,))
DefaultUniProtoPair
Int
7 ->
forall r.
Closed DefaultUni =>
(forall k (a :: k).
Typeable k =>
DefaultUni (Esc a) -> DecodeUniM r)
-> DecodeUniM r
forall (uni :: * -> *) r.
Closed uni =>
(forall k (a :: k). Typeable k => uni (Esc a) -> DecodeUniM r)
-> DecodeUniM r
withDecodedUni @DefaultUni ((forall k (a :: k).
Typeable k =>
DefaultUni (Esc a) -> DecodeUniM r)
-> DecodeUniM r)
-> (forall k (a :: k).
Typeable k =>
DefaultUni (Esc a) -> DecodeUniM r)
-> DecodeUniM r
forall a b. (a -> b) -> a -> b
$ \DefaultUni (Esc a)
uniF ->
forall r.
Closed DefaultUni =>
(forall k (a :: k).
Typeable k =>
DefaultUni (Esc a) -> DecodeUniM r)
-> DecodeUniM r
forall (uni :: * -> *) r.
Closed uni =>
(forall k (a :: k). Typeable k => uni (Esc a) -> DecodeUniM r)
-> DecodeUniM r
withDecodedUni @DefaultUni ((forall k (a :: k).
Typeable k =>
DefaultUni (Esc a) -> DecodeUniM r)
-> DecodeUniM r)
-> (forall k (a :: k).
Typeable k =>
DefaultUni (Esc a) -> DecodeUniM r)
-> DecodeUniM r
forall a b. (a -> b) -> a -> b
$ \DefaultUni (Esc a)
uniA ->
DefaultUni (Esc a)
-> DefaultUni (Esc a)
-> (forall b. (Typeable b, k ~ (k -> b)) => DecodeUniM r)
-> DecodeUniM r
forall a ab (f :: ab) (x :: a) (uni :: * -> *) (m :: * -> *) r.
(Typeable ab, Typeable a, MonadPlus m) =>
uni (Esc f)
-> uni (Esc x)
-> (forall b. (Typeable b, ab ~ (a -> b)) => m r)
-> m r
withApplicable DefaultUni (Esc a)
uniF DefaultUni (Esc a)
uniA ((forall b. (Typeable b, k ~ (k -> b)) => DecodeUniM r)
-> DecodeUniM r)
-> (forall b. (Typeable b, k ~ (k -> b)) => DecodeUniM r)
-> DecodeUniM r
forall a b. (a -> b) -> a -> b
$
DefaultUni (Esc (a a)) -> DecodeUniM r
forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k (DefaultUni (Esc (a a)) -> DecodeUniM r)
-> DefaultUni (Esc (a a)) -> DecodeUniM r
forall a b. (a -> b) -> a -> b
$ DefaultUni (Esc a)
DefaultUni (Esc a)
uniF DefaultUni (Esc a) -> DefaultUni (Esc a) -> DefaultUni (Esc (a a))
forall k k (f :: k -> k) (a :: k).
DefaultUni (Esc f) -> DefaultUni (Esc a) -> DefaultUni (Esc (f a))
`DefaultUniApply` DefaultUni (Esc a)
uniA
Int
8 -> DefaultUni (Esc Data) -> DecodeUniM r
forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r
k DefaultUni (Esc Data)
DefaultUniData
Int
_ -> DecodeUniM r
forall (f :: * -> *) a. Alternative f => f a
empty
bring
:: forall constr a r proxy. DefaultUni `Everywhere` constr
=> proxy constr -> DefaultUni (Esc a) -> (constr a => r) -> r
bring :: proxy constr -> DefaultUni (Esc a) -> (constr a => r) -> r
bring proxy constr
_ DefaultUni (Esc a)
DefaultUniInteger constr a => r
r = r
constr a => r
r
bring proxy constr
_ DefaultUni (Esc a)
DefaultUniByteString constr a => r
r = r
constr a => r
r
bring proxy constr
_ DefaultUni (Esc a)
DefaultUniString constr a => r
r = r
constr a => r
r
bring proxy constr
_ DefaultUni (Esc a)
DefaultUniUnit constr a => r
r = r
constr a => r
r
bring proxy constr
_ DefaultUni (Esc a)
DefaultUniBool constr a => r
r = r
constr a => r
r
bring proxy constr
p (DefaultUni (Esc f)
DefaultUniProtoList `DefaultUniApply` DefaultUni (Esc a)
uniA) constr a => r
r =
proxy constr -> DefaultUni (Esc a) -> (constr a => r) -> r
forall (uni :: * -> *) (constr :: * -> Constraint)
(proxy :: (* -> Constraint) -> *) a r.
(Closed uni, Everywhere uni constr) =>
proxy constr -> uni (Esc a) -> (constr a => r) -> r
bring proxy constr
p DefaultUni (Esc a)
DefaultUni (Esc a)
uniA constr a => r
constr a => r
r
bring proxy constr
p (DefaultUni (Esc f)
DefaultUniProtoPair `DefaultUniApply` DefaultUni (Esc a)
uniA `DefaultUniApply` DefaultUni (Esc a)
uniB) constr a => r
r =
proxy constr -> DefaultUni (Esc a) -> (constr a => r) -> r
forall (uni :: * -> *) (constr :: * -> Constraint)
(proxy :: (* -> Constraint) -> *) a r.
(Closed uni, Everywhere uni constr) =>
proxy constr -> uni (Esc a) -> (constr a => r) -> r
bring proxy constr
p DefaultUni (Esc a)
DefaultUni (Esc a)
uniA ((constr a => r) -> r) -> (constr a => r) -> r
forall a b. (a -> b) -> a -> b
$ proxy constr -> DefaultUni (Esc a) -> (constr a => r) -> r
forall (uni :: * -> *) (constr :: * -> Constraint)
(proxy :: (* -> Constraint) -> *) a r.
(Closed uni, Everywhere uni constr) =>
proxy constr -> uni (Esc a) -> (constr a => r) -> r
bring proxy constr
p DefaultUni (Esc a)
DefaultUni (Esc a)
uniB constr a => r
constr a => r
r
bring proxy constr
_ (DefaultUni (Esc f)
f `DefaultUniApply` DefaultUni (Esc a)
_ `DefaultUniApply` DefaultUni (Esc a)
_ `DefaultUniApply` DefaultUni (Esc a)
_) constr a => r
_ =
DefaultUni (Esc f) -> r
forall a b c d (f :: a -> b -> c -> d) any.
DefaultUni (Esc f) -> any
noMoreTypeFunctions DefaultUni (Esc f)
DefaultUni (Esc f)
f
bring proxy constr
_ DefaultUni (Esc a)
DefaultUniData constr a => r
r = r
constr a => r
r