{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
{-# OPTIONS_GHC -fmax-simplifier-iterations=0 #-}
module PlutusTx.Prelude (
module Eq,
module Enum,
module Ord,
module Semigroup,
module Monoid,
module Numeric,
module Functor,
module Applicative,
module Lattice,
module Foldable,
module Traversable,
(Haskell.>>=),
(Haskell.=<<),
(Haskell.>>),
Haskell.return,
module Base,
module Trace,
BI.BuiltinUnit,
BuiltinString,
appendString,
emptyString,
equalsString,
encodeUtf8,
error,
check,
module Bool,
Integer,
divide,
modulo,
quotient,
remainder,
even,
odd,
expMod,
module Maybe,
module Either,
module List,
BuiltinByteString,
appendByteString,
consByteString,
takeByteString,
dropByteString,
sliceByteString,
lengthOfByteString,
indexByteString,
emptyByteString,
decodeUtf8,
BuiltinByteStringUtf8 (..),
Builtins.andByteString,
Builtins.orByteString,
Builtins.xorByteString,
Builtins.complementByteString,
Builtins.readBit,
Builtins.writeBits,
Builtins.shiftByteString,
Builtins.rotateByteString,
Builtins.countSetBits,
Builtins.findFirstSetBit,
sha2_256,
sha3_256,
blake2b_224,
blake2b_256,
keccak_256,
ripemd_160,
verifyEd25519Signature,
verifyEcdsaSecp256k1Signature,
verifySchnorrSecp256k1Signature,
Rational,
unsafeRatio,
ratio,
fromInteger,
round,
BuiltinData,
BuiltinBLS12_381_G1_Element,
bls12_381_G1_equals,
bls12_381_G1_add,
bls12_381_G1_neg,
bls12_381_G1_scalarMul,
bls12_381_G1_compress,
bls12_381_G1_uncompress,
bls12_381_G1_hashToGroup,
bls12_381_G1_compressed_zero,
bls12_381_G1_compressed_generator,
BuiltinBLS12_381_G2_Element,
bls12_381_G2_equals,
bls12_381_G2_add,
bls12_381_G2_neg,
bls12_381_G2_scalarMul,
bls12_381_G2_compress,
bls12_381_G2_uncompress,
bls12_381_G2_hashToGroup,
bls12_381_G2_compressed_zero,
bls12_381_G2_compressed_generator,
BuiltinBLS12_381_MlResult,
bls12_381_millerLoop,
bls12_381_mulMlResult,
bls12_381_finalVerify,
fromBuiltin,
toBuiltin,
fromOpaque,
toOpaque,
integerToByteString,
byteStringToInteger
) where
import Data.String (IsString (..))
import PlutusCore.Data (Data (..))
import PlutusTx.Applicative as Applicative
import PlutusTx.Base as Base
import PlutusTx.Bool as Bool
import PlutusTx.Builtins (BuiltinBLS12_381_G1_Element, BuiltinBLS12_381_G2_Element,
BuiltinBLS12_381_MlResult, BuiltinByteString, BuiltinByteStringUtf8 (..),
BuiltinData, BuiltinString, Integer, appendByteString, appendString,
blake2b_224, blake2b_256, bls12_381_G1_add, bls12_381_G1_compress,
bls12_381_G1_compressed_generator, bls12_381_G1_compressed_zero,
bls12_381_G1_equals, bls12_381_G1_hashToGroup, bls12_381_G1_neg,
bls12_381_G1_scalarMul, bls12_381_G1_uncompress, bls12_381_G2_add,
bls12_381_G2_compress, bls12_381_G2_compressed_generator,
bls12_381_G2_compressed_zero, bls12_381_G2_equals,
bls12_381_G2_hashToGroup, bls12_381_G2_neg, bls12_381_G2_scalarMul,
bls12_381_G2_uncompress, bls12_381_finalVerify, bls12_381_millerLoop,
bls12_381_mulMlResult, byteStringToInteger, consByteString, decodeUtf8,
emptyByteString, emptyString, encodeUtf8, equalsByteString, equalsString,
error, fromBuiltin, fromOpaque, greaterThanByteString, indexByteString,
integerToByteString, keccak_256, lengthOfByteString, lessThanByteString,
ripemd_160, sha2_256, sha3_256, sliceByteString, toBuiltin, toOpaque,
trace, verifyEcdsaSecp256k1Signature, verifyEd25519Signature,
verifySchnorrSecp256k1Signature)
import PlutusTx.Builtins qualified as Builtins
import PlutusTx.Builtins.Internal qualified as BI
import PlutusTx.Either as Either
import PlutusTx.Enum as Enum
import PlutusTx.Eq as Eq
import PlutusTx.ErrorCodes
import PlutusTx.Foldable as Foldable
import PlutusTx.Functor as Functor
import PlutusTx.IsData
import PlutusTx.Lattice as Lattice
import PlutusTx.List as List hiding (concat, concatMap, foldl, foldr)
import PlutusTx.Maybe as Maybe
import PlutusTx.Monoid as Monoid
import PlutusTx.Numeric as Numeric
import PlutusTx.Ord as Ord
import PlutusTx.Ratio as Ratio
import PlutusTx.Semigroup as Semigroup
import PlutusTx.Trace as Trace
import PlutusTx.Traversable as Traversable
import Prelude qualified as Haskell (return, (=<<), (>>), (>>=))
check :: Bool -> BI.BuiltinUnit
check :: Bool -> BuiltinUnit
check Bool
b = if Bool
b then BuiltinUnit
BI.unitval else BuiltinString -> BuiltinUnit
forall a. BuiltinString -> a
traceError BuiltinString
checkHasFailedError
{-# INLINABLE check #-}
divide :: Integer -> Integer -> Integer
divide :: Integer -> Integer -> Integer
divide = Integer -> Integer -> Integer
Builtins.divideInteger
{-# INLINABLE divide #-}
modulo :: Integer -> Integer -> Integer
modulo :: Integer -> Integer -> Integer
modulo = Integer -> Integer -> Integer
Builtins.modInteger
{-# INLINABLE modulo #-}
expMod :: Integer -> Integer -> Integer -> Integer
expMod :: Integer -> Integer -> Integer -> Integer
expMod = Integer -> Integer -> Integer -> Integer
Builtins.expModInteger
{-# INLINABLE expMod #-}
{-# INLINABLE quotient #-}
quotient :: Integer -> Integer -> Integer
quotient :: Integer -> Integer -> Integer
quotient = Integer -> Integer -> Integer
Builtins.quotientInteger
remainder :: Integer -> Integer -> Integer
remainder :: Integer -> Integer -> Integer
remainder = Integer -> Integer -> Integer
Builtins.remainderInteger
{-# INLINABLE remainder #-}
even :: Integer -> Bool
even :: Integer -> Bool
even Integer
n = if Integer -> Integer -> Integer
modulo Integer
n Integer
2 Integer -> Integer -> Bool
forall a. Eq a => a -> a -> Bool
== Integer
0 then Bool
True else Bool
False
{-# INLINABLE even #-}
odd :: Integer -> Bool
odd :: Integer -> Bool
odd Integer
n = if Integer -> Bool
even Integer
n then Bool
False else Bool
True
{-# INLINABLE odd #-}
takeByteString :: Integer -> BuiltinByteString -> BuiltinByteString
takeByteString :: Integer -> BuiltinByteString -> BuiltinByteString
takeByteString Integer
n BuiltinByteString
bs = Integer -> Integer -> BuiltinByteString -> BuiltinByteString
Builtins.sliceByteString Integer
0 Integer
n BuiltinByteString
bs
{-# INLINABLE takeByteString #-}
dropByteString :: Integer -> BuiltinByteString -> BuiltinByteString
dropByteString :: Integer -> BuiltinByteString -> BuiltinByteString
dropByteString Integer
n BuiltinByteString
bs = Integer -> Integer -> BuiltinByteString -> BuiltinByteString
Builtins.sliceByteString Integer
n (BuiltinByteString -> Integer
Builtins.lengthOfByteString BuiltinByteString
bs Integer -> Integer -> Integer
forall a. AdditiveGroup a => a -> a -> a
- Integer
n) BuiltinByteString
bs
{-# INLINABLE dropByteString #-}