{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE EmptyDataDeriving #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StandaloneDeriving #-}
module Data.Void
( Void
, absurd
, vacuous
) where
import Control.Exception
import Data.Data
import Data.Ix
import GHC.Generics
import Data.Semigroup (Semigroup(..), stimesIdempotent)
data Void deriving
( Eq
, Data
, Generic
, Ord
, Read
, Show
)
instance Ix Void where
range :: (Void, Void) -> [Void]
range _ = []
index :: (Void, Void) -> Void -> Int
index _ = Void -> Int
forall a. Void -> a
absurd
inRange :: (Void, Void) -> Void -> Bool
inRange _ = Void -> Bool
forall a. Void -> a
absurd
rangeSize :: (Void, Void) -> Int
rangeSize _ = 0
instance Exception Void
instance Semigroup Void where
a :: Void
a <> :: Void -> Void -> Void
<> _ = Void
a
stimes :: b -> Void -> Void
stimes = b -> Void -> Void
forall b a. Integral b => b -> a -> a
stimesIdempotent
absurd :: Void -> a
absurd :: Void -> a
absurd a :: Void
a = case Void
a of {}
vacuous :: Functor f => f Void -> f a
vacuous :: f Void -> f a
vacuous = (Void -> a) -> f Void -> f a
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Void -> a
forall a. Void -> a
absurd