qfpl / applied-fp-course

Applied Functional Programming Course - Move from exercises to a working app!
http://qfpl.io/projects/professional-fp-courses/
Other
624 stars 181 forks source link

HKD Bonus stage for Config #84

Closed endgame closed 4 years ago

endgame commented 5 years ago

We define configs and partial configs, but with HKD being used more often these days maybe we want a bonus level where you define

data Config f = Config
  { port :: f Port
  , dbPath :: f DBFilePath
  }

instance Semigroup (Config Last)
instance Monoid (Config Last)

?

mankyKitty commented 4 years ago

Double jeopardy round where the scores can really change

Use deriving via

endgame commented 4 years ago

How? Won't we be plugging in different things in for f, explicitly? I'm not sure I understand.