[Haskell-cafe] seq (was: Article review: Category Theory)

Josef Svenningsson josef.svenningsson at gmail.com
Fri Jan 19 20:57:58 EST 2007


On 1/20/07, Brian Hulley <brianh at metamilk.com> 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* used before. See section 6.2.7 of the Haskell 1.4 report. It
was throw out in Haskell98. I don't remember why though.

> 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?
>
I'll pass on these two questions.

/Josef


More information about the Haskell-Cafe mailing list