module Data.Singletons.TypeLits (
Nat, Symbol,
Sing(SNat, SSym),
SNat, SSymbol, withKnownNat, withKnownSymbol,
Error, ErrorSym0, ErrorSym1, sError,
KnownNat, KnownNatSym0, KnownNatSym1, natVal,
KnownSymbol, KnownSymbolSym0, KnownSymbolSym1, symbolVal,
(:^), (:^$), (:^$$), (:^$$$)
) where
import Data.Singletons.TypeLits.Internal
import Data.Singletons.Prelude.Num ()
import Data.Singletons.Promote
instance Num Nat where
(+) = no_term_level_nats
() = no_term_level_nats
(*) = no_term_level_nats
negate = no_term_level_nats
abs = no_term_level_nats
signum = no_term_level_nats
fromInteger = no_term_level_nats
instance Eq Nat where
(==) = no_term_level_nats
instance Ord Nat where
compare = no_term_level_nats
instance Eq Symbol where
(==) = no_term_level_syms
instance Ord Symbol where
compare = no_term_level_syms
no_term_level_nats :: a
no_term_level_nats = error "The kind `Nat` may not be used at the term level."
no_term_level_syms :: a
no_term_level_syms = error "The kind `Symbol` may not be used at the term level."
$(genDefunSymbols [''KnownNat, ''KnownSymbol])