[Haskell-cafe] How to fix ambiguous type variable?

Viktor Dukhovni ietf-dane at dukhovni.org
Thu Jun 13 08:46:25 UTC 2019

> On Jun 13, 2019, at 4:25 AM, Boris <boris at d12frosted.io> wrote:
> Agree, a good point. And actually, your variant works without any extensions.

Well, in a sense it is working with an "extension", just one that
happens to be on by default and is required in Haskell 98.  Namely,
what makes it work is the "MonomorphismRestriction".  If you specify:

	{-# LANGUAGE NoMonomorphismRestriction #-}

then the example stops working.  I like the posted example as an
exceptionally clear illustration of the MonomorphismRestriction.


More information about the Haskell-Cafe mailing list