{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
module PlutusTx.Either (Either(..), isLeft, isRight, either) where
import PlutusTx.Bool (Bool (..))
import Prelude (Either (..))
isLeft :: Either a b -> Bool
isLeft :: forall a b. Either a b -> Bool
isLeft (Left a
_) = Bool
True
isLeft (Right b
_) = Bool
False
{-# INLINABLE isLeft #-}
isRight :: Either a b -> Bool
isRight :: forall a b. Either a b -> Bool
isRight (Left a
_) = Bool
False
isRight (Right b
_) = Bool
True
{-# INLINABLE isRight #-}
either :: (a -> c) -> (b -> c) -> Either a b -> c
either :: forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either a -> c
f b -> c
_ (Left a
x) = a -> c
f a
x
either a -> c
_ b -> c
g (Right b
y) = b -> c
g b
y
{-# INLINABLE either #-}