editable- Interactive editors for Generics

Safe HaskellNone




class Editable a where Source

Launch an editor for a value with editor. Editable can be derived with instance Editable a so long as:

  • a instances Generic (i.e. have deriving Generics on the type).
  • All the constructors' fields' types are Parseable.

Minimal complete definition



editor :: a -> IO a Source

Launch an interactive editor for a value.

class Parseable a where Source

A type is parseable if you can:

  • From a string return either a value or an error message.
  • Represent a value as a string.
  • Showing a value then reading it yields the same value.
  • The type can be pretty printed.

With overlapping instances, you get this instance for free for any type that is in Show, Read and Typeable. The String instance is also provided so quotes are not required.


(Show a, Read a, Typeable * a) => Parseable a 
Parseable [Char]