{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Plutarch.String (
PString,
pisHexDigit,
pencodeUtf8,
pdecodeUtf8,
) where
import Plutarch.Builtin.String (
PString,
pdecodeUtf8,
pencodeUtf8,
)
import Plutarch.Builtin.Bool (PBool, (#&&), (#||))
import Plutarch.Builtin.Integer (PInteger)
import Plutarch.Internal.Numeric ()
import Plutarch.Internal.Ord ((#<=))
import Plutarch.Internal.PLam (plam)
import Plutarch.Internal.Term (
S,
Term,
phoistAcyclic,
(:-->),
)
pisHexDigit :: forall (s :: S). Term s (PInteger :--> PBool)
pisHexDigit :: forall (s :: S). Term s (PInteger :--> PBool)
pisHexDigit = (forall (s :: S). Term s (PInteger :--> PBool))
-> Term s (PInteger :--> PBool)
forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic ((forall (s :: S). Term s (PInteger :--> PBool))
-> Term s (PInteger :--> PBool))
-> (forall (s :: S). Term s (PInteger :--> PBool))
-> Term s (PInteger :--> PBool)
forall a b. (a -> b) -> a -> b
$ (Term s PInteger -> Term s PBool) -> Term s (PInteger :--> PBool)
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
forall (c :: PType).
HasCallStack =>
(Term s c -> Term s PBool) -> Term s (c :--> PBool)
plam ((Term s PInteger -> Term s PBool) -> Term s (PInteger :--> PBool))
-> (Term s PInteger -> Term s PBool)
-> Term s (PInteger :--> PBool)
forall a b. (a -> b) -> a -> b
$ \Term s PInteger
c ->
(Term s PInteger
c Term s PInteger -> Term s PInteger -> Term s PBool
forall (s :: S). Term s PInteger -> Term s PInteger -> Term s PBool
forall (t :: PType) (s :: S).
POrd t =>
Term s t -> Term s t -> Term s PBool
#<= Term s PInteger
57 Term s PBool -> Term s PBool -> Term s PBool
forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool
#&& Term s PInteger
48 Term s PInteger -> Term s PInteger -> Term s PBool
forall (s :: S). Term s PInteger -> Term s PInteger -> Term s PBool
forall (t :: PType) (s :: S).
POrd t =>
Term s t -> Term s t -> Term s PBool
#<= Term s PInteger
c)
#|| (c #<= 70 #&& 65 #<= c)
#|| (c #<= 102 #&& 97 #<= c)