New Phrasebook entry: Inverting functions
Often we find ourselves needing a pair of related functions: 1. to encode some simple sum type as a string; 2. to parse a string back into that type. We show a simple pattern you can follow, with the help of GHC generics, to conveniently express this sort of bidirectional mapping.