{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Graphics.Implicit.FastIntUtil (Fastℕ(Fastℕ), toFastℕ, fromFastℕ) where
import Prelude (Integral, Num, Eq, Ord, Enum, Real, Show, Read, Int, id)
class FastN n where
fromFastℕ :: Fastℕ -> n
toFastℕ :: n -> Fastℕ
instance FastN Int where
fromFastℕ (Fastℕ a) = a
{-# INLINABLE fromFastℕ #-}
toFastℕ = Fastℕ
{-# INLINABLE toFastℕ #-}
instance FastN Fastℕ where
fromFastℕ = id
{-# INLINABLE fromFastℕ #-}
toFastℕ = id
{-# INLINABLE toFastℕ #-}
newtype Fastℕ = Fastℕ Int
deriving (Show, Read, Eq, Ord, Num, Enum, Integral, Real)