module Cases.Prelude
(
module Exports,
bug,
bottom,
(?:),
(|>),
(<|),
(|$>),
)
where
import BasePrelude as Exports
import qualified Debug.Trace.LocationTH
bug = [e| $(Debug.Trace.LocationTH.failure) . (msg <>) |]
where
msg = "A \"cases\" package bug: " :: String
bottom = [e| $bug "Bottom evaluated" |]
(?:) :: Maybe a -> a -> a
maybeA ?: b = fromMaybe b maybeA
{-# INLINE (?:) #-}
(|>) :: a -> (a -> b) -> b
a |> aToB = aToB a
{-# INLINE (|>) #-}
(<|) :: (a -> b) -> a -> b
aToB <| a = aToB a
{-# INLINE (<|) #-}
(|$>) = flip fmap
{-# INLINE (|$>) #-}