@@ -53,6 +53,7 @@ import PlutusCore.Data (Data)
5353import PlutusCore.Evaluation.Machine.ExMemoryUsage (IntegerCostedLiterally (.. ),
5454 NumBytesCostedAsNumWords (.. ))
5555import PlutusCore.Pretty.Extra (juxtRenderContext )
56+ import PlutusCore.Value (Value )
5657
5758import Control.Monad.Except (throwError )
5859import Data.ByteString (ByteString )
@@ -118,6 +119,7 @@ data DefaultUni a where
118119 DefaultUniBLS12_381_G1_Element :: DefaultUni (Esc BLS12_381.G1. Element )
119120 DefaultUniBLS12_381_G2_Element :: DefaultUni (Esc BLS12_381.G2. Element )
120121 DefaultUniBLS12_381_MlResult :: DefaultUni (Esc BLS12_381.Pairing. MlResult )
122+ DefaultUniValue :: DefaultUni (Esc Value )
121123
122124-- GHC infers crazy types for these two and the straightforward ones break pattern matching,
123125-- so we just leave GHC with its craziness.
@@ -182,6 +184,9 @@ instance GEq DefaultUni where
182184 geqStep DefaultUniBLS12_381_MlResult a2 = do
183185 DefaultUniBLS12_381_MlResult <- Just a2
184186 Just Refl
187+ geqStep DefaultUniValue a2 = do
188+ DefaultUniValue <- Just a2
189+ Just Refl
185190 {-# INLINE geqStep #-}
186191
187192 geqRec :: DefaultUni a1 -> DefaultUni a2 -> Maybe (a1 :~: a2 )
@@ -206,6 +211,7 @@ instance ToKind DefaultUni where
206211 toSingKind DefaultUniBLS12_381_G1_Element = knownKind
207212 toSingKind DefaultUniBLS12_381_G2_Element = knownKind
208213 toSingKind DefaultUniBLS12_381_MlResult = knownKind
214+ toSingKind DefaultUniValue = knownKind
209215
210216instance HasUniApply DefaultUni where
211217 uniApply = DefaultUniApply
@@ -231,6 +237,7 @@ instance PrettyBy RenderContext (DefaultUni a) where
231237 DefaultUniBLS12_381_G1_Element -> " bls12_381_G1_element"
232238 DefaultUniBLS12_381_G2_Element -> " bls12_381_G2_element"
233239 DefaultUniBLS12_381_MlResult -> " bls12_381_mlresult"
240+ DefaultUniValue -> " value"
234241
235242instance PrettyBy RenderContext (SomeTypeIn DefaultUni ) where
236243 prettyBy config (SomeTypeIn uni) = prettyBy config uni
@@ -263,6 +270,8 @@ instance DefaultUni `Contains` () where
263270 knownUni = DefaultUniUnit
264271instance DefaultUni `Contains ` Bool where
265272 knownUni = DefaultUniBool
273+ instance DefaultUni `Contains ` Value where
274+ knownUni = DefaultUniValue
266275instance DefaultUni `Contains ` [] where
267276 knownUni = DefaultUniProtoList
268277instance DefaultUni `Contains ` Strict. Vector where
@@ -302,6 +311,8 @@ instance KnownBuiltinTypeAst tyname DefaultUni BLS12_381.G2.Element =>
302311 KnownTypeAst tyname DefaultUni BLS12_381.G2. Element
303312instance KnownBuiltinTypeAst tyname DefaultUni BLS12_381.Pairing. MlResult =>
304313 KnownTypeAst tyname DefaultUni BLS12_381.Pairing. MlResult
314+ instance KnownBuiltinTypeAst tyname DefaultUni Value =>
315+ KnownTypeAst tyname DefaultUni Value
305316
306317instance KnownBuiltinTypeIn DefaultUni term Integer =>
307318 ReadKnownIn DefaultUni term Integer
@@ -327,6 +338,8 @@ instance KnownBuiltinTypeIn DefaultUni term BLS12_381.G2.Element =>
327338 ReadKnownIn DefaultUni term BLS12_381.G2. Element
328339instance KnownBuiltinTypeIn DefaultUni term BLS12_381.Pairing. MlResult =>
329340 ReadKnownIn DefaultUni term BLS12_381.Pairing. MlResult
341+ instance KnownBuiltinTypeIn DefaultUni term Value =>
342+ ReadKnownIn DefaultUni term Value
330343
331344instance KnownBuiltinTypeIn DefaultUni term Integer =>
332345 MakeKnownIn DefaultUni term Integer
@@ -352,6 +365,8 @@ instance KnownBuiltinTypeIn DefaultUni term BLS12_381.G2.Element =>
352365 MakeKnownIn DefaultUni term BLS12_381.G2. Element
353366instance KnownBuiltinTypeIn DefaultUni term BLS12_381.Pairing. MlResult =>
354367 MakeKnownIn DefaultUni term BLS12_381.Pairing. MlResult
368+ instance KnownBuiltinTypeIn DefaultUni term Value =>
369+ MakeKnownIn DefaultUni term Value
355370
356371-- If this tells you an instance is missing, add it right above, following the pattern.
357372instance TestTypesFromTheUniverseAreAllKnown DefaultUni
@@ -604,6 +619,7 @@ instance Closed DefaultUni where
604619 , constr `Permits ` Text
605620 , constr `Permits ` ()
606621 , constr `Permits ` Bool
622+ , constr `Permits ` Value
607623 , constr `Permits ` []
608624 , constr `Permits ` Strict. Vector
609625 , constr `Permits ` (,)
@@ -628,6 +644,7 @@ instance Closed DefaultUni where
628644 encodeUni DefaultUniBLS12_381_G2_Element = [10 ]
629645 encodeUni DefaultUniBLS12_381_MlResult = [11 ]
630646 encodeUni DefaultUniProtoArray = [12 ]
647+ encodeUni DefaultUniValue = [13 ]
631648
632649 -- See Note [Decoding universes].
633650 -- See Note [Stable encoding of tags].
@@ -649,6 +666,7 @@ instance Closed DefaultUni where
649666 10 -> k DefaultUniBLS12_381_G2_Element
650667 11 -> k DefaultUniBLS12_381_MlResult
651668 12 -> k DefaultUniProtoArray
669+ 13 -> k DefaultUniValue
652670 _ -> empty
653671
654672 bring
@@ -671,3 +689,4 @@ instance Closed DefaultUni where
671689 bring _ DefaultUniBLS12_381_G1_Element r = r
672690 bring _ DefaultUniBLS12_381_G2_Element r = r
673691 bring _ DefaultUniBLS12_381_MlResult r = r
692+ bring _ DefaultUniValue r = r
0 commit comments