module Control.Foldl.Internal (
Maybe'(..)
, lazy
, strict
, Either'(..)
, hush
, Pair(..)
) where
data Maybe' a = Just' !a | Nothing'
lazy :: Maybe' a -> Maybe a
lazy :: Maybe' a -> Maybe a
lazy Maybe' a
Nothing' = Maybe a
forall a. Maybe a
Nothing
lazy (Just' a
a) = a -> Maybe a
forall a. a -> Maybe a
Just a
a
{-# INLINABLE lazy #-}
strict :: Maybe a -> Maybe' a
strict :: Maybe a -> Maybe' a
strict Maybe a
Nothing = Maybe' a
forall a. Maybe' a
Nothing'
strict (Just a
a ) = a -> Maybe' a
forall a. a -> Maybe' a
Just' a
a
{-# INLINABLE strict #-}
data Either' a b = Left' !a | Right' !b
hush :: Either' a b -> Maybe b
hush :: Either' a b -> Maybe b
hush (Left' a
_) = Maybe b
forall a. Maybe a
Nothing
hush (Right' b
b) = b -> Maybe b
forall a. a -> Maybe a
Just b
b
{-# INLINABLE hush #-}
data Pair a b = Pair !a !b