{-# LANGUAGE RankNTypes #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Plutarch.Extra.Ord (
POrdering (..),
PComparator,
pmax,
pmin,
pfromOrd,
pfromOrdBy,
pmapComparator,
preverseComparator,
pcompareBy,
pequateBy,
pleqBy,
plessThanBy,
pgeqBy,
pgreaterThanBy,
pmaxBy,
pminBy,
pleqMapBy,
plessThanMapBy,
pgeqMapBy,
pgreaterThanMapBy,
pleqValueBy,
plessThanValueBy,
pgeqValueBy,
pgreaterThanValueBy,
pisSortedBy,
pallUnique,
pallUniqueBy,
ptryAllUnique,
ptryAllUniqueBy,
ptryMerge,
ptryMergeBy,
psort,
psortBy,
pnubSort,
pnubSortBy,
pinsertUniqueBy,
) where
import Data.Semigroup (Semigroup (stimes), stimesIdempotentMonoid)
import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted), PMap)
import Plutarch.Api.V1.Value (
AmountGuarantees,
PCurrencySymbol,
PTokenName,
PValue,
)
import Plutarch.Bool (pif')
import Plutarch.Extra.List (phandleList, precListLookahead)
import Plutarch.Extra.Map (phandleMin)
import Plutarch.Extra.Maybe (ptraceIfNothing)
import Plutarch.Internal.PlutusType (PlutusType (pcon', pmatch'))
import Plutarch.Lift (
PConstantDecl (
PConstantRepr,
PConstanted,
pconstantFromRepr,
pconstantToRepr
),
PUnsafeLiftDecl (PLifted),
)
import Plutarch.List (pconvertLists)
import Plutarch.Unsafe (punsafeCoerce)
pmin ::
forall (a :: S -> Type) (s :: S).
POrd a =>
Term s (a :--> a :--> a)
pmin :: forall (a :: PType) (s :: S). POrd a => Term s (a :--> (a :--> a))
pmin = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s a
x Term s a
y ->
forall (s :: S) (a :: PType).
Term s (PBool :--> (a :--> (a :--> a)))
pif'
# (x #<= y)
# x
# y
pmax ::
forall (a :: S -> Type) (s :: S).
POrd a =>
Term s (a :--> a :--> a)
pmax :: forall (a :: PType) (s :: S). POrd a => Term s (a :--> (a :--> a))
pmax = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s a
x Term s a
y ->
forall (s :: S) (a :: PType).
Term s (PBool :--> (a :--> (a :--> a)))
pif'
# (x #<= y)
# y
# x
data POrdering (s :: S)
=
PLT
|
PEQ
|
PGT
deriving stock
(
Int -> POrdering s -> ShowS
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (s :: S). Int -> POrdering s -> ShowS
forall (s :: S). [POrdering s] -> ShowS
forall (s :: S). POrdering s -> String
showList :: [POrdering s] -> ShowS
$cshowList :: forall (s :: S). [POrdering s] -> ShowS
show :: POrdering s -> String
$cshow :: forall (s :: S). POrdering s -> String
showsPrec :: Int -> POrdering s -> ShowS
$cshowsPrec :: forall (s :: S). Int -> POrdering s -> ShowS
Show
,
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (POrdering s) x -> POrdering s
forall (s :: S) x. POrdering s -> Rep (POrdering s) x
$cto :: forall (s :: S) x. Rep (POrdering s) x -> POrdering s
$cfrom :: forall (s :: S) x. POrdering s -> Rep (POrdering s) x
Generic
)
deriving anyclass
(
forall (s :: S). Bool -> Term s POrdering -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
pshow' :: forall (s :: S). Bool -> Term s POrdering -> Term s PString
$cpshow' :: forall (s :: S). Bool -> Term s POrdering -> Term s PString
PShow
,
PEq POrdering
forall (s :: S).
Term s POrdering -> Term s POrdering -> Term s PBool
forall (t :: PType).
PEq t
-> (forall (s :: S). Term s t -> Term s t -> Term s PBool)
-> (forall (s :: S). Term s t -> Term s t -> Term s PBool)
-> PPartialOrd t
#< :: forall (s :: S).
Term s POrdering -> Term s POrdering -> Term s PBool
$c#< :: forall (s :: S).
Term s POrdering -> Term s POrdering -> Term s PBool
#<= :: forall (s :: S).
Term s POrdering -> Term s POrdering -> Term s PBool
$c#<= :: forall (s :: S).
Term s POrdering -> Term s POrdering -> Term s PBool
PPartialOrd
,
PPartialOrd POrdering
forall (t :: PType). PPartialOrd t -> POrd t
POrd
)
instance PUnsafeLiftDecl POrdering where
type PLifted POrdering = Ordering
instance PConstantDecl Ordering where
type PConstantRepr Ordering = Integer
type PConstanted Ordering = POrdering
pconstantToRepr :: Ordering -> PConstantRepr Ordering
pconstantToRepr = \case
Ordering
LT -> Integer
0
Ordering
EQ -> Integer
1
Ordering
GT -> Integer
2
pconstantFromRepr :: PConstantRepr Ordering -> Maybe Ordering
pconstantFromRepr = \case
PConstantRepr Ordering
0 -> forall (f :: Type -> Type) a. Applicative f => a -> f a
pure Ordering
LT
PConstantRepr Ordering
1 -> forall (f :: Type -> Type) a. Applicative f => a -> f a
pure Ordering
EQ
PConstantRepr Ordering
2 -> forall (f :: Type -> Type) a. Applicative f => a -> f a
pure Ordering
GT
PConstantRepr Ordering
_ -> forall a. Maybe a
Nothing
instance PlutusType POrdering where
type PInner POrdering = PInteger
pcon' :: forall (s :: S). POrdering s -> Term s (PInner POrdering)
pcon' = \case
POrdering s
PLT -> Term s PInteger
0
POrdering s
PEQ -> Term s PInteger
1
POrdering s
PGT -> Term s PInteger
2
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner POrdering) -> (POrdering s -> Term s b) -> Term s b
pmatch' Term s (PInner POrdering)
x POrdering s -> Term s b
f =
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(Term s (PInner POrdering)
x forall (t :: PType) (s :: S).
PEq t =>
Term s t -> Term s t -> Term s PBool
#== Term s PInteger
0)
(POrdering s -> Term s b
f forall (s :: S). POrdering s
PLT)
( forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(Term s (PInner POrdering)
x forall (t :: PType) (s :: S).
PEq t =>
Term s t -> Term s t -> Term s PBool
#== Term s PInteger
1)
(POrdering s -> Term s b
f forall (s :: S). POrdering s
PEQ)
(POrdering s -> Term s b
f forall (s :: S). POrdering s
PGT)
)
instance PEq POrdering where
Term s POrdering
x #== :: forall (s :: S).
Term s POrdering -> Term s POrdering -> Term s PBool
#== Term s POrdering
y = forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s POrdering
x forall (t :: PType) (s :: S).
PEq t =>
Term s t -> Term s t -> Term s PBool
#== forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s POrdering
y
instance Semigroup (Term s POrdering) where
Term s POrdering
x <> :: Term s POrdering -> Term s POrdering -> Term s POrdering
<> Term s POrdering
y = forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif (forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s POrdering
x forall (t :: PType) (s :: S).
PPartialOrd t =>
Term s t -> Term s t -> Term s PBool
#< Term s PInteger
2) (forall (s :: S) (a :: PType) (b :: PType). Term s a -> Term s b
punsafeCoerce forall a b. (a -> b) -> a -> b
$ forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s POrdering
x forall a. Num a => a -> a -> a
* forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s POrdering
y) Term s POrdering
x
stimes :: forall b. Integral b => b -> Term s POrdering -> Term s POrdering
stimes = forall b a. (Integral b, Monoid a) => b -> a -> a
stimesIdempotentMonoid
instance Monoid (Term s POrdering) where
mempty :: Term s POrdering
mempty = forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). POrdering s
PEQ
data PComparator (a :: S -> Type) (s :: S) = PComparator
{ forall (a :: PType) (s :: S).
PComparator a s -> Term s (a :--> (a :--> PBool))
pcomparatorEq :: Term s (a :--> a :--> PBool)
, forall (a :: PType) (s :: S).
PComparator a s -> Term s (a :--> (a :--> PBool))
pcomparatorLe :: Term s (a :--> a :--> PBool)
}
deriving stock
(
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (a :: PType) (s :: S) x.
Rep (PComparator a s) x -> PComparator a s
forall (a :: PType) (s :: S) x.
PComparator a s -> Rep (PComparator a s) x
$cto :: forall (a :: PType) (s :: S) x.
Rep (PComparator a s) x -> PComparator a s
$cfrom :: forall (a :: PType) (s :: S) x.
PComparator a s -> Rep (PComparator a s) x
Generic
)
deriving anyclass
(
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
forall (a :: PType) (s :: S).
PComparator a s -> Term s (PInner (PComparator a))
forall (a :: PType) (s :: S) (b :: PType).
Term s (PInner (PComparator a))
-> (PComparator a s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner (PComparator a))
-> (PComparator a s -> Term s b) -> Term s b
$cpmatch' :: forall (a :: PType) (s :: S) (b :: PType).
Term s (PInner (PComparator a))
-> (PComparator a s -> Term s b) -> Term s b
pcon' :: forall (s :: S). PComparator a s -> Term s (PInner (PComparator a))
$cpcon' :: forall (a :: PType) (s :: S).
PComparator a s -> Term s (PInner (PComparator a))
PlutusType
)
instance DerivePlutusType (PComparator a) where
type DPTStrat _ = PlutusTypeScott
pfromOrd ::
forall (a :: S -> Type) (s :: S).
(POrd a) =>
Term s (PComparator a)
pfromOrd :: forall (a :: PType) (s :: S). POrd a => Term s (PComparator a)
pfromOrd =
forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (a :: PType) (s :: S).
Term s (a :--> (a :--> PBool))
-> Term s (a :--> (a :--> PBool)) -> PComparator a s
PComparator (forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (t :: PType) (s :: S).
PEq t =>
Term s t -> Term s t -> Term s PBool
(#==)) forall a b. (a -> b) -> a -> b
$
forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic (forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (t :: PType) (s :: S).
PPartialOrd t =>
Term s t -> Term s t -> Term s PBool
(#<=))
pfromOrdBy ::
forall (a :: S -> Type) (b :: S -> Type) (s :: S).
(POrd a) =>
Term s ((b :--> a) :--> PComparator b)
pfromOrdBy :: forall (a :: PType) (b :: PType) (s :: S).
POrd a =>
Term s ((b :--> a) :--> PComparator b)
pfromOrdBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (b :--> a)
f ->
forall (a :: PType) (b :: PType) (s :: S).
Term s ((b :--> a) :--> (PComparator a :--> PComparator b))
pmapComparator forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (b :--> a)
f forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S). POrd a => Term s (PComparator a)
pfromOrd @a
pmapComparator ::
forall (a :: S -> Type) (b :: S -> Type) (s :: S).
Term s ((b :--> a) :--> PComparator a :--> PComparator b)
pmapComparator :: forall (a :: PType) (b :: PType) (s :: S).
Term s ((b :--> a) :--> (PComparator a :--> PComparator b))
pmapComparator = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (b :--> a)
f Term s (PComparator a)
cmp ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
peq Term s (a :--> (a :--> PBool))
ple) ->
forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (a :: PType) (s :: S).
Term s (a :--> (a :--> PBool))
-> Term s (a :--> (a :--> PBool)) -> PComparator a s
PComparator (forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s b
x Term s b
y -> Term s (a :--> (a :--> PBool))
peq forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# (Term s (b :--> a)
f forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s b
x) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# (Term s (b :--> a)
f forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s b
y)) forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$
\Term s b
x Term s b
y -> Term s (a :--> (a :--> PBool))
ple forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# (Term s (b :--> a)
f forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s b
x) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# (Term s (b :--> a)
f forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s b
y)
preverseComparator ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> PComparator a)
preverseComparator :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> PComparator a)
preverseComparator = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
peq Term s (a :--> (a :--> PBool))
ple) ->
forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (a :: PType) (s :: S).
Term s (a :--> (a :--> PBool))
-> Term s (a :--> (a :--> PBool)) -> PComparator a s
PComparator Term s (a :--> (a :--> PBool))
peq forall a b. (a -> b) -> a -> b
$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s a
x Term s a
y -> Term s (a :--> (a :--> PBool))
ple forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x
pcompareBy ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> a :--> a :--> POrdering)
pcompareBy :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> POrdering)))
pcompareBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s a
x Term s a
y ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
peq Term s (a :--> (a :--> PBool))
ple) ->
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(Term s (a :--> (a :--> PBool))
peq forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y)
(forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). POrdering s
PEQ)
( forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(Term s (a :--> (a :--> PBool))
ple forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y)
(forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). POrdering s
PLT)
(forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). POrdering s
PGT)
)
pequateBy ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> a :--> a :--> PBool)
pequateBy :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pequateBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s a
x Term s a
y ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
peq Term s (a :--> (a :--> PBool))
_) -> Term s (a :--> (a :--> PBool))
peq forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y
pleqBy ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> a :--> a :--> PBool)
pleqBy :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pleqBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s a
x Term s a
y ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
_ Term s (a :--> (a :--> PBool))
ple) -> Term s (a :--> (a :--> PBool))
ple forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y
plessThanBy ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> a :--> a :--> PBool)
plessThanBy :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
plessThanBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s a
x Term s a
y ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
peq Term s (a :--> (a :--> PBool))
ple) ->
(forall (s :: S). Term s (PBool :--> PBool)
pnot forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s (a :--> (a :--> PBool))
peq forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y) forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool
#&& (Term s (a :--> (a :--> PBool))
ple forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y)
pgeqBy ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> a :--> a :--> PBool)
pgeqBy :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pgeqBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s a
x Term s a
y ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
peq Term s (a :--> (a :--> PBool))
ple) ->
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(Term s (a :--> (a :--> PBool))
peq forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y)
(forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue)
(forall (s :: S). Term s (PBool :--> PBool)
pnot forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s (a :--> (a :--> PBool))
ple forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y)
pgreaterThanBy ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> a :--> a :--> PBool)
pgreaterThanBy :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pgreaterThanBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s a
x Term s a
y ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
peq Term s (a :--> (a :--> PBool))
ple) ->
forall (s :: S). Term s (PBool :--> PBool)
pnot forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ (Term s (a :--> (a :--> PBool))
peq forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y) forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool
#|| (Term s (a :--> (a :--> PBool))
ple forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y)
pminBy ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> a :--> a :--> a)
pminBy :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> a)))
pminBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s a
x Term s a
y ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
_ Term s (a :--> (a :--> PBool))
ple) ->
forall (s :: S) (a :: PType).
Term s (PBool :--> (a :--> (a :--> a)))
pif'
# (ple # x # y)
# x
# y
pmaxBy ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> a :--> a :--> a)
pmaxBy :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> a)))
pmaxBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s a
x Term s a
y ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PComparator a)
cmp forall a b. (a -> b) -> a -> b
$ \(PComparator Term s (a :--> (a :--> PBool))
_ Term s (a :--> (a :--> PBool))
ple) ->
forall (s :: S) (a :: PType).
Term s (PBool :--> (a :--> (a :--> a)))
pif'
# (ple # x # y)
# y
# x
pleqMapBy ::
forall (k :: S -> Type) (v :: S -> Type) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term s (PComparator v :--> PMap 'Sorted k v :--> PMap 'Sorted k v :--> PBool)
pleqMapBy :: forall (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term
s
(PComparator v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool)))
pleqMapBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator v)
cmp Term s (PMap 'Sorted k v)
m1 Term s (PMap 'Sorted k v)
m2 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
m1 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k1 Term s v
v1 Term s (PMap 'Sorted k v)
kv1 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
m2 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k2 Term s v
v2 Term s (PMap 'Sorted k v)
kv2 ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (k :: PType) (v :: PType) (s :: S).
(POrd k, PIsData k, PIsData v) =>
Term
s
((PComparator v :--> (v :--> (v :--> PBool)))
:--> (PComparator v
:--> (k
:--> (k
:--> (v
:--> (v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool))))))))
-> Term s (PComparator v :--> (v :--> (v :--> PBool)))
-> Term s (PComparator v)
-> Term s k
-> Term s k
-> Term s v
-> Term s v
-> Term s (PMap 'Sorted k v)
-> Term s (PMap 'Sorted k v)
-> Term s PBool
pcmpMap) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pleqBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv2
plessThanMapBy ::
forall (k :: S -> Type) (v :: S -> Type) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term s (PComparator v :--> PMap 'Sorted k v :--> PMap 'Sorted k v :--> PBool)
plessThanMapBy :: forall (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term
s
(PComparator v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool)))
plessThanMapBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator v)
cmp Term s (PMap 'Sorted k v)
m1 Term s (PMap 'Sorted k v)
m2 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
m1 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k1 Term s v
v1 Term s (PMap 'Sorted k v)
kv1 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
m2 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k2 Term s v
v2 Term s (PMap 'Sorted k v)
kv2 ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (k :: PType) (v :: PType) (s :: S).
(POrd k, PIsData k, PIsData v) =>
Term
s
((PComparator v :--> (v :--> (v :--> PBool)))
:--> (PComparator v
:--> (k
:--> (k
:--> (v
:--> (v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool))))))))
-> Term s (PComparator v :--> (v :--> (v :--> PBool)))
-> Term s (PComparator v)
-> Term s k
-> Term s k
-> Term s v
-> Term s v
-> Term s (PMap 'Sorted k v)
-> Term s (PMap 'Sorted k v)
-> Term s PBool
pcmpMap) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
plessThanBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv2
pgeqMapBy ::
forall (k :: S -> Type) (v :: S -> Type) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term s (PComparator v :--> PMap 'Sorted k v :--> PMap 'Sorted k v :--> PBool)
pgeqMapBy :: forall (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term
s
(PComparator v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool)))
pgeqMapBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator v)
cmp Term s (PMap 'Sorted k v)
m1 Term s (PMap 'Sorted k v)
m2 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
m1 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k1 Term s v
v1 Term s (PMap 'Sorted k v)
kv1 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
m2 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k2 Term s v
v2 Term s (PMap 'Sorted k v)
kv2 ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (k :: PType) (v :: PType) (s :: S).
(POrd k, PIsData k, PIsData v) =>
Term
s
((PComparator v :--> (v :--> (v :--> PBool)))
:--> (PComparator v
:--> (k
:--> (k
:--> (v
:--> (v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool))))))))
-> Term s (PComparator v :--> (v :--> (v :--> PBool)))
-> Term s (PComparator v)
-> Term s k
-> Term s k
-> Term s v
-> Term s v
-> Term s (PMap 'Sorted k v)
-> Term s (PMap 'Sorted k v)
-> Term s PBool
pcmpMap) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pgeqBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv2
pgreaterThanMapBy ::
forall (k :: S -> Type) (v :: S -> Type) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term s (PComparator v :--> PMap 'Sorted k v :--> PMap 'Sorted k v :--> PBool)
pgreaterThanMapBy :: forall (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term
s
(PComparator v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool)))
pgreaterThanMapBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator v)
cmp Term s (PMap 'Sorted k v)
m1 Term s (PMap 'Sorted k v)
m2 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
m1 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k1 Term s v
v1 Term s (PMap 'Sorted k v)
kv1 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
m2 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k2 Term s v
v2 Term s (PMap 'Sorted k v)
kv2 ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (k :: PType) (v :: PType) (s :: S).
(POrd k, PIsData k, PIsData v) =>
Term
s
((PComparator v :--> (v :--> (v :--> PBool)))
:--> (PComparator v
:--> (k
:--> (k
:--> (v
:--> (v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool))))))))
-> Term s (PComparator v :--> (v :--> (v :--> PBool)))
-> Term s (PComparator v)
-> Term s k
-> Term s k
-> Term s v
-> Term s v
-> Term s (PMap 'Sorted k v)
-> Term s (PMap 'Sorted k v)
-> Term s PBool
pcmpMap) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pgreaterThanBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv2
pleqValueBy ::
forall (amount :: AmountGuarantees) (s :: S).
Term s (PComparator PInteger :--> PValue 'Sorted amount :--> PValue 'Sorted amount :--> PBool)
pleqValueBy :: forall (amount :: AmountGuarantees) (s :: S).
Term
s
(PComparator PInteger
:--> (PValue 'Sorted amount
:--> (PValue 'Sorted amount :--> PBool)))
pleqValueBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator PInteger)
cmp Term s (PValue 'Sorted amount)
pval Term s (PValue 'Sorted amount)
pval' ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin (forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s (PValue 'Sorted amount)
pval) (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k1 Term s (PMap 'Sorted PTokenName PInteger)
v1 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin (forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s (PValue 'Sorted amount)
pval') (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k2 Term s (PMap 'Sorted PTokenName PInteger)
v2 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2 ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (s :: S).
Term
s
((PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
:--> (PComparator PInteger
:--> (PCurrencySymbol
:--> (PCurrencySymbol
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap
'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> (PMap
'Sorted
PCurrencySymbol
(PMap 'Sorted PTokenName PInteger)
:--> PBool))))))))
-> Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
-> Term s (PComparator PInteger)
-> Term s PCurrencySymbol
-> Term s PCurrencySymbol
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term s PBool
pcmpValue) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term
s
(PComparator v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool)))
pleqMapBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator PInteger)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2
plessThanValueBy ::
forall (amount :: AmountGuarantees) (s :: S).
Term s (PComparator PInteger :--> PValue 'Sorted amount :--> PValue 'Sorted amount :--> PBool)
plessThanValueBy :: forall (amount :: AmountGuarantees) (s :: S).
Term
s
(PComparator PInteger
:--> (PValue 'Sorted amount
:--> (PValue 'Sorted amount :--> PBool)))
plessThanValueBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator PInteger)
cmp Term s (PValue 'Sorted amount)
pval Term s (PValue 'Sorted amount)
pval' ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin (forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s (PValue 'Sorted amount)
pval) (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k1 Term s (PMap 'Sorted PTokenName PInteger)
v1 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin (forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s (PValue 'Sorted amount)
pval') (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k2 Term s (PMap 'Sorted PTokenName PInteger)
v2 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2 ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (s :: S).
Term
s
((PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
:--> (PComparator PInteger
:--> (PCurrencySymbol
:--> (PCurrencySymbol
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap
'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> (PMap
'Sorted
PCurrencySymbol
(PMap 'Sorted PTokenName PInteger)
:--> PBool))))))))
-> Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
-> Term s (PComparator PInteger)
-> Term s PCurrencySymbol
-> Term s PCurrencySymbol
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term s PBool
pcmpValue) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term
s
(PComparator v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool)))
plessThanMapBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator PInteger)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2
pgeqValueBy ::
forall (amount :: AmountGuarantees) (s :: S).
Term s (PComparator PInteger :--> PValue 'Sorted amount :--> PValue 'Sorted amount :--> PBool)
pgeqValueBy :: forall (amount :: AmountGuarantees) (s :: S).
Term
s
(PComparator PInteger
:--> (PValue 'Sorted amount
:--> (PValue 'Sorted amount :--> PBool)))
pgeqValueBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator PInteger)
cmp Term s (PValue 'Sorted amount)
pval Term s (PValue 'Sorted amount)
pval' ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin (forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s (PValue 'Sorted amount)
pval) (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k1 Term s (PMap 'Sorted PTokenName PInteger)
v1 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin (forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s (PValue 'Sorted amount)
pval') (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k2 Term s (PMap 'Sorted PTokenName PInteger)
v2 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2 ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (s :: S).
Term
s
((PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
:--> (PComparator PInteger
:--> (PCurrencySymbol
:--> (PCurrencySymbol
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap
'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> (PMap
'Sorted
PCurrencySymbol
(PMap 'Sorted PTokenName PInteger)
:--> PBool))))))))
-> Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
-> Term s (PComparator PInteger)
-> Term s PCurrencySymbol
-> Term s PCurrencySymbol
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term s PBool
pcmpValue) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term
s
(PComparator v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool)))
pgeqMapBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator PInteger)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2
pgreaterThanValueBy ::
forall (amount :: AmountGuarantees) (s :: S).
Term s (PComparator PInteger :--> PValue 'Sorted amount :--> PValue 'Sorted amount :--> PBool)
pgreaterThanValueBy :: forall (amount :: AmountGuarantees) (s :: S).
Term
s
(PComparator PInteger
:--> (PValue 'Sorted amount
:--> (PValue 'Sorted amount :--> PBool)))
pgreaterThanValueBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator PInteger)
cmp Term s (PValue 'Sorted amount)
pval Term s (PValue 'Sorted amount)
pval' ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin (forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s (PValue 'Sorted amount)
pval) (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k1 Term s (PMap 'Sorted PTokenName PInteger)
v1 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin (forall (s :: S) (a :: PType). Term s a -> Term s (PInner a)
pto Term s (PValue 'Sorted amount)
pval') (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k2 Term s (PMap 'Sorted PTokenName PInteger)
v2 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2 ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall (s :: S).
Term
s
((PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
:--> (PComparator PInteger
:--> (PCurrencySymbol
:--> (PCurrencySymbol
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap
'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> (PMap
'Sorted
PCurrencySymbol
(PMap 'Sorted PTokenName PInteger)
:--> PBool))))))))
-> Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
-> Term s (PComparator PInteger)
-> Term s PCurrencySymbol
-> Term s PCurrencySymbol
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term s PBool
pcmpValue) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v, POrd k) =>
Term
s
(PComparator v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool)))
pgreaterThanMapBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator PInteger)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2
pisSortedBy ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> ell a :--> PBool)
pisSortedBy :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> PBool))
pisSortedBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp ->
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
(Term s (a :--> (ell a :--> r))
-> Term s a -> Term s a -> Term s (ell a) -> Term s r)
-> (Term s a -> Term s r) -> Term s r -> Term s (ell a :--> r)
precListLookahead (forall (s' :: S).
Term s' (PComparator a)
-> Term s' (a :--> (ell a :--> PBool))
-> Term s' a
-> Term s' a
-> Term s' (ell a)
-> Term s' PBool
go Term s (PComparator a)
cmp) (forall a b. a -> b -> a
const (forall (p :: PType) (s :: S). PLift p => PLifted p -> Term s p
pconstant Bool
True)) (forall (p :: PType) (s :: S). PLift p => PLifted p -> Term s p
pconstant Bool
True)
where
go ::
forall (s' :: S).
Term s' (PComparator a) ->
Term s' (a :--> ell a :--> PBool) ->
Term s' a ->
Term s' a ->
Term s' (ell a) ->
Term s' PBool
go :: forall (s' :: S).
Term s' (PComparator a)
-> Term s' (a :--> (ell a :--> PBool))
-> Term s' a
-> Term s' a
-> Term s' (ell a)
-> Term s' PBool
go Term s' (PComparator a)
cmp Term s' (a :--> (ell a :--> PBool))
self Term s' a
h Term s' a
peek Term s' (ell a)
rest =
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pleqBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
h forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
peek)
(Term s' (a :--> (ell a :--> PBool))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
peek forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (ell a)
rest)
(forall (p :: PType) (s :: S). PLift p => PLifted p -> Term s p
pconstant Bool
False)
pallUnique ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> PMaybe PBool)
pallUnique :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> PMaybe PBool)
pallUnique = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam (forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> PMaybe PBool))
pallUniqueBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S). POrd a => Term s (PComparator a)
pfromOrd @a forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#)
pallUniqueBy ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> ell a :--> PMaybe PBool)
pallUniqueBy :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> PMaybe PBool))
pallUniqueBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp ->
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
(Term s (a :--> (ell a :--> r))
-> Term s a -> Term s a -> Term s (ell a) -> Term s r)
-> (Term s a -> Term s r) -> Term s r -> Term s (ell a :--> r)
precListLookahead (forall (s' :: S).
Term s' (PComparator a)
-> Term s' (a :--> (ell a :--> PMaybe PBool))
-> Term s' a
-> Term s' a
-> Term s' (ell a)
-> Term s' (PMaybe PBool)
go Term s (PComparator a)
cmp) (forall a b. a -> b -> a
const forall (s' :: S). Term s' (PMaybe PBool)
success) forall (s' :: S). Term s' (PMaybe PBool)
success
where
success :: forall (s' :: S). Term s' (PMaybe PBool)
success :: forall (s' :: S). Term s' (PMaybe PBool)
success = forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (a :: PType) (s :: S). Term s a -> PMaybe a s
PJust forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: PType) (s :: S). PLift p => PLifted p -> Term s p
pconstant forall a b. (a -> b) -> a -> b
$ Bool
True
go ::
forall (s' :: S).
Term s' (PComparator a) ->
Term s' (a :--> ell a :--> PMaybe PBool) ->
Term s' a ->
Term s' a ->
Term s' (ell a) ->
Term s' (PMaybe PBool)
go :: forall (s' :: S).
Term s' (PComparator a)
-> Term s' (a :--> (ell a :--> PMaybe PBool))
-> Term s' a
-> Term s' a
-> Term s' (ell a)
-> Term s' (PMaybe PBool)
go Term s' (PComparator a)
cmp Term s' (a :--> (ell a :--> PMaybe PBool))
self Term s' a
h Term s' a
peek Term s' (ell a)
t = forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch (forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> POrdering)))
pcompareBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
h forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
peek) forall a b. (a -> b) -> a -> b
$ \case
POrdering s'
PLT -> Term s' (a :--> (ell a :--> PMaybe PBool))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
peek forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (ell a)
t
POrdering s'
PEQ -> forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (a :: PType) (s :: S). Term s a -> PMaybe a s
PJust forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: PType) (s :: S). PLift p => PLifted p -> Term s p
pconstant forall a b. (a -> b) -> a -> b
$ Bool
False
POrdering s'
PGT -> forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (a :: PType) (s :: S). PMaybe a s
PNothing
ptryAllUnique ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> PBool)
ptryAllUnique :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> PBool)
ptryAllUnique = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam (forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> PBool))
ptryAllUniqueBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S). POrd a => Term s (PComparator a)
pfromOrd @a forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#)
ptryAllUniqueBy ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> ell a :--> PBool)
ptryAllUniqueBy :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> PBool))
ptryAllUniqueBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s (ell a)
xs ->
forall (a :: PType) (s :: S).
Term s PString -> Term s (PMaybe a) -> Term s a
ptraceIfNothing Term s PString
"ptryAllUniqueBy: argument is unordered" forall a b. (a -> b) -> a -> b
$ forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> PMaybe PBool))
pallUniqueBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (ell a)
xs
ptryMerge ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> ell a :--> ell a)
ptryMerge :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> (ell a :--> ell a))
ptryMerge = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam (forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> (ell a :--> ell a)))
ptryMergeBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S). POrd a => Term s (PComparator a)
pfromOrd @a forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#)
ptryMergeBy ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> ell a :--> ell a :--> ell a)
ptryMergeBy :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> (ell a :--> ell a)))
ptryMergeBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s (ell a)
xs Term s (ell a)
ys ->
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (ell a)
xs (forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> ell a))
passertSorted forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (ell a)
ys) forall a b. (a -> b) -> a -> b
$ \Term s a
x Term s (ell a)
xs' ->
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (ell a)
ys (forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> ell a))
passertSorted forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (ell a)
xs) forall a b. (a -> b) -> a -> b
$ \Term s a
y Term s (ell a)
ys' ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ forall (s' :: S).
Term s' (PComparator a)
-> Term s' (a :--> (ell a :--> (a :--> (ell a :--> ell a))))
-> Term s' a
-> Term s' (ell a)
-> Term s' a
-> Term s' (ell a)
-> Term s' (ell a)
go Term s (PComparator a)
cmp) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (ell a)
xs' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (ell a)
ys'
where
go ::
forall (s' :: S).
Term s' (PComparator a) ->
Term s' (a :--> ell a :--> a :--> ell a :--> ell a) ->
Term s' a ->
Term s' (ell a) ->
Term s' a ->
Term s' (ell a) ->
Term s' (ell a)
go :: forall (s' :: S).
Term s' (PComparator a)
-> Term s' (a :--> (ell a :--> (a :--> (ell a :--> ell a))))
-> Term s' a
-> Term s' (ell a)
-> Term s' a
-> Term s' (ell a)
-> Term s' (ell a)
go Term s' (PComparator a)
cmp Term s' (a :--> (ell a :--> (a :--> (ell a :--> ell a))))
self Term s' a
x Term s' (ell a)
xs Term s' a
y Term s' (ell a)
ys =
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pleqBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
y)
( forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s' (ell a)
xs (forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (a :--> (ell a :--> ell a)))
passertSortedLookahead forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
y forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (ell a)
ys) forall a b. (a -> b) -> a -> b
$ \Term s' a
x' Term s' (ell a)
xs' ->
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pleqBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
x')
(Term s' (a :--> (ell a :--> (a :--> (ell a :--> ell a))))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (ell a)
xs' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
y forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (ell a)
ys)
forall (a :: PType) (s :: S). Term s a
unorderedError
)
( forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
y forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s' (ell a)
ys (forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (a :--> (ell a :--> ell a)))
passertSortedLookahead forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (ell a)
xs) forall a b. (a -> b) -> a -> b
$ \Term s' a
y' Term s' (ell a)
ys' ->
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pleqBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
y forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
y')
(Term s' (a :--> (ell a :--> (a :--> (ell a :--> ell a))))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (ell a)
xs forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
y' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (ell a)
ys')
forall (a :: PType) (s :: S). Term s a
unorderedError
)
psort ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> ell a)
psort :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> ell a)
psort = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam (forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> ell a))
psortBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S). POrd a => Term s (PComparator a)
pfromOrd @a forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#)
psortBy ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> ell a :--> ell a)
psortBy :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> ell a))
psortBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s (ell a)
xs ->
forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a)
-> (forall (s' :: S).
Term s' (PComparator a) -> Term s' (PList a) -> Term s' (PList a))
-> (forall (s' :: S).
Term s' (PComparator a)
-> Term s' (PList a) -> Term s' (PList a) -> Term s' (PList a))
-> Term s (PList (PList a) :--> ell a)
pmergeAllUnsafe
Term s (PComparator a)
cmp
(forall a b. a -> b -> a
const forall a. a -> a
id)
forall (a :: PType) (s :: S).
Term s (PComparator a)
-> Term s (PList a) -> Term s (PList a) -> Term s (PList a)
pmergeUnsafe
#$ pmergeStart_2_3_4
# cmp
# xs
pnubSort ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> ell a)
pnubSort :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(POrd a, PElemConstraint ell a, PListLike ell) =>
Term s (ell a :--> ell a)
pnubSort = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam (forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> ell a))
pnubSortBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S). POrd a => Term s (PComparator a)
pfromOrd @a forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#)
pnubSortBy ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> ell a :--> ell a)
pnubSortBy :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> ell a))
pnubSortBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s (ell a)
xs ->
forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a)
-> (forall (s' :: S).
Term s' (PComparator a) -> Term s' (PList a) -> Term s' (PList a))
-> (forall (s' :: S).
Term s' (PComparator a)
-> Term s' (PList a) -> Term s' (PList a) -> Term s' (PList a))
-> Term s (PList (PList a) :--> ell a)
pmergeAllUnsafe
Term s (PComparator a)
cmp
(\Term s' (PComparator a)
cmp' Term s' (PList a)
xs' -> forall (a :: PType) (s :: S).
Term s (PComparator a :--> (PList a :--> PList a))
pnubUnsafe forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PComparator a)
cmp' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PList a)
xs')
forall (a :: PType) (s :: S).
Term s (PComparator a)
-> Term s (PList a) -> Term s (PList a) -> Term s (PList a)
pmergeUnsafeNoDupes
#$ pmergeStart_2_3_4
# cmp
# xs
pmergeAllUnsafe ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a) ->
(forall (s' :: S). Term s' (PComparator a) -> Term s' (PList a) -> Term s' (PList a)) ->
(forall (s' :: S). Term s' (PComparator a) -> Term s' (PList a) -> Term s' (PList a) -> Term s' (PList a)) ->
Term s (PList (PList a) :--> ell a)
pmergeAllUnsafe :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a)
-> (forall (s' :: S).
Term s' (PComparator a) -> Term s' (PList a) -> Term s' (PList a))
-> (forall (s' :: S).
Term s' (PComparator a)
-> Term s' (PList a) -> Term s' (PList a) -> Term s' (PList a))
-> Term s (PList (PList a) :--> ell a)
pmergeAllUnsafe Term s (PComparator a)
cmp forall (s' :: S).
Term s' (PComparator a) -> Term s' (PList a) -> Term s' (PList a)
whenSingleton forall (s' :: S).
Term s' (PComparator a)
-> Term s' (PList a) -> Term s' (PList a) -> Term s' (PList a)
whenMerging = forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PList (PList a))
xs -> forall (f :: PType -> PType) (g :: PType -> PType) (a :: PType)
(s :: S).
(PIsListLike f a, PIsListLike g a) =>
Term s (f a :--> g a)
pconvertLists forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam Term s (PList (PList a) :--> PList a)
-> Term s (PList (PList a)) -> Term s (PList a)
go forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList (PList a))
xs
where
go ::
Term s (PList (PList a) :--> PList a) ->
Term s (PList (PList a)) ->
Term s (PList a)
go :: Term s (PList (PList a) :--> PList a)
-> Term s (PList (PList a)) -> Term s (PList a)
go Term s (PList (PList a) :--> PList a)
self Term s (PList (PList a))
xs = forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (PList (PList a))
xs forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (list a)
pnil forall a b. (a -> b) -> a -> b
$ \Term s (PList a)
y Term s (PList (PList a))
ys ->
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (PList (PList a))
ys (forall (s' :: S).
Term s' (PComparator a) -> Term s' (PList a) -> Term s' (PList a)
whenSingleton Term s (PComparator a)
cmp Term s (PList a)
y) forall a b. (a -> b) -> a -> b
$ \Term s (PList a)
_ Term s (PList (PList a))
_ ->
Term s (PList (PList a) :--> PList a)
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s (PList (PList a) :--> PList (PList a))
pmergePairs forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList (PList a))
xs
pmergePairs :: Term s (PList (PList a) :--> PList (PList a))
pmergePairs :: Term s (PList (PList a) :--> PList (PList a))
pmergePairs = forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PList (PList a) :--> PList (PList a))
self Term s (PList (PList a))
xs ->
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (PList (PList a))
xs forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (list a)
pnil forall a b. (a -> b) -> a -> b
$ \Term s (PList a)
x' Term s (PList (PList a))
xs' ->
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (PList (PList a))
xs' Term s (PList (PList a))
xs forall a b. (a -> b) -> a -> b
$ \Term s (PList a)
x'' Term s (PList (PList a))
xs'' ->
forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (s' :: S).
Term s' (PComparator a)
-> Term s' (PList a) -> Term s' (PList a) -> Term s' (PList a)
whenMerging Term s (PComparator a)
cmp Term s (PList a)
x' Term s (PList a)
x'' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s (PList (PList a) :--> PList (PList a))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList (PList a))
xs''
pmergeUnsafe ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a) ->
Term s (PList a) ->
Term s (PList a) ->
Term s (PList a)
pmergeUnsafe :: forall (a :: PType) (s :: S).
Term s (PComparator a)
-> Term s (PList a) -> Term s (PList a) -> Term s (PList a)
pmergeUnsafe Term s (PComparator a)
cmp Term s (PList a)
xs Term s (PList a)
ys =
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (PList a)
xs Term s (PList a)
ys forall a b. (a -> b) -> a -> b
$ \Term s a
x' Term s (PList a)
xs' ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ Term s (a :--> (PList a :--> (PList a :--> PList a)))
-> Term s a
-> Term s (PList a)
-> Term s (PList a)
-> Term s (PList a)
go) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
xs' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
ys
where
go ::
Term s (a :--> PList a :--> PList a :--> PList a) ->
Term s a ->
Term s (PList a) ->
Term s (PList a) ->
Term s (PList a)
go :: Term s (a :--> (PList a :--> (PList a :--> PList a)))
-> Term s a
-> Term s (PList a)
-> Term s (PList a)
-> Term s (PList a)
go Term s (a :--> (PList a :--> (PList a :--> PList a)))
self Term s a
x' Term s (PList a)
xs' Term s (PList a)
ys' =
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (PList a)
ys' (forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
xs') forall a b. (a -> b) -> a -> b
$ \Term s a
y'' Term s (PList a)
ys'' ->
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pleqBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y'')
(forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s (a :--> (PList a :--> (PList a :--> PList a)))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y'' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
ys'' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
xs')
(forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y'' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s (a :--> (PList a :--> (PList a :--> PList a)))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
xs' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
ys'')
pmergeUnsafeNoDupes ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a) ->
Term s (PList a) ->
Term s (PList a) ->
Term s (PList a)
pmergeUnsafeNoDupes :: forall (a :: PType) (s :: S).
Term s (PComparator a)
-> Term s (PList a) -> Term s (PList a) -> Term s (PList a)
pmergeUnsafeNoDupes Term s (PComparator a)
cmp Term s (PList a)
xs Term s (PList a)
ys =
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (PList a)
xs (forall (a :: PType) (s :: S).
Term s (PComparator a :--> (PList a :--> PList a))
pnubUnsafe forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
ys) forall a b. (a -> b) -> a -> b
$ \Term s a
x' Term s (PList a)
xs' ->
(forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ Term s (a :--> (PList a :--> (PList a :--> PList a)))
-> Term s a
-> Term s (PList a)
-> Term s (PList a)
-> Term s (PList a)
go) forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
xs' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
ys
where
go ::
Term s (a :--> PList a :--> PList a :--> PList a) ->
Term s a ->
Term s (PList a) ->
Term s (PList a) ->
Term s (PList a)
go :: Term s (a :--> (PList a :--> (PList a :--> PList a)))
-> Term s a
-> Term s (PList a)
-> Term s (PList a)
-> Term s (PList a)
go Term s (a :--> (PList a :--> (PList a :--> PList a)))
self Term s a
x' Term s (PList a)
xs' Term s (PList a)
ys' =
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (PList a)
ys' (forall (a :: PType) (s :: S).
Term s (PComparator a :--> (PList a :--> PList a))
pnubUnsafe forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
xs') forall a b. (a -> b) -> a -> b
$ \Term s a
y'' Term s (PList a)
ys'' ->
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch (forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> POrdering)))
pcompareBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y'') forall a b. (a -> b) -> a -> b
$ \case
POrdering s
PLT -> forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s (a :--> (PList a :--> (PList a :--> PList a)))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y'' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
ys'' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
xs'
POrdering s
PEQ -> Term s (a :--> (PList a :--> (PList a :--> PList a)))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y'' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
ys'' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
xs'
POrdering s
PGT -> forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y'' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s (a :--> (PList a :--> (PList a :--> PList a)))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
xs' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PList a)
ys''
pnubUnsafe ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a :--> PList a :--> PList a)
pnubUnsafe :: forall (a :: PType) (s :: S).
Term s (PComparator a :--> (PList a :--> PList a))
pnubUnsafe = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp ->
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
(Term s (a :--> (ell a :--> r))
-> Term s a -> Term s a -> Term s (ell a) -> Term s r)
-> (Term s a -> Term s r) -> Term s r -> Term s (ell a :--> r)
precListLookahead (forall (s' :: S).
Term s' (PComparator a)
-> Term s' (a :--> (PList a :--> PList a))
-> Term s' a
-> Term s' a
-> Term s' (PList a)
-> Term s' (PList a)
go Term s (PComparator a)
cmp) (forall (list :: PType -> PType) (a :: PType) (s :: S).
PIsListLike list a =>
Term s (a :--> list a)
psingleton forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#) forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (list a)
pnil
where
go ::
forall (s' :: S).
Term s' (PComparator a) ->
Term s' (a :--> PList a :--> PList a) ->
Term s' a ->
Term s' a ->
Term s' (PList a) ->
Term s' (PList a)
go :: forall (s' :: S).
Term s' (PComparator a)
-> Term s' (a :--> (PList a :--> PList a))
-> Term s' a
-> Term s' a
-> Term s' (PList a)
-> Term s' (PList a)
go Term s' (PComparator a)
cmp Term s' (a :--> (PList a :--> PList a))
self Term s' a
h Term s' a
peek Term s' (PList a)
t =
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pequateBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
h forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
peek)
(Term s' (a :--> (PList a :--> PList a))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
peek forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PList a)
t)
(forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
h forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s' (a :--> (PList a :--> PList a))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' a
peek forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s' (PList a)
t)
pmergeStart_2_3_4 ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> ell a :--> PList (PList a))
pmergeStart_2_3_4 :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> PList (PList a)))
pmergeStart_2_3_4 = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall (s :: S) (a :: PType) (b :: PType).
Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b))
pfix forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a :--> (ell a :--> PList (PList a)))
self Term s (PComparator a)
cmp ->
forall (r :: PType) (s' :: S).
Term s' r
-> (Term s' a -> Term s' (ell a) -> Term s' r)
-> Term s' (ell a)
-> Term s' r
pmatchList forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (list a)
pnil forall a b. (a -> b) -> a -> b
$
\Term s a
_0 -> forall (r :: PType) (s' :: S).
Term s' r
-> (Term s' a -> Term s' (ell a) -> Term s' r)
-> Term s' (ell a)
-> Term s' r
pmatchList (forall (a :: PType) (f :: Type -> Type) (s :: S).
Foldable f =>
f (Term s a) -> Term s (PList a)
plist [forall (a :: PType) (s :: S). Term s a -> Term s (PList a)
psing Term s a
_0]) forall a b. (a -> b) -> a -> b
$
\Term s a
_1 -> forall (r :: PType) (s' :: S).
Term s' r
-> (Term s' a -> Term s' (ell a) -> Term s' r)
-> Term s' (ell a)
-> Term s' r
pmatchList (forall (a :: PType) (f :: Type -> Type) (s :: S).
Foldable f =>
f (Term s a) -> Term s (PList a)
plist [forall (a :: PType) (s :: S).
Term s (PComparator a) -> Term s a -> Term s a -> Term s (PList a)
psort2 Term s (PComparator a)
cmp Term s a
_0 Term s a
_1]) forall a b. (a -> b) -> a -> b
$
\Term s a
_2 -> forall (r :: PType) (s' :: S).
Term s' r
-> (Term s' a -> Term s' (ell a) -> Term s' r)
-> Term s' (ell a)
-> Term s' r
pmatchList (forall (a :: PType) (f :: Type -> Type) (s :: S).
Foldable f =>
f (Term s a) -> Term s (PList a)
plist [forall (a :: PType) (s :: S).
Term s (PComparator a)
-> Term s a -> Term s a -> Term s a -> Term s (PList a)
psort3 Term s (PComparator a)
cmp Term s a
_0 Term s a
_1 Term s a
_2]) forall a b. (a -> b) -> a -> b
$
\Term s a
_3 Term s (ell a)
rest -> forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall a b. (a -> b) -> a -> b
$ forall (a :: PType) (s :: S).
Term s a -> Term s (PList a) -> PList a s
PSCons (forall (a :: PType) (s :: S).
Term s (PComparator a)
-> Term s a -> Term s a -> Term s a -> Term s a -> Term s (PList a)
psort4 Term s (PComparator a)
cmp Term s a
_0 Term s a
_1 Term s a
_2 Term s a
_3) (Term s (PComparator a :--> (ell a :--> PList (PList a)))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (ell a)
rest)
where
pmatchList ::
forall (r :: S -> Type) (s' :: S).
Term s' r ->
(Term s' a -> Term s' (ell a) -> Term s' r) ->
Term s' (ell a) ->
Term s' r
pmatchList :: forall (r :: PType) (s' :: S).
Term s' r
-> (Term s' a -> Term s' (ell a) -> Term s' r)
-> Term s' (ell a)
-> Term s' r
pmatchList = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall (list :: PType -> PType) (a :: PType) (s :: S) (r :: PType).
(PListLike list, PElemConstraint list a) =>
(Term s a -> Term s (list a) -> Term s r)
-> Term s r -> Term s (list a) -> Term s r
pelimList
plist ::
forall (a :: S -> Type) (f :: Type -> Type) (s :: S).
(Foldable f) =>
f (Term s a) ->
Term s (PList a)
plist :: forall (a :: PType) (f :: Type -> Type) (s :: S).
Foldable f =>
f (Term s a) -> Term s (PList a)
plist = forall (t :: Type -> Type) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (\Term s a
x -> forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (a :: PType) (s :: S).
Term s a -> Term s (PList a) -> PList a s
PSCons Term s a
x) (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (a :: PType) (s :: S). PList a s
PSNil)
psing ::
forall (a :: S -> Type) (s :: S).
Term s a ->
Term s (PList a)
psing :: forall (a :: PType) (s :: S). Term s a -> Term s (PList a)
psing Term s a
x = forall (a :: PType) (f :: Type -> Type) (s :: S).
Foldable f =>
f (Term s a) -> Term s (PList a)
plist [Term s a
x]
psort2 ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a) ->
Term s a ->
Term s a ->
Term s (PList a)
psort2 :: forall (a :: PType) (s :: S).
Term s (PComparator a) -> Term s a -> Term s a -> Term s (PList a)
psort2 Term s (PComparator a)
cmp Term s a
_0 Term s a
_1 =
forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp Term s a
_0 Term s a
_1 forall a b. (a -> b) -> a -> b
$ \Term s a
_0 Term s a
_1 ->
forall (a :: PType) (f :: Type -> Type) (s :: S).
Foldable f =>
f (Term s a) -> Term s (PList a)
plist [Term s a
_0, Term s a
_1]
psort3 ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a) ->
Term s a ->
Term s a ->
Term s a ->
Term s (PList a)
psort3 :: forall (a :: PType) (s :: S).
Term s (PComparator a)
-> Term s a -> Term s a -> Term s a -> Term s (PList a)
psort3 Term s (PComparator a)
cmp Term s a
_0 Term s a
_1 Term s a
_2 =
forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp Term s a
_0 Term s a
_2 forall a b. (a -> b) -> a -> b
$ \Term s a
_0 Term s a
_2 ->
forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp Term s a
_0 Term s a
_1 forall a b. (a -> b) -> a -> b
$ \Term s a
_0 Term s a
_1 ->
forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp Term s a
_1 Term s a
_2 forall a b. (a -> b) -> a -> b
$ \Term s a
_1 Term s a
_2 ->
forall (a :: PType) (f :: Type -> Type) (s :: S).
Foldable f =>
f (Term s a) -> Term s (PList a)
plist [Term s a
_0, Term s a
_1, Term s a
_2]
psort4 ::
forall (a :: S -> Type) (s :: S).
Term s (PComparator a) ->
Term s a ->
Term s a ->
Term s a ->
Term s a ->
Term s (PList a)
psort4 :: forall (a :: PType) (s :: S).
Term s (PComparator a)
-> Term s a -> Term s a -> Term s a -> Term s a -> Term s (PList a)
psort4 Term s (PComparator a)
cmp Term s a
_0 Term s a
_1 Term s a
_2 Term s a
_3 =
forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp Term s a
_0 Term s a
_2 forall a b. (a -> b) -> a -> b
$ \Term s a
_0 Term s a
_2 ->
forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp Term s a
_1 Term s a
_3 forall a b. (a -> b) -> a -> b
$ \Term s a
_1 Term s a
_3 ->
(\Term
s (PComparator a :--> (a :--> (a :--> (a :--> (a :--> PList a)))))
f -> Term
s (PComparator a :--> (a :--> (a :--> (a :--> (a :--> PList a)))))
f forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
_0 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
_1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
_2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
_3) forall a b. (a -> b) -> a -> b
$
forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$
\Term s (PComparator a)
cmp' Term s a
_0 Term s a
_1 Term s a
_2 Term s a
_3 ->
forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp' Term s a
_0 Term s a
_1 forall a b. (a -> b) -> a -> b
$ \Term s a
_0 Term s a
_1 ->
forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp' Term s a
_2 Term s a
_3 forall a b. (a -> b) -> a -> b
$ \Term s a
_2 Term s a
_3 ->
forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp' Term s a
_1 Term s a
_2 forall a b. (a -> b) -> a -> b
$ \Term s a
_1 Term s a
_2 ->
forall (a :: PType) (f :: Type -> Type) (s :: S).
Foldable f =>
f (Term s a) -> Term s (PList a)
plist [Term s a
_0, Term s a
_1, Term s a
_2, Term s a
_3]
pswap ::
forall (a :: S -> Type) (r :: S -> Type) (s :: S).
Term s (PComparator a) ->
Term s a ->
Term s a ->
(Term s a -> Term s a -> Term s r) ->
Term s r
pswap :: forall (a :: PType) (r :: PType) (s :: S).
Term s (PComparator a)
-> Term s a
-> Term s a
-> (Term s a -> Term s a -> Term s r)
-> Term s r
pswap Term s (PComparator a)
cmp Term s a
x Term s a
y Term s a -> Term s a -> Term s r
cont = forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif (forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pleqBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
y) (Term s a -> Term s a -> Term s r
cont Term s a
x Term s a
y) (Term s a -> Term s a -> Term s r
cont Term s a
y Term s a
x)
passertSorted ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> ell a :--> ell a)
passertSorted :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> ell a))
passertSorted = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s (ell a)
xs ->
forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (ell a)
xs Term s (ell a)
xs forall a b. (a -> b) -> a -> b
$ \Term s a
x' Term s (ell a)
xs' ->
forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (a :--> (ell a :--> ell a)))
passertSortedLookahead forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (ell a)
xs'
passertSortedLookahead ::
forall (a :: S -> Type) (ell :: (S -> Type) -> S -> Type) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> a :--> ell a :--> ell a)
passertSortedLookahead :: forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (a :--> (ell a :--> ell a)))
passertSortedLookahead = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
cmp Term s a
x Term s (ell a)
xs ->
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(forall (a :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (PComparator a :--> (ell a :--> PBool))
pisSortedBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (ell a)
xs)
( forall (a :: PType) (r :: PType) (ell :: PType -> PType) (s :: S).
(PElemConstraint ell a, PListLike ell) =>
Term s (ell a)
-> Term s r -> (Term s a -> Term s (ell a) -> Term s r) -> Term s r
phandleList Term s (ell a)
xs (forall (list :: PType -> PType) (a :: PType) (s :: S).
PIsListLike list a =>
Term s (a :--> list a)
psingleton forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x) forall a b. (a -> b) -> a -> b
$ \Term s a
x' Term s (ell a)
_ ->
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pleqBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x')
(forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (ell a)
xs)
forall (a :: PType) (s :: S). Term s a
unorderedError
)
forall (a :: PType) (s :: S). Term s a
unorderedError
unorderedError :: forall (a :: S -> Type) (s :: S). Term s a
unorderedError :: forall (a :: PType) (s :: S). Term s a
unorderedError = forall (s :: S) (a :: PType). Term s PString -> Term s a
ptraceError Term s PString
"ptryMergeBy: argument list-like out of order"
pcmpMap ::
forall (k :: S -> Type) (v :: S -> Type) (s :: S).
(POrd k, PIsData k, PIsData v) =>
Term
s
( (PComparator v :--> v :--> v :--> PBool)
:--> PComparator v
:--> k
:--> k
:--> v
:--> v
:--> PMap 'Sorted k v
:--> PMap 'Sorted k v
:--> PBool
) ->
Term s (PComparator v :--> v :--> v :--> PBool) ->
Term s (PComparator v) ->
Term s k ->
Term s k ->
Term s v ->
Term s v ->
Term s (PMap 'Sorted k v) ->
Term s (PMap 'Sorted k v) ->
Term s PBool
pcmpMap :: forall (k :: PType) (v :: PType) (s :: S).
(POrd k, PIsData k, PIsData v) =>
Term
s
((PComparator v :--> (v :--> (v :--> PBool)))
:--> (PComparator v
:--> (k
:--> (k
:--> (v
:--> (v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool))))))))
-> Term s (PComparator v :--> (v :--> (v :--> PBool)))
-> Term s (PComparator v)
-> Term s k
-> Term s k
-> Term s v
-> Term s v
-> Term s (PMap 'Sorted k v)
-> Term s (PMap 'Sorted k v)
-> Term s PBool
pcmpMap Term
s
((PComparator v :--> (v :--> (v :--> PBool)))
:--> (PComparator v
:--> (k
:--> (k
:--> (v
:--> (v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool))))))))
self Term s (PComparator v :--> (v :--> (v :--> PBool)))
doCmp Term s (PComparator v)
cmp Term s k
k1 Term s k
k2 Term s v
v1 Term s v
v2 Term s (PMap 'Sorted k v)
kv1 Term s (PMap 'Sorted k v)
kv2 = forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch (forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> POrdering)))
pcompareBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S). POrd a => Term s (PComparator a)
pfromOrd forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k2) forall a b. (a -> b) -> a -> b
$ \case
POrdering s
PLT -> forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
kv1 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k1' Term s v
v1' Term s (PMap 'Sorted k v)
kv1' ->
Term
s
((PComparator v :--> (v :--> (v :--> PBool)))
:--> (PComparator v
:--> (k
:--> (k
:--> (v
:--> (v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool))))))))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v :--> (v :--> (v :--> PBool)))
doCmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv2
POrdering s
PEQ ->
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(Term s (PComparator v :--> (v :--> (v :--> PBool)))
doCmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v2)
( forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
kv1 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k1' Term s v
v1' Term s (PMap 'Sorted k v)
kv1' ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
kv2 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k2' Term s v
v2' Term s (PMap 'Sorted k v)
kv2' ->
Term
s
((PComparator v :--> (v :--> (v :--> PBool)))
:--> (PComparator v
:--> (k
:--> (k
:--> (v
:--> (v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool))))))))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v :--> (v :--> (v :--> PBool)))
doCmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k2' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v2' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv2'
)
(forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PFalse)
POrdering s
PGT -> forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term s (PMap 'Sorted k v)
kv2 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s k
k2' Term s v
v2' Term s (PMap 'Sorted k v)
kv2' ->
Term
s
((PComparator v :--> (v :--> (v :--> PBool)))
:--> (PComparator v
:--> (k
:--> (k
:--> (v
:--> (v
:--> (PMap 'Sorted k v :--> (PMap 'Sorted k v :--> PBool))))))))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v :--> (v :--> (v :--> PBool)))
doCmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator v)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s k
k2' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s v
v2' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted k v)
kv2'
pcmpValue ::
forall (s :: S).
Term
s
( ( PComparator PInteger
:--> PMap 'Sorted PTokenName PInteger
:--> PMap 'Sorted PTokenName PInteger
:--> PBool
)
:--> PComparator PInteger
:--> PCurrencySymbol
:--> PCurrencySymbol
:--> PMap 'Sorted PTokenName PInteger
:--> PMap 'Sorted PTokenName PInteger
:--> PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> PBool
) ->
Term
s
( PComparator PInteger
:--> PMap 'Sorted PTokenName PInteger
:--> PMap 'Sorted PTokenName PInteger
:--> PBool
) ->
Term s (PComparator PInteger) ->
Term s PCurrencySymbol ->
Term s PCurrencySymbol ->
Term s (PMap 'Sorted PTokenName PInteger) ->
Term s (PMap 'Sorted PTokenName PInteger) ->
Term s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)) ->
Term s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)) ->
Term s PBool
pcmpValue :: forall (s :: S).
Term
s
((PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
:--> (PComparator PInteger
:--> (PCurrencySymbol
:--> (PCurrencySymbol
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap
'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> (PMap
'Sorted
PCurrencySymbol
(PMap 'Sorted PTokenName PInteger)
:--> PBool))))))))
-> Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
-> Term s (PComparator PInteger)
-> Term s PCurrencySymbol
-> Term s PCurrencySymbol
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term s (PMap 'Sorted PTokenName PInteger)
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
-> Term s PBool
pcmpValue Term
s
((PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
:--> (PComparator PInteger
:--> (PCurrencySymbol
:--> (PCurrencySymbol
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap
'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> (PMap
'Sorted
PCurrencySymbol
(PMap 'Sorted PTokenName PInteger)
:--> PBool))))))))
self Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
doCmp Term s (PComparator PInteger)
cmp Term s PCurrencySymbol
k1 Term s PCurrencySymbol
k2 Term s (PMap 'Sorted PTokenName PInteger)
v1 Term s (PMap 'Sorted PTokenName PInteger)
v2 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2 = forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch (forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> POrdering)))
pcompareBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# forall (a :: PType) (s :: S). POrd a => Term s (PComparator a)
pfromOrd forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k2) forall a b. (a -> b) -> a -> b
$ \case
POrdering s
PLT -> forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k1' Term s (PMap 'Sorted PTokenName PInteger)
v1' Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1' ->
Term
s
((PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
:--> (PComparator PInteger
:--> (PCurrencySymbol
:--> (PCurrencySymbol
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap
'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> (PMap
'Sorted
PCurrencySymbol
(PMap 'Sorted PTokenName PInteger)
:--> PBool))))))))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
doCmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator PInteger)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v2 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2
POrdering s
PEQ ->
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
doCmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator PInteger)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v2)
( forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k1' Term s (PMap 'Sorted PTokenName PInteger)
v1' Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1' ->
forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k2' Term s (PMap 'Sorted PTokenName PInteger)
v2' Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2' ->
Term
s
((PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
:--> (PComparator PInteger
:--> (PCurrencySymbol
:--> (PCurrencySymbol
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap
'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> (PMap
'Sorted
PCurrencySymbol
(PMap 'Sorted PTokenName PInteger)
:--> PBool))))))))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
doCmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator PInteger)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k2' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v2' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2'
)
(forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PFalse)
POrdering s
PGT -> forall (r :: PType) (k :: PType) (v :: PType) (s :: S).
(PIsData k, PIsData v) =>
Term s (PMap 'Sorted k v)
-> Term s r
-> (Term s k -> Term s v -> Term s (PMap 'Sorted k v) -> Term s r)
-> Term s r
phandleMin Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2 (forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon forall (s :: S). PBool s
PTrue) forall a b. (a -> b) -> a -> b
$ \Term s PCurrencySymbol
k2' Term s (PMap 'Sorted PTokenName PInteger)
v2' Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2' ->
Term
s
((PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
:--> (PComparator PInteger
:--> (PCurrencySymbol
:--> (PCurrencySymbol
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap
'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger)
:--> (PMap
'Sorted
PCurrencySymbol
(PMap 'Sorted PTokenName PInteger)
:--> PBool))))))))
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s
(PComparator PInteger
:--> (PMap 'Sorted PTokenName PInteger
:--> (PMap 'Sorted PTokenName PInteger :--> PBool)))
doCmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator PInteger)
cmp forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s PCurrencySymbol
k2' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Sorted PTokenName PInteger)
v2' forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv1 forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term
s (PMap 'Sorted PCurrencySymbol (PMap 'Sorted PTokenName PInteger))
kv2'
pinsertUniqueBy ::
forall (list :: PType -> PType) (a :: PType) (s :: S).
(PIsListLike list a) =>
Term s (PComparator a :--> a :--> list a :--> list a)
pinsertUniqueBy :: forall (list :: PType -> PType) (a :: PType) (s :: S).
PIsListLike list a =>
Term s (PComparator a :--> (a :--> (list a :--> list a)))
pinsertUniqueBy = forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic forall a b. (a -> b) -> a -> b
$
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
plam forall a b. (a -> b) -> a -> b
$ \Term s (PComparator a)
c Term s a
x ->
let lt :: Term s (a :--> (a :--> PBool))
lt = forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
plessThanBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
c
eq :: Term s (a :--> (a :--> PBool))
eq = forall (a :: PType) (s :: S).
Term s (PComparator a :--> (a :--> (a :--> PBool)))
pequateBy forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PComparator a)
c
in forall (list :: PType -> PType) (a :: PType) (s :: S) (r :: PType).
PIsListLike list a =>
(Term s (list a :--> r) -> Term s a -> Term s (list a) -> Term s r)
-> (Term s (list a :--> r) -> Term s r) -> Term s (list a :--> r)
precList
( \Term s (list a :--> list a)
self Term s a
h Term s (list a)
t ->
let ensureUniqueness :: Term s (list a) -> Term s (list a)
ensureUniqueness =
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(Term s (a :--> (a :--> PBool))
eq forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
h)
(forall (s :: S) (a :: PType). Term s PString -> Term s a
ptraceError Term s PString
"inserted value already exists")
next :: Term s (list a)
next =
forall (s :: S) (a :: PType).
Term s PBool -> Term s a -> Term s a -> Term s a
pif
(Term s (a :--> (a :--> PBool))
lt forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
h)
(forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
h forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (list a)
t)
(forall (list :: PType -> PType) (a :: PType) (s :: S).
(PListLike list, PElemConstraint list a) =>
Term s (a :--> (list a :--> list a))
pcons forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
h forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
#$ Term s (list a :--> list a)
self forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s (list a)
t)
in Term s (list a) -> Term s (list a)
ensureUniqueness Term s (list a)
next
)
(forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (list :: PType -> PType) (a :: PType) (s :: S).
PIsListLike list a =>
Term s (a :--> list a)
psingleton forall (s :: S) (a :: PType) (b :: PType).
HasCallStack =>
Term s (a :--> b) -> Term s a -> Term s b
# Term s a
x)