
23 Nov
2016
23 Nov
'16
9:55 p.m.
I was messing around in GHCi, exploring the generic representation of a particular value. I tried out both case testSequence of IxSequence x -> case from x of M1 (L1 y) -> y and case testSequence of IxSequence x -> case from x of M1 (R1 y) -> y I was initially mystified to see that neither of these produced an error. Surely, I thought, it can't be both L1 and R1! And indeed it can't. But the Show instance for U1 is lazy, so the first test happily printed out M1 {unM1 = U1} even though that is utter nonsense. I propose that U1 simply derive the Show instance to avoid such peculiar behavior. David Feuer