Haskell and Standard ML modules

Hello. I am writing a Haskell program based on some guidelines written for Standard ML (The Tiger compiler from the "Modern Compiler Implementation in ML" book). The author uses modules for abstracting things like specifities of the taraget machine. For intance, there is a general Frame signature that abstracts the frame representation which depends on the target machine. For each target machine there is a structure compliant to that signature. For instante MipsFrame, PentiumFrame and SparcFrames would be structures implementing the Frame signature. Many parts of the program just see the Frame signature. Is there any guidelines on how to achieve somethying similar to this in Haskell? Regards, Romildo

Parameterized modules are probably the easiest solution. http://web.cecs.pdx.edu/~sheard/papers/JfpPearl.ps Sometimes you can achieve analogues to SML signatures with type classes, however in the case of FRAME (p.260), quite a few of the "methods" don't actually use the abstract frame type so a type class isn't strictly a good fit (see the discussion on page 13 of the paper above). There is a least one of paper giving a rigorous comparison of SML functors and Haskell type classes, unfortunately I can't remember the authors. The link below is a (long) thesis: http://www.informatik.uni-freiburg.de/~wehr/publications/Wehr_ML_modules_and...

2010/7/4 Stephen Tetley
There is a least one of paper giving a rigorous comparison of SML functors and Haskell type classes, unfortunately I can't remember the authors. The link below is a (long) thesis: http://www.informatik.uni-freiburg.de/~wehr/publications/Wehr_ML_modules_and...
Here is the short paper: http://www.cse.unsw.edu.au/~chak/papers/modules-classes.pdf
participants (2)
-
José Romildo Malaquias
-
Stephen Tetley