
27 Aug
2013
27 Aug
'13
9:46 a.m.
Lukas Lehner
writes: ... My question is that I have to enforce the type that specific way (don't want to use ExtendedDefaultRules) or is there some more generic way?
print flatten (List ([] :: Show a => [a]) Even for an empty list, we have to provide evidence that the list is showable. That's what the type signature is doing: I am a list of something/anything showable. (If you want all of your NestedLists's to be showable, it's better to put a Show constraint on the data decl. But that would take us into existential types or GADT's.) AntC