Skip to content

Commit

Permalink
[Builtins] Removed usages '<:'
Browse files Browse the repository at this point in the history
  • Loading branch information
effectfully committed Jun 7, 2021
1 parent 6234de6 commit 49776c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Expand Up @@ -112,7 +112,7 @@ revealUnique (Name name uniq) =
-- TODO: we can generate more types here.
-- | Generate a 'Builtin' and supply its typed version to a continuation.
withTypedBuiltinGen
:: (Generatable uni, HasConstantIn uni term, Monad m)
:: (uni ~ DefaultUni, HasConstantIn uni term, Monad m)
=> (forall a. AsKnownType term a -> GenT m c) -> GenT m c
withTypedBuiltinGen k = Gen.choice
[ k @Integer AsKnownType
Expand Down Expand Up @@ -172,7 +172,7 @@ genIterAppValue (Denotation object embed meta scheme) = result where
-- Arguments to functions and 'Builtin's are generated recursively.
genTerm
:: forall uni fun m.
(Generatable uni, Monad m)
(uni ~ DefaultUni, Monad m)
=> TypedBuiltinGenT (Plain Term uni fun) m
-- ^ Ground generators of built-ins. The base case of the recursion.
-> DenotationContext (Plain Term uni fun)
Expand Down
Expand Up @@ -15,7 +15,6 @@ module PlutusCore.Generators.Internal.TypedBuiltinGen
( TermOf(..)
, TypedBuiltinGenT
, TypedBuiltinGen
, Generatable
, genLowerBytes
, genTypedBuiltinFail
, genTypedBuiltinDef
Expand Down Expand Up @@ -56,8 +55,6 @@ type TypedBuiltinGenT term m = forall a. AsKnownType term a -> GenT m (TermOf te
-- | 'TypedBuiltinGenT' specified to 'Identity'.
type TypedBuiltinGen term = TypedBuiltinGenT term Identity

type Generatable uni = (GShow uni, GEq uni, DefaultUni <: uni)

instance (PrettyBy config a, PrettyBy config term) =>
PrettyBy config (TermOf term a) where
prettyBy config (TermOf t x) = prettyBy config t <+> "~>" <+> prettyBy config x
Expand Down Expand Up @@ -95,7 +92,7 @@ genTypedBuiltinFail tb = fail $ fold

-- | A default built-ins generator.
genTypedBuiltinDef
:: (Generatable uni, HasConstantIn uni term, Monad m)
:: (HasConstantIn DefaultUni term, Monad m)
=> TypedBuiltinGenT term m
genTypedBuiltinDef
= updateTypedBuiltinGen @Integer (Gen.integral $ Range.linearFrom 0 0 10)
Expand Down
2 changes: 1 addition & 1 deletion plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs
Expand Up @@ -117,7 +117,7 @@ nonZeroArg :: (Integer -> Integer -> Integer) -> Integer -> Integer -> Evaluatio
nonZeroArg _ _ 0 = EvaluationFailure
nonZeroArg f x y = EvaluationSuccess $ f x y

instance (GShow uni, GEq uni, DefaultUni <: uni) => ToBuiltinMeaning uni DefaultFun where
instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where
type CostingPart uni DefaultFun = BuiltinCostModel
toBuiltinMeaning AddInteger =
makeBuiltinMeaning
Expand Down

0 comments on commit 49776c0

Please sign in to comment.