silkapp/rest — pull request #89 by hesselink (2014-11-13 21:56:12+00:00)
Title: Safer dicts

This uses the trick @sebastiaanvisser and I found while working on the extensible dictionaries: encoding the return type of the dictionaries with a type level `Maybe`, using `Nothing` to indicate no dictionaries. Then we can use `FromMaybe` to sometimes choose polymorphism and sometimes choose `()` for the empty list.

On top of that, I could also implement `Reason_` as `Reason Void` instead of `Reason ()`, which failed before because the `Dicts` had a `()` as a return type for the empty case.

This does make things quite a bit more complicated internally, but externally it makes things a bit simpler: all the `some*` combinators are gone. It's also more correct. What do the rest of you think about it?

I might make the list in `Dicts` a non-empty list as well, and see if that solves more problems.