/usr/share/doc/libghc-src-meta-doc/html/haskell-src-meta.txt is in libghc-src-meta-doc 0.6.0.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Parse source to template-haskell abstract syntax.
--
-- The translation from haskell-src-exts abstract syntax to
-- template-haskell abstract syntax isn't 100% complete yet.
@package haskell-src-meta
@version 0.6.0.4
-- | This module is exported for backwards-compatibility purposes. All it
-- does is re-export the instances defined in
-- <a>Language.Haskell.TH.Instances</a>, from the th-orphans package.
-- | <i>Deprecated: Use the th-orphans package instead. </i>
module Language.Haskell.TH.Instances.Lift
module Language.Haskell.Meta.Syntax.Translate
class ToName a
toName :: ToName a => a -> Name
class ToLit a
toLit :: ToLit a => a -> Lit
class ToType a
toType :: ToType a => a -> Type
class ToPat a
toPat :: ToPat a => a -> Pat
class ToExp a
toExp :: ToExp a => a -> Exp
class ToDecs a
toDecs :: ToDecs a => a -> [Dec]
class ToDec a
toDec :: ToDec a => a -> Dec
class ToStmt a
toStmt :: ToStmt a => a -> Stmt
class ToLoc a
toLoc :: ToLoc a => a -> Loc
moduleName :: [Char]
noTH :: Show e => String -> e -> a
noTHyet :: Show e => String -> String -> e -> a
todo :: Show e => String -> e -> a
nonsense :: Show e => String -> String -> e -> a
toFieldExp :: FieldUpdate -> FieldExp
toMatch :: Alt -> Match
toBody :: GuardedAlts -> Body
toGuard :: GuardedAlt -> (Guard, Exp)
toKind :: Kind -> Kind
toTyVar :: TyVarBind -> TyVarBndr
(.->.) :: Type -> Type -> Type
toCxt :: Context -> Cxt
foldAppT :: Type -> [Type] -> Type
hsBindsToDecs :: Binds -> [Dec]
hsBangTypeToStrictType :: BangType -> (Strict, Type)
transAct :: Activation -> Phases
qualConDeclToCon :: QualConDecl -> Con
conDeclToCon :: ConDecl -> Con
bangToVarStrictTypes :: [Name] -> BangType -> [VarStrictType]
bangToStrictType :: BangType -> StrictType
hsMatchesToFunD :: [Match] -> Dec
hsMatchToClause :: Match -> Clause
hsRhsToBody :: Rhs -> Body
hsGuardedRhsToBody :: GuardedRhs -> Body
hsStmtToGuard :: Stmt -> Guard
collectVars :: Type -> [TyVarBndr]
fixForall :: Type -> Type
instance ToDecs Binds
instance ToDecs a => ToDecs [a]
instance ToDecs Decl
instance ToDecs InstDecl
instance ToDec Decl
instance ToStmt Stmt
instance ToType Type
instance ToType Kind
instance ToName TyVarBndr
instance ToName Name
instance ToName TyVarBind
instance ToLoc SrcLoc
instance ToExp Exp
instance ToExp QOp
instance ToPat Pat
instance ToLit Literal
instance ToName Op
instance ToName QName
instance ToName SpecialCon
instance ToName Module
instance ToName Name
instance ToName String
instance ToLit Double
instance ToLit Float
instance ToLit Int
instance ToLit Integer
instance ToLit String
instance ToLit Char
instance (ToPat a, ToPat b, ToPat c, ToPat d) => ToPat (a, b, c, d)
instance (ToPat a, ToPat b, ToPat c) => ToPat (a, b, c)
instance (ToPat a, ToPat b) => ToPat (a, b)
instance ToPat a => ToPat [a]
instance ToPat Lit
instance (ToExp a, ToExp b, ToExp c, ToExp d) => ToExp (a, b, c, d)
instance (ToExp a, ToExp b, ToExp c) => ToExp (a, b, c)
instance (ToExp a, ToExp b) => ToExp (a, b)
instance ToExp a => ToExp [a]
instance ToExp Lit
module Language.Haskell.Meta.Parse
parsePat :: String -> Either String Pat
parseExp :: String -> Either String Exp
parseType :: String -> Either String Type
parseDecs :: String -> Either String [Dec]
-- | <i>Deprecated: The provided ParseModes aren't very meaningful, use
-- your own instead </i>
myDefaultParseMode :: ParseMode
-- | <i>Deprecated: The provided ParseModes aren't very meaningful, use
-- your own instead </i>
myDefaultExtensions :: [KnownExtension]
parseResultToEither :: ParseResult a -> Either String a
parseHsModule :: String -> Either String Module
parseHsDecls :: String -> Either String [Decl]
parseHsType :: String -> Either String Type
parseHsExp :: String -> Either String Exp
parseHsPat :: String -> Either String Pat
pprHsModule :: Module -> String
moduleDecls :: Module -> [Decl]
emptySrcLoc :: SrcLoc
emptyHsModule :: String -> Module
-- | This module provides the tools to handle operator fixities in infix
-- expressions correctly.
--
-- The problem we solve is the following. Consider making a quasiquoter
-- which antiquotes to Haskell - for instance, the quasiquoter in
-- <a>http://hackage.haskell.org/package/hmatrix-static</a> allows me to
-- write
--
-- <pre>
-- myVec :: Vector Double
-- myVec = [vec| 2+3*4, 5-4-3 |]
-- </pre>
--
-- To correctly parse such expressions, we need to know the fixities and
-- precedences of the operators, so that the above is parsed the same way
-- as
--
-- <pre>
-- myVec = [vec| 2+(3*4), (5-4)-3 |]
-- </pre>
--
-- There is a danger, if we are not careful in parsing, that the above
-- expression instead parses as
--
-- <pre>
-- myVec = [vec| (2+3)*4, 5-(4-3) |]
-- </pre>
--
-- which is a surprising bug, and would only be detected through testing
-- at runtime, rather than at compile time.
--
-- When this danger arises, we use this "careful" module. It handles
-- "unresolved infix" expressions such as <tt>2+3*4</tt> in two ways,
-- depending on the version of GHC:
--
-- <ul>
-- <li>in GHC 7.4 and above (where support for "unresolved infix" was
-- added in Template Haskell), resolution of the infix expression is
-- deferred to the compiler, which has all fixities available to it.</li>
-- <li>prior to GHC 7.4, any ambiguous infix expression is flagged as a
-- parse error at compile time, and the user is advised to resolve the
-- ambiguity by adding parentheses.</li>
-- </ul>
module Language.Haskell.Meta.Parse.Careful
parsePat :: String -> Either String Pat
parseExp :: String -> Either String Exp
parseType :: String -> Either String Type
parseDecs :: String -> Either String [Dec]
module Language.Haskell.Meta
-- | This module is a staging ground for to-be-organized-and-merged-nicely
-- code.
module Language.Haskell.Meta.Utils
cleanNames :: Data a => a -> a
-- | The type passed in must have a <tt>Show</tt> instance which produces a
-- valid Haskell expression. Returns an empty <tt>String</tt> if this is
-- not the case. This is not TH-specific, but useful in general.
pretty :: Show a => a -> String
pp :: (Data a, Ppr a) => a -> String
ppDoc :: (Data a, Ppr a) => a -> Doc
gpretty :: Data a => a -> String
-- | <pre>
-- unsafeRunQ = unsafePerformIO . runQ
-- </pre>
unsafeRunQ :: Q a -> a
nameToRawCodeStr :: Name -> String
(|$|) :: ExpQ -> ExpQ -> ExpQ
(|.|) :: ExpQ -> ExpQ -> ExpQ
(|->|) :: TypeQ -> TypeQ -> TypeQ
unForall :: Type -> Type
functionT :: [TypeQ] -> TypeQ
mkVarT :: String -> TypeQ
-- | Infinite list of names composed of lowercase letters
myNames :: [Name]
-- | Generalisation of renameTs
renameThings :: (t1 -> t2 -> t -> (a, t1, t2)) -> t1 -> t2 -> [a] -> [t] -> ([a], t1, t2)
-- | renameT applied to a list of types
renameTs :: [(Name, Name)] -> [Name] -> [Type] -> [Type] -> ([Type], [(Name, Name)], [Name])
-- | Rename type variables in the Type according to the given association
-- list. Normalise constructor names (remove qualification, etc.) If a
-- name is not found in the association list, replace it with one from
-- the fresh names list, and add this translation to the returned list.
-- The fresh names list should be infinite; myNames is a good example.
renameT :: [(Name, Name)] -> [Name] -> Type -> (Type, [(Name, Name)], [Name])
-- | Remove qualification, etc.
normaliseName :: Name -> Name
applyT :: Type -> Type -> Type
substT :: [(Name, Type)] -> [Name] -> Type -> Type
splitCon :: Con -> (Name, [Type])
strictTypeTy :: StrictType -> Type
varStrictTypeTy :: VarStrictType -> Type
conTypes :: Con -> [Type]
conToConType :: Type -> Con -> Type
decCons :: Dec -> [Con]
decTyVars :: Dec -> [TyVarBndr]
decName :: Dec -> Maybe Name
foreignName :: Foreign -> Name
unwindT :: Type -> [Type]
unwindE :: Exp -> [Exp]
-- | The arity of a Type.
arityT :: Type -> Int
typeToName :: Type -> Maybe Name
-- | Randomly useful.
nameSpaceOf :: Name -> Maybe NameSpace
conName :: Con -> Name
recCName :: Con -> Maybe Name
dataDCons :: Dec -> [Con]
fromDataConI :: Info -> Q (Maybe Exp)
fromTyConI :: Info -> Maybe Dec
mkFunD :: Name -> [Pat] -> Exp -> Dec
mkClauseQ :: [PatQ] -> ExpQ -> ClauseQ
-- | The strategy for producing QuasiQuoters which this datatype aims to
-- facilitate is as follows. Given a collection of datatypes which make
-- up the to-be-quasiquoted languages AST, make each type in this
-- collection an instance of at least <tt>Show</tt> and <tt>Lift</tt>.
-- Now, assuming <tt>parsePat</tt> and <tt>parseExp</tt>, both of type
-- <tt>String -> Q a</tt> (where <tt>a</tt> is the top level type of
-- the AST), are the pair of functions you wish to use for parsing in
-- pattern and expression context respectively, put them inside a
-- <tt>Quoter</tt> datatype and pass this to quasify.
toExpQ :: Lift a => (String -> Q a) -> (String -> ExpQ)
toPatQ :: Show a => (String -> Q a) -> (String -> PatQ)
showToPatQ :: Show a => a -> PatQ
eitherQ :: (e -> String) -> Either e a -> Q a
normalizeT :: Data a => a -> a
instance Typeable QuasiQuoter
instance Typeable1 Q
instance Show (Q Doc)
instance Show (Q String)
instance Show TypeQ
instance Show DecQ
instance Show (Q [Dec])
instance Show ExpQ
|