module Streamly.Internal.Data.Either.Strict
( Either' (..)
, isLeft'
, isRight'
, fromLeft'
, fromRight'
)
where
data Either' a b = Left' !a | Right' !b deriving Int -> Either' a b -> ShowS
[Either' a b] -> ShowS
Either' a b -> String
(Int -> Either' a b -> ShowS)
-> (Either' a b -> String)
-> ([Either' a b] -> ShowS)
-> Show (Either' a b)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall a b. (Show a, Show b) => Int -> Either' a b -> ShowS
forall a b. (Show a, Show b) => [Either' a b] -> ShowS
forall a b. (Show a, Show b) => Either' a b -> String
showList :: [Either' a b] -> ShowS
$cshowList :: forall a b. (Show a, Show b) => [Either' a b] -> ShowS
show :: Either' a b -> String
$cshow :: forall a b. (Show a, Show b) => Either' a b -> String
showsPrec :: Int -> Either' a b -> ShowS
$cshowsPrec :: forall a b. (Show a, Show b) => Int -> Either' a b -> ShowS
Show
{-# INLINABLE isLeft' #-}
isLeft' :: Either' a b -> Bool
isLeft' :: forall a b. Either' a b -> Bool
isLeft' (Left' a
_) = Bool
True
isLeft' (Right' b
_) = Bool
False
{-# INLINABLE isRight' #-}
isRight' :: Either' a b -> Bool
isRight' :: forall a b. Either' a b -> Bool
isRight' (Left' a
_) = Bool
False
isRight' (Right' b
_) = Bool
True
{-# INLINABLE fromLeft' #-}
fromLeft' :: Either' a b -> a
fromLeft' :: forall a b. Either' a b -> a
fromLeft' (Left' a
a) = a
a
fromLeft' Either' a b
_ = String -> a
forall a. HasCallStack => String -> a
error String
"fromLeft' expecting a Left'-value"
{-# INLINABLE fromRight' #-}
fromRight' :: Either' a b -> b
fromRight' :: forall a b. Either' a b -> b
fromRight' (Right' b
b) = b
b
fromRight' Either' a b
_ = String -> b
forall a. HasCallStack => String -> a
error String
"fromRight' expecting a Right'-value"