13 Jun
2019
13 Jun
'19
4:46 a.m.
On Jun 13, 2019, at 4:25 AM, Boris
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. -- Viktor.