module Plutarch.Monadic ((>>=), (>>), fail) where
import Data.String (fromString)
import Plutarch.Internal.Term (
Config (Tracing),
Term,
TracingMode (DetTracing),
pgetConfig,
)
import Plutarch.Trace (ptraceInfoError)
import Prelude hiding (fail, (>>), (>>=))
(>>=) :: (x -> Term s a) -> x -> Term s a
>>= :: forall x (s :: S) (a :: PType). (x -> Term s a) -> x -> Term s a
(>>=) = (x -> Term s a) -> x -> Term s a
forall a. a -> a
id
(>>) :: (x -> Term s a) -> x -> Term s a
>> :: forall x (s :: S) (a :: PType). (x -> Term s a) -> x -> Term s a
(>>) = (x -> Term s a) -> x -> Term s a
forall a. a -> a
id
fail :: String -> Term s a
fail :: forall (s :: S) (a :: PType). String -> Term s a
fail String
s = (Config -> Term s a) -> Term s a
forall (s :: S) (a :: PType). (Config -> Term s a) -> Term s a
pgetConfig ((Config -> Term s a) -> Term s a)
-> (Config -> Term s a) -> Term s a
forall a b. (a -> b) -> a -> b
$ \case
Tracing LogLevel
_ TracingMode
DetTracing -> Term s PString -> Term s a
forall (a :: PType) (s :: S). Term s PString -> Term s a
ptraceInfoError Term s PString
"Pattern matching failure in QualifiedDo syntax"
Config
_ -> Term s PString -> Term s a
forall (a :: PType) (s :: S). Term s PString -> Term s a
ptraceInfoError (Term s PString -> Term s a) -> Term s PString -> Term s a
forall a b. (a -> b) -> a -> b
$ String -> Term s PString
forall a. IsString a => String -> a
fromString String
s