-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Data To Class transformation.
--
-- Create a class definition from a data declaration.
--
-- How this package works is explained in Data Declarations to Class
-- Definitions (see
-- http://daniel-diaz.github.io/projects/dtc/dtc.pdf).
@package DTC
@version 1.1.0.1
-- | Some useful functions.
module Language.Haskell.DTC.Mod
-- | Lift a function over [HsDecl] to a function
-- over HsModule.
modifyHsDecls :: ([Decl] -> [Decl]) -> (Module -> Module)
-- | Skip a bang in a type.
unBangType :: BangType -> Type
-- | Extract the Name of a TyVarBind.
tyVarName :: TyVarBind -> Name
-- | Lift a function over String to a function over HsName.
modifyHsName :: (String -> String) -> (Name -> Name)
-- | Class definition from a data declaration.
module Language.Haskell.DTC.Class
-- | Transform a data declaration to a class definition. The String
-- argument will be the name of the type variable of the class
-- definition.
dataToClassWith :: String -> Decl -> Decl
-- | Transform a data declaration to a class definition. Equivalent to
-- dataToClassWith "t".
dataToClass :: Decl -> Decl
module Language.Haskell.DTC.DataInfo
-- | Information about names in a data declaration.
data DataInfo
DataInfo :: Name -> [(Name, Int)] -> [(Name, [Name])] -> DataInfo
-- | The data type name.
dataName :: DataInfo -> Name
-- | Ordinary constructor names, and their number of arguments.
consList :: DataInfo -> [(Name, Int)]
-- | Record constructor names and their field names.
rconsList :: DataInfo -> [(Name, [Name])]
-- | Extract a DataInfo from a declaration. Returns Nothing
-- if the argument is not a data declaration.
dataInfo :: Decl -> Maybe DataInfo
-- | Extract DataInfo from all data declarations in a module.
moduleDataInfo :: Module -> [DataInfo]
instance Show DataInfo
-- | All you need to parse a module.
module Language.Haskell.DTC.Parser
-- | The result of a parse.
data ParseResult a :: * -> *
-- | The parse succeeded, yielding a value.
ParseOk :: a -> ParseResult a
-- | The parse failed at the specified source location, with an error
-- message.
ParseFailed :: SrcLoc -> String -> ParseResult a
-- | A complete Haskell source module.
data Module :: *
-- | Static parameters governing a parse. Note that the various parse
-- functions in Language.Haskell.Exts.Parser never look at
-- LANGUAGE pragmas, regardless of what the
-- ignoreLanguagePragmas flag is set to. Only the various
-- parseFile functions in Language.Haskell.Exts will act
-- on it, when set to False.
data ParseMode :: *
ParseMode :: String -> [Extension] -> Bool -> Bool -> Maybe [Fixity] -> ParseMode
-- | original name of the file being parsed
parseFilename :: ParseMode -> String
-- | list of extensions enabled for parsing
extensions :: ParseMode -> [Extension]
-- | if True, the parser won't care about further extensions in
-- LANGUAGE pragmas in source files
ignoreLanguagePragmas :: ParseMode -> Bool
-- | if True, the parser won't read line position information from
-- LINE pragmas in source files
ignoreLinePragmas :: ParseMode -> Bool
-- | list of fixities to be aware of
fixities :: ParseMode -> Maybe [Fixity]
-- | Default parameters for a parse. The default is an unknown filename, no
-- extensions (i.e. Haskell 98), don't ignore LANGUAGE pragmas, do ignore
-- LINE pragmas, and be aware of fixities from the Prelude.
defaultParseMode :: ParseMode
-- | Parse of a string, which should contain a complete Haskell module.
parseModule :: String -> ParseResult Module
-- | Parse of a string containing a complete Haskell module, using an
-- explicit mode.
parseModuleWithMode :: ParseMode -> String -> ParseResult Module
-- | Parse a module from a source code file. It throws an error if parsing
-- fails.
parseModuleWithSrc :: FilePath -> ParseMode -> IO Module
-- | Main module of DTC.
module Language.Haskell.DTC