data-default icon indicating copy to clipboard operation
data-default copied to clipboard

Is Default (e -> r) necessary?

Open 2piix opened this issue 10 years ago • 0 comments

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)

2piix avatar May 16 '14 01:05 2piix