
I'd like to write a small module using Data.TypeLevel.Num. It has type level constants, variables, addition, and maximum, which is pretty much all I need. But I've never used it before, and there's one thing I want to do that I don't understand how to do. val :: Nat t => t -> Int val _ = t as an Int e.g., if x :: D8 then val x = 8. The "value-level reflection functions" in Data.TypeLevel.Num.Ops all seem to be 'undefined'.

On Wed, Nov 30, 2011 at 23:55, Richard O'Keefe
The "value-level reflection functions" in Data.TypeLevel.Num.Ops all seem to be 'undefined'.
Those are operations on type level representations, but expressed at the value level; that is, in some sense the opposite of what you're looking for. Looks like what you really want is Data.TypeLevel.Num.Sets.toNum (or toInt in the same module). -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
participants (2)
-
Brandon Allbery
-
Richard O'Keefe