Language.Haskell.Meta.Syntax.Translate

haskell-src-meta-0.7.0.1: Parse source to template-haskell abstract syntax.

Copyright | (c) Matt Morrow 2008
License | BSD3
Maintainer | Matt Morrow <mjm2002@gmail.com>
Stability | experimental
Portability | portable (template-haskell)
Safe Haskell | None
Language | Haskell98

Language.Haskell.Meta.Syntax.Translate

Contents

- ToName {String,HsName,Module,HsSpecialCon,HsQName}
- ToLit HsLiteral
- ToPat HsPat
- ToExp HsExp
- ToLoc SrcLoc
- ToType HsType
- ToStmt HsStmt
- ToDec HsDecl
- ToDecs InstDecl
- ToDecs HsDecl HsBinds

Description

Synopsis

- class ToName a where
- class ToNames a where
- class ToLit a where
- class ToType a where
- class ToPat a where
- class ToExp a where
- class ToDecs a where
- class ToDec a where
- class ToStmt a where
- class ToLoc a where
- class ToCxt a where
- class ToPred a where
- class ToTyVars a where
- class ToMaybeKind a where
- class ToInjectivityAnn a where
- moduleName :: [Char]
- noTH :: (Functor f, Show (f ())) => String -> f e -> a
- noTHyet :: (Functor f, Show (f ())) => String -> String -> f e -> a
- todo :: (Functor f, Show (f ())) => String -> f e -> a
- nonsense :: (Functor f, Show (f ())) => String -> String -> f e -> a
- toFieldExp :: FieldUpdate l -> FieldExp
- toMatch :: Alt l -> Match
- toBody :: Rhs l -> Body
- toGuard :: GuardedRhs t -> (Guard, Exp)
- toKind :: Kind l -> Kind
- toTyVar :: TyVarBind l -> TyVarBndr
- toStrictType :: Type l -> StrictType
- (.->.) :: Type -> Type -> Type
- foldAppT :: Type -> [Type] -> Type
- transAct :: Maybe (Activation l) -> Phases
- qualConDeclToCon :: QualConDecl l -> Con
- conDeclToCon :: ConDecl l -> Con
- hsMatchesToFunD :: [Match l] -> Dec
- hsMatchToClause :: Match l -> Clause
- hsRhsToBody :: Rhs l -> Body
- hsGuardedRhsToBody :: GuardedRhs l -> Body
- hsStmtToGuard :: Stmt l -> Guard
- collectVars :: Type -> [TyVarBndr]
- fixForall :: Type -> Type

# Documentation

class ToName a where #

Minimal complete definition

toName

Methods

toName :: a -> Name #

Instances

ToName Name # |
Methods toName :: Name -> Name #
ToName TyVarBndr # |
Methods toName :: TyVarBndr -> Name #
ToName String # |
Methods toName :: String -> Name #
ToName (SpecialCon l) # |
Methods toName :: SpecialCon l -> Name #
ToName (QName l) # |
Methods toName :: QName l -> Name #
ToName (Name l) # |
Methods toName :: Name l -> Name #
ToName (Op l) # |
Methods toName :: Op l -> Name #
ToName (DeclHead l) # |
Methods toName :: DeclHead l -> Name #
ToName (TyVarBind l) # |
Methods toName :: TyVarBind l -> Name #

class ToNames a where #

Minimal complete definition

toNames

Methods

toNames :: a -> [Name] #

Instances

ToNames a => ToNames (Maybe a) # |
Methods toNames :: Maybe a -> [Name] #
ToNames (InstRule l) # |
Methods toNames :: InstRule l -> [Name] #
ToNames (InstHead l) # |
Methods toNames :: InstHead l -> [Name] #
ToNames (Deriving l) # |
Methods toNames :: Deriving l -> [Name] #

class ToLit a where #

Minimal complete definition

toLit

Methods

toLit :: a -> Lit #

Instances

ToLit Char # |
Methods toLit :: Char -> Lit #
ToLit Double # |
Methods toLit :: Double -> Lit #
ToLit Float # |
Methods toLit :: Float -> Lit #
ToLit Int # |
Methods toLit :: Int -> Lit #
ToLit Integer # |
Methods toLit :: Integer -> Lit #
ToLit String # |
Methods toLit :: String -> Lit #
ToLit (Literal l) # |
Methods toLit :: Literal l -> Lit #

class ToType a where #

Minimal complete definition

toType

Methods

toType :: a -> Type #

Instances

ToType (QName l) # |
Methods toType :: QName l -> Type #
ToType (InstRule l) # |
Methods toType :: InstRule l -> Type #
ToType (InstHead l) # |
Methods toType :: InstHead l -> Type #
ToType (Type l) # |
Methods toType :: Type l -> Type #
ToType (Kind l) # |
Methods toType :: Kind l -> Type #

class ToPat a where #

Minimal complete definition

toPat

Methods

toPat :: a -> Pat #

Instances

ToPat Lit # |
Methods toPat :: Lit -> Pat #
ToPat a => ToPat [a] # |
Methods toPat :: [a] -> Pat #
ToPat (Pat l) # |
Methods toPat :: Pat l -> Pat #
(ToPat a, ToPat b) => ToPat (a, b) # |
Methods toPat :: (a, b) -> Pat #
(ToPat a, ToPat b, ToPat c) => ToPat (a, b, c) # |
Methods toPat :: (a, b, c) -> Pat #
(ToPat a, ToPat b, ToPat c, ToPat d) => ToPat (a, b, c, d) # |
Methods toPat :: (a, b, c, d) -> Pat #

class ToExp a where #

Minimal complete definition

toExp

Methods

toExp :: a -> Exp #

Instances

ToExp Lit # |
Methods toExp :: Lit -> Exp #
ToExp a => ToExp [a] # |
Methods toExp :: [a] -> Exp #
ToExp (QOp l) # |
Methods toExp :: QOp l -> Exp #
ToExp (Exp l) # |
Methods toExp :: Exp l -> Exp #
(ToExp a, ToExp b) => ToExp (a, b) # |
Methods toExp :: (a, b) -> Exp #
(ToExp a, ToExp b, ToExp c) => ToExp (a, b, c) # |
Methods toExp :: (a, b, c) -> Exp #
(ToExp a, ToExp b, ToExp c, ToExp d) => ToExp (a, b, c, d) # |
Methods toExp :: (a, b, c, d) -> Exp #

class ToDecs a where #

Minimal complete definition

toDecs

Methods

toDecs :: a -> [Dec] #

Instances

ToDecs a => ToDecs [a] # |
Methods toDecs :: [a] -> [Dec] #
ToDecs a => ToDecs (Maybe a) # |
Methods toDecs :: Maybe a -> [Dec] #
ToDecs (Decl l) # |
Methods toDecs :: Decl l -> [Dec] #
ToDecs (Binds l) # |
Methods toDecs :: Binds l -> [Dec] #
ToDecs (ClassDecl l) # |
Methods toDecs :: ClassDecl l -> [Dec] #
ToDecs (InstDecl l) # |
Methods toDecs :: InstDecl l -> [Dec] #

class ToDec a where #

Minimal complete definition

toDec

Methods

toDec :: a -> Dec #

Instances

ToDec (Decl l) # |
Methods toDec :: Decl l -> Dec #

class ToStmt a where #

Minimal complete definition

toStmt

Methods

toStmt :: a -> Stmt #

Instances

ToStmt (Stmt l) # |
Methods toStmt :: Stmt l -> Stmt #

class ToLoc a where #

Minimal complete definition

toLoc

Methods

toLoc :: a -> Loc #

Instances

ToLoc SrcLoc # |
Methods toLoc :: SrcLoc -> Loc #

class ToCxt a where #

Minimal complete definition

toCxt

Methods

toCxt :: a -> Cxt #

Instances

ToCxt [InstRule l] # |
Methods toCxt :: [InstRule l] -> Cxt #
ToCxt a => ToCxt (Maybe a) # |
Methods toCxt :: Maybe a -> Cxt #
ToCxt (InstRule l) # |
Methods toCxt :: InstRule l -> Cxt #
ToCxt (Deriving l) # |
Methods toCxt :: Deriving l -> Cxt #
ToCxt (Context l) # |
Methods toCxt :: Context l -> Cxt #

class ToPred a where #

Minimal complete definition

toPred

Methods

toPred :: a -> Pred #

Instances

ToPred (Asst l) # |
Methods toPred :: Asst l -> Pred #

class ToTyVars a where #

Minimal complete definition

toTyVars

Methods

toTyVars :: a -> [TyVarBndr] #

Instances

ToTyVars a => ToTyVars [a] # |
Methods toTyVars :: [a] -> [TyVarBndr] #
ToTyVars a => ToTyVars (Maybe a) # |
Methods toTyVars :: Maybe a -> [TyVarBndr] #
ToTyVars (DeclHead l) # |
Methods toTyVars :: DeclHead l -> [TyVarBndr] #
ToTyVars (TyVarBind l) # |
Methods toTyVars :: TyVarBind l -> [TyVarBndr] #

class ToMaybeKind a where #

Minimal complete definition

toMaybeKind

Methods

toMaybeKind :: a -> Maybe Kind #

Instances

ToMaybeKind a => ToMaybeKind (Maybe a) # |
Methods toMaybeKind :: Maybe a -> Maybe Kind #
ToMaybeKind (ResultSig l) # |
Methods toMaybeKind :: ResultSig l -> Maybe Kind #

class ToInjectivityAnn a where #

Minimal complete definition

toInjectivityAnn

Methods

toInjectivityAnn :: a -> InjectivityAnn #

Instances

ToInjectivityAnn (InjectivityInfo l) # |
Methods toInjectivityAnn :: InjectivityInfo l -> InjectivityAnn #

moduleName :: [Char] #

noTH :: (Functor f, Show (f ())) => String -> f e -> a #

noTHyet :: (Functor f, Show (f ())) => String -> String -> f e -> a #

todo :: (Functor f, Show (f ())) => String -> f e -> a #

nonsense :: (Functor f, Show (f ())) => String -> String -> f e -> a #

# ToName {String,HsName,Module,HsSpecialCon,HsQName}

# ToLit HsLiteral

# ToPat HsPat

# ToExp HsExp

toFieldExp :: FieldUpdate l -> FieldExp #

toMatch :: Alt l -> Match #

toBody :: Rhs l -> Body #

toGuard :: GuardedRhs t -> (Guard, Exp) #

# ToLoc SrcLoc

# ToType HsType

toKind :: Kind l -> Kind #

toTyVar :: TyVarBind l -> TyVarBndr #

toStrictType :: Type l -> StrictType #

(.->.) :: Type -> Type -> Type #

foldAppT :: Type -> [Type] -> Type #

# ToStmt HsStmt

# ToDec HsDecl

transAct :: Maybe (Activation l) -> Phases #

qualConDeclToCon :: QualConDecl l -> Con #

conDeclToCon :: ConDecl l -> Con #

hsMatchesToFunD :: [Match l] -> Dec #

hsMatchToClause :: Match l -> Clause #

hsRhsToBody :: Rhs l -> Body #

hsGuardedRhsToBody :: GuardedRhs l -> Body #

hsStmtToGuard :: Stmt l -> Guard #

# ToDecs InstDecl

# ToDecs HsDecl HsBinds

collectVars :: Type -> [TyVarBndr] #

fixForall :: Type -> Type #