4 ms·
It's possible to do without Existential Types, in fact they are only a language extension supported by GHC, not part of any standard. I think the obvious way to
by aristidb 16y ago
It's possible to do without Existential Types, in fact they are only a language extension supported by GHC, not part of any standard. I think the obvious way to "simulate" existential types is with records like
data MyRec = MkMyRec { op1 :: Int -> (MkMyRec, Int); op2 :: MkMyRec }
Existential types just give you direct access to all methods in an existing typeclass, which may or may not be helpful.
Btw., OCaml is on my list of "things to do" right below "create something with more than 200 lines in Haskell" (which is hard because Haskell is so dense). ;-)
- loup-vaillant 16y ago"create something with more than 200 lines in Haskell" (which is hard because Haskell is so dense). ;-) You might succeed by translating USSM http://www.loup-vaillant.fr/projects/ussm http://www.loup-vaillant.fr/projects/ussm The system is written in about 300 lines of Ocaml, and should be easy to translate. Plus, you can rewrite it piece by piece, and still have a system that works.