2018-05-24 23:00 GMT+02:00 Olaf Klinke <olf@aatal-apotheke.de>:
[...] I'm struggling to make the concept of monoidal configuration work when there is no sensible default configuration. Suppose my configuration type is

data Config = Config {foo :: Bool, bar :: Int}

with no reasonable default, e.g.

emptyConfig = Config {
  foo = error "you did not specify option foo",
  bar = error "you did not specify option bar"
  }
[...]

I find the approach in https://medium.com/@jonathangfischoff/the-partial-options-monoid-pattern-31914a71fc67 quite straightforward, without any need for higher-kinded stuff, generics or lenses: Just distinguish between partial and non-partial options, and make a Monoid instance only for the partial ones.

Cheers,
   S.