27 Aug
2013
27 Aug
'13
5:46 p.m.
Lukas Lehner <lehner.lukas <at> gmail.com> 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