expression in where-block are evaluated multiple times if they have a type signature
In this code x
is only evaluated once:
Start = (x, x)
where
x = trace_n "eval" ()
If however the type signature is added, x
is evaluated twice:
Start = (x, x)
where
x :: ()
x = trace_n "eval" ()
This is a pity, as I prefer adding as many type signatures as possible, so I currently loose performance without a reason.