Add unary natural numbers to experiment on matching with literals.
authorIavor S. Diatchki <iavor.diatchki@gmail.com>
Sat, 29 Sep 2012 21:52:35 +0000 (14:52 -0700)
committerIavor S. Diatchki <iavor.diatchki@gmail.com>
Sat, 29 Sep 2012 21:52:35 +0000 (14:52 -0700)
commit02998bd6bbaa67b2c67d1df6a0e7198307f778fe
tree941c4d5dcf67f92591891d68d31183c764bef07c
parent4f03d110022e1612d35988ca3dce4b8e32ea443f
Add unary natural numbers to experiment on matching with literals.

The idea is that when we want to match on type level nats, we should
use `Nat1`, and use the `FromNat1` function to switch between the
structured and unstructured representation of numbers.

A bit of custom machinery is needed for this to work properly,
because to go back (i.e., to solve FromNat1 x ~ 3) GHC needs to know
that FromNat1 is an injective function.
libraries/base/GHC/TypeLits.hs