Skip to content

Instantly share code, notes, and snippets.

@pnlph
Created February 19, 2020 18:25
Show Gist options
  • Save pnlph/c6651cb49b0f3f74d5c286f630f83426 to your computer and use it in GitHub Desktop.
Save pnlph/c6651cb49b0f3f74d5c286f630f83426 to your computer and use it in GitHub Desktop.
module ReflectionNames where
postulate Name : Set
{-# BUILTIN QNAME Name #-}
data Bool : Set where
false : Bool
true : Bool
{-# BUILTIN BOOL Bool #-}
{-# BUILTIN FALSE false #-}
{-# BUILTIN TRUE true #-}
postulate String : Set
{-# BUILTIN STRING String #-}
primitive
primQNameEquality : Name → Name → Bool
primQNameLess : Name → Name → Bool
primShowQName : Name → String
data Nat : Set where
zero : Nat
suc : Nat → Nat
nameOfNat : Name
nameOfNat = quote Nat
nameOfBool : Name
nameOfBool = quote Bool
isNat : Name → Bool
isNat (quote Nat) = true
isNat _ = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment