-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Interactive editors for Generics
--
@package editable
@version 1.0.0.2
module Data.Editable
-- | 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.
--
class Editable a where editor = fmap to . geditor Nothing Nothing . from
editor :: Editable a => a -> IO a
-- | 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.
class Parseable a
reader :: Parseable a => String -> Either String a
shower :: Parseable a => a -> String
typeName :: Parseable a => a -> String
instance [overlap ok] GEditable U1
instance [overlap ok] (GEditable b, GEditable c) => GEditable (b :+: c)
instance [overlap ok] (GEditable b, GEditable c) => GEditable (b :*: c)
instance [overlap ok] (GEditable e, Selector c) => GEditable (M1 S c e)
instance [overlap ok] (GEditable e, Datatype c) => GEditable (M1 D c e)
instance [overlap ok] (GEditable e, Constructor c) => GEditable (M1 C c e)
instance [overlap ok] Parseable e => GEditable (K1 i e)
instance [overlap ok] (Show a, Read a, Typeable a) => Parseable a
instance [overlap ok] Parseable [Char]