
I would like to present my version of type arithmetic with decimal encoding: http://thesz.mskhug.ru/svn/hhdl/TyleA.hs It is not worth Cabal package in its current state, but I hope it would be useful for someone. It is easy to use, just say Plus (D1 :. D2 :. D0) D8 to get a type of 128. Or you can say $(tySize 128) if you're not afraid to use Template Haskell. I tested it on my current project, it works quite well with numbers around 128..512, about 10-20 times faster than Peano numbers. As operations over this representation are not lazy (Peano numbers oeprations are lazy for one argument of Plus and for part of one argument of Max), it is not well suited for big number of operations done at once. I encountered it when I autogenerated a big arithmetic expression for big polymorphic data type. I think it is quite rare situation.

On Wed, 1 Jun 2011, Serguey Zefirov wrote:
I would like to present my version of type arithmetic with decimal encoding: http://thesz.mskhug.ru/svn/hhdl/TyleA.hs
How does it compare to http://hackage.haskell.org/package/type-level ?

2011/6/1 Henning Thielemann
On Wed, 1 Jun 2011, Serguey Zefirov wrote:
I would like to present my version of type arithmetic with decimal encoding: http://thesz.mskhug.ru/svn/hhdl/TyleA.hs How does it compare to http://hackage.haskell.org/package/type-level ?
My version is slightly simpler to use, I think, because type-level uses functional dependencies: "Type-level functions are implemented using functional dependencies of multi parameter type classes." I use type families.
participants (2)
-
Henning Thielemann
-
Serguey Zefirov