
5 Jun
2019
5 Jun
'19
10:32 a.m.
Hi Dannyu, On 6/5/19 3:45 AM, Dannyu NDos wrote:
Shouldn't it be laws that "show" must be injective and "read" must be surjective? Without such laws, one could define:
data Foo = Foo instance Show Foo where show _ _ = id instance Read Foo where readPrec = pfail
which should be prevented.
This doesn't look like something anyone would ever want to do, even out of ignorance. So that example is not really compelling. What is your general motivation to add "laws" to Show and Read? Li-yao