[Haskell] Initialisation without unsafePerformIO

George Russell ger at informatik.uni-bremen.de
Thu Jun 3 14:11:39 EDT 2004

Chung-chieh Shan wrote (snipped):
 > The enabling technique behind our solution is to propagate values
 > via types (literally), with the help of polymorphic recursion and
 > higher-ranked polymorphism.  The technique essentially emulates
 > local type-class instance declarations.  Configuration parameters
 > are propagated throughout the code implicitly as part of type
 > inference rather than explicitly by the programmer.

Crikey!  You represent configuration values which are
integers by encoding them as a type with constructors
    data Zero
    data Twice s
    data Succ s
    data Pred s
and you encode general values which are instances of Storable
by casting their binary representation (pinned by a StablePtr)
into bytes and then encoding the result as integers.  My mind
boggles.  It would be nice if your paper included an appendix
containing a main program which, say, used a graphics library
including configuration parameters in your style.  (Say,
default font (string), font size (integer) and mouse handedness

More information about the Haskell mailing list