-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A library for generic programming that aims to be easy to understand -- -- Documentation is here: https://generics-eot.readthedocs.io/ @package generics-eot @version 0.4 -- | generics-eot tries to be a library for datatype generic -- programming that is easy to understand. "eot" stands for "eithers of -- tuples". -- -- A tutorial on how to use generics-eot can be found here: -- https://generics-eot.readthedocs.io/. module Generics.Eot -- | An instance (HasEot a) allows us to -- --
-- -- Once an algebraic datatype has an instance for Generic it -- automatically gets one for HasEot. class HasEot a where { type family Eot a :: *; } -- | Convert a value of type a to its generic representation. toEot :: HasEot a => a -> Eot a -- | Convert a value in a generic representation to a (inverse of -- toEot). fromEot :: HasEot a => Eot a -> a -- | Extract meta information about the ADT. datatype :: HasEot a => Proxy a -> Datatype -- | Type for meta information about ADTs. data Datatype Datatype :: String -> [Constructor] -> Datatype -- | unqualified name of the type [datatypeName] :: Datatype -> String [constructors] :: Datatype -> [Constructor] data Constructor Constructor :: String -> Fields -> Constructor [constructorName] :: Constructor -> String [fields] :: Constructor -> Fields -- | Type that represents meta information about fields of one constructor. data Fields -- | Record constructor, containing the list of the selector names. Selectors :: [String] -> Fields -- | Constructor with fields, but without selector names. The argument -- gives the number of fields. NoSelectors :: Int -> Fields -- | Constructor without fields. NoFields :: Fields -- | Representable types of kind *. This class is derivable in GHC with the -- DeriveGeneric flag on. class Generic a -- | A concrete, poly-kinded proxy type data Proxy k (t :: k) :: forall k. () => k -> * Proxy :: Proxy k -- | Uninhabited data type data Void :: * -- | Since Void values logically don't exist, this witnesses the -- logical reasoning tool of "ex falso quodlibet". absurd :: () => Void -> a instance (GHC.Generics.Generic a, Generics.Eot.ImpliedByGeneric a c f) => Generics.Eot.HasEot a