data-default
data-default copied to clipboard
Is Default (e -> r) necessary?
Do you personally use the (e -> r) instance? Do you know if anybody else does? I'm trying to define:
data Preference = Preference
{ userId :: UserId
, max :: Int
}
Obviously, the UserId can't be defaulted (sensibly -- i.e., while respecting the app's semantics for a UserId), but it would be pretty nice to be able to define:
instance Default (UserId -> Preference) where
def = \uid -> (Preference uid 1000)