Open nikita-volkov opened 8 years ago
I'd want that too. It could also be used for parametrised construction (factories?):
data Parameter = P1 | P2
data MyDataType = First A B C | Second D E F
instance Default (Parameter -> MyDataType) where
def P1 = First def def def
def P2 = Second def def def
The current instance isn't very useful and it occupies the space for a whole universe of way more useful default morphism instances, e.g.:
Basically, the whole "conversion" ecosystem could be encoded this way.