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

apfelmus at quantentunnel.de apfelmus at quantentunnel.de
Sat Jan 20 05:52:07 EST 2007


Lennart Augustsson wrote:
> And this is why some of us think that adding polymorphic seq to Haskell
> was a mistake. :(

To ease the pain, (oca)ML has the same problem/feature: function types
are lifted:

  let rec f (x : int) : int = f x ;;
  let g y     = let x = 1 / 0 in f ;;
  let const y = 1 ;;

  # const f ;;
  - : int = 1
  # const (g 1) ;;
  Exception: Division_by_zero.

The reason is, of course, that one cannot be strict in a function
argument (taking _|_ = \x -> _|_) because this is undecidable (and
nonsense with extensional equality).

But because the ML-equivalent of (.) is strict, it still does a correct
internalization of morphism composition.

Regards,
apfelmus



More information about the Haskell-Cafe mailing list