{-# LANGUAGE TemplateHaskell #-}

-- | Inhabited types

module Data.Inhabited where



import Data.Complex
import Data.Int
import Data.Word

import Data.Inhabited.TH



-- | Inhabited types
class Inhabited a
  where
    -- | Example value. An example value does not have to be an agreed-upon
    -- default value. It can really be any value whatsoever.
    example :: a

instance Inhabited Bool             where example :: Bool
example = Bool
False
instance Inhabited Int8             where example :: Int8
example = Int8
0
instance Inhabited Int16            where example :: Int16
example = Int16
0
instance Inhabited Int32            where example :: Int32
example = Int32
0
instance Inhabited Int64            where example :: Int64
example = Int64
0
instance Inhabited Word8            where example :: Word8
example = Word8
0
instance Inhabited Word16           where example :: Word16
example = Word16
0
instance Inhabited Word32           where example :: Word32
example = Word32
0
instance Inhabited Word64           where example :: Word64
example = Word64
0
instance Inhabited Float            where example :: Float
example = Float
0
instance Inhabited Double           where example :: Double
example = Double
0
instance Inhabited (Complex Float)  where example :: Complex Float
example = Complex Float
0
instance Inhabited (Complex Double) where example :: Complex Double
example = Complex Double
0

inhabitedTupleInstances 15