[Haskell-cafe] seq (was: Article review: Category Theory)
robdockins at fastmail.fm
Sat Jan 20 04:47:11 EST 2007
On Friday 19 January 2007 18:09, Brian Hulley wrote:
> Neil Mitchell wrote:
> > Hi Brian,
> >> Is there any solution that would allow excess laziness to be removed
> >> from a Haskell program such that Hask would be a category?
> > class Seq a where
> > seq :: a -> b -> b
> > Then you have a different seq based on the types, and it doesn't go
> > wrong. You would probably want deriving Seq support.
> This seems an amazingly neat solution to a really terrible problem, so:
> 1) Does anyone know why this was not used in the first place?
It was this way in Haskell 1.4, but was changed for Haskell 98.
IIRC, there is a fairly complete discussion of this issue in the "History of
Haskell" paper draft that SP Jones et al circulated about for comment.
Unfortunately, those drafts seem to have been pulled now, so I can't double
check or give you a link.
> 2) Would it be good to use this in future versions of Haskell?
> 3) Is there any practical program which requires the current seq that could
> not be rewritten to use the typeclass seq?
> Thanks, Brian.
More information about the Haskell-Cafe