seq as type class method

Stefan Holdermans stefan at
Thu Nov 5 18:13:18 EST 2009


> I have read in the History of Haskell, that originally 'seq' should  
> be a method of a type class, that can be automatically derived by a  
> 'deriving' clause. It was also mentioned that this clean solution  
> was dropped because of particular experiences with developing a  
> parser. However the arguments appeared to me, like these were  
> problems of debugging.

If I understood it correctly, the problem was more general than just  
debugging. Every introduction of seq in a function could result in the  
requirement to also adapt the type signatures of calling functions.

What wasn't understood by then is that making a seq a type-class  
method is not enough to recover parametricity, which was the goal.  
This is explained in a recent paper by Daniel Seidel and Janis  

   Daniel Seidel and Janis Voigtlaender. Taming selective strictness.
   In Stefan Fischer, Erik Maehle, and Ruediger Reischuk, editors,
   INFORMATIK 2009 – Im Focus das Leben, Beitraege der 39.
   Jahrestagung der Gesellschaft fuer Informatik e.V. (GI), 28.
   September – 2. Oktober, in Luebeck, volume 154 of Lecture Notes
   in Informatics, pages 2916–2930. GI, 2009.



More information about the Libraries mailing list