{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
module PlutusTx.Trace (
trace,
traceError,
traceIfFalse,
traceIfTrue,
traceBool
) where
import PlutusTx.Bool
import PlutusTx.Builtins as Builtins
{-# INLINABLE traceError #-}
traceError :: Builtins.BuiltinString -> a
traceError :: forall a. BuiltinString -> a
traceError BuiltinString
str = () -> a
forall a. () -> a
error (BuiltinString -> () -> ()
forall a. BuiltinString -> a -> a
trace BuiltinString
str ())
{-# INLINABLE traceIfFalse #-}
traceIfFalse :: Builtins.BuiltinString -> Bool -> Bool
traceIfFalse :: BuiltinString -> Bool -> Bool
traceIfFalse BuiltinString
str Bool
a = if Bool
a then Bool
True else BuiltinString -> Bool -> Bool
forall a. BuiltinString -> a -> a
trace BuiltinString
str Bool
False
{-# INLINABLE traceIfTrue #-}
traceIfTrue :: Builtins.BuiltinString -> Bool -> Bool
traceIfTrue :: BuiltinString -> Bool -> Bool
traceIfTrue BuiltinString
str Bool
a = if Bool
a then BuiltinString -> Bool -> Bool
forall a. BuiltinString -> a -> a
trace BuiltinString
str Bool
True else Bool
False
{-# INLINABLE traceBool #-}
traceBool :: BuiltinString -> BuiltinString -> Bool -> Bool
traceBool :: BuiltinString -> BuiltinString -> Bool -> Bool
traceBool BuiltinString
trueLabel BuiltinString
falseLabel Bool
c = if Bool
c then BuiltinString -> Bool -> Bool
forall a. BuiltinString -> a -> a
trace BuiltinString
trueLabel Bool
True else BuiltinString -> Bool -> Bool
forall a. BuiltinString -> a -> a
trace BuiltinString
falseLabel Bool
False