
19 Oct
2014
19 Oct
'14
4:43 a.m.
On Sat, Oct 18, 2014 at 11:32:46PM -0700, Jeffrey Brown wrote:
In the below, however, :sprint shows them unevaluated both before and after the seq call. let x = 1 + 2 let y = x + 1 :sprint x :sprint y seq y () :sprint x :sprint y
Why?
Because you are using GHC 7.8 where the mmonomorphism restriction is not imposed. Without the monomorphism restriction `1 + 2` is of type `Num a => a`, not `Int`, and forcing it does not memoize the result. Try running GHCi with `-XMonomorphismRestriction`. Tom