[Haskell-cafe] number-parameterized types and heterogeneous lists
Harald ROTTER
harald.rotter at sagem.com
Mon Jun 23 02:50:33 EDT 2008
Hello,
sorry for the late answer, I was off for the weekend :-)
The paper "Number-parameterized types" by Oleg Kielyov is located at
http://okmij.org/ftp/papers/number-parameterized-types.pdf
It impressively shows what one can do with Haskell's type system.
What I am after is the replacement of a "chain" of digits, like e.g.
D1 $ D0 $ D0 $ Sz
by a list
[D1,D0,D0]
so I can effectively use list operations on those "typed numbers". I also
wonder if there is some kind of
"generalized" foldr such that, e.g.
D1 $ D0 $ D0 $ Sz = specialFoldr ($) Sz [D1,D0,D0]
I think that this foldr must be some "special" foldr that augments the data
type of the result in each foldr step.
Would this be possible or am I just chasing phantoms ?
Thanks
Harald.
" Ce courriel et les documents qui y sont attaches peuvent contenir des informations confidentielles. Si vous n'etes pas le destinataire escompte, merci d'en informer l'expediteur immediatement et de detruire ce courriel ainsi que tous les documents attaches de votre systeme informatique. Toute divulgation, distribution ou copie du present courriel et des documents attaches sans autorisation prealable de son emetteur est interdite."
" This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, please advise the sender immediately and delete this e-mail and all attached documents from your computer system. Any unauthorised disclosure, distribution or copying hereof is prohibited."
More information about the Haskell-Cafe
mailing list