Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- instances :: QuasiQuoter
- splitInstances :: Dec -> DecsQ
- globalizeClass :: Name -> Q Name
- getClassOps :: Traversable t => t Dec -> Map ParentName (Set Name) -> Q (Map ParentName (Set Name))
- defName :: Dec -> Name
- sigName :: Dec -> Name
- getSuperclassNames :: Name -> Q [Name]
- getClassMethods :: Name -> Q (Set Name)
- getTransitiveSuperclassNames :: Name -> Q (Map Name (Set a))
- occName :: Name -> String
- getTransitiveSuperclassNames' :: Name -> Q (Map Name Int)
- transitiveProvidedDefaults :: Name -> Q (Map Name Dec)
- providedDefaults :: Name -> Q (Map Name Name)
- guard :: Alternative f => Bool -> f ()
- returnQ :: a -> Q a
- bindQ :: Q a -> (a -> Q b) -> Q b
- sequenceQ :: [Q a] -> Q [a]
- newName :: String -> Q Name
- mkName :: String -> Name
- mkNameG_v :: String -> String -> String -> Name
- mkNameG_d :: String -> String -> String -> Name
- mkNameG_tc :: String -> String -> String -> Name
- mkNameL :: String -> Uniq -> Name
- mkNameS :: String -> Name
- unTypeQ :: Q (TExp a) -> Q Exp
- unsafeTExpCoerce :: Q Exp -> Q (TExp a)
- charL :: Char -> Lit
- stringL :: String -> Lit
- integerL :: Integer -> Lit
- intPrimL :: Integer -> Lit
- wordPrimL :: Integer -> Lit
- floatPrimL :: Rational -> Lit
- doublePrimL :: Rational -> Lit
- rationalL :: Rational -> Lit
- stringPrimL :: [Word8] -> Lit
- charPrimL :: Char -> Lit
- liftString :: String -> Q Exp
- litP :: Lit -> PatQ
- varP :: Name -> PatQ
- tupP :: [PatQ] -> PatQ
- unboxedTupP :: [PatQ] -> PatQ
- unboxedSumP :: PatQ -> SumAlt -> SumArity -> PatQ
- conP :: Name -> [PatQ] -> PatQ
- infixP :: PatQ -> Name -> PatQ -> PatQ
- tildeP :: PatQ -> PatQ
- bangP :: PatQ -> PatQ
- asP :: Name -> PatQ -> PatQ
- wildP :: PatQ
- recP :: Name -> [FieldPatQ] -> PatQ
- listP :: [PatQ] -> PatQ
- sigP :: PatQ -> TypeQ -> PatQ
- viewP :: ExpQ -> PatQ -> PatQ
- fieldPat :: Name -> PatQ -> FieldPatQ
- match :: PatQ -> BodyQ -> [DecQ] -> MatchQ
- clause :: [PatQ] -> BodyQ -> [DecQ] -> ClauseQ
- varE :: Name -> ExpQ
- conE :: Name -> ExpQ
- litE :: Lit -> ExpQ
- appE :: ExpQ -> ExpQ -> ExpQ
- appTypeE :: ExpQ -> TypeQ -> ExpQ
- infixE :: Maybe ExpQ -> ExpQ -> Maybe ExpQ -> ExpQ
- infixApp :: ExpQ -> ExpQ -> ExpQ -> ExpQ
- sectionL :: ExpQ -> ExpQ -> ExpQ
- sectionR :: ExpQ -> ExpQ -> ExpQ
- lamE :: [PatQ] -> ExpQ -> ExpQ
- lamCaseE :: [MatchQ] -> ExpQ
- tupE :: [ExpQ] -> ExpQ
- unboxedTupE :: [ExpQ] -> ExpQ
- unboxedSumE :: ExpQ -> SumAlt -> SumArity -> ExpQ
- condE :: ExpQ -> ExpQ -> ExpQ -> ExpQ
- multiIfE :: [Q (Guard, Exp)] -> ExpQ
- letE :: [DecQ] -> ExpQ -> ExpQ
- caseE :: ExpQ -> [MatchQ] -> ExpQ
- doE :: [StmtQ] -> ExpQ
- compE :: [StmtQ] -> ExpQ
- fromE :: ExpQ -> ExpQ
- fromThenE :: ExpQ -> ExpQ -> ExpQ
- fromToE :: ExpQ -> ExpQ -> ExpQ
- fromThenToE :: ExpQ -> ExpQ -> ExpQ -> ExpQ
- listE :: [ExpQ] -> ExpQ
- sigE :: ExpQ -> TypeQ -> ExpQ
- recConE :: Name -> [Q (Name, Exp)] -> ExpQ
- recUpdE :: ExpQ -> [Q (Name, Exp)] -> ExpQ
- staticE :: ExpQ -> ExpQ
- unboundVarE :: Name -> ExpQ
- labelE :: String -> ExpQ
- fieldExp :: Name -> ExpQ -> Q (Name, Exp)
- guardedB :: [Q (Guard, Exp)] -> BodyQ
- normalB :: ExpQ -> BodyQ
- normalGE :: ExpQ -> ExpQ -> Q (Guard, Exp)
- patGE :: [StmtQ] -> ExpQ -> Q (Guard, Exp)
- bindS :: PatQ -> ExpQ -> StmtQ
- letS :: [DecQ] -> StmtQ
- noBindS :: ExpQ -> StmtQ
- parS :: [[StmtQ]] -> StmtQ
- funD :: Name -> [ClauseQ] -> DecQ
- valD :: PatQ -> BodyQ -> [DecQ] -> DecQ
- instanceWithOverlapD :: Maybe Overlap -> CxtQ -> TypeQ -> [DecQ] -> DecQ
- sigD :: Name -> TypeQ -> DecQ
- forImpD :: Callconv -> Safety -> String -> Name -> TypeQ -> DecQ
- pragInlD :: Name -> Inline -> RuleMatch -> Phases -> DecQ
- pragSpecD :: Name -> TypeQ -> Phases -> DecQ
- pragSpecInlD :: Name -> TypeQ -> Inline -> Phases -> DecQ
- pragSpecInstD :: TypeQ -> DecQ
- pragRuleD :: String -> [RuleBndrQ] -> ExpQ -> ExpQ -> Phases -> DecQ
- pragAnnD :: AnnTarget -> ExpQ -> DecQ
- tySynInstD :: Name -> TySynEqnQ -> DecQ
- infixLD :: Int -> Name -> DecQ
- infixRD :: Int -> Name -> DecQ
- infixND :: Int -> Name -> DecQ
- roleAnnotD :: Name -> [Role] -> DecQ
- standaloneDerivWithStrategyD :: Maybe DerivStrategy -> CxtQ -> TypeQ -> DecQ
- defaultSigD :: Name -> TypeQ -> DecQ
- patSynD :: Name -> PatSynArgsQ -> PatSynDirQ -> PatQ -> DecQ
- patSynSigD :: Name -> TypeQ -> DecQ
- pragCompleteD :: [Name] -> Maybe Name -> DecQ
- cxt :: [PredQ] -> CxtQ
- noSourceUnpackedness :: SourceUnpackednessQ
- sourceNoUnpack :: SourceUnpackednessQ
- sourceUnpack :: SourceUnpackednessQ
- noSourceStrictness :: SourceStrictnessQ
- sourceLazy :: SourceStrictnessQ
- sourceStrict :: SourceStrictnessQ
- normalC :: Name -> [BangTypeQ] -> ConQ
- recC :: Name -> [VarBangTypeQ] -> ConQ
- infixC :: Q (Bang, Type) -> Name -> Q (Bang, Type) -> ConQ
- gadtC :: [Name] -> [StrictTypeQ] -> TypeQ -> ConQ
- recGadtC :: [Name] -> [VarStrictTypeQ] -> TypeQ -> ConQ
- bang :: SourceUnpackednessQ -> SourceStrictnessQ -> BangQ
- bangType :: BangQ -> TypeQ -> BangTypeQ
- varBangType :: Name -> BangTypeQ -> VarBangTypeQ
- unidir :: PatSynDirQ
- implBidir :: PatSynDirQ
- explBidir :: [ClauseQ] -> PatSynDirQ
- prefixPatSyn :: [Name] -> PatSynArgsQ
- infixPatSyn :: Name -> Name -> PatSynArgsQ
- recordPatSyn :: [Name] -> PatSynArgsQ
- varT :: Name -> TypeQ
- conT :: Name -> TypeQ
- tupleT :: Int -> TypeQ
- unboxedTupleT :: Int -> TypeQ
- unboxedSumT :: SumArity -> TypeQ
- arrowT :: TypeQ
- listT :: TypeQ
- appT :: TypeQ -> TypeQ -> TypeQ
- equalityT :: TypeQ
- litT :: TyLitQ -> TypeQ
- promotedT :: Name -> TypeQ
- promotedTupleT :: Int -> TypeQ
- promotedNilT :: TypeQ
- promotedConsT :: TypeQ
- wildCardT :: TypeQ
- numTyLit :: Integer -> TyLitQ
- strTyLit :: String -> TyLitQ
- nominalR :: Role
- representationalR :: Role
- phantomR :: Role
- inferR :: Role
- varK :: Name -> Kind
- conK :: Name -> Kind
- tupleK :: Int -> Kind
- arrowK :: Kind
- listK :: Kind
- appK :: Kind -> Kind -> Kind
- injectivityAnn :: Name -> [Name] -> InjectivityAnn
- cCall :: Callconv
- stdCall :: Callconv
- cApi :: Callconv
- prim :: Callconv
- javaScript :: Callconv
- unsafe :: Safety
- safe :: Safety
- interruptible :: Safety
- funDep :: [Name] -> [Name] -> FunDep
- tySynEqn :: [TypeQ] -> TypeQ -> TySynEqnQ
- ruleVar :: Name -> RuleBndrQ
- typedRuleVar :: Name -> TypeQ -> RuleBndrQ
- valueAnnotation :: Name -> AnnTarget
- typeAnnotation :: Name -> AnnTarget
- moduleAnnotation :: AnnTarget
- derivClause :: Maybe DerivStrategy -> [PredQ] -> DerivClauseQ
- join :: Monad m => m (m a) -> m a
- class Applicative m => Monad (m :: * -> *) where
- class Functor (f :: * -> *) where
- class Monad m => MonadFix (m :: * -> *) where
- class Foldable (t :: * -> *) where
- mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
- sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
- (<>) :: Semigroup a => a -> a -> a
- class Semigroup a => Monoid a where
- class Lift t
- data Exp
- = VarE Name
- | ConE Name
- | LitE Lit
- | AppE Exp Exp
- | AppTypeE Exp Type
- | InfixE (Maybe Exp) Exp (Maybe Exp)
- | UInfixE Exp Exp Exp
- | ParensE Exp
- | LamE [Pat] Exp
- | LamCaseE [Match]
- | TupE [Exp]
- | UnboxedTupE [Exp]
- | UnboxedSumE Exp SumAlt SumArity
- | CondE Exp Exp Exp
- | MultiIfE [(Guard, Exp)]
- | LetE [Dec] Exp
- | CaseE Exp [Match]
- | DoE [Stmt]
- | CompE [Stmt]
- | ArithSeqE Range
- | ListE [Exp]
- | SigE Exp Type
- | RecConE Name [FieldExp]
- | RecUpdE Exp [FieldExp]
- | StaticE Exp
- | UnboundVarE Name
- | LabelE String
- data Match = Match Pat Body [Dec]
- data Clause = Clause [Pat] Body [Dec]
- newtype Q a = Q {}
- type ExpQ = Q Exp
- type DecQ = Q Dec
- data Pat
- type MatchQ = Q Match
- type ClauseQ = Q Clause
- type StmtQ = Q Stmt
- type ConQ = Q Con
- type TypeQ = Q Type
- data Type
- = ForallT [TyVarBndr] Cxt Type
- | AppT Type Type
- | SigT Type Kind
- | VarT Name
- | ConT Name
- | PromotedT Name
- | InfixT Type Name Type
- | UInfixT Type Name Type
- | ParensT Type
- | TupleT Int
- | UnboxedTupleT Int
- | UnboxedSumT SumArity
- | ArrowT
- | EqualityT
- | ListT
- | PromotedTupleT Int
- | PromotedNilT
- | PromotedConsT
- | StarT
- | ConstraintT
- | LitT TyLit
- | WildCardT
- data Dec
- = FunD Name [Clause]
- | ValD Pat Body [Dec]
- | DataD Cxt Name [TyVarBndr] (Maybe Kind) [Con] [DerivClause]
- | NewtypeD Cxt Name [TyVarBndr] (Maybe Kind) Con [DerivClause]
- | TySynD Name [TyVarBndr] Type
- | ClassD Cxt Name [TyVarBndr] [FunDep] [Dec]
- | InstanceD (Maybe Overlap) Cxt Type [Dec]
- | SigD Name Type
- | ForeignD Foreign
- | InfixD Fixity Name
- | PragmaD Pragma
- | DataFamilyD Name [TyVarBndr] (Maybe Kind)
- | DataInstD Cxt Name [Type] (Maybe Kind) [Con] [DerivClause]
- | NewtypeInstD Cxt Name [Type] (Maybe Kind) Con [DerivClause]
- | TySynInstD Name TySynEqn
- | OpenTypeFamilyD TypeFamilyHead
- | ClosedTypeFamilyD TypeFamilyHead [TySynEqn]
- | RoleAnnotD Name [Role]
- | StandaloneDerivD (Maybe DerivStrategy) Cxt Type
- | DefaultSigD Name Type
- | PatSynD Name PatSynArgs PatSynDir Pat
- | PatSynSigD Name PatSynType
- type BangTypeQ = Q BangType
- type VarBangTypeQ = Q VarBangType
- type FieldExp = (Name, Exp)
- type FieldPat = (Name, Pat)
- data Name = Name OccName NameFlavour
- type PatQ = Q Pat
- type FieldPatQ = Q FieldPat
- type FieldExpQ = Q FieldExp
- data FunDep = FunDep [Name] [Name]
- type Pred = Type
- type PredQ = Q Pred
- type TyVarBndrQ = Q TyVarBndr
- type DecsQ = Q [Dec]
- type RuleBndrQ = Q RuleBndr
- type TySynEqnQ = Q TySynEqn
- newtype TExp a = TExp {}
- data InjectivityAnn = InjectivityAnn Name [Name]
- type KindQ = Q Kind
- data Overlap
- type DerivClauseQ = Q DerivClause
- data DerivStrategy
- class Monad m => MonadIO (m :: * -> *) where
- mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
- (<$!>) :: Monad m => (a -> b) -> m a -> m b
- unless :: Applicative f => Bool -> f () -> f ()
- replicateM_ :: Applicative m => Int -> m a -> m ()
- replicateM :: Applicative m => Int -> m a -> m [a]
- foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
- foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
- forever :: Applicative f => f a -> f b
- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- find :: Foldable t => (a -> Bool) -> t a -> Maybe a
- notElem :: (Foldable t, Eq a) => a -> t a -> Bool
- minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- all :: Foldable t => (a -> Bool) -> t a -> Bool
- any :: Foldable t => (a -> Bool) -> t a -> Bool
- or :: Foldable t => t Bool -> Bool
- and :: Foldable t => t Bool -> Bool
- concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- concat :: Foldable t => t [a] -> [a]
- msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
- asum :: (Foldable t, Alternative f) => t (f a) -> f a
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()
- forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
- traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
- foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b
- newtype First a = First {}
- newtype Last a = Last {}
- newtype Dual a = Dual {
- getDual :: a
- newtype Endo a = Endo {
- appEndo :: a -> a
- newtype All = All {}
- newtype Any = Any {}
- newtype Sum a = Sum {
- getSum :: a
- newtype Product a = Product {
- getProduct :: a
- newtype Alt (f :: k -> *) (a :: k) :: forall k. (k -> *) -> k -> * = Alt {
- getAlt :: f a
- fix :: (a -> a) -> a
- void :: Functor f => f a -> f ()
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- ap :: Monad m => m (a -> b) -> m a -> m b
- liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
- liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
- liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
- liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- when :: Applicative f => Bool -> f () -> f ()
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- class (Alternative m, Monad m) => MonadPlus (m :: * -> *) where
- fromList :: Ord k => [(k, a)] -> Map k a
- traverseWithKey :: Applicative t => (k -> a -> t b) -> Map k a -> t (Map k b)
- adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a
- insert :: Ord k => k -> a -> Map k a -> Map k a
- lookup :: Ord k => k -> Map k a -> Maybe a
- data Map k a
- data Extension
- = Cpp
- | OverlappingInstances
- | UndecidableInstances
- | IncoherentInstances
- | UndecidableSuperClasses
- | MonomorphismRestriction
- | MonoPatBinds
- | MonoLocalBinds
- | RelaxedPolyRec
- | ExtendedDefaultRules
- | ForeignFunctionInterface
- | UnliftedFFITypes
- | InterruptibleFFI
- | CApiFFI
- | GHCForeignImportPrim
- | JavaScriptFFI
- | ParallelArrays
- | Arrows
- | TemplateHaskell
- | TemplateHaskellQuotes
- | QuasiQuotes
- | ImplicitParams
- | ImplicitPrelude
- | ScopedTypeVariables
- | AllowAmbiguousTypes
- | UnboxedTuples
- | UnboxedSums
- | BangPatterns
- | TypeFamilies
- | TypeFamilyDependencies
- | TypeInType
- | OverloadedStrings
- | OverloadedLists
- | NumDecimals
- | DisambiguateRecordFields
- | RecordWildCards
- | RecordPuns
- | ViewPatterns
- | GADTs
- | GADTSyntax
- | NPlusKPatterns
- | DoAndIfThenElse
- | RebindableSyntax
- | ConstraintKinds
- | PolyKinds
- | DataKinds
- | InstanceSigs
- | ApplicativeDo
- | StandaloneDeriving
- | DeriveDataTypeable
- | AutoDeriveTypeable
- | DeriveFunctor
- | DeriveTraversable
- | DeriveFoldable
- | DeriveGeneric
- | DefaultSignatures
- | DeriveAnyClass
- | DeriveLift
- | DerivingStrategies
- | TypeSynonymInstances
- | FlexibleContexts
- | FlexibleInstances
- | ConstrainedClassMethods
- | MultiParamTypeClasses
- | NullaryTypeClasses
- | FunctionalDependencies
- | UnicodeSyntax
- | ExistentialQuantification
- | MagicHash
- | EmptyDataDecls
- | KindSignatures
- | RoleAnnotations
- | ParallelListComp
- | TransformListComp
- | MonadComprehensions
- | GeneralizedNewtypeDeriving
- | RecursiveDo
- | PostfixOperators
- | TupleSections
- | PatternGuards
- | LiberalTypeSynonyms
- | RankNTypes
- | ImpredicativeTypes
- | TypeOperators
- | ExplicitNamespaces
- | PackageImports
- | ExplicitForAll
- | AlternativeLayoutRule
- | AlternativeLayoutRuleTransitional
- | DatatypeContexts
- | NondecreasingIndentation
- | RelaxedLayout
- | TraditionalRecordSyntax
- | LambdaCase
- | MultiWayIf
- | BinaryLiterals
- | NegativeLiterals
- | HexFloatLiterals
- | DuplicateRecordFields
- | OverloadedLabels
- | EmptyCase
- | PatternSynonyms
- | PartialTypeSignatures
- | NamedWildCards
- | StaticPointers
- | TypeApplications
- | Strict
- | StrictData
- | MonadFailDesugaring
- | EmptyDataDeriving
- data ForeignSrcLang
- = LangC
- | LangCxx
- | LangObjc
- | LangObjcxx
- parseDecs :: String -> Either String [Dec]
- class MonadTrans (t :: (* -> *) -> * -> *) where
- censor :: MonadWriter w m => (w -> w) -> m a -> m a
- listens :: MonadWriter w m => (w -> b) -> m a -> m (a, b)
- class (Monoid w, Monad m) => MonadWriter w (m :: * -> *) | m -> w where
- newtype WriterT w (m :: * -> *) a = WriterT {
- runWriterT :: m (a, w)
- type Writer w = WriterT w Identity
- runWriter :: Writer w a -> (a, w)
- execWriter :: Writer w a -> w
- mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' b
- execWriterT :: Monad m => WriterT w m a -> m w
- mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b
- tyVarSig :: TyVarBndr -> FamilyResultSig
- kindSig :: Kind -> FamilyResultSig
- noSig :: FamilyResultSig
- constraintK :: Kind
- starK :: Kind
- kindedTV :: Name -> Kind -> TyVarBndr
- plainTV :: Name -> TyVarBndr
- sigT :: TypeQ -> Kind -> TypeQ
- forallT :: [TyVarBndr] -> CxtQ -> TypeQ -> TypeQ
- forallC :: [TyVarBndr] -> CxtQ -> ConQ -> ConQ
- closedTypeFamilyD :: Name -> [TyVarBndr] -> FamilyResultSig -> Maybe InjectivityAnn -> [TySynEqnQ] -> DecQ
- openTypeFamilyD :: Name -> [TyVarBndr] -> FamilyResultSig -> Maybe InjectivityAnn -> DecQ
- dataFamilyD :: Name -> [TyVarBndr] -> Maybe Kind -> DecQ
- newtypeInstD :: CxtQ -> Name -> [TypeQ] -> Maybe Kind -> ConQ -> [DerivClauseQ] -> DecQ
- dataInstD :: CxtQ -> Name -> [TypeQ] -> Maybe Kind -> [ConQ] -> [DerivClauseQ] -> DecQ
- classD :: CxtQ -> Name -> [TyVarBndr] -> [FunDep] -> [DecQ] -> DecQ
- newtypeD :: CxtQ -> Name -> [TyVarBndr] -> Maybe Kind -> ConQ -> [DerivClauseQ] -> DecQ
- dataD :: CxtQ -> Name -> [TyVarBndr] -> Maybe Kind -> [ConQ] -> [DerivClauseQ] -> DecQ
- tySynD :: Name -> [TyVarBndr] -> TypeQ -> DecQ
- thisModule :: Q Module
- appsE :: [ExpQ] -> ExpQ
- varStrictType :: Name -> StrictTypeQ -> VarStrictTypeQ
- strictType :: Q Strict -> TypeQ -> StrictTypeQ
- unpacked :: Q Strict
- notStrict :: Q Strict
- isStrict :: Q Strict
- equalP :: TypeQ -> TypeQ -> PredQ
- classP :: Name -> [Q Type] -> Q Pred
- parensT :: TypeQ -> TypeQ
- uInfixT :: TypeQ -> Name -> TypeQ -> TypeQ
- infixT :: TypeQ -> Name -> TypeQ -> TypeQ
- standaloneDerivD :: CxtQ -> TypeQ -> DecQ
- pragLineD :: Int -> String -> DecQ
- instanceD :: CxtQ -> TypeQ -> [DecQ] -> DecQ
- stringE :: String -> ExpQ
- arithSeqE :: RangeQ -> ExpQ
- lam1E :: PatQ -> ExpQ -> ExpQ
- uInfixE :: ExpQ -> ExpQ -> ExpQ -> ExpQ
- parensE :: ExpQ -> ExpQ
- dyn :: String -> ExpQ
- patG :: [StmtQ] -> GuardQ
- normalG :: ExpQ -> GuardQ
- fromThenToR :: ExpQ -> ExpQ -> ExpQ -> RangeQ
- fromToR :: ExpQ -> ExpQ -> RangeQ
- fromThenR :: ExpQ -> ExpQ -> RangeQ
- fromR :: ExpQ -> RangeQ
- parensP :: PatQ -> PatQ
- uInfixP :: PatQ -> Name -> PatQ -> PatQ
- type InfoQ = Q Info
- type TExpQ a = Q (TExp a)
- type TyLitQ = Q TyLit
- type CxtQ = Q Cxt
- type BodyQ = Q Body
- type GuardQ = Q Guard
- type RangeQ = Q Range
- type SourceStrictnessQ = Q SourceStrictness
- type SourceUnpackednessQ = Q SourceUnpackedness
- type BangQ = Q Bang
- type StrictTypeQ = Q StrictType
- type VarStrictTypeQ = Q VarStrictType
- type PatSynDirQ = Q PatSynDir
- type PatSynArgsQ = Q PatSynArgs
- type FamilyResultSigQ = Q FamilyResultSig
- pprParendType :: Type -> Doc
- pprPat :: Precedence -> Pat -> Doc
- pprLit :: Precedence -> Lit -> Doc
- pprExp :: Precedence -> Exp -> Doc
- pprint :: Ppr a => a -> String
- class Ppr a where
- data QuasiQuoter = QuasiQuoter {}
- thenCmp :: Ordering -> Ordering -> Ordering
- cmpEq :: Ordering -> Bool
- defaultFixity :: Fixity
- maxPrecedence :: Int
- unboxedSumTypeName :: SumArity -> Name
- unboxedSumDataName :: SumAlt -> SumArity -> Name
- mk_unboxed_tup_name :: Int -> NameSpace -> Name
- unboxedTupleTypeName :: Int -> Name
- unboxedTupleDataName :: Int -> Name
- mk_tup_name :: Int -> NameSpace -> Name
- tupleTypeName :: Int -> Name
- tupleDataName :: Int -> Name
- showName' :: NameIs -> Name -> String
- showName :: Name -> String
- mkNameG :: NameSpace -> String -> String -> String -> Name
- mkNameU :: String -> Uniq -> Name
- nameSpace :: Name -> Maybe NameSpace
- namePackage :: Name -> Maybe String
- nameModule :: Name -> Maybe String
- nameBase :: Name -> String
- occString :: OccName -> String
- mkOccName :: String -> OccName
- pkgString :: PkgName -> String
- mkPkgName :: String -> PkgName
- modString :: ModName -> String
- mkModName :: String -> ModName
- dataToPatQ :: Data a => (forall b. Data b => b -> Maybe (Q Pat)) -> a -> Q Pat
- liftData :: Data a => a -> Q Exp
- dataToExpQ :: Data a => (forall b. Data b => b -> Maybe (Q Exp)) -> a -> Q Exp
- dataToQa :: Data a => (Name -> k) -> (Lit -> Q q) -> (k -> [Q q] -> Q q) -> (forall b. Data b => b -> Maybe (Q q)) -> a -> Q q
- rightName :: Name
- leftName :: Name
- justName :: Name
- nothingName :: Name
- falseName :: Name
- trueName :: Name
- extsEnabled :: Q [Extension]
- isExtEnabled :: Extension -> Q Bool
- putQ :: Typeable a => a -> Q ()
- getQ :: Typeable a => Q (Maybe a)
- addCorePlugin :: String -> Q ()
- addModFinalizer :: Q () -> Q ()
- addForeignFile :: ForeignSrcLang -> String -> Q ()
- addTopDecls :: [Dec] -> Q ()
- addDependentFile :: FilePath -> Q ()
- runIO :: IO a -> Q a
- location :: Q Loc
- isInstance :: Name -> [Type] -> Q Bool
- reifyConStrictness :: Name -> Q [DecidedStrictness]
- reifyModule :: Module -> Q ModuleInfo
- reifyAnnotations :: Data a => AnnLookup -> Q [a]
- reifyRoles :: Name -> Q [Role]
- reifyInstances :: Name -> [Type] -> Q [InstanceDec]
- reifyFixity :: Name -> Q (Maybe Fixity)
- reify :: Name -> Q Info
- lookupValueName :: String -> Q (Maybe Name)
- lookupTypeName :: String -> Q (Maybe Name)
- lookupName :: Bool -> String -> Q (Maybe Name)
- recover :: Q a -> Q a -> Q a
- reportWarning :: String -> Q ()
- reportError :: String -> Q ()
- report :: Bool -> String -> Q ()
- runQ :: Quasi m => Q a -> m a
- counter :: IORef Int
- badIO :: String -> IO a
- class (MonadIO m, MonadFail m) => Quasi (m :: * -> *) where
- newtype ModName = ModName String
- newtype PkgName = PkgName String
- data Module = Module PkgName ModName
- newtype OccName = OccName String
- data NameFlavour
- data NameSpace
- type Uniq = Int
- data NameIs
- data Loc = Loc {}
- type CharPos = (Int, Int)
- data Info
- data ModuleInfo = ModuleInfo [Module]
- type ParentName = Name
- type SumAlt = Int
- type SumArity = Int
- type Arity = Int
- type Unlifted = Bool
- type InstanceDec = Dec
- data Fixity = Fixity Int FixityDirection
- data FixityDirection
- data Lit
- data Body
- data Guard
- data Stmt
- data Range
- data DerivClause = DerivClause (Maybe DerivStrategy) Cxt
- type PatSynType = Type
- data TypeFamilyHead = TypeFamilyHead Name [TyVarBndr] FamilyResultSig (Maybe InjectivityAnn)
- data TySynEqn = TySynEqn [Type] Type
- data Foreign
- data Callconv
- = CCall
- | StdCall
- | CApi
- | Prim
- | JavaScript
- data Safety
- = Unsafe
- | Safe
- | Interruptible
- data Pragma
- data Inline
- data RuleMatch
- data Phases
- data RuleBndr
- data AnnTarget
- type Cxt = [Pred]
- data SourceUnpackedness
- data SourceStrictness
- data DecidedStrictness
- data Con
- data Bang = Bang SourceUnpackedness SourceStrictness
- type BangType = (Bang, Type)
- type VarBangType = (Name, Bang, Type)
- type Strict = Bang
- type StrictType = BangType
- type VarStrictType = VarBangType
- data PatSynDir
- data PatSynArgs
- = PrefixPatSyn [Name]
- | InfixPatSyn Name Name
- | RecordPatSyn [Name]
- data TyVarBndr
- data FamilyResultSig
- data TyLit
- data Role
- data AnnLookup
- type Kind = Type
- data Defaults = Defaults {
- defining :: Name
- definition :: Name
- type Set k = Map k ()
- mapLookup :: Ord k => k -> Map k v -> Maybe v
- fromKeys :: Ord k => v -> [k] -> Map k v
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- adjustMany :: (Ord k, Foldable t) => (a -> as -> as) -> Map k as -> t (k, a) -> Map k as
Documentation
instances :: QuasiQuoter Source #
QuasiQuoter
for providing intrinsic-superclasses.
Example:
{-# language TemplateHaskell,QuasiQuotes,FlexibleInstances,UndecidableInstances #-} import Prelude hiding (Monoid(..)) import Language.Haskell.TH.Instances class Semigroup a where mappend :: a -> a -> a class Semigroup a => Commutative a class Semigroup a => Monoid a where mempty :: a class Monoid a => Group a where inverse :: a -> a class (Commutative a, Group a) => CommutativeGroup a $(return []) -- Only needed if classes are defined in the same module, to make sure they're in scope below [instances| Num a => CommutativeGroup a where mempty = fromInteger 0 mappend a b = a + b inverse = negate |]
will generate the appropriate instances for Semigroup
, Monoid
, and Group
:
instance Num a => Semigroup a where mappend a b = a + b instance Num a => Commutative a instance Num a => Monoid a where mempty = fromInteger 0 instance Num a => Group a where inverse = negate instance Num a => CommutativeGroup a
splitInstances :: Dec -> DecsQ Source #
Implements the instances
quasiquoter ast transform
getClassOps :: Traversable t => t Dec -> Map ParentName (Set Name) -> Q (Map ParentName (Set Name)) Source #
Create a Map of className to method declaration from a list of instance method definitions
getSuperclassNames :: Name -> Q [Name] Source #
reify the names of the direct superclasses for a class name
getTransitiveSuperclassNames :: Name -> Q (Map Name (Set a)) Source #
reify the names of all transitive superclasses for a class name, including itself
occName :: Name -> String Source #
Extract the unqualified part from a Name
. For example:
show ''Show === "GHC.Show.Show" occName ''Show === "Show"
getTransitiveSuperclassNames' :: Name -> Q (Map Name Int) Source #
reify the names of all transitive superclasses for a class name, including itself
providedDefaults :: Name -> Q (Map Name Name) Source #
Get the default superclass method implementations provided by a subclass
guard :: Alternative f => Bool -> f () #
Conditional failure of Alternative
computations. Defined by
guard True =pure
() guard False =empty
Examples
Common uses of guard
include conditionally signaling an error in
an error monad and conditionally rejecting the current choice in an
Alternative
-based parser.
As an example of signaling an error in the error monad Maybe
,
consider a safe division function safeDiv x y
that returns
Nothing
when the denominator y
is zero and
otherwise. For example:Just
(x `div`
y)
>>> safeDiv 4 0 Nothing >>> safeDiv 4 2 Just 2
A definition of safeDiv
using guards, but not guard
:
safeDiv :: Int -> Int -> Maybe Int safeDiv x y | y /= 0 = Just (x `div` y) | otherwise = Nothing
A definition of safeDiv
using guard
and Monad
do
-notation:
safeDiv :: Int -> Int -> Maybe Int safeDiv x y = do guard (y /= 0) return (x `div` y)
Generate a fresh name, which cannot be captured.
For example, this:
f = $(do nm1 <- newName "x" let nm2 =mkName
"x" return (LamE
[VarP
nm1] (LamE [VarP nm2] (VarE
nm1))) )
will produce the splice
f = \x0 -> \x -> x0
In particular, the occurrence VarE nm1
refers to the binding VarP nm1
,
and is not captured by the binding VarP nm2
.
Although names generated by newName
cannot be captured, they can
capture other names. For example, this:
g = $(do nm1 <- newName "x" let nm2 = mkName "x" return (LamE [VarP nm2] (LamE [VarP nm1] (VarE nm2))) )
will produce the splice
g = \x -> \x0 -> x0
since the occurrence VarE nm2
is captured by the innermost binding
of x
, namely VarP nm1
.
Generate a capturable name. Occurrences of such names will be resolved according to the Haskell scoping rules at the occurrence site.
For example:
f = [| pi + $(varE (mkName "pi")) |] ... g = let pi = 3 in $f
In this case, g
is desugared to
g = Prelude.pi + 3
Note that mkName
may be used with qualified names:
mkName "Prelude.pi"
See also dyn
for a useful combinator. The above example could
be rewritten using dyn
as
f = [| pi + $(dyn "pi") |]
floatPrimL :: Rational -> Lit #
doublePrimL :: Rational -> Lit #
stringPrimL :: [Word8] -> Lit #
liftString :: String -> Q Exp #
unboxedTupP :: [PatQ] -> PatQ #
unboxedTupE :: [ExpQ] -> ExpQ #
unboundVarE :: Name -> ExpQ #
pragSpecInstD :: TypeQ -> DecQ #
tySynInstD :: Name -> TySynEqnQ -> DecQ #
roleAnnotD :: Name -> [Role] -> DecQ #
standaloneDerivWithStrategyD :: Maybe DerivStrategy -> CxtQ -> TypeQ -> DecQ #
defaultSigD :: Name -> TypeQ -> DecQ #
patSynD :: Name -> PatSynArgsQ -> PatSynDirQ -> PatQ -> DecQ #
Pattern synonym declaration
patSynSigD :: Name -> TypeQ -> DecQ #
Pattern synonym type signature
recC :: Name -> [VarBangTypeQ] -> ConQ #
bang :: SourceUnpackednessQ -> SourceStrictnessQ -> BangQ #
varBangType :: Name -> BangTypeQ -> VarBangTypeQ #
unidir :: PatSynDirQ #
implBidir :: PatSynDirQ #
explBidir :: [ClauseQ] -> PatSynDirQ #
prefixPatSyn :: [Name] -> PatSynArgsQ #
infixPatSyn :: Name -> Name -> PatSynArgsQ #
recordPatSyn :: [Name] -> PatSynArgsQ #
unboxedTupleT :: Int -> TypeQ #
unboxedSumT :: SumArity -> TypeQ #
promotedTupleT :: Int -> TypeQ #
promotedNilT :: TypeQ #
promotedConsT :: TypeQ #
injectivityAnn :: Name -> [Name] -> InjectivityAnn #
javaScript :: Callconv #
interruptible :: Safety #
typedRuleVar :: Name -> TypeQ -> RuleBndrQ #
valueAnnotation :: Name -> AnnTarget #
typeAnnotation :: Name -> AnnTarget #
derivClause :: Maybe DerivStrategy -> [PredQ] -> DerivClauseQ #
join :: Monad m => m (m a) -> m a #
The join
function is the conventional monad join operator. It
is used to remove one level of monadic structure, projecting its
bound argument into the outer level.
class Applicative m => Monad (m :: * -> *) where #
The Monad
class defines the basic operations over a monad,
a concept from a branch of mathematics known as category theory.
From the perspective of a Haskell programmer, however, it is best to
think of a monad as an abstract datatype of actions.
Haskell's do
expressions provide a convenient syntax for writing
monadic expressions.
Instances of Monad
should satisfy the following laws:
Furthermore, the Monad
and Applicative
operations should relate as follows:
The above laws imply:
and that pure
and (<*>
) satisfy the applicative functor laws.
The instances of Monad
for lists, Maybe
and IO
defined in the Prelude satisfy these laws.
(>>=) :: m a -> (a -> m b) -> m b infixl 1 #
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
(>>) :: m a -> m b -> m b infixl 1 #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
Inject a value into the monadic type.
Fail with a message. This operation is not part of the
mathematical definition of a monad, but is invoked on pattern-match
failure in a do
expression.
As part of the MonadFail proposal (MFP), this function is moved
to its own class MonadFail
(see Control.Monad.Fail for more
details). The definition here will be removed in a future
release.
Instances
Monad [] | Since: base-2.1 |
Monad Maybe | Since: base-2.1 |
Monad IO | Since: base-2.1 |
Monad Par1 | Since: base-4.9.0.0 |
Monad Q | |
Monad First | |
Monad Last | |
Monad Dual | Since: base-4.8.0.0 |
Monad Sum | Since: base-4.8.0.0 |
Monad Product | Since: base-4.8.0.0 |
Monad ReadP | Since: base-2.1 |
Monad NonEmpty | Since: base-4.9.0.0 |
Monad PprM | |
Monad P | Since: base-2.1 |
Monad (Either e) | Since: base-4.4.0.0 |
Monad (U1 :: * -> *) | Since: base-4.9.0.0 |
Monoid a => Monad ((,) a) | Since: base-4.9.0.0 |
Monad (Proxy :: * -> *) | Since: base-4.7.0.0 |
Monad m => Monad (MaybeT m) | |
Monad f => Monad (Rec1 f) | Since: base-4.9.0.0 |
Monad f => Monad (Alt f) | |
Monad m => Monad (IdentityT m) | |
(Monad m, Error e) => Monad (ErrorT e m) | |
Monad m => Monad (ExceptT e m) | |
Monad m => Monad (StateT s m) | |
Monad m => Monad (StateT s m) | |
(Monoid w, Monad m) => Monad (WriterT w m) | |
(Monoid w, Monad m) => Monad (WriterT w m) | |
Monad ((->) r :: * -> *) | Since: base-2.1 |
(Monad f, Monad g) => Monad (f :*: g) | Since: base-4.9.0.0 |
(Applicative f, Monad f) => Monad (WhenMissing f k x) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal (>>=) :: WhenMissing f k x a -> (a -> WhenMissing f k x b) -> WhenMissing f k x b # (>>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b # return :: a -> WhenMissing f k x a # fail :: String -> WhenMissing f k x a # | |
Monad m => Monad (ReaderT r m) | |
Monad f => Monad (M1 i c f) | Since: base-4.9.0.0 |
(Monad f, Applicative f) => Monad (WhenMatched f k x y) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal (>>=) :: WhenMatched f k x y a -> (a -> WhenMatched f k x y b) -> WhenMatched f k x y b # (>>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b # return :: a -> WhenMatched f k x y a # fail :: String -> WhenMatched f k x y a # | |
(Monoid w, Monad m) => Monad (RWST r w s m) | |
(Monoid w, Monad m) => Monad (RWST r w s m) | |
class Functor (f :: * -> *) where #
The Functor
class is used for types that can be mapped over.
Instances of Functor
should satisfy the following laws:
fmap id == id fmap (f . g) == fmap f . fmap g
The instances of Functor
for lists, Maybe
and IO
satisfy these laws.
Instances
class Monad m => MonadFix (m :: * -> *) where #
Monads having fixed points with a 'knot-tying' semantics.
Instances of MonadFix
should satisfy the following laws:
- purity
mfix
(return
. h) =return
(fix
h)- left shrinking (or tightening)
mfix
(\x -> a >>= \y -> f x y) = a >>= \y ->mfix
(\x -> f x y)- sliding
, for strictmfix
(liftM
h . f) =liftM
h (mfix
(f . h))h
.- nesting
mfix
(\x ->mfix
(\y -> f x y)) =mfix
(\x -> f x x)
This class is used in the translation of the recursive do
notation
supported by GHC and Hugs.
Instances
class Foldable (t :: * -> *) where #
Data structures that can be folded.
For example, given a data type
data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
a suitable instance would be
instance Foldable Tree where foldMap f Empty = mempty foldMap f (Leaf x) = f x foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r
This is suitable even for abstract types, as the monoid is assumed
to satisfy the monoid laws. Alternatively, one could define foldr
:
instance Foldable Tree where foldr f z Empty = z foldr f z (Leaf x) = f x z foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l
Foldable
instances are expected to satisfy the following laws:
foldr f z t = appEndo (foldMap (Endo . f) t ) z
foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
fold = foldMap id
length = getSum . foldMap (Sum . const 1)
sum
, product
, maximum
, and minimum
should all be essentially
equivalent to foldMap
forms, such as
sum = getSum . foldMap Sum
but may be less defined.
If the type is also a Functor
instance, it should satisfy
foldMap f = fold . fmap f
which implies that
foldMap f . fmap g = foldMap (f . g)
fold :: Monoid m => t m -> m #
Combine the elements of a structure using a monoid.
foldMap :: Monoid m => (a -> m) -> t a -> m #
Map each element of the structure to a monoid, and combine the results.
foldr :: (a -> b -> b) -> b -> t a -> b #
Right-associative fold of a structure.
In the case of lists, foldr
, when applied to a binary operator, a
starting value (typically the right-identity of the operator), and a
list, reduces the list using the binary operator, from right to left:
foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)
Note that, since the head of the resulting expression is produced by
an application of the operator to the first element of the list,
foldr
can produce a terminating expression from an infinite list.
For a general Foldable
structure this should be semantically identical
to,
foldr f z =foldr
f z .toList
foldr' :: (a -> b -> b) -> b -> t a -> b #
Right-associative fold of a structure, but with strict application of the operator.
foldl :: (b -> a -> b) -> b -> t a -> b #
Left-associative fold of a structure.
In the case of lists, foldl
, when applied to a binary
operator, a starting value (typically the left-identity of the operator),
and a list, reduces the list using the binary operator, from left to
right:
foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
Note that to produce the outermost application of the operator the
entire input list must be traversed. This means that foldl'
will
diverge if given an infinite list.
Also note that if you want an efficient left-fold, you probably want to
use foldl'
instead of foldl
. The reason for this is that latter does
not force the "inner" results (e.g. z
in the above example)
before applying them to the operator (e.g. to f
x1(
). This results
in a thunk chain f
x2)O(n)
elements long, which then must be evaluated from
the outside-in.
For a general Foldable
structure this should be semantically identical
to,
foldl f z =foldl
f z .toList
foldl' :: (b -> a -> b) -> b -> t a -> b #
Left-associative fold of a structure but with strict application of the operator.
This ensures that each step of the fold is forced to weak head normal
form before being applied, avoiding the collection of thunks that would
otherwise occur. This is often what you want to strictly reduce a finite
list to a single, monolithic result (e.g. length
).
For a general Foldable
structure this should be semantically identical
to,
foldl f z =foldl'
f z .toList
foldr1 :: (a -> a -> a) -> t a -> a #
A variant of foldr
that has no base case,
and thus may only be applied to non-empty structures.
foldr1
f =foldr1
f .toList
foldl1 :: (a -> a -> a) -> t a -> a #
A variant of foldl
that has no base case,
and thus may only be applied to non-empty structures.
foldl1
f =foldl1
f .toList
List of elements of a structure, from left to right.
Test whether the structure is empty. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.
Returns the size/length of a finite structure as an Int
. The
default implementation is optimized for structures that are similar to
cons-lists, because there is no general way to do better.
elem :: Eq a => a -> t a -> Bool infix 4 #
Does the element occur in the structure?
maximum :: Ord a => t a -> a #
The largest element of a non-empty structure.
minimum :: Ord a => t a -> a #
The least element of a non-empty structure.
The sum
function computes the sum of the numbers of a structure.
product :: Num a => t a -> a #
The product
function computes the product of the numbers of a
structure.
Instances
Foldable [] | Since: base-2.1 |
Defined in Data.Foldable fold :: Monoid m => [m] -> m # foldMap :: Monoid m => (a -> m) -> [a] -> m # foldr :: (a -> b -> b) -> b -> [a] -> b # foldr' :: (a -> b -> b) -> b -> [a] -> b # foldl :: (b -> a -> b) -> b -> [a] -> b # foldl' :: (b -> a -> b) -> b -> [a] -> b # foldr1 :: (a -> a -> a) -> [a] -> a # foldl1 :: (a -> a -> a) -> [a] -> a # elem :: Eq a => a -> [a] -> Bool # maximum :: Ord a => [a] -> a # | |
Foldable Maybe | Since: base-2.1 |
Defined in Data.Foldable fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # | |
Foldable Par1 | |
Defined in Data.Foldable fold :: Monoid m => Par1 m -> m # foldMap :: Monoid m => (a -> m) -> Par1 a -> m # foldr :: (a -> b -> b) -> b -> Par1 a -> b # foldr' :: (a -> b -> b) -> b -> Par1 a -> b # foldl :: (b -> a -> b) -> b -> Par1 a -> b # foldl' :: (b -> a -> b) -> b -> Par1 a -> b # foldr1 :: (a -> a -> a) -> Par1 a -> a # foldl1 :: (a -> a -> a) -> Par1 a -> a # elem :: Eq a => a -> Par1 a -> Bool # maximum :: Ord a => Par1 a -> a # | |
Foldable First | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # | |
Foldable Last | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # | |
Foldable Dual | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Dual m -> m # foldMap :: Monoid m => (a -> m) -> Dual a -> m # foldr :: (a -> b -> b) -> b -> Dual a -> b # foldr' :: (a -> b -> b) -> b -> Dual a -> b # foldl :: (b -> a -> b) -> b -> Dual a -> b # foldl' :: (b -> a -> b) -> b -> Dual a -> b # foldr1 :: (a -> a -> a) -> Dual a -> a # foldl1 :: (a -> a -> a) -> Dual a -> a # elem :: Eq a => a -> Dual a -> Bool # maximum :: Ord a => Dual a -> a # | |
Foldable Sum | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Sum m -> m # foldMap :: Monoid m => (a -> m) -> Sum a -> m # foldr :: (a -> b -> b) -> b -> Sum a -> b # foldr' :: (a -> b -> b) -> b -> Sum a -> b # foldl :: (b -> a -> b) -> b -> Sum a -> b # foldl' :: (b -> a -> b) -> b -> Sum a -> b # foldr1 :: (a -> a -> a) -> Sum a -> a # foldl1 :: (a -> a -> a) -> Sum a -> a # elem :: Eq a => a -> Sum a -> Bool # maximum :: Ord a => Sum a -> a # | |
Foldable Product | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Product m -> m # foldMap :: Monoid m => (a -> m) -> Product a -> m # foldr :: (a -> b -> b) -> b -> Product a -> b # foldr' :: (a -> b -> b) -> b -> Product a -> b # foldl :: (b -> a -> b) -> b -> Product a -> b # foldl' :: (b -> a -> b) -> b -> Product a -> b # foldr1 :: (a -> a -> a) -> Product a -> a # foldl1 :: (a -> a -> a) -> Product a -> a # elem :: Eq a => a -> Product a -> Bool # maximum :: Ord a => Product a -> a # minimum :: Ord a => Product a -> a # | |
Foldable NonEmpty | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => NonEmpty m -> m # foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m # foldr :: (a -> b -> b) -> b -> NonEmpty a -> b # foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b # foldl :: (b -> a -> b) -> b -> NonEmpty a -> b # foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b # foldr1 :: (a -> a -> a) -> NonEmpty a -> a # foldl1 :: (a -> a -> a) -> NonEmpty a -> a # elem :: Eq a => a -> NonEmpty a -> Bool # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # | |
Foldable Set | |
Defined in Data.Set.Internal fold :: Monoid m => Set m -> m # foldMap :: Monoid m => (a -> m) -> Set a -> m # foldr :: (a -> b -> b) -> b -> Set a -> b # foldr' :: (a -> b -> b) -> b -> Set a -> b # foldl :: (b -> a -> b) -> b -> Set a -> b # foldl' :: (b -> a -> b) -> b -> Set a -> b # foldr1 :: (a -> a -> a) -> Set a -> a # foldl1 :: (a -> a -> a) -> Set a -> a # elem :: Eq a => a -> Set a -> Bool # maximum :: Ord a => Set a -> a # | |
Foldable ModuleName | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ModuleName m -> m # foldMap :: Monoid m => (a -> m) -> ModuleName a -> m # foldr :: (a -> b -> b) -> b -> ModuleName a -> b # foldr' :: (a -> b -> b) -> b -> ModuleName a -> b # foldl :: (b -> a -> b) -> b -> ModuleName a -> b # foldl' :: (b -> a -> b) -> b -> ModuleName a -> b # foldr1 :: (a -> a -> a) -> ModuleName a -> a # foldl1 :: (a -> a -> a) -> ModuleName a -> a # toList :: ModuleName a -> [a] # null :: ModuleName a -> Bool # length :: ModuleName a -> Int # elem :: Eq a => a -> ModuleName a -> Bool # maximum :: Ord a => ModuleName a -> a # minimum :: Ord a => ModuleName a -> a # sum :: Num a => ModuleName a -> a # product :: Num a => ModuleName a -> a # | |
Foldable SpecialCon | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => SpecialCon m -> m # foldMap :: Monoid m => (a -> m) -> SpecialCon a -> m # foldr :: (a -> b -> b) -> b -> SpecialCon a -> b # foldr' :: (a -> b -> b) -> b -> SpecialCon a -> b # foldl :: (b -> a -> b) -> b -> SpecialCon a -> b # foldl' :: (b -> a -> b) -> b -> SpecialCon a -> b # foldr1 :: (a -> a -> a) -> SpecialCon a -> a # foldl1 :: (a -> a -> a) -> SpecialCon a -> a # toList :: SpecialCon a -> [a] # null :: SpecialCon a -> Bool # length :: SpecialCon a -> Int # elem :: Eq a => a -> SpecialCon a -> Bool # maximum :: Ord a => SpecialCon a -> a # minimum :: Ord a => SpecialCon a -> a # sum :: Num a => SpecialCon a -> a # product :: Num a => SpecialCon a -> a # | |
Foldable QName | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => QName m -> m # foldMap :: Monoid m => (a -> m) -> QName a -> m # foldr :: (a -> b -> b) -> b -> QName a -> b # foldr' :: (a -> b -> b) -> b -> QName a -> b # foldl :: (b -> a -> b) -> b -> QName a -> b # foldl' :: (b -> a -> b) -> b -> QName a -> b # foldr1 :: (a -> a -> a) -> QName a -> a # foldl1 :: (a -> a -> a) -> QName a -> a # elem :: Eq a => a -> QName a -> Bool # maximum :: Ord a => QName a -> a # minimum :: Ord a => QName a -> a # | |
Foldable Name | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Name m -> m # foldMap :: Monoid m => (a -> m) -> Name a -> m # foldr :: (a -> b -> b) -> b -> Name a -> b # foldr' :: (a -> b -> b) -> b -> Name a -> b # foldl :: (b -> a -> b) -> b -> Name a -> b # foldl' :: (b -> a -> b) -> b -> Name a -> b # foldr1 :: (a -> a -> a) -> Name a -> a # foldl1 :: (a -> a -> a) -> Name a -> a # elem :: Eq a => a -> Name a -> Bool # maximum :: Ord a => Name a -> a # | |
Foldable IPName | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => IPName m -> m # foldMap :: Monoid m => (a -> m) -> IPName a -> m # foldr :: (a -> b -> b) -> b -> IPName a -> b # foldr' :: (a -> b -> b) -> b -> IPName a -> b # foldl :: (b -> a -> b) -> b -> IPName a -> b # foldl' :: (b -> a -> b) -> b -> IPName a -> b # foldr1 :: (a -> a -> a) -> IPName a -> a # foldl1 :: (a -> a -> a) -> IPName a -> a # elem :: Eq a => a -> IPName a -> Bool # maximum :: Ord a => IPName a -> a # minimum :: Ord a => IPName a -> a # | |
Foldable QOp | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => QOp m -> m # foldMap :: Monoid m => (a -> m) -> QOp a -> m # foldr :: (a -> b -> b) -> b -> QOp a -> b # foldr' :: (a -> b -> b) -> b -> QOp a -> b # foldl :: (b -> a -> b) -> b -> QOp a -> b # foldl' :: (b -> a -> b) -> b -> QOp a -> b # foldr1 :: (a -> a -> a) -> QOp a -> a # foldl1 :: (a -> a -> a) -> QOp a -> a # elem :: Eq a => a -> QOp a -> Bool # maximum :: Ord a => QOp a -> a # | |
Foldable Op | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Op m -> m # foldMap :: Monoid m => (a -> m) -> Op a -> m # foldr :: (a -> b -> b) -> b -> Op a -> b # foldr' :: (a -> b -> b) -> b -> Op a -> b # foldl :: (b -> a -> b) -> b -> Op a -> b # foldl' :: (b -> a -> b) -> b -> Op a -> b # foldr1 :: (a -> a -> a) -> Op a -> a # foldl1 :: (a -> a -> a) -> Op a -> a # elem :: Eq a => a -> Op a -> Bool # maximum :: Ord a => Op a -> a # | |
Foldable CName | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => CName m -> m # foldMap :: Monoid m => (a -> m) -> CName a -> m # foldr :: (a -> b -> b) -> b -> CName a -> b # foldr' :: (a -> b -> b) -> b -> CName a -> b # foldl :: (b -> a -> b) -> b -> CName a -> b # foldl' :: (b -> a -> b) -> b -> CName a -> b # foldr1 :: (a -> a -> a) -> CName a -> a # foldl1 :: (a -> a -> a) -> CName a -> a # elem :: Eq a => a -> CName a -> Bool # maximum :: Ord a => CName a -> a # minimum :: Ord a => CName a -> a # | |
Foldable Module | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Module m -> m # foldMap :: Monoid m => (a -> m) -> Module a -> m # foldr :: (a -> b -> b) -> b -> Module a -> b # foldr' :: (a -> b -> b) -> b -> Module a -> b # foldl :: (b -> a -> b) -> b -> Module a -> b # foldl' :: (b -> a -> b) -> b -> Module a -> b # foldr1 :: (a -> a -> a) -> Module a -> a # foldl1 :: (a -> a -> a) -> Module a -> a # elem :: Eq a => a -> Module a -> Bool # maximum :: Ord a => Module a -> a # minimum :: Ord a => Module a -> a # | |
Foldable ModuleHead | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ModuleHead m -> m # foldMap :: Monoid m => (a -> m) -> ModuleHead a -> m # foldr :: (a -> b -> b) -> b -> ModuleHead a -> b # foldr' :: (a -> b -> b) -> b -> ModuleHead a -> b # foldl :: (b -> a -> b) -> b -> ModuleHead a -> b # foldl' :: (b -> a -> b) -> b -> ModuleHead a -> b # foldr1 :: (a -> a -> a) -> ModuleHead a -> a # foldl1 :: (a -> a -> a) -> ModuleHead a -> a # toList :: ModuleHead a -> [a] # null :: ModuleHead a -> Bool # length :: ModuleHead a -> Int # elem :: Eq a => a -> ModuleHead a -> Bool # maximum :: Ord a => ModuleHead a -> a # minimum :: Ord a => ModuleHead a -> a # sum :: Num a => ModuleHead a -> a # product :: Num a => ModuleHead a -> a # | |
Foldable ExportSpecList | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ExportSpecList m -> m # foldMap :: Monoid m => (a -> m) -> ExportSpecList a -> m # foldr :: (a -> b -> b) -> b -> ExportSpecList a -> b # foldr' :: (a -> b -> b) -> b -> ExportSpecList a -> b # foldl :: (b -> a -> b) -> b -> ExportSpecList a -> b # foldl' :: (b -> a -> b) -> b -> ExportSpecList a -> b # foldr1 :: (a -> a -> a) -> ExportSpecList a -> a # foldl1 :: (a -> a -> a) -> ExportSpecList a -> a # toList :: ExportSpecList a -> [a] # null :: ExportSpecList a -> Bool # length :: ExportSpecList a -> Int # elem :: Eq a => a -> ExportSpecList a -> Bool # maximum :: Ord a => ExportSpecList a -> a # minimum :: Ord a => ExportSpecList a -> a # sum :: Num a => ExportSpecList a -> a # product :: Num a => ExportSpecList a -> a # | |
Foldable ExportSpec | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ExportSpec m -> m # foldMap :: Monoid m => (a -> m) -> ExportSpec a -> m # foldr :: (a -> b -> b) -> b -> ExportSpec a -> b # foldr' :: (a -> b -> b) -> b -> ExportSpec a -> b # foldl :: (b -> a -> b) -> b -> ExportSpec a -> b # foldl' :: (b -> a -> b) -> b -> ExportSpec a -> b # foldr1 :: (a -> a -> a) -> ExportSpec a -> a # foldl1 :: (a -> a -> a) -> ExportSpec a -> a # toList :: ExportSpec a -> [a] # null :: ExportSpec a -> Bool # length :: ExportSpec a -> Int # elem :: Eq a => a -> ExportSpec a -> Bool # maximum :: Ord a => ExportSpec a -> a # minimum :: Ord a => ExportSpec a -> a # sum :: Num a => ExportSpec a -> a # product :: Num a => ExportSpec a -> a # | |
Foldable EWildcard | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => EWildcard m -> m # foldMap :: Monoid m => (a -> m) -> EWildcard a -> m # foldr :: (a -> b -> b) -> b -> EWildcard a -> b # foldr' :: (a -> b -> b) -> b -> EWildcard a -> b # foldl :: (b -> a -> b) -> b -> EWildcard a -> b # foldl' :: (b -> a -> b) -> b -> EWildcard a -> b # foldr1 :: (a -> a -> a) -> EWildcard a -> a # foldl1 :: (a -> a -> a) -> EWildcard a -> a # toList :: EWildcard a -> [a] # length :: EWildcard a -> Int # elem :: Eq a => a -> EWildcard a -> Bool # maximum :: Ord a => EWildcard a -> a # minimum :: Ord a => EWildcard a -> a # | |
Foldable Namespace | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Namespace m -> m # foldMap :: Monoid m => (a -> m) -> Namespace a -> m # foldr :: (a -> b -> b) -> b -> Namespace a -> b # foldr' :: (a -> b -> b) -> b -> Namespace a -> b # foldl :: (b -> a -> b) -> b -> Namespace a -> b # foldl' :: (b -> a -> b) -> b -> Namespace a -> b # foldr1 :: (a -> a -> a) -> Namespace a -> a # foldl1 :: (a -> a -> a) -> Namespace a -> a # toList :: Namespace a -> [a] # length :: Namespace a -> Int # elem :: Eq a => a -> Namespace a -> Bool # maximum :: Ord a => Namespace a -> a # minimum :: Ord a => Namespace a -> a # | |
Foldable ImportDecl | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ImportDecl m -> m # foldMap :: Monoid m => (a -> m) -> ImportDecl a -> m # foldr :: (a -> b -> b) -> b -> ImportDecl a -> b # foldr' :: (a -> b -> b) -> b -> ImportDecl a -> b # foldl :: (b -> a -> b) -> b -> ImportDecl a -> b # foldl' :: (b -> a -> b) -> b -> ImportDecl a -> b # foldr1 :: (a -> a -> a) -> ImportDecl a -> a # foldl1 :: (a -> a -> a) -> ImportDecl a -> a # toList :: ImportDecl a -> [a] # null :: ImportDecl a -> Bool # length :: ImportDecl a -> Int # elem :: Eq a => a -> ImportDecl a -> Bool # maximum :: Ord a => ImportDecl a -> a # minimum :: Ord a => ImportDecl a -> a # sum :: Num a => ImportDecl a -> a # product :: Num a => ImportDecl a -> a # | |
Foldable ImportSpecList | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ImportSpecList m -> m # foldMap :: Monoid m => (a -> m) -> ImportSpecList a -> m # foldr :: (a -> b -> b) -> b -> ImportSpecList a -> b # foldr' :: (a -> b -> b) -> b -> ImportSpecList a -> b # foldl :: (b -> a -> b) -> b -> ImportSpecList a -> b # foldl' :: (b -> a -> b) -> b -> ImportSpecList a -> b # foldr1 :: (a -> a -> a) -> ImportSpecList a -> a # foldl1 :: (a -> a -> a) -> ImportSpecList a -> a # toList :: ImportSpecList a -> [a] # null :: ImportSpecList a -> Bool # length :: ImportSpecList a -> Int # elem :: Eq a => a -> ImportSpecList a -> Bool # maximum :: Ord a => ImportSpecList a -> a # minimum :: Ord a => ImportSpecList a -> a # sum :: Num a => ImportSpecList a -> a # product :: Num a => ImportSpecList a -> a # | |
Foldable ImportSpec | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ImportSpec m -> m # foldMap :: Monoid m => (a -> m) -> ImportSpec a -> m # foldr :: (a -> b -> b) -> b -> ImportSpec a -> b # foldr' :: (a -> b -> b) -> b -> ImportSpec a -> b # foldl :: (b -> a -> b) -> b -> ImportSpec a -> b # foldl' :: (b -> a -> b) -> b -> ImportSpec a -> b # foldr1 :: (a -> a -> a) -> ImportSpec a -> a # foldl1 :: (a -> a -> a) -> ImportSpec a -> a # toList :: ImportSpec a -> [a] # null :: ImportSpec a -> Bool # length :: ImportSpec a -> Int # elem :: Eq a => a -> ImportSpec a -> Bool # maximum :: Ord a => ImportSpec a -> a # minimum :: Ord a => ImportSpec a -> a # sum :: Num a => ImportSpec a -> a # product :: Num a => ImportSpec a -> a # | |
Foldable Assoc | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Assoc m -> m # foldMap :: Monoid m => (a -> m) -> Assoc a -> m # foldr :: (a -> b -> b) -> b -> Assoc a -> b # foldr' :: (a -> b -> b) -> b -> Assoc a -> b # foldl :: (b -> a -> b) -> b -> Assoc a -> b # foldl' :: (b -> a -> b) -> b -> Assoc a -> b # foldr1 :: (a -> a -> a) -> Assoc a -> a # foldl1 :: (a -> a -> a) -> Assoc a -> a # elem :: Eq a => a -> Assoc a -> Bool # maximum :: Ord a => Assoc a -> a # minimum :: Ord a => Assoc a -> a # | |
Foldable Decl | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Decl m -> m # foldMap :: Monoid m => (a -> m) -> Decl a -> m # foldr :: (a -> b -> b) -> b -> Decl a -> b # foldr' :: (a -> b -> b) -> b -> Decl a -> b # foldl :: (b -> a -> b) -> b -> Decl a -> b # foldl' :: (b -> a -> b) -> b -> Decl a -> b # foldr1 :: (a -> a -> a) -> Decl a -> a # foldl1 :: (a -> a -> a) -> Decl a -> a # elem :: Eq a => a -> Decl a -> Bool # maximum :: Ord a => Decl a -> a # | |
Foldable PatternSynDirection | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => PatternSynDirection m -> m # foldMap :: Monoid m => (a -> m) -> PatternSynDirection a -> m # foldr :: (a -> b -> b) -> b -> PatternSynDirection a -> b # foldr' :: (a -> b -> b) -> b -> PatternSynDirection a -> b # foldl :: (b -> a -> b) -> b -> PatternSynDirection a -> b # foldl' :: (b -> a -> b) -> b -> PatternSynDirection a -> b # foldr1 :: (a -> a -> a) -> PatternSynDirection a -> a # foldl1 :: (a -> a -> a) -> PatternSynDirection a -> a # toList :: PatternSynDirection a -> [a] # null :: PatternSynDirection a -> Bool # length :: PatternSynDirection a -> Int # elem :: Eq a => a -> PatternSynDirection a -> Bool # maximum :: Ord a => PatternSynDirection a -> a # minimum :: Ord a => PatternSynDirection a -> a # sum :: Num a => PatternSynDirection a -> a # product :: Num a => PatternSynDirection a -> a # | |
Foldable TypeEqn | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => TypeEqn m -> m # foldMap :: Monoid m => (a -> m) -> TypeEqn a -> m # foldr :: (a -> b -> b) -> b -> TypeEqn a -> b # foldr' :: (a -> b -> b) -> b -> TypeEqn a -> b # foldl :: (b -> a -> b) -> b -> TypeEqn a -> b # foldl' :: (b -> a -> b) -> b -> TypeEqn a -> b # foldr1 :: (a -> a -> a) -> TypeEqn a -> a # foldl1 :: (a -> a -> a) -> TypeEqn a -> a # elem :: Eq a => a -> TypeEqn a -> Bool # maximum :: Ord a => TypeEqn a -> a # minimum :: Ord a => TypeEqn a -> a # | |
Foldable Annotation | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Annotation m -> m # foldMap :: Monoid m => (a -> m) -> Annotation a -> m # foldr :: (a -> b -> b) -> b -> Annotation a -> b # foldr' :: (a -> b -> b) -> b -> Annotation a -> b # foldl :: (b -> a -> b) -> b -> Annotation a -> b # foldl' :: (b -> a -> b) -> b -> Annotation a -> b # foldr1 :: (a -> a -> a) -> Annotation a -> a # foldl1 :: (a -> a -> a) -> Annotation a -> a # toList :: Annotation a -> [a] # null :: Annotation a -> Bool # length :: Annotation a -> Int # elem :: Eq a => a -> Annotation a -> Bool # maximum :: Ord a => Annotation a -> a # minimum :: Ord a => Annotation a -> a # sum :: Num a => Annotation a -> a # product :: Num a => Annotation a -> a # | |
Foldable BooleanFormula | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => BooleanFormula m -> m # foldMap :: Monoid m => (a -> m) -> BooleanFormula a -> m # foldr :: (a -> b -> b) -> b -> BooleanFormula a -> b # foldr' :: (a -> b -> b) -> b -> BooleanFormula a -> b # foldl :: (b -> a -> b) -> b -> BooleanFormula a -> b # foldl' :: (b -> a -> b) -> b -> BooleanFormula a -> b # foldr1 :: (a -> a -> a) -> BooleanFormula a -> a # foldl1 :: (a -> a -> a) -> BooleanFormula a -> a # toList :: BooleanFormula a -> [a] # null :: BooleanFormula a -> Bool # length :: BooleanFormula a -> Int # elem :: Eq a => a -> BooleanFormula a -> Bool # maximum :: Ord a => BooleanFormula a -> a # minimum :: Ord a => BooleanFormula a -> a # sum :: Num a => BooleanFormula a -> a # product :: Num a => BooleanFormula a -> a # | |
Foldable Role | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Role m -> m # foldMap :: Monoid m => (a -> m) -> Role a -> m # foldr :: (a -> b -> b) -> b -> Role a -> b # foldr' :: (a -> b -> b) -> b -> Role a -> b # foldl :: (b -> a -> b) -> b -> Role a -> b # foldl' :: (b -> a -> b) -> b -> Role a -> b # foldr1 :: (a -> a -> a) -> Role a -> a # foldl1 :: (a -> a -> a) -> Role a -> a # elem :: Eq a => a -> Role a -> Bool # maximum :: Ord a => Role a -> a # | |
Foldable DataOrNew | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => DataOrNew m -> m # foldMap :: Monoid m => (a -> m) -> DataOrNew a -> m # foldr :: (a -> b -> b) -> b -> DataOrNew a -> b # foldr' :: (a -> b -> b) -> b -> DataOrNew a -> b # foldl :: (b -> a -> b) -> b -> DataOrNew a -> b # foldl' :: (b -> a -> b) -> b -> DataOrNew a -> b # foldr1 :: (a -> a -> a) -> DataOrNew a -> a # foldl1 :: (a -> a -> a) -> DataOrNew a -> a # toList :: DataOrNew a -> [a] # length :: DataOrNew a -> Int # elem :: Eq a => a -> DataOrNew a -> Bool # maximum :: Ord a => DataOrNew a -> a # minimum :: Ord a => DataOrNew a -> a # | |
Foldable InjectivityInfo | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => InjectivityInfo m -> m # foldMap :: Monoid m => (a -> m) -> InjectivityInfo a -> m # foldr :: (a -> b -> b) -> b -> InjectivityInfo a -> b # foldr' :: (a -> b -> b) -> b -> InjectivityInfo a -> b # foldl :: (b -> a -> b) -> b -> InjectivityInfo a -> b # foldl' :: (b -> a -> b) -> b -> InjectivityInfo a -> b # foldr1 :: (a -> a -> a) -> InjectivityInfo a -> a # foldl1 :: (a -> a -> a) -> InjectivityInfo a -> a # toList :: InjectivityInfo a -> [a] # null :: InjectivityInfo a -> Bool # length :: InjectivityInfo a -> Int # elem :: Eq a => a -> InjectivityInfo a -> Bool # maximum :: Ord a => InjectivityInfo a -> a # minimum :: Ord a => InjectivityInfo a -> a # sum :: Num a => InjectivityInfo a -> a # product :: Num a => InjectivityInfo a -> a # | |
Foldable ResultSig | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ResultSig m -> m # foldMap :: Monoid m => (a -> m) -> ResultSig a -> m # foldr :: (a -> b -> b) -> b -> ResultSig a -> b # foldr' :: (a -> b -> b) -> b -> ResultSig a -> b # foldl :: (b -> a -> b) -> b -> ResultSig a -> b # foldl' :: (b -> a -> b) -> b -> ResultSig a -> b # foldr1 :: (a -> a -> a) -> ResultSig a -> a # foldl1 :: (a -> a -> a) -> ResultSig a -> a # toList :: ResultSig a -> [a] # length :: ResultSig a -> Int # elem :: Eq a => a -> ResultSig a -> Bool # maximum :: Ord a => ResultSig a -> a # minimum :: Ord a => ResultSig a -> a # | |
Foldable DeclHead | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => DeclHead m -> m # foldMap :: Monoid m => (a -> m) -> DeclHead a -> m # foldr :: (a -> b -> b) -> b -> DeclHead a -> b # foldr' :: (a -> b -> b) -> b -> DeclHead a -> b # foldl :: (b -> a -> b) -> b -> DeclHead a -> b # foldl' :: (b -> a -> b) -> b -> DeclHead a -> b # foldr1 :: (a -> a -> a) -> DeclHead a -> a # foldl1 :: (a -> a -> a) -> DeclHead a -> a # elem :: Eq a => a -> DeclHead a -> Bool # maximum :: Ord a => DeclHead a -> a # minimum :: Ord a => DeclHead a -> a # | |
Foldable InstRule | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => InstRule m -> m # foldMap :: Monoid m => (a -> m) -> InstRule a -> m # foldr :: (a -> b -> b) -> b -> InstRule a -> b # foldr' :: (a -> b -> b) -> b -> InstRule a -> b # foldl :: (b -> a -> b) -> b -> InstRule a -> b # foldl' :: (b -> a -> b) -> b -> InstRule a -> b # foldr1 :: (a -> a -> a) -> InstRule a -> a # foldl1 :: (a -> a -> a) -> InstRule a -> a # elem :: Eq a => a -> InstRule a -> Bool # maximum :: Ord a => InstRule a -> a # minimum :: Ord a => InstRule a -> a # | |
Foldable InstHead | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => InstHead m -> m # foldMap :: Monoid m => (a -> m) -> InstHead a -> m # foldr :: (a -> b -> b) -> b -> InstHead a -> b # foldr' :: (a -> b -> b) -> b -> InstHead a -> b # foldl :: (b -> a -> b) -> b -> InstHead a -> b # foldl' :: (b -> a -> b) -> b -> InstHead a -> b # foldr1 :: (a -> a -> a) -> InstHead a -> a # foldl1 :: (a -> a -> a) -> InstHead a -> a # elem :: Eq a => a -> InstHead a -> Bool # maximum :: Ord a => InstHead a -> a # minimum :: Ord a => InstHead a -> a # | |
Foldable Deriving | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Deriving m -> m # foldMap :: Monoid m => (a -> m) -> Deriving a -> m # foldr :: (a -> b -> b) -> b -> Deriving a -> b # foldr' :: (a -> b -> b) -> b -> Deriving a -> b # foldl :: (b -> a -> b) -> b -> Deriving a -> b # foldl' :: (b -> a -> b) -> b -> Deriving a -> b # foldr1 :: (a -> a -> a) -> Deriving a -> a # foldl1 :: (a -> a -> a) -> Deriving a -> a # elem :: Eq a => a -> Deriving a -> Bool # maximum :: Ord a => Deriving a -> a # minimum :: Ord a => Deriving a -> a # | |
Foldable DerivStrategy | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => DerivStrategy m -> m # foldMap :: Monoid m => (a -> m) -> DerivStrategy a -> m # foldr :: (a -> b -> b) -> b -> DerivStrategy a -> b # foldr' :: (a -> b -> b) -> b -> DerivStrategy a -> b # foldl :: (b -> a -> b) -> b -> DerivStrategy a -> b # foldl' :: (b -> a -> b) -> b -> DerivStrategy a -> b # foldr1 :: (a -> a -> a) -> DerivStrategy a -> a # foldl1 :: (a -> a -> a) -> DerivStrategy a -> a # toList :: DerivStrategy a -> [a] # null :: DerivStrategy a -> Bool # length :: DerivStrategy a -> Int # elem :: Eq a => a -> DerivStrategy a -> Bool # maximum :: Ord a => DerivStrategy a -> a # minimum :: Ord a => DerivStrategy a -> a # sum :: Num a => DerivStrategy a -> a # product :: Num a => DerivStrategy a -> a # | |
Foldable Binds | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Binds m -> m # foldMap :: Monoid m => (a -> m) -> Binds a -> m # foldr :: (a -> b -> b) -> b -> Binds a -> b # foldr' :: (a -> b -> b) -> b -> Binds a -> b # foldl :: (b -> a -> b) -> b -> Binds a -> b # foldl' :: (b -> a -> b) -> b -> Binds a -> b # foldr1 :: (a -> a -> a) -> Binds a -> a # foldl1 :: (a -> a -> a) -> Binds a -> a # elem :: Eq a => a -> Binds a -> Bool # maximum :: Ord a => Binds a -> a # minimum :: Ord a => Binds a -> a # | |
Foldable IPBind | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => IPBind m -> m # foldMap :: Monoid m => (a -> m) -> IPBind a -> m # foldr :: (a -> b -> b) -> b -> IPBind a -> b # foldr' :: (a -> b -> b) -> b -> IPBind a -> b # foldl :: (b -> a -> b) -> b -> IPBind a -> b # foldl' :: (b -> a -> b) -> b -> IPBind a -> b # foldr1 :: (a -> a -> a) -> IPBind a -> a # foldl1 :: (a -> a -> a) -> IPBind a -> a # elem :: Eq a => a -> IPBind a -> Bool # maximum :: Ord a => IPBind a -> a # minimum :: Ord a => IPBind a -> a # | |
Foldable Match | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Match m -> m # foldMap :: Monoid m => (a -> m) -> Match a -> m # foldr :: (a -> b -> b) -> b -> Match a -> b # foldr' :: (a -> b -> b) -> b -> Match a -> b # foldl :: (b -> a -> b) -> b -> Match a -> b # foldl' :: (b -> a -> b) -> b -> Match a -> b # foldr1 :: (a -> a -> a) -> Match a -> a # foldl1 :: (a -> a -> a) -> Match a -> a # elem :: Eq a => a -> Match a -> Bool # maximum :: Ord a => Match a -> a # minimum :: Ord a => Match a -> a # | |
Foldable QualConDecl | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => QualConDecl m -> m # foldMap :: Monoid m => (a -> m) -> QualConDecl a -> m # foldr :: (a -> b -> b) -> b -> QualConDecl a -> b # foldr' :: (a -> b -> b) -> b -> QualConDecl a -> b # foldl :: (b -> a -> b) -> b -> QualConDecl a -> b # foldl' :: (b -> a -> b) -> b -> QualConDecl a -> b # foldr1 :: (a -> a -> a) -> QualConDecl a -> a # foldl1 :: (a -> a -> a) -> QualConDecl a -> a # toList :: QualConDecl a -> [a] # null :: QualConDecl a -> Bool # length :: QualConDecl a -> Int # elem :: Eq a => a -> QualConDecl a -> Bool # maximum :: Ord a => QualConDecl a -> a # minimum :: Ord a => QualConDecl a -> a # sum :: Num a => QualConDecl a -> a # product :: Num a => QualConDecl a -> a # | |
Foldable ConDecl | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ConDecl m -> m # foldMap :: Monoid m => (a -> m) -> ConDecl a -> m # foldr :: (a -> b -> b) -> b -> ConDecl a -> b # foldr' :: (a -> b -> b) -> b -> ConDecl a -> b # foldl :: (b -> a -> b) -> b -> ConDecl a -> b # foldl' :: (b -> a -> b) -> b -> ConDecl a -> b # foldr1 :: (a -> a -> a) -> ConDecl a -> a # foldl1 :: (a -> a -> a) -> ConDecl a -> a # elem :: Eq a => a -> ConDecl a -> Bool # maximum :: Ord a => ConDecl a -> a # minimum :: Ord a => ConDecl a -> a # | |
Foldable FieldDecl | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => FieldDecl m -> m # foldMap :: Monoid m => (a -> m) -> FieldDecl a -> m # foldr :: (a -> b -> b) -> b -> FieldDecl a -> b # foldr' :: (a -> b -> b) -> b -> FieldDecl a -> b # foldl :: (b -> a -> b) -> b -> FieldDecl a -> b # foldl' :: (b -> a -> b) -> b -> FieldDecl a -> b # foldr1 :: (a -> a -> a) -> FieldDecl a -> a # foldl1 :: (a -> a -> a) -> FieldDecl a -> a # toList :: FieldDecl a -> [a] # length :: FieldDecl a -> Int # elem :: Eq a => a -> FieldDecl a -> Bool # maximum :: Ord a => FieldDecl a -> a # minimum :: Ord a => FieldDecl a -> a # | |
Foldable GadtDecl | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => GadtDecl m -> m # foldMap :: Monoid m => (a -> m) -> GadtDecl a -> m # foldr :: (a -> b -> b) -> b -> GadtDecl a -> b # foldr' :: (a -> b -> b) -> b -> GadtDecl a -> b # foldl :: (b -> a -> b) -> b -> GadtDecl a -> b # foldl' :: (b -> a -> b) -> b -> GadtDecl a -> b # foldr1 :: (a -> a -> a) -> GadtDecl a -> a # foldl1 :: (a -> a -> a) -> GadtDecl a -> a # elem :: Eq a => a -> GadtDecl a -> Bool # maximum :: Ord a => GadtDecl a -> a # minimum :: Ord a => GadtDecl a -> a # | |
Foldable ClassDecl | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ClassDecl m -> m # foldMap :: Monoid m => (a -> m) -> ClassDecl a -> m # foldr :: (a -> b -> b) -> b -> ClassDecl a -> b # foldr' :: (a -> b -> b) -> b -> ClassDecl a -> b # foldl :: (b -> a -> b) -> b -> ClassDecl a -> b # foldl' :: (b -> a -> b) -> b -> ClassDecl a -> b # foldr1 :: (a -> a -> a) -> ClassDecl a -> a # foldl1 :: (a -> a -> a) -> ClassDecl a -> a # toList :: ClassDecl a -> [a] # length :: ClassDecl a -> Int # elem :: Eq a => a -> ClassDecl a -> Bool # maximum :: Ord a => ClassDecl a -> a # minimum :: Ord a => ClassDecl a -> a # | |
Foldable InstDecl | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => InstDecl m -> m # foldMap :: Monoid m => (a -> m) -> InstDecl a -> m # foldr :: (a -> b -> b) -> b -> InstDecl a -> b # foldr' :: (a -> b -> b) -> b -> InstDecl a -> b # foldl :: (b -> a -> b) -> b -> InstDecl a -> b # foldl' :: (b -> a -> b) -> b -> InstDecl a -> b # foldr1 :: (a -> a -> a) -> InstDecl a -> a # foldl1 :: (a -> a -> a) -> InstDecl a -> a # elem :: Eq a => a -> InstDecl a -> Bool # maximum :: Ord a => InstDecl a -> a # minimum :: Ord a => InstDecl a -> a # | |
Foldable BangType | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => BangType m -> m # foldMap :: Monoid m => (a -> m) -> BangType a -> m # foldr :: (a -> b -> b) -> b -> BangType a -> b # foldr' :: (a -> b -> b) -> b -> BangType a -> b # foldl :: (b -> a -> b) -> b -> BangType a -> b # foldl' :: (b -> a -> b) -> b -> BangType a -> b # foldr1 :: (a -> a -> a) -> BangType a -> a # foldl1 :: (a -> a -> a) -> BangType a -> a # elem :: Eq a => a -> BangType a -> Bool # maximum :: Ord a => BangType a -> a # minimum :: Ord a => BangType a -> a # | |
Foldable Unpackedness | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Unpackedness m -> m # foldMap :: Monoid m => (a -> m) -> Unpackedness a -> m # foldr :: (a -> b -> b) -> b -> Unpackedness a -> b # foldr' :: (a -> b -> b) -> b -> Unpackedness a -> b # foldl :: (b -> a -> b) -> b -> Unpackedness a -> b # foldl' :: (b -> a -> b) -> b -> Unpackedness a -> b # foldr1 :: (a -> a -> a) -> Unpackedness a -> a # foldl1 :: (a -> a -> a) -> Unpackedness a -> a # toList :: Unpackedness a -> [a] # null :: Unpackedness a -> Bool # length :: Unpackedness a -> Int # elem :: Eq a => a -> Unpackedness a -> Bool # maximum :: Ord a => Unpackedness a -> a # minimum :: Ord a => Unpackedness a -> a # sum :: Num a => Unpackedness a -> a # product :: Num a => Unpackedness a -> a # | |
Foldable Rhs | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Rhs m -> m # foldMap :: Monoid m => (a -> m) -> Rhs a -> m # foldr :: (a -> b -> b) -> b -> Rhs a -> b # foldr' :: (a -> b -> b) -> b -> Rhs a -> b # foldl :: (b -> a -> b) -> b -> Rhs a -> b # foldl' :: (b -> a -> b) -> b -> Rhs a -> b # foldr1 :: (a -> a -> a) -> Rhs a -> a # foldl1 :: (a -> a -> a) -> Rhs a -> a # elem :: Eq a => a -> Rhs a -> Bool # maximum :: Ord a => Rhs a -> a # | |
Foldable GuardedRhs | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => GuardedRhs m -> m # foldMap :: Monoid m => (a -> m) -> GuardedRhs a -> m # foldr :: (a -> b -> b) -> b -> GuardedRhs a -> b # foldr' :: (a -> b -> b) -> b -> GuardedRhs a -> b # foldl :: (b -> a -> b) -> b -> GuardedRhs a -> b # foldl' :: (b -> a -> b) -> b -> GuardedRhs a -> b # foldr1 :: (a -> a -> a) -> GuardedRhs a -> a # foldl1 :: (a -> a -> a) -> GuardedRhs a -> a # toList :: GuardedRhs a -> [a] # null :: GuardedRhs a -> Bool # length :: GuardedRhs a -> Int # elem :: Eq a => a -> GuardedRhs a -> Bool # maximum :: Ord a => GuardedRhs a -> a # minimum :: Ord a => GuardedRhs a -> a # sum :: Num a => GuardedRhs a -> a # product :: Num a => GuardedRhs a -> a # | |
Foldable Type | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Type m -> m # foldMap :: Monoid m => (a -> m) -> Type a -> m # foldr :: (a -> b -> b) -> b -> Type a -> b # foldr' :: (a -> b -> b) -> b -> Type a -> b # foldl :: (b -> a -> b) -> b -> Type a -> b # foldl' :: (b -> a -> b) -> b -> Type a -> b # foldr1 :: (a -> a -> a) -> Type a -> a # foldl1 :: (a -> a -> a) -> Type a -> a # elem :: Eq a => a -> Type a -> Bool # maximum :: Ord a => Type a -> a # | |
Foldable MaybePromotedName | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => MaybePromotedName m -> m # foldMap :: Monoid m => (a -> m) -> MaybePromotedName a -> m # foldr :: (a -> b -> b) -> b -> MaybePromotedName a -> b # foldr' :: (a -> b -> b) -> b -> MaybePromotedName a -> b # foldl :: (b -> a -> b) -> b -> MaybePromotedName a -> b # foldl' :: (b -> a -> b) -> b -> MaybePromotedName a -> b # foldr1 :: (a -> a -> a) -> MaybePromotedName a -> a # foldl1 :: (a -> a -> a) -> MaybePromotedName a -> a # toList :: MaybePromotedName a -> [a] # null :: MaybePromotedName a -> Bool # length :: MaybePromotedName a -> Int # elem :: Eq a => a -> MaybePromotedName a -> Bool # maximum :: Ord a => MaybePromotedName a -> a # minimum :: Ord a => MaybePromotedName a -> a # sum :: Num a => MaybePromotedName a -> a # product :: Num a => MaybePromotedName a -> a # | |
Foldable Promoted | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Promoted m -> m # foldMap :: Monoid m => (a -> m) -> Promoted a -> m # foldr :: (a -> b -> b) -> b -> Promoted a -> b # foldr' :: (a -> b -> b) -> b -> Promoted a -> b # foldl :: (b -> a -> b) -> b -> Promoted a -> b # foldl' :: (b -> a -> b) -> b -> Promoted a -> b # foldr1 :: (a -> a -> a) -> Promoted a -> a # foldl1 :: (a -> a -> a) -> Promoted a -> a # elem :: Eq a => a -> Promoted a -> Bool # maximum :: Ord a => Promoted a -> a # minimum :: Ord a => Promoted a -> a # | |
Foldable TyVarBind | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => TyVarBind m -> m # foldMap :: Monoid m => (a -> m) -> TyVarBind a -> m # foldr :: (a -> b -> b) -> b -> TyVarBind a -> b # foldr' :: (a -> b -> b) -> b -> TyVarBind a -> b # foldl :: (b -> a -> b) -> b -> TyVarBind a -> b # foldl' :: (b -> a -> b) -> b -> TyVarBind a -> b # foldr1 :: (a -> a -> a) -> TyVarBind a -> a # foldl1 :: (a -> a -> a) -> TyVarBind a -> a # toList :: TyVarBind a -> [a] # length :: TyVarBind a -> Int # elem :: Eq a => a -> TyVarBind a -> Bool # maximum :: Ord a => TyVarBind a -> a # minimum :: Ord a => TyVarBind a -> a # | |
Foldable Kind | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Kind m -> m # foldMap :: Monoid m => (a -> m) -> Kind a -> m # foldr :: (a -> b -> b) -> b -> Kind a -> b # foldr' :: (a -> b -> b) -> b -> Kind a -> b # foldl :: (b -> a -> b) -> b -> Kind a -> b # foldl' :: (b -> a -> b) -> b -> Kind a -> b # foldr1 :: (a -> a -> a) -> Kind a -> a # foldl1 :: (a -> a -> a) -> Kind a -> a # elem :: Eq a => a -> Kind a -> Bool # maximum :: Ord a => Kind a -> a # | |
Foldable FunDep | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => FunDep m -> m # foldMap :: Monoid m => (a -> m) -> FunDep a -> m # foldr :: (a -> b -> b) -> b -> FunDep a -> b # foldr' :: (a -> b -> b) -> b -> FunDep a -> b # foldl :: (b -> a -> b) -> b -> FunDep a -> b # foldl' :: (b -> a -> b) -> b -> FunDep a -> b # foldr1 :: (a -> a -> a) -> FunDep a -> a # foldl1 :: (a -> a -> a) -> FunDep a -> a # elem :: Eq a => a -> FunDep a -> Bool # maximum :: Ord a => FunDep a -> a # minimum :: Ord a => FunDep a -> a # | |
Foldable Context | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Context m -> m # foldMap :: Monoid m => (a -> m) -> Context a -> m # foldr :: (a -> b -> b) -> b -> Context a -> b # foldr' :: (a -> b -> b) -> b -> Context a -> b # foldl :: (b -> a -> b) -> b -> Context a -> b # foldl' :: (b -> a -> b) -> b -> Context a -> b # foldr1 :: (a -> a -> a) -> Context a -> a # foldl1 :: (a -> a -> a) -> Context a -> a # elem :: Eq a => a -> Context a -> Bool # maximum :: Ord a => Context a -> a # minimum :: Ord a => Context a -> a # | |
Foldable Asst | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Asst m -> m # foldMap :: Monoid m => (a -> m) -> Asst a -> m # foldr :: (a -> b -> b) -> b -> Asst a -> b # foldr' :: (a -> b -> b) -> b -> Asst a -> b # foldl :: (b -> a -> b) -> b -> Asst a -> b # foldl' :: (b -> a -> b) -> b -> Asst a -> b # foldr1 :: (a -> a -> a) -> Asst a -> a # foldl1 :: (a -> a -> a) -> Asst a -> a # elem :: Eq a => a -> Asst a -> Bool # maximum :: Ord a => Asst a -> a # | |
Foldable Literal | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Literal m -> m # foldMap :: Monoid m => (a -> m) -> Literal a -> m # foldr :: (a -> b -> b) -> b -> Literal a -> b # foldr' :: (a -> b -> b) -> b -> Literal a -> b # foldl :: (b -> a -> b) -> b -> Literal a -> b # foldl' :: (b -> a -> b) -> b -> Literal a -> b # foldr1 :: (a -> a -> a) -> Literal a -> a # foldl1 :: (a -> a -> a) -> Literal a -> a # elem :: Eq a => a -> Literal a -> Bool # maximum :: Ord a => Literal a -> a # minimum :: Ord a => Literal a -> a # | |
Foldable Sign | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Sign m -> m # foldMap :: Monoid m => (a -> m) -> Sign a -> m # foldr :: (a -> b -> b) -> b -> Sign a -> b # foldr' :: (a -> b -> b) -> b -> Sign a -> b # foldl :: (b -> a -> b) -> b -> Sign a -> b # foldl' :: (b -> a -> b) -> b -> Sign a -> b # foldr1 :: (a -> a -> a) -> Sign a -> a # foldl1 :: (a -> a -> a) -> Sign a -> a # elem :: Eq a => a -> Sign a -> Bool # maximum :: Ord a => Sign a -> a # | |
Foldable Exp | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Exp m -> m # foldMap :: Monoid m => (a -> m) -> Exp a -> m # foldr :: (a -> b -> b) -> b -> Exp a -> b # foldr' :: (a -> b -> b) -> b -> Exp a -> b # foldl :: (b -> a -> b) -> b -> Exp a -> b # foldl' :: (b -> a -> b) -> b -> Exp a -> b # foldr1 :: (a -> a -> a) -> Exp a -> a # foldl1 :: (a -> a -> a) -> Exp a -> a # elem :: Eq a => a -> Exp a -> Bool # maximum :: Ord a => Exp a -> a # | |
Foldable XName | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => XName m -> m # foldMap :: Monoid m => (a -> m) -> XName a -> m # foldr :: (a -> b -> b) -> b -> XName a -> b # foldr' :: (a -> b -> b) -> b -> XName a -> b # foldl :: (b -> a -> b) -> b -> XName a -> b # foldl' :: (b -> a -> b) -> b -> XName a -> b # foldr1 :: (a -> a -> a) -> XName a -> a # foldl1 :: (a -> a -> a) -> XName a -> a # elem :: Eq a => a -> XName a -> Bool # maximum :: Ord a => XName a -> a # minimum :: Ord a => XName a -> a # | |
Foldable XAttr | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => XAttr m -> m # foldMap :: Monoid m => (a -> m) -> XAttr a -> m # foldr :: (a -> b -> b) -> b -> XAttr a -> b # foldr' :: (a -> b -> b) -> b -> XAttr a -> b # foldl :: (b -> a -> b) -> b -> XAttr a -> b # foldl' :: (b -> a -> b) -> b -> XAttr a -> b # foldr1 :: (a -> a -> a) -> XAttr a -> a # foldl1 :: (a -> a -> a) -> XAttr a -> a # elem :: Eq a => a -> XAttr a -> Bool # maximum :: Ord a => XAttr a -> a # minimum :: Ord a => XAttr a -> a # | |
Foldable Bracket | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Bracket m -> m # foldMap :: Monoid m => (a -> m) -> Bracket a -> m # foldr :: (a -> b -> b) -> b -> Bracket a -> b # foldr' :: (a -> b -> b) -> b -> Bracket a -> b # foldl :: (b -> a -> b) -> b -> Bracket a -> b # foldl' :: (b -> a -> b) -> b -> Bracket a -> b # foldr1 :: (a -> a -> a) -> Bracket a -> a # foldl1 :: (a -> a -> a) -> Bracket a -> a # elem :: Eq a => a -> Bracket a -> Bool # maximum :: Ord a => Bracket a -> a # minimum :: Ord a => Bracket a -> a # | |
Foldable Splice | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Splice m -> m # foldMap :: Monoid m => (a -> m) -> Splice a -> m # foldr :: (a -> b -> b) -> b -> Splice a -> b # foldr' :: (a -> b -> b) -> b -> Splice a -> b # foldl :: (b -> a -> b) -> b -> Splice a -> b # foldl' :: (b -> a -> b) -> b -> Splice a -> b # foldr1 :: (a -> a -> a) -> Splice a -> a # foldl1 :: (a -> a -> a) -> Splice a -> a # elem :: Eq a => a -> Splice a -> Bool # maximum :: Ord a => Splice a -> a # minimum :: Ord a => Splice a -> a # | |
Foldable Safety | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Safety m -> m # foldMap :: Monoid m => (a -> m) -> Safety a -> m # foldr :: (a -> b -> b) -> b -> Safety a -> b # foldr' :: (a -> b -> b) -> b -> Safety a -> b # foldl :: (b -> a -> b) -> b -> Safety a -> b # foldl' :: (b -> a -> b) -> b -> Safety a -> b # foldr1 :: (a -> a -> a) -> Safety a -> a # foldl1 :: (a -> a -> a) -> Safety a -> a # elem :: Eq a => a -> Safety a -> Bool # maximum :: Ord a => Safety a -> a # minimum :: Ord a => Safety a -> a # | |
Foldable CallConv | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => CallConv m -> m # foldMap :: Monoid m => (a -> m) -> CallConv a -> m # foldr :: (a -> b -> b) -> b -> CallConv a -> b # foldr' :: (a -> b -> b) -> b -> CallConv a -> b # foldl :: (b -> a -> b) -> b -> CallConv a -> b # foldl' :: (b -> a -> b) -> b -> CallConv a -> b # foldr1 :: (a -> a -> a) -> CallConv a -> a # foldl1 :: (a -> a -> a) -> CallConv a -> a # elem :: Eq a => a -> CallConv a -> Bool # maximum :: Ord a => CallConv a -> a # minimum :: Ord a => CallConv a -> a # | |
Foldable ModulePragma | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => ModulePragma m -> m # foldMap :: Monoid m => (a -> m) -> ModulePragma a -> m # foldr :: (a -> b -> b) -> b -> ModulePragma a -> b # foldr' :: (a -> b -> b) -> b -> ModulePragma a -> b # foldl :: (b -> a -> b) -> b -> ModulePragma a -> b # foldl' :: (b -> a -> b) -> b -> ModulePragma a -> b # foldr1 :: (a -> a -> a) -> ModulePragma a -> a # foldl1 :: (a -> a -> a) -> ModulePragma a -> a # toList :: ModulePragma a -> [a] # null :: ModulePragma a -> Bool # length :: ModulePragma a -> Int # elem :: Eq a => a -> ModulePragma a -> Bool # maximum :: Ord a => ModulePragma a -> a # minimum :: Ord a => ModulePragma a -> a # sum :: Num a => ModulePragma a -> a # product :: Num a => ModulePragma a -> a # | |
Foldable Overlap | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Overlap m -> m # foldMap :: Monoid m => (a -> m) -> Overlap a -> m # foldr :: (a -> b -> b) -> b -> Overlap a -> b # foldr' :: (a -> b -> b) -> b -> Overlap a -> b # foldl :: (b -> a -> b) -> b -> Overlap a -> b # foldl' :: (b -> a -> b) -> b -> Overlap a -> b # foldr1 :: (a -> a -> a) -> Overlap a -> a # foldl1 :: (a -> a -> a) -> Overlap a -> a # elem :: Eq a => a -> Overlap a -> Bool # maximum :: Ord a => Overlap a -> a # minimum :: Ord a => Overlap a -> a # | |
Foldable Activation | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Activation m -> m # foldMap :: Monoid m => (a -> m) -> Activation a -> m # foldr :: (a -> b -> b) -> b -> Activation a -> b # foldr' :: (a -> b -> b) -> b -> Activation a -> b # foldl :: (b -> a -> b) -> b -> Activation a -> b # foldl' :: (b -> a -> b) -> b -> Activation a -> b # foldr1 :: (a -> a -> a) -> Activation a -> a # foldl1 :: (a -> a -> a) -> Activation a -> a # toList :: Activation a -> [a] # null :: Activation a -> Bool # length :: Activation a -> Int # elem :: Eq a => a -> Activation a -> Bool # maximum :: Ord a => Activation a -> a # minimum :: Ord a => Activation a -> a # sum :: Num a => Activation a -> a # product :: Num a => Activation a -> a # | |
Foldable Rule | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Rule m -> m # foldMap :: Monoid m => (a -> m) -> Rule a -> m # foldr :: (a -> b -> b) -> b -> Rule a -> b # foldr' :: (a -> b -> b) -> b -> Rule a -> b # foldl :: (b -> a -> b) -> b -> Rule a -> b # foldl' :: (b -> a -> b) -> b -> Rule a -> b # foldr1 :: (a -> a -> a) -> Rule a -> a # foldl1 :: (a -> a -> a) -> Rule a -> a # elem :: Eq a => a -> Rule a -> Bool # maximum :: Ord a => Rule a -> a # | |
Foldable RuleVar | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => RuleVar m -> m # foldMap :: Monoid m => (a -> m) -> RuleVar a -> m # foldr :: (a -> b -> b) -> b -> RuleVar a -> b # foldr' :: (a -> b -> b) -> b -> RuleVar a -> b # foldl :: (b -> a -> b) -> b -> RuleVar a -> b # foldl' :: (b -> a -> b) -> b -> RuleVar a -> b # foldr1 :: (a -> a -> a) -> RuleVar a -> a # foldl1 :: (a -> a -> a) -> RuleVar a -> a # elem :: Eq a => a -> RuleVar a -> Bool # maximum :: Ord a => RuleVar a -> a # minimum :: Ord a => RuleVar a -> a # | |
Foldable WarningText | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => WarningText m -> m # foldMap :: Monoid m => (a -> m) -> WarningText a -> m # foldr :: (a -> b -> b) -> b -> WarningText a -> b # foldr' :: (a -> b -> b) -> b -> WarningText a -> b # foldl :: (b -> a -> b) -> b -> WarningText a -> b # foldl' :: (b -> a -> b) -> b -> WarningText a -> b # foldr1 :: (a -> a -> a) -> WarningText a -> a # foldl1 :: (a -> a -> a) -> WarningText a -> a # toList :: WarningText a -> [a] # null :: WarningText a -> Bool # length :: WarningText a -> Int # elem :: Eq a => a -> WarningText a -> Bool # maximum :: Ord a => WarningText a -> a # minimum :: Ord a => WarningText a -> a # sum :: Num a => WarningText a -> a # product :: Num a => WarningText a -> a # | |
Foldable Pat | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Pat m -> m # foldMap :: Monoid m => (a -> m) -> Pat a -> m # foldr :: (a -> b -> b) -> b -> Pat a -> b # foldr' :: (a -> b -> b) -> b -> Pat a -> b # foldl :: (b -> a -> b) -> b -> Pat a -> b # foldl' :: (b -> a -> b) -> b -> Pat a -> b # foldr1 :: (a -> a -> a) -> Pat a -> a # foldl1 :: (a -> a -> a) -> Pat a -> a # elem :: Eq a => a -> Pat a -> Bool # maximum :: Ord a => Pat a -> a # | |
Foldable PXAttr | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => PXAttr m -> m # foldMap :: Monoid m => (a -> m) -> PXAttr a -> m # foldr :: (a -> b -> b) -> b -> PXAttr a -> b # foldr' :: (a -> b -> b) -> b -> PXAttr a -> b # foldl :: (b -> a -> b) -> b -> PXAttr a -> b # foldl' :: (b -> a -> b) -> b -> PXAttr a -> b # foldr1 :: (a -> a -> a) -> PXAttr a -> a # foldl1 :: (a -> a -> a) -> PXAttr a -> a # elem :: Eq a => a -> PXAttr a -> Bool # maximum :: Ord a => PXAttr a -> a # minimum :: Ord a => PXAttr a -> a # | |
Foldable RPatOp | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => RPatOp m -> m # foldMap :: Monoid m => (a -> m) -> RPatOp a -> m # foldr :: (a -> b -> b) -> b -> RPatOp a -> b # foldr' :: (a -> b -> b) -> b -> RPatOp a -> b # foldl :: (b -> a -> b) -> b -> RPatOp a -> b # foldl' :: (b -> a -> b) -> b -> RPatOp a -> b # foldr1 :: (a -> a -> a) -> RPatOp a -> a # foldl1 :: (a -> a -> a) -> RPatOp a -> a # elem :: Eq a => a -> RPatOp a -> Bool # maximum :: Ord a => RPatOp a -> a # minimum :: Ord a => RPatOp a -> a # | |
Foldable RPat | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => RPat m -> m # foldMap :: Monoid m => (a -> m) -> RPat a -> m # foldr :: (a -> b -> b) -> b -> RPat a -> b # foldr' :: (a -> b -> b) -> b -> RPat a -> b # foldl :: (b -> a -> b) -> b -> RPat a -> b # foldl' :: (b -> a -> b) -> b -> RPat a -> b # foldr1 :: (a -> a -> a) -> RPat a -> a # foldl1 :: (a -> a -> a) -> RPat a -> a # elem :: Eq a => a -> RPat a -> Bool # maximum :: Ord a => RPat a -> a # | |
Foldable PatField | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => PatField m -> m # foldMap :: Monoid m => (a -> m) -> PatField a -> m # foldr :: (a -> b -> b) -> b -> PatField a -> b # foldr' :: (a -> b -> b) -> b -> PatField a -> b # foldl :: (b -> a -> b) -> b -> PatField a -> b # foldl' :: (b -> a -> b) -> b -> PatField a -> b # foldr1 :: (a -> a -> a) -> PatField a -> a # foldl1 :: (a -> a -> a) -> PatField a -> a # elem :: Eq a => a -> PatField a -> Bool # maximum :: Ord a => PatField a -> a # minimum :: Ord a => PatField a -> a # | |
Foldable Stmt | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Stmt m -> m # foldMap :: Monoid m => (a -> m) -> Stmt a -> m # foldr :: (a -> b -> b) -> b -> Stmt a -> b # foldr' :: (a -> b -> b) -> b -> Stmt a -> b # foldl :: (b -> a -> b) -> b -> Stmt a -> b # foldl' :: (b -> a -> b) -> b -> Stmt a -> b # foldr1 :: (a -> a -> a) -> Stmt a -> a # foldl1 :: (a -> a -> a) -> Stmt a -> a # elem :: Eq a => a -> Stmt a -> Bool # maximum :: Ord a => Stmt a -> a # | |
Foldable QualStmt | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => QualStmt m -> m # foldMap :: Monoid m => (a -> m) -> QualStmt a -> m # foldr :: (a -> b -> b) -> b -> QualStmt a -> b # foldr' :: (a -> b -> b) -> b -> QualStmt a -> b # foldl :: (b -> a -> b) -> b -> QualStmt a -> b # foldl' :: (b -> a -> b) -> b -> QualStmt a -> b # foldr1 :: (a -> a -> a) -> QualStmt a -> a # foldl1 :: (a -> a -> a) -> QualStmt a -> a # elem :: Eq a => a -> QualStmt a -> Bool # maximum :: Ord a => QualStmt a -> a # minimum :: Ord a => QualStmt a -> a # | |
Foldable FieldUpdate | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => FieldUpdate m -> m # foldMap :: Monoid m => (a -> m) -> FieldUpdate a -> m # foldr :: (a -> b -> b) -> b -> FieldUpdate a -> b # foldr' :: (a -> b -> b) -> b -> FieldUpdate a -> b # foldl :: (b -> a -> b) -> b -> FieldUpdate a -> b # foldl' :: (b -> a -> b) -> b -> FieldUpdate a -> b # foldr1 :: (a -> a -> a) -> FieldUpdate a -> a # foldl1 :: (a -> a -> a) -> FieldUpdate a -> a # toList :: FieldUpdate a -> [a] # null :: FieldUpdate a -> Bool # length :: FieldUpdate a -> Int # elem :: Eq a => a -> FieldUpdate a -> Bool # maximum :: Ord a => FieldUpdate a -> a # minimum :: Ord a => FieldUpdate a -> a # sum :: Num a => FieldUpdate a -> a # product :: Num a => FieldUpdate a -> a # | |
Foldable Alt | |
Defined in Language.Haskell.Exts.Syntax fold :: Monoid m => Alt m -> m # foldMap :: Monoid m => (a -> m) -> Alt a -> m # foldr :: (a -> b -> b) -> b -> Alt a -> b # foldr' :: (a -> b -> b) -> b -> Alt a -> b # foldl :: (b -> a -> b) -> b -> Alt a -> b # foldl' :: (b -> a -> b) -> b -> Alt a -> b # foldr1 :: (a -> a -> a) -> Alt a -> a # foldl1 :: (a -> a -> a) -> Alt a -> a # elem :: Eq a => a -> Alt a -> Bool # maximum :: Ord a => Alt a -> a # | |
Foldable (Either a) | Since: base-4.7.0.0 |
Defined in Data.Foldable fold :: Monoid m => Either a m -> m # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # toList :: Either a a0 -> [a0] # length :: Either a a0 -> Int # elem :: Eq a0 => a0 -> Either a a0 -> Bool # maximum :: Ord a0 => Either a a0 -> a0 # minimum :: Ord a0 => Either a a0 -> a0 # | |
Foldable (V1 :: * -> *) | |
Defined in Data.Foldable fold :: Monoid m => V1 m -> m # foldMap :: Monoid m => (a -> m) -> V1 a -> m # foldr :: (a -> b -> b) -> b -> V1 a -> b # foldr' :: (a -> b -> b) -> b -> V1 a -> b # foldl :: (b -> a -> b) -> b -> V1 a -> b # foldl' :: (b -> a -> b) -> b -> V1 a -> b # foldr1 :: (a -> a -> a) -> V1 a -> a # foldl1 :: (a -> a -> a) -> V1 a -> a # elem :: Eq a => a -> V1 a -> Bool # maximum :: Ord a => V1 a -> a # | |
Foldable (U1 :: * -> *) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => U1 m -> m # foldMap :: Monoid m => (a -> m) -> U1 a -> m # foldr :: (a -> b -> b) -> b -> U1 a -> b # foldr' :: (a -> b -> b) -> b -> U1 a -> b # foldl :: (b -> a -> b) -> b -> U1 a -> b # foldl' :: (b -> a -> b) -> b -> U1 a -> b # foldr1 :: (a -> a -> a) -> U1 a -> a # foldl1 :: (a -> a -> a) -> U1 a -> a # elem :: Eq a => a -> U1 a -> Bool # maximum :: Ord a => U1 a -> a # | |
Foldable ((,) a) | Since: base-4.7.0.0 |
Defined in Data.Foldable fold :: Monoid m => (a, m) -> m # foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m # foldr :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldr' :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldl :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldl' :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldr1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # foldl1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # elem :: Eq a0 => a0 -> (a, a0) -> Bool # maximum :: Ord a0 => (a, a0) -> a0 # minimum :: Ord a0 => (a, a0) -> a0 # | |
Foldable (Array i) | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Array i m -> m # foldMap :: Monoid m => (a -> m) -> Array i a -> m # foldr :: (a -> b -> b) -> b -> Array i a -> b # foldr' :: (a -> b -> b) -> b -> Array i a -> b # foldl :: (b -> a -> b) -> b -> Array i a -> b # foldl' :: (b -> a -> b) -> b -> Array i a -> b # foldr1 :: (a -> a -> a) -> Array i a -> a # foldl1 :: (a -> a -> a) -> Array i a -> a # elem :: Eq a => a -> Array i a -> Bool # maximum :: Ord a => Array i a -> a # minimum :: Ord a => Array i a -> a # | |
Foldable (Proxy :: * -> *) | Since: base-4.7.0.0 |
Defined in Data.Foldable fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
Foldable (Map k) | |
Defined in Data.Map.Internal fold :: Monoid m => Map k m -> m # foldMap :: Monoid m => (a -> m) -> Map k a -> m # foldr :: (a -> b -> b) -> b -> Map k a -> b # foldr' :: (a -> b -> b) -> b -> Map k a -> b # foldl :: (b -> a -> b) -> b -> Map k a -> b # foldl' :: (b -> a -> b) -> b -> Map k a -> b # foldr1 :: (a -> a -> a) -> Map k a -> a # foldl1 :: (a -> a -> a) -> Map k a -> a # elem :: Eq a => a -> Map k a -> Bool # maximum :: Ord a => Map k a -> a # minimum :: Ord a => Map k a -> a # | |
Foldable f => Foldable (MaybeT f) | |
Defined in Control.Monad.Trans.Maybe fold :: Monoid m => MaybeT f m -> m # foldMap :: Monoid m => (a -> m) -> MaybeT f a -> m # foldr :: (a -> b -> b) -> b -> MaybeT f a -> b # foldr' :: (a -> b -> b) -> b -> MaybeT f a -> b # foldl :: (b -> a -> b) -> b -> MaybeT f a -> b # foldl' :: (b -> a -> b) -> b -> MaybeT f a -> b # foldr1 :: (a -> a -> a) -> MaybeT f a -> a # foldl1 :: (a -> a -> a) -> MaybeT f a -> a # elem :: Eq a => a -> MaybeT f a -> Bool # maximum :: Ord a => MaybeT f a -> a # minimum :: Ord a => MaybeT f a -> a # | |
Foldable f => Foldable (Rec1 f) | |
Defined in Data.Foldable fold :: Monoid m => Rec1 f m -> m # foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m # foldr :: (a -> b -> b) -> b -> Rec1 f a -> b # foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b # foldl :: (b -> a -> b) -> b -> Rec1 f a -> b # foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b # foldr1 :: (a -> a -> a) -> Rec1 f a -> a # foldl1 :: (a -> a -> a) -> Rec1 f a -> a # elem :: Eq a => a -> Rec1 f a -> Bool # maximum :: Ord a => Rec1 f a -> a # minimum :: Ord a => Rec1 f a -> a # | |
Foldable (URec Char :: * -> *) | |
Defined in Data.Foldable fold :: Monoid m => URec Char m -> m # foldMap :: Monoid m => (a -> m) -> URec Char a -> m # foldr :: (a -> b -> b) -> b -> URec Char a -> b # foldr' :: (a -> b -> b) -> b -> URec Char a -> b # foldl :: (b -> a -> b) -> b -> URec Char a -> b # foldl' :: (b -> a -> b) -> b -> URec Char a -> b # foldr1 :: (a -> a -> a) -> URec Char a -> a # foldl1 :: (a -> a -> a) -> URec Char a -> a # toList :: URec Char a -> [a] # length :: URec Char a -> Int # elem :: Eq a => a -> URec Char a -> Bool # maximum :: Ord a => URec Char a -> a # minimum :: Ord a => URec Char a -> a # | |
Foldable (URec Double :: * -> *) | |
Defined in Data.Foldable fold :: Monoid m => URec Double m -> m # foldMap :: Monoid m => (a -> m) -> URec Double a -> m # foldr :: (a -> b -> b) -> b -> URec Double a -> b # foldr' :: (a -> b -> b) -> b -> URec Double a -> b # foldl :: (b -> a -> b) -> b -> URec Double a -> b # foldl' :: (b -> a -> b) -> b -> URec Double a -> b # foldr1 :: (a -> a -> a) -> URec Double a -> a # foldl1 :: (a -> a -> a) -> URec Double a -> a # toList :: URec Double a -> [a] # null :: URec Double a -> Bool # length :: URec Double a -> Int # elem :: Eq a => a -> URec Double a -> Bool # maximum :: Ord a => URec Double a -> a # minimum :: Ord a => URec Double a -> a # | |
Foldable (URec Float :: * -> *) | |
Defined in Data.Foldable fold :: Monoid m => URec Float m -> m # foldMap :: Monoid m => (a -> m) -> URec Float a -> m # foldr :: (a -> b -> b) -> b -> URec Float a -> b # foldr' :: (a -> b -> b) -> b -> URec Float a -> b # foldl :: (b -> a -> b) -> b -> URec Float a -> b # foldl' :: (b -> a -> b) -> b -> URec Float a -> b # foldr1 :: (a -> a -> a) -> URec Float a -> a # foldl1 :: (a -> a -> a) -> URec Float a -> a # toList :: URec Float a -> [a] # null :: URec Float a -> Bool # length :: URec Float a -> Int # elem :: Eq a => a -> URec Float a -> Bool # maximum :: Ord a => URec Float a -> a # minimum :: Ord a => URec Float a -> a # | |
Foldable (URec Int :: * -> *) | |
Defined in Data.Foldable fold :: Monoid m => URec Int m -> m # foldMap :: Monoid m => (a -> m) -> URec Int a -> m # foldr :: (a -> b -> b) -> b -> URec Int a -> b # foldr' :: (a -> b -> b) -> b -> URec Int a -> b # foldl :: (b -> a -> b) -> b -> URec Int a -> b # foldl' :: (b -> a -> b) -> b -> URec Int a -> b # foldr1 :: (a -> a -> a) -> URec Int a -> a # foldl1 :: (a -> a -> a) -> URec Int a -> a # elem :: Eq a => a -> URec Int a -> Bool # maximum :: Ord a => URec Int a -> a # minimum :: Ord a => URec Int a -> a # | |
Foldable (URec Word :: * -> *) | |
Defined in Data.Foldable fold :: Monoid m => URec Word m -> m # foldMap :: Monoid m => (a -> m) -> URec Word a -> m # foldr :: (a -> b -> b) -> b -> URec Word a -> b # foldr' :: (a -> b -> b) -> b -> URec Word a -> b # foldl :: (b -> a -> b) -> b -> URec Word a -> b # foldl' :: (b -> a -> b) -> b -> URec Word a -> b # foldr1 :: (a -> a -> a) -> URec Word a -> a # foldl1 :: (a -> a -> a) -> URec Word a -> a # toList :: URec Word a -> [a] # length :: URec Word a -> Int # elem :: Eq a => a -> URec Word a -> Bool # maximum :: Ord a => URec Word a -> a # minimum :: Ord a => URec Word a -> a # | |
Foldable (URec (Ptr ()) :: * -> *) | |
Defined in Data.Foldable fold :: Monoid m => URec (Ptr ()) m -> m # foldMap :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m # foldr :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b # foldr' :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b # foldl :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b # foldl' :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b # foldr1 :: (a -> a -> a) -> URec (Ptr ()) a -> a # foldl1 :: (a -> a -> a) -> URec (Ptr ()) a -> a # toList :: URec (Ptr ()) a -> [a] # null :: URec (Ptr ()) a -> Bool # length :: URec (Ptr ()) a -> Int # elem :: Eq a => a -> URec (Ptr ()) a -> Bool # maximum :: Ord a => URec (Ptr ()) a -> a # minimum :: Ord a => URec (Ptr ()) a -> a # | |
Foldable f => Foldable (IdentityT f) | |
Defined in Control.Monad.Trans.Identity fold :: Monoid m => IdentityT f m -> m # foldMap :: Monoid m => (a -> m) -> IdentityT f a -> m # foldr :: (a -> b -> b) -> b -> IdentityT f a -> b # foldr' :: (a -> b -> b) -> b -> IdentityT f a -> b # foldl :: (b -> a -> b) -> b -> IdentityT f a -> b # foldl' :: (b -> a -> b) -> b -> IdentityT f a -> b # foldr1 :: (a -> a -> a) -> IdentityT f a -> a # foldl1 :: (a -> a -> a) -> IdentityT f a -> a # toList :: IdentityT f a -> [a] # null :: IdentityT f a -> Bool # length :: IdentityT f a -> Int # elem :: Eq a => a -> IdentityT f a -> Bool # maximum :: Ord a => IdentityT f a -> a # minimum :: Ord a => IdentityT f a -> a # | |
Foldable f => Foldable (ErrorT e f) | |
Defined in Control.Monad.Trans.Error fold :: Monoid m => ErrorT e f m -> m # foldMap :: Monoid m => (a -> m) -> ErrorT e f a -> m # foldr :: (a -> b -> b) -> b -> ErrorT e f a -> b # foldr' :: (a -> b -> b) -> b -> ErrorT e f a -> b # foldl :: (b -> a -> b) -> b -> ErrorT e f a -> b # foldl' :: (b -> a -> b) -> b -> ErrorT e f a -> b # foldr1 :: (a -> a -> a) -> ErrorT e f a -> a # foldl1 :: (a -> a -> a) -> ErrorT e f a -> a # toList :: ErrorT e f a -> [a] # null :: ErrorT e f a -> Bool # length :: ErrorT e f a -> Int # elem :: Eq a => a -> ErrorT e f a -> Bool # maximum :: Ord a => ErrorT e f a -> a # minimum :: Ord a => ErrorT e f a -> a # | |
Foldable f => Foldable (ExceptT e f) | |
Defined in Control.Monad.Trans.Except fold :: Monoid m => ExceptT e f m -> m # foldMap :: Monoid m => (a -> m) -> ExceptT e f a -> m # foldr :: (a -> b -> b) -> b -> ExceptT e f a -> b # foldr' :: (a -> b -> b) -> b -> ExceptT e f a -> b # foldl :: (b -> a -> b) -> b -> ExceptT e f a -> b # foldl' :: (b -> a -> b) -> b -> ExceptT e f a -> b # foldr1 :: (a -> a -> a) -> ExceptT e f a -> a # foldl1 :: (a -> a -> a) -> ExceptT e f a -> a # toList :: ExceptT e f a -> [a] # null :: ExceptT e f a -> Bool # length :: ExceptT e f a -> Int # elem :: Eq a => a -> ExceptT e f a -> Bool # maximum :: Ord a => ExceptT e f a -> a # minimum :: Ord a => ExceptT e f a -> a # | |
Foldable f => Foldable (WriterT w f) | |
Defined in Control.Monad.Trans.Writer.Lazy fold :: Monoid m => WriterT w f m -> m # foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m # foldr :: (a -> b -> b) -> b -> WriterT w f a -> b # foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b # foldl :: (b -> a -> b) -> b -> WriterT w f a -> b # foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b # foldr1 :: (a -> a -> a) -> WriterT w f a -> a # foldl1 :: (a -> a -> a) -> WriterT w f a -> a # toList :: WriterT w f a -> [a] # null :: WriterT w f a -> Bool # length :: WriterT w f a -> Int # elem :: Eq a => a -> WriterT w f a -> Bool # maximum :: Ord a => WriterT w f a -> a # minimum :: Ord a => WriterT w f a -> a # | |
Foldable f => Foldable (WriterT w f) | |
Defined in Control.Monad.Trans.Writer.Strict fold :: Monoid m => WriterT w f m -> m # foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m # foldr :: (a -> b -> b) -> b -> WriterT w f a -> b # foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b # foldl :: (b -> a -> b) -> b -> WriterT w f a -> b # foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b # foldr1 :: (a -> a -> a) -> WriterT w f a -> a # foldl1 :: (a -> a -> a) -> WriterT w f a -> a # toList :: WriterT w f a -> [a] # null :: WriterT w f a -> Bool # length :: WriterT w f a -> Int # elem :: Eq a => a -> WriterT w f a -> Bool # maximum :: Ord a => WriterT w f a -> a # minimum :: Ord a => WriterT w f a -> a # | |
Foldable (K1 i c :: * -> *) | |
Defined in Data.Foldable fold :: Monoid m => K1 i c m -> m # foldMap :: Monoid m => (a -> m) -> K1 i c a -> m # foldr :: (a -> b -> b) -> b -> K1 i c a -> b # foldr' :: (a -> b -> b) -> b -> K1 i c a -> b # foldl :: (b -> a -> b) -> b -> K1 i c a -> b # foldl' :: (b -> a -> b) -> b -> K1 i c a -> b # foldr1 :: (a -> a -> a) -> K1 i c a -> a # foldl1 :: (a -> a -> a) -> K1 i c a -> a # elem :: Eq a => a -> K1 i c a -> Bool # maximum :: Ord a => K1 i c a -> a # minimum :: Ord a => K1 i c a -> a # | |
(Foldable f, Foldable g) => Foldable (f :+: g) | |
Defined in Data.Foldable fold :: Monoid m => (f :+: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldr1 :: (a -> a -> a) -> (f :+: g) a -> a # foldl1 :: (a -> a -> a) -> (f :+: g) a -> a # toList :: (f :+: g) a -> [a] # length :: (f :+: g) a -> Int # elem :: Eq a => a -> (f :+: g) a -> Bool # maximum :: Ord a => (f :+: g) a -> a # minimum :: Ord a => (f :+: g) a -> a # | |
(Foldable f, Foldable g) => Foldable (f :*: g) | |
Defined in Data.Foldable fold :: Monoid m => (f :*: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldr1 :: (a -> a -> a) -> (f :*: g) a -> a # foldl1 :: (a -> a -> a) -> (f :*: g) a -> a # toList :: (f :*: g) a -> [a] # length :: (f :*: g) a -> Int # elem :: Eq a => a -> (f :*: g) a -> Bool # maximum :: Ord a => (f :*: g) a -> a # minimum :: Ord a => (f :*: g) a -> a # | |
Foldable f => Foldable (M1 i c f) | |
Defined in Data.Foldable fold :: Monoid m => M1 i c f m -> m # foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m # foldr :: (a -> b -> b) -> b -> M1 i c f a -> b # foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b # foldl :: (b -> a -> b) -> b -> M1 i c f a -> b # foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b # foldr1 :: (a -> a -> a) -> M1 i c f a -> a # foldl1 :: (a -> a -> a) -> M1 i c f a -> a # elem :: Eq a => a -> M1 i c f a -> Bool # maximum :: Ord a => M1 i c f a -> a # minimum :: Ord a => M1 i c f a -> a # | |
(Foldable f, Foldable g) => Foldable (f :.: g) | |
Defined in Data.Foldable fold :: Monoid m => (f :.: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldr1 :: (a -> a -> a) -> (f :.: g) a -> a # foldl1 :: (a -> a -> a) -> (f :.: g) a -> a # toList :: (f :.: g) a -> [a] # length :: (f :.: g) a -> Int # elem :: Eq a => a -> (f :.: g) a -> Bool # maximum :: Ord a => (f :.: g) a -> a # minimum :: Ord a => (f :.: g) a -> a # |
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) #
Map each element of a structure to a monadic action, evaluate
these actions from left to right, and collect the results. For
a version that ignores the results see mapM_
.
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a) #
Evaluate each monadic action in the structure from left to
right, and collect the results. For a version that ignores the
results see sequence_
.
class Semigroup a => Monoid a where #
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:
x
<>
mempty
= xmempty
<>
x = xx
(<>
(y<>
z) = (x<>
y)<>
zSemigroup
law)mconcat
=foldr
'(<>)'mempty
The method names refer to the monoid of lists under concatenation, but there are many other instances.
Some types can be viewed as a monoid in more than one way,
e.g. both addition and multiplication on numbers.
In such cases we often define newtype
s and make those instances
of Monoid
, e.g. Sum
and Product
.
NOTE: Semigroup
is a superclass of Monoid
since base-4.11.0.0.
Identity of mappend
An associative operation
NOTE: This method is redundant and has the default
implementation
since base-4.11.0.0.mappend
= '(<>)'
Fold a list using the monoid.
For most types, the default definition for mconcat
will be
used, but the function is included in the class definition so
that an optimized version can be provided for specific types.
Instances
Monoid Ordering | Since: base-2.1 |
Monoid () | Since: base-2.1 |
Monoid All | Since: base-2.1 |
Monoid Any | Since: base-2.1 |
Monoid Doc | |
Monoid [a] | Since: base-2.1 |
Semigroup a => Monoid (Maybe a) | Lift a semigroup into Since 4.11.0: constraint on inner Since: base-2.1 |
Monoid a => Monoid (IO a) | Since: base-4.9.0.0 |
Monoid (First a) | Since: base-2.1 |
Monoid (Last a) | Since: base-2.1 |
Monoid a => Monoid (Dual a) | Since: base-2.1 |
Monoid (Endo a) | Since: base-2.1 |
Num a => Monoid (Sum a) | Since: base-2.1 |
Num a => Monoid (Product a) | Since: base-2.1 |
Ord a => Monoid (Set a) | |
Monoid (Doc a) | |
Monoid (MergeSet a) | |
Monoid b => Monoid (a -> b) | Since: base-2.1 |
(Monoid a, Monoid b) => Monoid (a, b) | Since: base-2.1 |
Monoid (Proxy s) | Since: base-4.7.0.0 |
Ord k => Monoid (Map k v) | |
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) | Since: base-2.1 |
Alternative f => Monoid (Alt f a) | Since: base-4.8.0.0 |
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) | Since: base-2.1 |
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) | Since: base-2.1 |
A Lift
instance can have any of its values turned into a Template
Haskell expression. This is needed when a value used within a Template
Haskell quotation is bound outside the Oxford brackets ([| ... |]
) but not
at the top level. As an example:
add1 :: Int -> Q Exp add1 x = [| x + 1 |]
Template Haskell has no way of knowing what value x
will take on at
splice-time, so it requires the type of x
to be an instance of Lift
.
A Lift
instance must satisfy $(lift x) ≡ x
for all x
, where $(...)
is a Template Haskell splice.
Lift
instances can be derived automatically by use of the -XDeriveLift
GHC language extension:
{-# LANGUAGE DeriveLift #-} module Foo where import Language.Haskell.TH.Syntax data Bar a = Bar1 a (Bar a) | Bar2 String deriving Lift
Instances
Lift Bool | |
Lift Char | |
Lift Double | |
Lift Float | |
Lift Int | |
Lift Int8 | |
Lift Int16 | |
Lift Int32 | |
Lift Int64 | |
Lift Integer | |
Lift Natural | |
Lift Word | |
Lift Word8 | |
Lift Word16 | |
Lift Word32 | |
Lift Word64 | |
Lift () | |
Defined in Language.Haskell.TH.Syntax | |
Lift a => Lift [a] | |
Defined in Language.Haskell.TH.Syntax | |
Lift a => Lift (Maybe a) | |
Integral a => Lift (Ratio a) | |
(Lift a, Lift b) => Lift (Either a b) | |
(Lift a, Lift b) => Lift (a, b) | |
Defined in Language.Haskell.TH.Syntax | |
(Lift a, Lift b, Lift c) => Lift (a, b, c) | |
Defined in Language.Haskell.TH.Syntax | |
(Lift a, Lift b, Lift c, Lift d) => Lift (a, b, c, d) | |
Defined in Language.Haskell.TH.Syntax | |
(Lift a, Lift b, Lift c, Lift d, Lift e) => Lift (a, b, c, d, e) | |
Defined in Language.Haskell.TH.Syntax | |
(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift (a, b, c, d, e, f) | |
Defined in Language.Haskell.TH.Syntax | |
(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift (a, b, c, d, e, f, g) | |
Defined in Language.Haskell.TH.Syntax |
VarE Name | { x } |
ConE Name | data T1 = C1 t1 t2; p = {C1} e1 e2 |
LitE Lit | { 5 or 'c'} |
AppE Exp Exp | { f x } |
AppTypeE Exp Type | { f @Int } |
InfixE (Maybe Exp) Exp (Maybe Exp) | {x + y} or {(x+)} or {(+ x)} or {(+)} |
UInfixE Exp Exp Exp | {x + y} |
ParensE Exp | { (e) } |
LamE [Pat] Exp | { \ p1 p2 -> e } |
LamCaseE [Match] | { \case m1; m2 } |
TupE [Exp] | { (e1,e2) } |
UnboxedTupE [Exp] | { (# e1,e2 #) } |
UnboxedSumE Exp SumAlt SumArity | { (#|e|#) } |
CondE Exp Exp Exp | { if e1 then e2 else e3 } |
MultiIfE [(Guard, Exp)] | { if | g1 -> e1 | g2 -> e2 } |
LetE [Dec] Exp | { let x=e1; y=e2 in e3 } |
CaseE Exp [Match] | { case e of m1; m2 } |
DoE [Stmt] | { do { p <- e1; e2 } } |
CompE [Stmt] | { [ (x,y) | x <- xs, y <- ys ] } The result expression of the comprehension is
the last of the E.g. translation: [ f x | x <- xs ] CompE [BindS (VarP x) (VarE xs), NoBindS (AppE (VarE f) (VarE x))] |
ArithSeqE Range | { [ 1 ,2 .. 10 ] } |
ListE [Exp] | { [1,2,3] } |
SigE Exp Type | { e :: t } |
RecConE Name [FieldExp] | { T { x = y, z = w } } |
RecUpdE Exp [FieldExp] | { (f x) { z = w } } |
StaticE Exp | { static e } |
UnboundVarE Name |
|
LabelE String |
|
Instances
Instances
Eq Match | |
Data Match | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Match -> c Match # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Match # dataTypeOf :: Match -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Match) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Match) # gmapT :: (forall b. Data b => b -> b) -> Match -> Match # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r # gmapQ :: (forall d. Data d => d -> u) -> Match -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Match -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Match -> m Match # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Match -> m Match # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Match -> m Match # | |
Ord Match | |
Show Match | |
Generic Match | |
Ppr Match | |
type Rep Match | |
Defined in Language.Haskell.TH.Syntax type Rep Match = D1 (MetaData "Match" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Match" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Pat) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Body) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Dec])))) |
Instances
Eq Clause | |
Data Clause | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Clause -> c Clause # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Clause # toConstr :: Clause -> Constr # dataTypeOf :: Clause -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Clause) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Clause) # gmapT :: (forall b. Data b => b -> b) -> Clause -> Clause # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r # gmapQ :: (forall d. Data d => d -> u) -> Clause -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Clause -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Clause -> m Clause # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Clause -> m Clause # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Clause -> m Clause # | |
Ord Clause | |
Show Clause | |
Generic Clause | |
Ppr Clause | |
type Rep Clause | |
Defined in Language.Haskell.TH.Syntax type Rep Clause = D1 (MetaData "Clause" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Clause" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Pat]) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Body) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Dec])))) |
Instances
Monad Q | |
Functor Q | |
MonadFail Q | |
Defined in Language.Haskell.TH.Syntax | |
Applicative Q | |
MonadIO Q | |
Defined in Language.Haskell.TH.Syntax | |
Quasi Q | |
Defined in Language.Haskell.TH.Syntax qNewName :: String -> Q Name # qReport :: Bool -> String -> Q () # qRecover :: Q a -> Q a -> Q a # qLookupName :: Bool -> String -> Q (Maybe Name) # qReifyFixity :: Name -> Q (Maybe Fixity) # qReifyInstances :: Name -> [Type] -> Q [Dec] # qReifyRoles :: Name -> Q [Role] # qReifyAnnotations :: Data a => AnnLookup -> Q [a] # qReifyModule :: Module -> Q ModuleInfo # qReifyConStrictness :: Name -> Q [DecidedStrictness] # qAddDependentFile :: FilePath -> Q () # qAddTopDecls :: [Dec] -> Q () # qAddForeignFile :: ForeignSrcLang -> String -> Q () # qAddModFinalizer :: Q () -> Q () # qAddCorePlugin :: String -> Q () # qGetQ :: Typeable a => Q (Maybe a) # qPutQ :: Typeable a => a -> Q () # qIsExtEnabled :: Extension -> Q Bool # qExtsEnabled :: Q [Extension] # |
Pattern in Haskell given in {}
LitP Lit | { 5 or 'c' } |
VarP Name | { x } |
TupP [Pat] | { (p1,p2) } |
UnboxedTupP [Pat] | { (# p1,p2 #) } |
UnboxedSumP Pat SumAlt SumArity | { (#|p|#) } |
ConP Name [Pat] | data T1 = C1 t1 t2; {C1 p1 p1} = e |
InfixP Pat Name Pat | foo ({x :+ y}) = e |
UInfixP Pat Name Pat | foo ({x :+ y}) = e |
ParensP Pat | {(p)} |
TildeP Pat | { ~p } |
BangP Pat | { !p } |
AsP Name Pat | { x @ p } |
WildP | { _ } |
RecP Name [FieldPat] | f (Pt { pointx = x }) = g x |
ListP [Pat] | { [1,2,3] } |
SigP Pat Type | { p :: t } |
ViewP Exp Pat | { e -> p } |
Instances
ForallT [TyVarBndr] Cxt Type | forall <vars>. <ctxt> => <type> |
AppT Type Type | T a b |
SigT Type Kind | t :: k |
VarT Name | a |
ConT Name | T |
PromotedT Name | 'T |
InfixT Type Name Type | T + T |
UInfixT Type Name Type | T + T |
ParensT Type | (T) |
TupleT Int | (,), (,,), etc. |
UnboxedTupleT Int | (#,#), (#,,#), etc. |
UnboxedSumT SumArity | (#|#), (#||#), etc. |
ArrowT | -> |
EqualityT | ~ |
ListT | [] |
PromotedTupleT Int | '(), '(,), '(,,), etc. |
PromotedNilT | '[] |
PromotedConsT | (':) |
StarT | * |
ConstraintT | Constraint |
LitT TyLit | 0,1,2, etc. |
WildCardT | _ |
Instances
FunD Name [Clause] | { f p1 p2 = b where decs } |
ValD Pat Body [Dec] | { p = b where decs } |
DataD Cxt Name [TyVarBndr] (Maybe Kind) [Con] [DerivClause] | { data Cxt x => T x = A x | B (T x) deriving (Z,W) deriving stock Eq } |
NewtypeD Cxt Name [TyVarBndr] (Maybe Kind) Con [DerivClause] | { newtype Cxt x => T x = A (B x) deriving (Z,W Q) deriving stock Eq } |
TySynD Name [TyVarBndr] Type | { type T x = (x,x) } |
ClassD Cxt Name [TyVarBndr] [FunDep] [Dec] | { class Eq a => Ord a where ds } |
InstanceD (Maybe Overlap) Cxt Type [Dec] | { instance {-# OVERLAPS #-} Show w => Show [w] where ds } |
SigD Name Type | { length :: [a] -> Int } |
ForeignD Foreign | { foreign import ... } { foreign export ... } |
InfixD Fixity Name | { infix 3 foo } |
PragmaD Pragma | { {-# INLINE [1] foo #-} } |
DataFamilyD Name [TyVarBndr] (Maybe Kind) | { data family T a b c :: * } |
DataInstD Cxt Name [Type] (Maybe Kind) [Con] [DerivClause] | { data instance Cxt x => T [x] = A x | B (T x) deriving (Z,W) deriving stock Eq } |
NewtypeInstD Cxt Name [Type] (Maybe Kind) Con [DerivClause] | { newtype instance Cxt x => T [x] = A (B x) deriving (Z,W) deriving stock Eq } |
TySynInstD Name TySynEqn | { type instance ... } |
OpenTypeFamilyD TypeFamilyHead | { type family T a b c = (r :: *) | r -> a b } |
ClosedTypeFamilyD TypeFamilyHead [TySynEqn] | { type family F a b = (r :: *) | r -> a where ... } |
RoleAnnotD Name [Role] | { type role T nominal representational } |
StandaloneDerivD (Maybe DerivStrategy) Cxt Type | { deriving stock instance Ord a => Ord (Foo a) } |
DefaultSigD Name Type | { default size :: Data a => a -> Int } |
PatSynD Name PatSynArgs PatSynDir Pat |
also, besides prefix pattern synonyms, both infix and record
pattern synonyms are supported. See |
PatSynSigD Name PatSynType | A pattern synonym's type signature. |
Instances
type VarBangTypeQ = Q VarBangType #
An abstract type representing names in the syntax tree.
Name
s can be constructed in several ways, which come with different
name-capture guarantees (see Language.Haskell.TH.Syntax for
an explanation of name capture):
- the built-in syntax
'f
and''T
can be used to construct names, The expression'f
gives aName
which refers to the valuef
currently in scope, and''T
gives aName
which refers to the typeT
currently in scope. These names can never be captured. lookupValueName
andlookupTypeName
are similar to'f
and''T
respectively, but theName
s are looked up at the point where the current splice is being run. These names can never be captured.newName
monadically generates a new name, which can never be captured.mkName
generates a capturable name.
Names constructed using newName
and mkName
may be used in bindings
(such as let x = ...
or x -> ...
), but names constructed using
lookupValueName
, lookupTypeName
, 'f
, ''T
may not.
Instances
Eq Name | |
Data Name | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name # dataTypeOf :: Name -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Name) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) # gmapT :: (forall b. Data b => b -> b) -> Name -> Name # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # | |
Ord Name | |
Show Name | |
Generic Name | |
Ppr Name | |
type Rep Name | |
Defined in Language.Haskell.TH.Syntax type Rep Name = D1 (MetaData "Name" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Name" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 OccName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NameFlavour))) |
Instances
Eq FunDep | |
Data FunDep | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FunDep -> c FunDep # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FunDep # toConstr :: FunDep -> Constr # dataTypeOf :: FunDep -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FunDep) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunDep) # gmapT :: (forall b. Data b => b -> b) -> FunDep -> FunDep # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunDep -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunDep -> r # gmapQ :: (forall d. Data d => d -> u) -> FunDep -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FunDep -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FunDep -> m FunDep # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FunDep -> m FunDep # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FunDep -> m FunDep # | |
Ord FunDep | |
Show FunDep | |
Generic FunDep | |
Ppr FunDep | |
type Rep FunDep | |
Defined in Language.Haskell.TH.Syntax type Rep FunDep = D1 (MetaData "FunDep" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "FunDep" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Name]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Name]))) |
Since the advent of ConstraintKinds
, constraints are really just types.
Equality constraints use the EqualityT
constructor. Constraints may also
be tuples of other constraints.
type TyVarBndrQ = Q TyVarBndr #
data InjectivityAnn #
Injectivity annotation
Instances
Varieties of allowed instance overlap.
Overlappable | May be overlapped by more specific instances |
Overlapping | May overlap a more general instance |
Overlaps | Both |
Incoherent | Both |
Instances
Eq Overlap | |
Data Overlap | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Overlap -> c Overlap # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Overlap # toConstr :: Overlap -> Constr # dataTypeOf :: Overlap -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Overlap) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Overlap) # gmapT :: (forall b. Data b => b -> b) -> Overlap -> Overlap # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Overlap -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Overlap -> r # gmapQ :: (forall d. Data d => d -> u) -> Overlap -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Overlap -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Overlap -> m Overlap # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Overlap -> m Overlap # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Overlap -> m Overlap # | |
Ord Overlap | |
Show Overlap | |
Generic Overlap | |
type Rep Overlap | |
Defined in Language.Haskell.TH.Syntax type Rep Overlap = D1 (MetaData "Overlap" "Language.Haskell.TH.Syntax" "template-haskell" False) ((C1 (MetaCons "Overlappable" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Overlapping" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "Overlaps" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Incoherent" PrefixI False) (U1 :: * -> *))) |
type DerivClauseQ = Q DerivClause #
data DerivStrategy #
What the user explicitly requests when deriving an instance.
StockStrategy | A "standard" derived instance |
AnyclassStrategy | -XDeriveAnyClass |
NewtypeStrategy | -XGeneralizedNewtypeDeriving |
Instances
class Monad m => MonadIO (m :: * -> *) where #
Monads in which IO
computations may be embedded.
Any monad built by applying a sequence of monad transformers to the
IO
monad will be an instance of this class.
Instances should satisfy the following laws, which state that liftIO
is a transformer of monads:
Instances
MonadIO IO | Since: base-4.9.0.0 |
Defined in Control.Monad.IO.Class | |
MonadIO Q | |
Defined in Language.Haskell.TH.Syntax | |
MonadIO m => MonadIO (MaybeT m) | |
Defined in Control.Monad.Trans.Maybe | |
MonadIO m => MonadIO (IdentityT m) | |
Defined in Control.Monad.Trans.Identity | |
(Error e, MonadIO m) => MonadIO (ErrorT e m) | |
Defined in Control.Monad.Trans.Error | |
MonadIO m => MonadIO (ExceptT e m) | |
Defined in Control.Monad.Trans.Except | |
MonadIO m => MonadIO (StateT s m) | |
Defined in Control.Monad.Trans.State.Lazy | |
MonadIO m => MonadIO (StateT s m) | |
Defined in Control.Monad.Trans.State.Strict | |
(Monoid w, MonadIO m) => MonadIO (WriterT w m) | |
Defined in Control.Monad.Trans.Writer.Lazy | |
(Monoid w, MonadIO m) => MonadIO (WriterT w m) | |
Defined in Control.Monad.Trans.Writer.Strict | |
MonadIO m => MonadIO (ReaderT r m) | |
Defined in Control.Monad.Trans.Reader | |
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) | |
Defined in Control.Monad.Trans.RWS.Lazy | |
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) | |
Defined in Control.Monad.Trans.RWS.Strict |
unless :: Applicative f => Bool -> f () -> f () #
The reverse of when
.
replicateM_ :: Applicative m => Int -> m a -> m () #
Like replicateM
, but discards the result.
replicateM :: Applicative m => Int -> m a -> m [a] #
performs the action replicateM
n actn
times,
gathering the results.
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m () #
Like foldM
, but discards the result.
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #
The foldM
function is analogous to foldl
, except that its result is
encapsulated in a monad. Note that foldM
works from left-to-right over
the list arguments. This could be an issue where (
and the `folded
function' are not commutative.>>
)
foldM f a1 [x1, x2, ..., xm] == do a2 <- f a1 x1 a3 <- f a2 x2 ... f am xm
If right-to-left evaluation is required, the input list should be reversed.
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () #
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] #
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c]) #
The mapAndUnzipM
function maps its first argument over a list, returning
the result as a pair of lists. This function is mainly used with complicated
data structures or a state-transforming monad.
forever :: Applicative f => f a -> f b #
repeats the action infinitely.forever
act
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 #
Left-to-right Kleisli composition of monads.
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a] #
This generalizes the list-based filter
function.
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) #
minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #
The least element of a non-empty structure with respect to the given comparison function.
maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #
The largest element of a non-empty structure with respect to the given comparison function.
all :: Foldable t => (a -> Bool) -> t a -> Bool #
Determines whether all elements of the structure satisfy the predicate.
any :: Foldable t => (a -> Bool) -> t a -> Bool #
Determines whether any element of the structure satisfies the predicate.
concatMap :: Foldable t => (a -> [b]) -> t a -> [b] #
Map a function over all the elements of a container and concatenate the resulting lists.
concat :: Foldable t => t [a] -> [a] #
The concatenation of all the elements of a container of lists.
asum :: (Foldable t, Alternative f) => t (f a) -> f a #
sequence_ :: (Foldable t, Monad m) => t (m a) -> m () #
Evaluate each monadic action in the structure from left to right,
and ignore the results. For a version that doesn't ignore the
results see sequence
.
As of base 4.8.0.0, sequence_
is just sequenceA_
, specialized
to Monad
.
sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f () #
Evaluate each action in the structure from left to right, and
ignore the results. For a version that doesn't ignore the results
see sequenceA
.
for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f () #
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f () #
Map each element of a structure to an action, evaluate these
actions from left to right, and ignore the results. For a version
that doesn't ignore the results see traverse
.
foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #
Monadic fold over the elements of a structure, associating to the left, i.e. from left to right.
foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b #
Monadic fold over the elements of a structure, associating to the right, i.e. from right to left.
Maybe monoid returning the leftmost non-Nothing value.
is isomorphic to First
a
, but precedes it
historically.Alt
Maybe
a
>>>
getFirst (First (Just "hello") <> First Nothing <> First (Just "world"))
Just "hello"
Instances
Monad First | |
Functor First | |
MonadFix First | Since: base-4.8.0.0 |
Defined in Control.Monad.Fix | |
Applicative First | |
Foldable First | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # | |
Traversable First | Since: base-4.8.0.0 |
Eq a => Eq (First a) | |
Data a => Data (First a) | Since: base-4.8.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> First a -> c (First a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (First a) # toConstr :: First a -> Constr # dataTypeOf :: First a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (First a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (First a)) # gmapT :: (forall b. Data b => b -> b) -> First a -> First a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r # gmapQ :: (forall d. Data d => d -> u) -> First a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> First a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> First a -> m (First a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) # | |
Ord a => Ord (First a) | |
Read a => Read (First a) | |
Show a => Show (First a) | |
Generic (First a) | |
Semigroup (First a) | Since: base-4.9.0.0 |
Monoid (First a) | Since: base-2.1 |
Generic1 First | |
type Rep (First a) | |
Defined in Data.Monoid | |
type Rep1 First | |
Defined in Data.Monoid |
Maybe monoid returning the rightmost non-Nothing value.
is isomorphic to Last
a
, and thus to
Dual
(First
a)Dual
(Alt
Maybe
a)
>>>
getLast (Last (Just "hello") <> Last Nothing <> Last (Just "world"))
Just "world"
Instances
Monad Last | |
Functor Last | |
MonadFix Last | Since: base-4.8.0.0 |
Defined in Control.Monad.Fix | |
Applicative Last | |
Foldable Last | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # | |
Traversable Last | Since: base-4.8.0.0 |
Eq a => Eq (Last a) | |
Data a => Data (Last a) | Since: base-4.8.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Last a -> c (Last a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Last a) # toConstr :: Last a -> Constr # dataTypeOf :: Last a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Last a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Last a)) # gmapT :: (forall b. Data b => b -> b) -> Last a -> Last a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r # gmapQ :: (forall d. Data d => d -> u) -> Last a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Last a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # | |
Ord a => Ord (Last a) | |
Read a => Read (Last a) | |
Show a => Show (Last a) | |
Generic (Last a) | |
Semigroup (Last a) | Since: base-4.9.0.0 |
Monoid (Last a) | Since: base-2.1 |
Generic1 Last | |
type Rep (Last a) | |
Defined in Data.Monoid | |
type Rep1 Last | |
Defined in Data.Monoid |
The dual of a Monoid
, obtained by swapping the arguments of mappend
.
>>>
getDual (mappend (Dual "Hello") (Dual "World"))
"WorldHello"
Instances
Monad Dual | Since: base-4.8.0.0 |
Functor Dual | Since: base-4.8.0.0 |
MonadFix Dual | Since: base-4.8.0.0 |
Defined in Control.Monad.Fix | |
Applicative Dual | Since: base-4.8.0.0 |
Foldable Dual | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Dual m -> m # foldMap :: Monoid m => (a -> m) -> Dual a -> m # foldr :: (a -> b -> b) -> b -> Dual a -> b # foldr' :: (a -> b -> b) -> b -> Dual a -> b # foldl :: (b -> a -> b) -> b -> Dual a -> b # foldl' :: (b -> a -> b) -> b -> Dual a -> b # foldr1 :: (a -> a -> a) -> Dual a -> a # foldl1 :: (a -> a -> a) -> Dual a -> a # elem :: Eq a => a -> Dual a -> Bool # maximum :: Ord a => Dual a -> a # | |
Traversable Dual | Since: base-4.8.0.0 |
Bounded a => Bounded (Dual a) | |
Eq a => Eq (Dual a) | |
Data a => Data (Dual a) | Since: base-4.8.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dual a -> c (Dual a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Dual a) # toConstr :: Dual a -> Constr # dataTypeOf :: Dual a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Dual a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Dual a)) # gmapT :: (forall b. Data b => b -> b) -> Dual a -> Dual a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dual a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dual a -> r # gmapQ :: (forall d. Data d => d -> u) -> Dual a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Dual a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) # | |
Ord a => Ord (Dual a) | |
Read a => Read (Dual a) | |
Show a => Show (Dual a) | |
Generic (Dual a) | |
Semigroup a => Semigroup (Dual a) | Since: base-4.9.0.0 |
Monoid a => Monoid (Dual a) | Since: base-2.1 |
Generic1 Dual | |
type Rep (Dual a) | |
Defined in Data.Semigroup.Internal | |
type Rep1 Dual | |
Defined in Data.Semigroup.Internal |
The monoid of endomorphisms under composition.
>>>
let computation = Endo ("Hello, " ++) <> Endo (++ "!")
>>>
appEndo computation "Haskell"
"Hello, Haskell!"
Boolean monoid under conjunction (&&
).
>>>
getAll (All True <> mempty <> All False)
False
>>>
getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8]))
False
Instances
Bounded All | |
Eq All | |
Data All | Since: base-4.8.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> All -> c All # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c All # dataTypeOf :: All -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c All) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c All) # gmapT :: (forall b. Data b => b -> b) -> All -> All # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> All -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> All -> r # gmapQ :: (forall d. Data d => d -> u) -> All -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> All -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> All -> m All # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All # | |
Ord All | |
Read All | |
Show All | |
Generic All | |
Semigroup All | Since: base-4.9.0.0 |
Monoid All | Since: base-2.1 |
type Rep All | |
Defined in Data.Semigroup.Internal |
Boolean monoid under disjunction (||
).
>>>
getAny (Any True <> mempty <> Any False)
True
>>>
getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8]))
True
Instances
Bounded Any | |
Eq Any | |
Data Any | Since: base-4.8.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Any -> c Any # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Any # dataTypeOf :: Any -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Any) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Any) # gmapT :: (forall b. Data b => b -> b) -> Any -> Any # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r # gmapQ :: (forall d. Data d => d -> u) -> Any -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Any -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Any -> m Any # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any # | |
Ord Any | |
Read Any | |
Show Any | |
Generic Any | |
Semigroup Any | Since: base-4.9.0.0 |
Monoid Any | Since: base-2.1 |
type Rep Any | |
Defined in Data.Semigroup.Internal |
Monoid under addition.
>>>
getSum (Sum 1 <> Sum 2 <> mempty)
3
Instances
Monad Sum | Since: base-4.8.0.0 |
Functor Sum | Since: base-4.8.0.0 |
MonadFix Sum | Since: base-4.8.0.0 |
Defined in Control.Monad.Fix | |
Applicative Sum | Since: base-4.8.0.0 |
Foldable Sum | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Sum m -> m # foldMap :: Monoid m => (a -> m) -> Sum a -> m # foldr :: (a -> b -> b) -> b -> Sum a -> b # foldr' :: (a -> b -> b) -> b -> Sum a -> b # foldl :: (b -> a -> b) -> b -> Sum a -> b # foldl' :: (b -> a -> b) -> b -> Sum a -> b # foldr1 :: (a -> a -> a) -> Sum a -> a # foldl1 :: (a -> a -> a) -> Sum a -> a # elem :: Eq a => a -> Sum a -> Bool # maximum :: Ord a => Sum a -> a # | |
Traversable Sum | Since: base-4.8.0.0 |
Bounded a => Bounded (Sum a) | |
Eq a => Eq (Sum a) | |
Data a => Data (Sum a) | Since: base-4.8.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sum a -> c (Sum a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Sum a) # dataTypeOf :: Sum a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Sum a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Sum a)) # gmapT :: (forall b. Data b => b -> b) -> Sum a -> Sum a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r # gmapQ :: (forall d. Data d => d -> u) -> Sum a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Sum a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) # | |
Num a => Num (Sum a) | |
Ord a => Ord (Sum a) | |
Read a => Read (Sum a) | |
Show a => Show (Sum a) | |
Generic (Sum a) | |
Num a => Semigroup (Sum a) | Since: base-4.9.0.0 |
Num a => Monoid (Sum a) | Since: base-2.1 |
Generic1 Sum | |
type Rep (Sum a) | |
Defined in Data.Semigroup.Internal | |
type Rep1 Sum | |
Defined in Data.Semigroup.Internal |
Monoid under multiplication.
>>>
getProduct (Product 3 <> Product 4 <> mempty)
12
Product | |
|
Instances
Monad Product | Since: base-4.8.0.0 |
Functor Product | Since: base-4.8.0.0 |
MonadFix Product | Since: base-4.8.0.0 |
Defined in Control.Monad.Fix | |
Applicative Product | Since: base-4.8.0.0 |
Foldable Product | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Product m -> m # foldMap :: Monoid m => (a -> m) -> Product a -> m # foldr :: (a -> b -> b) -> b -> Product a -> b # foldr' :: (a -> b -> b) -> b -> Product a -> b # foldl :: (b -> a -> b) -> b -> Product a -> b # foldl' :: (b -> a -> b) -> b -> Product a -> b # foldr1 :: (a -> a -> a) -> Product a -> a # foldl1 :: (a -> a -> a) -> Product a -> a # elem :: Eq a => a -> Product a -> Bool # maximum :: Ord a => Product a -> a # minimum :: Ord a => Product a -> a # | |
Traversable Product | Since: base-4.8.0.0 |
Bounded a => Bounded (Product a) | |
Eq a => Eq (Product a) | |
Data a => Data (Product a) | Since: base-4.8.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Product a -> c (Product a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Product a) # toConstr :: Product a -> Constr # dataTypeOf :: Product a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Product a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Product a)) # gmapT :: (forall b. Data b => b -> b) -> Product a -> Product a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r # gmapQ :: (forall d. Data d => d -> u) -> Product a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Product a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) # | |
Num a => Num (Product a) | |
Defined in Data.Semigroup.Internal | |
Ord a => Ord (Product a) | |
Defined in Data.Semigroup.Internal | |
Read a => Read (Product a) | |
Show a => Show (Product a) | |
Generic (Product a) | |
Num a => Semigroup (Product a) | Since: base-4.9.0.0 |
Num a => Monoid (Product a) | Since: base-2.1 |
Generic1 Product | |
type Rep (Product a) | |
Defined in Data.Semigroup.Internal | |
type Rep1 Product | |
Defined in Data.Semigroup.Internal |
newtype Alt (f :: k -> *) (a :: k) :: forall k. (k -> *) -> k -> * #
Monoid under <|>
.
Since: base-4.8.0.0
Instances
Generic1 (Alt f :: k -> *) | |
Monad f => Monad (Alt f) | |
Functor f => Functor (Alt f) | |
MonadFix f => MonadFix (Alt f) | Since: base-4.8.0.0 |
Defined in Control.Monad.Fix | |
Applicative f => Applicative (Alt f) | |
Alternative f => Alternative (Alt f) | |
MonadPlus f => MonadPlus (Alt f) | |
Enum (f a) => Enum (Alt f a) | |
Eq (f a) => Eq (Alt f a) | |
(Data (f a), Data a, Typeable f) => Data (Alt f a) | Since: base-4.8.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Alt f a -> c (Alt f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Alt f a) # toConstr :: Alt f a -> Constr # dataTypeOf :: Alt f a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Alt f a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Alt f a)) # gmapT :: (forall b. Data b => b -> b) -> Alt f a -> Alt f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Alt f a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Alt f a -> r # gmapQ :: (forall d. Data d => d -> u) -> Alt f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Alt f a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) # | |
Num (f a) => Num (Alt f a) | |
Ord (f a) => Ord (Alt f a) | |
Read (f a) => Read (Alt f a) | |
Show (f a) => Show (Alt f a) | |
Generic (Alt f a) | |
Alternative f => Semigroup (Alt f a) | Since: base-4.9.0.0 |
Alternative f => Monoid (Alt f a) | Since: base-4.8.0.0 |
type Rep1 (Alt f :: k -> *) | |
Defined in Data.Semigroup.Internal | |
type Rep (Alt f a) | |
Defined in Data.Semigroup.Internal |
is the least fixed point of the function fix
ff
,
i.e. the least defined x
such that f x = x
.
For example, we can write the factorial function using direct recursion as
>>>
let fac n = if n <= 1 then 1 else n * fac (n-1) in fac 5
120
This uses the fact that Haskell’s let
introduces recursive bindings. We can
rewrite this definition using fix
,
>>>
fix (\rec n -> if n <= 1 then 1 else n * rec (n-1)) 5
120
Instead of making a recursive call, we introduce a dummy parameter rec
;
when used within fix
, this parameter then refers to fix'
argument, hence
the recursion is reintroduced.
void :: Functor f => f a -> f () #
discards or ignores the result of evaluation, such
as the return value of an void
valueIO
action.
Examples
Replace the contents of a
with unit:Maybe
Int
>>>
void Nothing
Nothing>>>
void (Just 3)
Just ()
Replace the contents of an
with unit,
resulting in an Either
Int
Int
:Either
Int
'()'
>>>
void (Left 8675309)
Left 8675309>>>
void (Right 8675309)
Right ()
Replace every element of a list with unit:
>>>
void [1,2,3]
[(),(),()]
Replace the second element of a pair with unit:
>>>
void (1,2)
(1,())
Discard the result of an IO
action:
>>>
mapM print [1,2]
1 2 [(),()]>>>
void $ mapM print [1,2]
1 2
mapMaybe :: (a -> Maybe b) -> [a] -> [b] #
The mapMaybe
function is a version of map
which can throw
out elements. In particular, the functional argument returns
something of type
. If this is Maybe
bNothing
, no element
is added on to the result list. If it is
, then Just
bb
is
included in the result list.
Examples
Using
is a shortcut for mapMaybe
f x
in most cases:catMaybes
$ map
f x
>>>
import Text.Read ( readMaybe )
>>>
let readMaybeInt = readMaybe :: String -> Maybe Int
>>>
mapMaybe readMaybeInt ["1", "Foo", "3"]
[1,3]>>>
catMaybes $ map readMaybeInt ["1", "Foo", "3"]
[1,3]
If we map the Just
constructor, the entire list should be returned:
>>>
mapMaybe Just [1,2,3]
[1,2,3]
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r #
Promote a function to a monad, scanning the monadic arguments from
left to right (cf. liftM2
).
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r #
Promote a function to a monad, scanning the monadic arguments from
left to right (cf. liftM2
).
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r #
Promote a function to a monad, scanning the monadic arguments from
left to right (cf. liftM2
).
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r #
Promote a function to a monad, scanning the monadic arguments from left to right. For example,
liftM2 (+) [0,1] [0,2] = [0,2,1,3] liftM2 (+) (Just 1) Nothing = Nothing
when :: Applicative f => Bool -> f () -> f () #
Conditional execution of Applicative
expressions. For example,
when debug (putStrLn "Debugging")
will output the string Debugging
if the Boolean value debug
is True
, and otherwise do nothing.
(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 #
Same as >>=
, but with the arguments interchanged.
class (Alternative m, Monad m) => MonadPlus (m :: * -> *) where #
Monads that also support choice and failure.
The identity of mplus
. It should also satisfy the equations
mzero >>= f = mzero v >> mzero = mzero
The default definition is
mzero = empty
An associative operation. The default definition is
mplus = (<|>
)
Instances
MonadPlus [] | Since: base-2.1 |
MonadPlus Maybe | Since: base-2.1 |
MonadPlus IO | Since: base-4.9.0.0 |
MonadPlus ReadP | Since: base-2.1 |
MonadPlus P | Since: base-2.1 |
Defined in Text.ParserCombinators.ReadP | |
MonadPlus (U1 :: * -> *) | Since: base-4.9.0.0 |
MonadPlus (Proxy :: * -> *) | Since: base-4.9.0.0 |
Monad m => MonadPlus (MaybeT m) | |
MonadPlus f => MonadPlus (Rec1 f) | Since: base-4.9.0.0 |
MonadPlus f => MonadPlus (Alt f) | |
MonadPlus m => MonadPlus (IdentityT m) | |
(Monad m, Error e) => MonadPlus (ErrorT e m) | |
(Monad m, Monoid e) => MonadPlus (ExceptT e m) | |
MonadPlus m => MonadPlus (StateT s m) | |
MonadPlus m => MonadPlus (StateT s m) | |
(Monoid w, MonadPlus m) => MonadPlus (WriterT w m) | |
(Monoid w, MonadPlus m) => MonadPlus (WriterT w m) | |
(MonadPlus f, MonadPlus g) => MonadPlus (f :*: g) | Since: base-4.9.0.0 |
MonadPlus m => MonadPlus (ReaderT r m) | |
MonadPlus f => MonadPlus (M1 i c f) | Since: base-4.9.0.0 |
(Monoid w, MonadPlus m) => MonadPlus (RWST r w s m) | |
(Monoid w, MonadPlus m) => MonadPlus (RWST r w s m) | |
fromList :: Ord k => [(k, a)] -> Map k a #
O(n*log n). Build a map from a list of key/value pairs. See also fromAscList
.
If the list contains more than one value for the same key, the last value
for the key is retained.
If the keys of the list are ordered, linear-time implementation is used,
with the performance equal to fromDistinctAscList
.
fromList [] == empty fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")] fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]
traverseWithKey :: Applicative t => (k -> a -> t b) -> Map k a -> t (Map k b) #
O(n).
That is, behaves exactly like a regular traverseWithKey
f m == fromList
$ traverse
((k, v) -> (,) k $ f k v) (toList
m)traverse
except that the traversing
function also has access to the key associated with a value.
traverseWithKey (\k v -> if odd k then Just (succ v) else Nothing) (fromList [(1, 'a'), (5, 'e')]) == Just (fromList [(1, 'b'), (5, 'f')]) traverseWithKey (\k v -> if odd k then Just (succ v) else Nothing) (fromList [(2, 'c')]) == Nothing
adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a #
O(log n). Update a value at a specific key with the result of the provided function. When the key is not a member of the map, the original map is returned.
adjust ("new " ++) 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "new a")] adjust ("new " ++) 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")] adjust ("new " ++) 7 empty == empty
insert :: Ord k => k -> a -> Map k a -> Map k a #
O(log n). Insert a new key and value in the map.
If the key is already present in the map, the associated value is
replaced with the supplied value. insert
is equivalent to
.insertWith
const
insert 5 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'x')] insert 7 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'a'), (7, 'x')] insert 5 'x' empty == singleton 5 'x'
lookup :: Ord k => k -> Map k a -> Maybe a #
O(log n). Lookup the value at a key in the map.
The function will return the corresponding value as (
,
or Just
value)Nothing
if the key isn't in the map.
An example of using lookup
:
import Prelude hiding (lookup) import Data.Map employeeDept = fromList([("John","Sales"), ("Bob","IT")]) deptCountry = fromList([("IT","USA"), ("Sales","France")]) countryCurrency = fromList([("USA", "Dollar"), ("France", "Euro")]) employeeCurrency :: String -> Maybe String employeeCurrency name = do dept <- lookup name employeeDept country <- lookup dept deptCountry lookup country countryCurrency main = do putStrLn $ "John's currency: " ++ (show (employeeCurrency "John")) putStrLn $ "Pete's currency: " ++ (show (employeeCurrency "Pete"))
The output of this program:
John's currency: Just "Euro" Pete's currency: Nothing
A Map from keys k
to values a
.
Instances
Eq2 Map | Since: containers-0.5.9 |
Ord2 Map | Since: containers-0.5.9 |
Defined in Data.Map.Internal | |
Show2 Map | Since: containers-0.5.9 |
Functor (Map k) | |
Foldable (Map k) | |
Defined in Data.Map.Internal fold :: Monoid m => Map k m -> m # foldMap :: Monoid m => (a -> m) -> Map k a -> m # foldr :: (a -> b -> b) -> b -> Map k a -> b # foldr' :: (a -> b -> b) -> b -> Map k a -> b # foldl :: (b -> a -> b) -> b -> Map k a -> b # foldl' :: (b -> a -> b) -> b -> Map k a -> b # foldr1 :: (a -> a -> a) -> Map k a -> a # foldl1 :: (a -> a -> a) -> Map k a -> a # elem :: Eq a => a -> Map k a -> Bool # maximum :: Ord a => Map k a -> a # minimum :: Ord a => Map k a -> a # | |
Traversable (Map k) | |
Eq k => Eq1 (Map k) | Since: containers-0.5.9 |
Ord k => Ord1 (Map k) | Since: containers-0.5.9 |
Defined in Data.Map.Internal | |
(Ord k, Read k) => Read1 (Map k) | Since: containers-0.5.9 |
Defined in Data.Map.Internal | |
Show k => Show1 (Map k) | Since: containers-0.5.9 |
Ord k => IsList (Map k v) | Since: containers-0.5.6.2 |
(Eq k, Eq a) => Eq (Map k a) | |
(Data k, Data a, Ord k) => Data (Map k a) | |
Defined in Data.Map.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Map k a -> c (Map k a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Map k a) # toConstr :: Map k a -> Constr # dataTypeOf :: Map k a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Map k a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Map k a)) # gmapT :: (forall b. Data b => b -> b) -> Map k a -> Map k a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Map k a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Map k a -> r # gmapQ :: (forall d. Data d => d -> u) -> Map k a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Map k a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) # | |
(Ord k, Ord v) => Ord (Map k v) | |
(Ord k, Read k, Read e) => Read (Map k e) | |
(Show k, Show a) => Show (Map k a) | |
Ord k => Semigroup (Map k v) | |
Ord k => Monoid (Map k v) | |
(NFData k, NFData a) => NFData (Map k a) | |
Defined in Data.Map.Internal | |
type Item (Map k v) | |
Defined in Data.Map.Internal |
The language extensions known to GHC.
Note that there is an orphan Binary
instance for this type supplied by
the GHC.LanguageExtensions module provided by ghc-boot
. We can't provide
here as this would require adding transitive dependencies to the
template-haskell
package, which must have a minimal dependency set.
Instances
Enum Extension | |
Defined in GHC.LanguageExtensions.Type succ :: Extension -> Extension # pred :: Extension -> Extension # fromEnum :: Extension -> Int # enumFrom :: Extension -> [Extension] # enumFromThen :: Extension -> Extension -> [Extension] # enumFromTo :: Extension -> Extension -> [Extension] # enumFromThenTo :: Extension -> Extension -> Extension -> [Extension] # | |
Eq Extension | |
Show Extension | |
Generic Extension | |
type Rep Extension | |
Defined in GHC.LanguageExtensions.Type type Rep Extension = D1 (MetaData "Extension" "GHC.LanguageExtensions.Type" "ghc-boot-th-8.4.3" False) ((((((C1 (MetaCons "Cpp" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "OverlappingInstances" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "UndecidableInstances" PrefixI False) (U1 :: * -> *))) :+: (C1 (MetaCons "IncoherentInstances" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "UndecidableSuperClasses" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "MonomorphismRestriction" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "MonoPatBinds" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "MonoLocalBinds" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RelaxedPolyRec" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "ExtendedDefaultRules" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ForeignFunctionInterface" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "UnliftedFFITypes" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "InterruptibleFFI" PrefixI False) (U1 :: * -> *))))) :+: (((C1 (MetaCons "CApiFFI" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "GHCForeignImportPrim" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "JavaScriptFFI" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "ParallelArrays" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Arrows" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "TemplateHaskell" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "TemplateHaskellQuotes" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "QuasiQuotes" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "ImplicitParams" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ImplicitPrelude" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "ScopedTypeVariables" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "AllowAmbiguousTypes" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "UnboxedTuples" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "UnboxedSums" PrefixI False) (U1 :: * -> *)))))) :+: ((((C1 (MetaCons "BangPatterns" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "TypeFamilies" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "TypeFamilyDependencies" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "TypeInType" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "OverloadedStrings" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "OverloadedLists" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "NumDecimals" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "DisambiguateRecordFields" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "RecordWildCards" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RecordPuns" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "ViewPatterns" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "GADTs" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "GADTSyntax" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "NPlusKPatterns" PrefixI False) (U1 :: * -> *))))) :+: (((C1 (MetaCons "DoAndIfThenElse" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "RebindableSyntax" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ConstraintKinds" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "PolyKinds" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "DataKinds" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "InstanceSigs" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ApplicativeDo" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "StandaloneDeriving" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "DeriveDataTypeable" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "AutoDeriveTypeable" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "DeriveFunctor" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "DeriveTraversable" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "DeriveFoldable" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "DeriveGeneric" PrefixI False) (U1 :: * -> *))))))) :+: (((((C1 (MetaCons "DefaultSignatures" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "DeriveAnyClass" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "DeriveLift" PrefixI False) (U1 :: * -> *))) :+: (C1 (MetaCons "DerivingStrategies" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "TypeSynonymInstances" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "FlexibleContexts" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "FlexibleInstances" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "ConstrainedClassMethods" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "MultiParamTypeClasses" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "NullaryTypeClasses" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "FunctionalDependencies" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "UnicodeSyntax" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ExistentialQuantification" PrefixI False) (U1 :: * -> *))))) :+: (((C1 (MetaCons "MagicHash" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "EmptyDataDecls" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "KindSignatures" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "RoleAnnotations" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ParallelListComp" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "TransformListComp" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "MonadComprehensions" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "GeneralizedNewtypeDeriving" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "RecursiveDo" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "PostfixOperators" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "TupleSections" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "PatternGuards" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "LiberalTypeSynonyms" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RankNTypes" PrefixI False) (U1 :: * -> *)))))) :+: ((((C1 (MetaCons "ImpredicativeTypes" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "TypeOperators" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ExplicitNamespaces" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "PackageImports" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ExplicitForAll" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "AlternativeLayoutRule" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "AlternativeLayoutRuleTransitional" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "DatatypeContexts" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "NondecreasingIndentation" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RelaxedLayout" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "TraditionalRecordSyntax" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "LambdaCase" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "MultiWayIf" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "BinaryLiterals" PrefixI False) (U1 :: * -> *))))) :+: (((C1 (MetaCons "NegativeLiterals" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "HexFloatLiterals" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "DuplicateRecordFields" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "OverloadedLabels" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "EmptyCase" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "PatternSynonyms" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "PartialTypeSignatures" PrefixI False) (U1 :: * -> *)))) :+: ((C1 (MetaCons "NamedWildCards" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "StaticPointers" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "TypeApplications" PrefixI False) (U1 :: * -> *))) :+: ((C1 (MetaCons "Strict" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "StrictData" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "MonadFailDesugaring" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "EmptyDataDeriving" PrefixI False) (U1 :: * -> *)))))))) |
data ForeignSrcLang #
Instances
Eq ForeignSrcLang | |
Defined in GHC.ForeignSrcLang.Type (==) :: ForeignSrcLang -> ForeignSrcLang -> Bool # (/=) :: ForeignSrcLang -> ForeignSrcLang -> Bool # | |
Show ForeignSrcLang | |
Defined in GHC.ForeignSrcLang.Type showsPrec :: Int -> ForeignSrcLang -> ShowS # show :: ForeignSrcLang -> String # showList :: [ForeignSrcLang] -> ShowS # | |
Generic ForeignSrcLang | |
Defined in GHC.ForeignSrcLang.Type type Rep ForeignSrcLang :: * -> * # from :: ForeignSrcLang -> Rep ForeignSrcLang x # to :: Rep ForeignSrcLang x -> ForeignSrcLang # | |
type Rep ForeignSrcLang | |
Defined in GHC.ForeignSrcLang.Type type Rep ForeignSrcLang = D1 (MetaData "ForeignSrcLang" "GHC.ForeignSrcLang.Type" "ghc-boot-th-8.4.3" False) ((C1 (MetaCons "LangC" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "LangCxx" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "LangObjc" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "LangObjcxx" PrefixI False) (U1 :: * -> *))) |
class MonadTrans (t :: (* -> *) -> * -> *) where #
The class of monad transformers. Instances should satisfy the
following laws, which state that lift
is a monad transformation:
lift :: Monad m => m a -> t m a #
Lift a computation from the argument monad to the constructed monad.
Instances
MonadTrans MaybeT | |
Defined in Control.Monad.Trans.Maybe | |
MonadTrans (IdentityT :: (* -> *) -> * -> *) | |
Defined in Control.Monad.Trans.Identity | |
MonadTrans (ErrorT e) | |
Defined in Control.Monad.Trans.Error | |
MonadTrans (ExceptT e) | |
Defined in Control.Monad.Trans.Except | |
MonadTrans (StateT s) | |
Defined in Control.Monad.Trans.State.Lazy | |
MonadTrans (StateT s) | |
Defined in Control.Monad.Trans.State.Strict | |
Monoid w => MonadTrans (WriterT w) | |
Defined in Control.Monad.Trans.Writer.Lazy | |
Monoid w => MonadTrans (WriterT w) | |
Defined in Control.Monad.Trans.Writer.Strict | |
MonadTrans (ReaderT r :: (* -> *) -> * -> *) | |
Defined in Control.Monad.Trans.Reader | |
Monoid w => MonadTrans (RWST r w s) | |
Defined in Control.Monad.Trans.RWS.Lazy | |
Monoid w => MonadTrans (RWST r w s) | |
Defined in Control.Monad.Trans.RWS.Strict |
censor :: MonadWriter w m => (w -> w) -> m a -> m a #
listens :: MonadWriter w m => (w -> b) -> m a -> m (a, b) #
class (Monoid w, Monad m) => MonadWriter w (m :: * -> *) | m -> w where #
embeds a simple writer action.writer
(a,w)
is an action that produces the output tell
ww
.
is an action that executes the action listen
mm
and adds
its output to the value of the computation.
pass :: m (a, w -> w) -> m a #
is an action that executes the action pass
mm
, which
returns a value and a function, and returns the value, applying
the function to the output.
Instances
MonadWriter w m => MonadWriter w (MaybeT m) | |
Monoid w => MonadWriter w ((,) w) | NOTE: This instance is only defined for Since: mtl-2.2.2 |
(Monoid w, Monad m) => MonadWriter w (WriterT w m) | |
(Monoid w, Monad m) => MonadWriter w (WriterT w m) | |
MonadWriter w m => MonadWriter w (StateT s m) | |
MonadWriter w m => MonadWriter w (StateT s m) | |
MonadWriter w m => MonadWriter w (IdentityT m) | |
MonadWriter w m => MonadWriter w (ExceptT e m) | Since: mtl-2.2 |
(Error e, MonadWriter w m) => MonadWriter w (ErrorT e m) | |
MonadWriter w m => MonadWriter w (ReaderT r m) | |
(Monoid w, Monad m) => MonadWriter w (RWST r w s m) | |
(Monoid w, Monad m) => MonadWriter w (RWST r w s m) | |
newtype WriterT w (m :: * -> *) a #
A writer monad parameterized by:
w
- the output to accumulate.m
- The inner monad.
The return
function produces the output mempty
, while >>=
combines the outputs of the subcomputations using mappend
.
WriterT | |
|
Instances
runWriter :: Writer w a -> (a, w) #
Unwrap a writer computation as a (result, output) pair.
(The inverse of writer
.)
execWriter :: Writer w a -> w #
Extract the output from a writer computation.
execWriter
m =snd
(runWriter
m)
execWriterT :: Monad m => WriterT w m a -> m w #
Extract the output from a writer computation.
execWriterT
m =liftM
snd
(runWriterT
m)
mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b #
Map both the return value and output of a computation using the given function.
runWriterT
(mapWriterT
f m) = f (runWriterT
m)
tyVarSig :: TyVarBndr -> FamilyResultSig #
kindSig :: Kind -> FamilyResultSig #
constraintK :: Kind #
closedTypeFamilyD :: Name -> [TyVarBndr] -> FamilyResultSig -> Maybe InjectivityAnn -> [TySynEqnQ] -> DecQ #
openTypeFamilyD :: Name -> [TyVarBndr] -> FamilyResultSig -> Maybe InjectivityAnn -> DecQ #
newtypeInstD :: CxtQ -> Name -> [TypeQ] -> Maybe Kind -> ConQ -> [DerivClauseQ] -> DecQ #
thisModule :: Q Module #
Return the Module at the place of splicing. Can be used as an
input for reifyModule
.
varStrictType :: Name -> StrictTypeQ -> VarStrictTypeQ #
strictType :: Q Strict -> TypeQ -> StrictTypeQ #
standaloneDerivD :: CxtQ -> TypeQ -> DecQ #
type SourceStrictnessQ = Q SourceStrictness #
type SourceUnpackednessQ = Q SourceUnpackedness #
type StrictTypeQ = Q StrictType #
type VarStrictTypeQ = Q VarStrictType #
type PatSynDirQ = Q PatSynDir #
type PatSynArgsQ = Q PatSynArgs #
type FamilyResultSigQ = Q FamilyResultSig #
pprParendType :: Type -> Doc #
pprPat :: Precedence -> Pat -> Doc #
pprLit :: Precedence -> Lit -> Doc #
pprExp :: Precedence -> Exp -> Doc #
Instances
data QuasiQuoter #
The QuasiQuoter
type, a value q
of this type can be used
in the syntax [q| ... string to parse ...|]
. In fact, for
convenience, a QuasiQuoter
actually defines multiple quasiquoters
to be used in different splice contexts; if you are only interested
in defining a quasiquoter to be used for expressions, you would
define a QuasiQuoter
with only quoteExp
, and leave the other
fields stubbed out with errors.
QuasiQuoter | |
|
defaultFixity :: Fixity #
Default fixity: infixl 9
maxPrecedence :: Int #
Highest allowed operator precedence for Fixity
constructor (answer: 9)
unboxedSumTypeName :: SumArity -> Name #
Unboxed sum type constructor
unboxedSumDataName :: SumAlt -> SumArity -> Name #
Unboxed sum data constructor
mk_unboxed_tup_name :: Int -> NameSpace -> Name #
unboxedTupleTypeName :: Int -> Name #
Unboxed tuple type constructor
unboxedTupleDataName :: Int -> Name #
Unboxed tuple data constructor
mk_tup_name :: Int -> NameSpace -> Name #
tupleTypeName :: Int -> Name #
Tuple type constructor
tupleDataName :: Int -> Name #
Tuple data constructor
mkNameG :: NameSpace -> String -> String -> String -> Name #
Used for 'x etc, but not available to the programmer
nameSpace :: Name -> Maybe NameSpace #
Returns whether a name represents an occurrence of a top-level variable
(VarName
), data constructor (DataName
), type constructor, or type class
(TcClsName
). If we can't be sure, it returns Nothing
.
Examples
>>>
nameSpace 'Prelude.id
Just VarName>>>
nameSpace (mkName "id")
Nothing -- only works for top-level variable names>>>
nameSpace 'Data.Maybe.Just
Just DataName>>>
nameSpace ''Data.Maybe.Maybe
Just TcClsName>>>
nameSpace ''Data.Ord.Ord
Just TcClsName
namePackage :: Name -> Maybe String #
A name's package, if it exists.
Examples
>>>
namePackage ''Data.Either.Either
Just "base">>>
namePackage (mkName "foo")
Nothing>>>
namePackage (mkName "Module.foo")
Nothing
nameModule :: Name -> Maybe String #
Module prefix of a name, if it exists.
Examples
>>>
nameModule ''Data.Either.Either
Just "Data.Either">>>
nameModule (mkName "foo")
Nothing>>>
nameModule (mkName "Module.foo")
Just "Module"
The name without its module prefix.
Examples
>>>
nameBase ''Data.Either.Either
"Either">>>
nameBase (mkName "foo")
"foo">>>
nameBase (mkName "Module.foo")
"foo"
dataToPatQ :: Data a => (forall b. Data b => b -> Maybe (Q Pat)) -> a -> Q Pat #
dataToPatQ
converts a value to a 'Q Pat' representation of the same
value, in the SYB style. It takes a function to handle type-specific cases,
alternatively, pass const Nothing
to get default behavior.
dataToExpQ :: Data a => (forall b. Data b => b -> Maybe (Q Exp)) -> a -> Q Exp #
dataToExpQ
converts a value to a 'Q Exp' representation of the
same value, in the SYB style. It is generalized to take a function
override type-specific cases; see liftData
for a more commonly
used variant.
dataToQa :: Data a => (Name -> k) -> (Lit -> Q q) -> (k -> [Q q] -> Q q) -> (forall b. Data b => b -> Maybe (Q q)) -> a -> Q q #
dataToQa
is an internal utility function for constructing generic
conversion functions from types with Data
instances to various
quasi-quoting representations. See the source of dataToExpQ
and
dataToPatQ
for two example usages: mkCon
, mkLit
and appQ
are overloadable to account for different syntax for
expressions and patterns; antiQ
allows you to override type-specific
cases, a common usage is just const Nothing
, which results in
no overloading.
nothingName :: Name #
extsEnabled :: Q [Extension] #
List all enabled language extensions.
isExtEnabled :: Extension -> Q Bool #
Determine whether the given language extension is enabled in the Q
monad.
putQ :: Typeable a => a -> Q () #
Replace the state in the Q
monad. Note that the state is local to the
Haskell module in which the Template Haskell expression is executed.
getQ :: Typeable a => Q (Maybe a) #
Get state from the Q
monad. Note that the state is local to the
Haskell module in which the Template Haskell expression is executed.
addCorePlugin :: String -> Q () #
Adds a core plugin to the compilation pipeline.
addCorePlugin m
has almost the same effect as passing -fplugin=m
to ghc
in the command line. The major difference is that the plugin module m
must not belong to the current package. When TH executes, it is too late
to tell the compiler that we needed to compile first a plugin module in the
current package.
addModFinalizer :: Q () -> Q () #
Add a finalizer that will run in the Q monad after the current module has been type checked. This only makes sense when run within a top-level splice.
The finalizer is given the local type environment at the splice point. Thus
reify
is able to find the local definitions when executed inside the
finalizer.
addForeignFile :: ForeignSrcLang -> String -> Q () #
Emit a foreign file which will be compiled and linked to the object for the current module. Currently only languages that can be compiled with the C compiler are supported, and the flags passed as part of -optc will be also applied to the C compiler invocation that will compile them.
Note that for non-C languages (for example C++) extern C
directives
must be used to get symbols that we can access from Haskell.
To get better errors, it is reccomended to use #line pragmas when emitting C files, e.g.
{-# LANGUAGE CPP #-} ... addForeignFile LangC $ unlines [ "#line " ++ show (__LINE__ + 1) ++ " " ++ show __FILE__ , ... ]
addTopDecls :: [Dec] -> Q () #
Add additional top-level declarations. The added declarations will be type checked along with the current declaration group.
addDependentFile :: FilePath -> Q () #
Record external files that runIO is using (dependent upon). The compiler can then recognize that it should re-compile the Haskell file when an external file changes.
Expects an absolute file path.
Notes:
- ghc -M does not know about these dependencies - it does not execute TH.
- The dependency is based on file content, not a modification time
The runIO
function lets you run an I/O computation in the Q
monad.
Take care: you are guaranteed the ordering of calls to runIO
within
a single Q
computation, but not about the order in which splices are run.
Note: for various murky reasons, stdout and stderr handles are not necessarily flushed when the compiler finishes running, so you should flush them yourself.
isInstance :: Name -> [Type] -> Q Bool #
Is the list of instances returned by reifyInstances
nonempty?
reifyConStrictness :: Name -> Q [DecidedStrictness] #
reifyConStrictness nm
looks up the strictness information for the fields
of the constructor with the name nm
. Note that the strictness information
that reifyConStrictness
returns may not correspond to what is written in
the source code. For example, in the following data declaration:
data Pair a = Pair a a
reifyConStrictness
would return [
under most
circumstances, but it would return DecidedLazy
, DecidedLazy][
if the
DecidedStrict
, DecidedStrict]-XStrictData
language extension was enabled.
reifyModule :: Module -> Q ModuleInfo #
reifyModule mod
looks up information about module mod
. To
look up the current module, call this function with the return
value of thisModule
.
reifyAnnotations :: Data a => AnnLookup -> Q [a] #
reifyAnnotations target
returns the list of annotations
associated with target
. Only the annotations that are
appropriately typed is returned. So if you have Int
and String
annotations for the same target, you have to call this function twice.
reifyRoles :: Name -> Q [Role] #
reifyRoles nm
returns the list of roles associated with the parameters of
the tycon nm
. Fails if nm
cannot be found or is not a tycon.
The returned list should never contain InferR
.
reifyInstances :: Name -> [Type] -> Q [InstanceDec] #
reifyInstances nm tys
returns a list of visible instances of nm tys
. That is,
if nm
is the name of a type class, then all instances of this class at the types tys
are returned. Alternatively, if nm
is the name of a data family or type family,
all instances of this family at the types tys
are returned.
reifyFixity :: Name -> Q (Maybe Fixity) #
reifyFixity nm
attempts to find a fixity declaration for nm
. For
example, if the function foo
has the fixity declaration infixr 7 foo
, then
reifyFixity 'foo
would return
. If the function
Just
(Fixity
7 InfixR
)bar
does not have a fixity declaration, then reifyFixity 'bar
returns
Nothing
, so you may assume bar
has defaultFixity
.
reify
looks up information about the Name
.
It is sometimes useful to construct the argument name using lookupTypeName
or lookupValueName
to ensure that we are reifying from the right namespace. For instance, in this context:
data D = D
which D
does reify (mkName "D")
return information about? (Answer: D
-the-type, but don't rely on it.)
To ensure we get information about D
-the-value, use lookupValueName
:
do Just nm <- lookupValueName "D" reify nm
and to get information about D
-the-type, use lookupTypeName
.
lookupValueName :: String -> Q (Maybe Name) #
Look up the given name in the (value namespace of the) current splice's scope. See Language.Haskell.TH.Syntax for more details.
lookupTypeName :: String -> Q (Maybe Name) #
Look up the given name in the (type namespace of the) current splice's scope. See Language.Haskell.TH.Syntax for more details.
Recover from errors raised by reportError
or fail
.
reportWarning :: String -> Q () #
Report a warning to the user, and carry on.
reportError :: String -> Q () #
Report an error to the user, but allow the current splice's computation to carry on. To abort the computation, use fail
.
report :: Bool -> String -> Q () #
Report an error (True) or warning (False),
but carry on; use fail
to stop.
class (MonadIO m, MonadFail m) => Quasi (m :: * -> *) where #
qNewName, qReport, qRecover, qLookupName, qReify, qReifyFixity, qReifyInstances, qReifyRoles, qReifyAnnotations, qReifyModule, qReifyConStrictness, qLocation, qAddDependentFile, qAddTopDecls, qAddForeignFile, qAddModFinalizer, qAddCorePlugin, qGetQ, qPutQ, qIsExtEnabled, qExtsEnabled
:: Bool | |
-> String | |
-> m () | Report an error (True) or warning (False)
...but carry on; use |
:: m a | the error handler |
-> m a | action which may fail |
-> m a | Recover from the monadic |
qLookupName :: Bool -> String -> m (Maybe Name) #
qReifyFixity :: Name -> m (Maybe Fixity) #
qReifyInstances :: Name -> [Type] -> m [Dec] #
qReifyRoles :: Name -> m [Role] #
qReifyAnnotations :: Data a => AnnLookup -> m [a] #
qReifyModule :: Module -> m ModuleInfo #
qReifyConStrictness :: Name -> m [DecidedStrictness] #
qAddDependentFile :: FilePath -> m () #
qAddTopDecls :: [Dec] -> m () #
qAddForeignFile :: ForeignSrcLang -> String -> m () #
qAddModFinalizer :: Q () -> m () #
qAddCorePlugin :: String -> m () #
qGetQ :: Typeable a => m (Maybe a) #
qPutQ :: Typeable a => a -> m () #
qIsExtEnabled :: Extension -> m Bool #
qExtsEnabled :: m [Extension] #
Instances
Instances
Eq ModName | |
Data ModName | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ModName -> c ModName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ModName # toConstr :: ModName -> Constr # dataTypeOf :: ModName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ModName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModName) # gmapT :: (forall b. Data b => b -> b) -> ModName -> ModName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ModName -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ModName -> r # gmapQ :: (forall d. Data d => d -> u) -> ModName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ModName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ModName -> m ModName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ModName -> m ModName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ModName -> m ModName # | |
Ord ModName | |
Show ModName | |
Generic ModName | |
type Rep ModName | |
Defined in Language.Haskell.TH.Syntax |
Instances
Eq PkgName | |
Data PkgName | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PkgName -> c PkgName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PkgName # toConstr :: PkgName -> Constr # dataTypeOf :: PkgName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PkgName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PkgName) # gmapT :: (forall b. Data b => b -> b) -> PkgName -> PkgName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PkgName -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PkgName -> r # gmapQ :: (forall d. Data d => d -> u) -> PkgName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PkgName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PkgName -> m PkgName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PkgName -> m PkgName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PkgName -> m PkgName # | |
Ord PkgName | |
Show PkgName | |
Generic PkgName | |
type Rep PkgName | |
Defined in Language.Haskell.TH.Syntax |
Obtained from reifyModule
and thisModule
.
Instances
Eq Module | |
Data Module | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Module -> c Module # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Module # toConstr :: Module -> Constr # dataTypeOf :: Module -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Module) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Module) # gmapT :: (forall b. Data b => b -> b) -> Module -> Module # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r # gmapQ :: (forall d. Data d => d -> u) -> Module -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Module -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Module -> m Module # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Module -> m Module # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Module -> m Module # | |
Ord Module | |
Show Module | |
Generic Module | |
Ppr Module | |
type Rep Module | |
Defined in Language.Haskell.TH.Syntax type Rep Module = D1 (MetaData "Module" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Module" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PkgName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ModName))) |
Instances
Eq OccName | |
Data OccName | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccName -> c OccName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OccName # toConstr :: OccName -> Constr # dataTypeOf :: OccName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OccName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName) # gmapT :: (forall b. Data b => b -> b) -> OccName -> OccName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r # gmapQ :: (forall d. Data d => d -> u) -> OccName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccName -> m OccName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName # | |
Ord OccName | |
Show OccName | |
Generic OccName | |
type Rep OccName | |
Defined in Language.Haskell.TH.Syntax |
data NameFlavour #
NameS | An unqualified name; dynamically bound |
NameQ ModName | A qualified name; dynamically bound |
NameU !Int | A unique local name |
NameL !Int | Local name bound outside of the TH AST |
NameG NameSpace PkgName ModName | Global name bound outside of the TH AST: An original name (occurrences only, not binders) Need the namespace too to be sure which thing we are naming |
Instances
VarName | Variables |
DataName | Data constructors |
TcClsName | Type constructors and classes; Haskell has them in the same name space for now. |
Instances
Eq NameSpace | |
Data NameSpace | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NameSpace -> c NameSpace # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NameSpace # toConstr :: NameSpace -> Constr # dataTypeOf :: NameSpace -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NameSpace) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NameSpace) # gmapT :: (forall b. Data b => b -> b) -> NameSpace -> NameSpace # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NameSpace -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NameSpace -> r # gmapQ :: (forall d. Data d => d -> u) -> NameSpace -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NameSpace -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NameSpace -> m NameSpace # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NameSpace -> m NameSpace # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NameSpace -> m NameSpace # | |
Ord NameSpace | |
Defined in Language.Haskell.TH.Syntax | |
Show NameSpace | |
Generic NameSpace | |
type Rep NameSpace | |
Defined in Language.Haskell.TH.Syntax |
Loc | |
|
Instances
Eq Loc | |
Data Loc | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Loc -> c Loc # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Loc # dataTypeOf :: Loc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Loc) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Loc) # gmapT :: (forall b. Data b => b -> b) -> Loc -> Loc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r # gmapQ :: (forall d. Data d => d -> u) -> Loc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Loc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Loc -> m Loc # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Loc -> m Loc # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Loc -> m Loc # | |
Ord Loc | |
Show Loc | |
Generic Loc | |
Ppr Loc | |
type Rep Loc | |
Defined in Language.Haskell.TH.Syntax type Rep Loc = D1 (MetaData "Loc" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Loc" PrefixI True) ((S1 (MetaSel (Just "loc_filename") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "loc_package") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :*: (S1 (MetaSel (Just "loc_module") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Just "loc_start") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CharPos) :*: S1 (MetaSel (Just "loc_end") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CharPos))))) |
ClassI Dec [InstanceDec] | A class, with a list of its visible instances |
ClassOpI Name Type ParentName | A class method |
TyConI Dec | A "plain" type constructor. "Fancier" type constructors are returned using |
FamilyI Dec [InstanceDec] | A type or data family, with a list of its visible instances. A closed type family is returned with 0 instances. |
PrimTyConI Name Arity Unlifted | A "primitive" type constructor, which can't be expressed with a |
DataConI Name Type ParentName | A data constructor |
PatSynI Name PatSynType | A pattern synonym. |
VarI Name Type (Maybe Dec) | A "value" variable (as opposed to a type variable, see The |
TyVarI Name Type | A type variable. The |
Instances
data ModuleInfo #
Obtained from reifyModule
in the Q
Monad.
ModuleInfo [Module] | Contains the import list of the module. |
Instances
type ParentName = Name #
In UnboxedSumE
and UnboxedSumP
, the number associated with a
particular data constructor. SumAlt
s are one-indexed and should never
exceed the value of its corresponding SumArity
. For example:
In UnboxedSumE
, UnboxedSumT
, and UnboxedSumP
, the total number of
SumAlt
s. For example, (#|#)
has a SumArity
of 2.
In PrimTyConI
, arity of the type constructor
In PrimTyConI
, is the type constructor unlifted?
type InstanceDec = Dec #
InstanceDec
desribes a single instance of a class or type function.
It is just a Dec
, but guaranteed to be one of the following:
InstanceD
(with empty[
)Dec
]DataInstD
orNewtypeInstD
(with empty derived[
)Name
]TySynInstD
Instances
Eq Fixity | |
Data Fixity | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Fixity -> c Fixity # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Fixity # toConstr :: Fixity -> Constr # dataTypeOf :: Fixity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Fixity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity) # gmapT :: (forall b. Data b => b -> b) -> Fixity -> Fixity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQ :: (forall d. Data d => d -> u) -> Fixity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Fixity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # | |
Ord Fixity | |
Show Fixity | |
Generic Fixity | |
type Rep Fixity | |
Defined in Language.Haskell.TH.Syntax type Rep Fixity = D1 (MetaData "Fixity" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Fixity" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FixityDirection))) |
data FixityDirection #
Instances
CharL Char | |
StringL String | |
IntegerL Integer | Used for overloaded and non-overloaded literals. We don't have a good way to represent non-overloaded literals at the moment. Maybe that doesn't matter? |
RationalL Rational | |
IntPrimL Integer | |
WordPrimL Integer | |
FloatPrimL Rational | |
DoublePrimL Rational | |
StringPrimL [Word8] | A primitive C-style string, type Addr# |
CharPrimL Char |
Instances
Instances
Eq Body | |
Data Body | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Body -> c Body # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Body # dataTypeOf :: Body -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Body) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Body) # gmapT :: (forall b. Data b => b -> b) -> Body -> Body # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r # gmapQ :: (forall d. Data d => d -> u) -> Body -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Body -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Body -> m Body # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Body -> m Body # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Body -> m Body # | |
Ord Body | |
Show Body | |
Generic Body | |
type Rep Body | |
Defined in Language.Haskell.TH.Syntax type Rep Body = D1 (MetaData "Body" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "GuardedB" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Guard, Exp)])) :+: C1 (MetaCons "NormalB" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Exp))) |
Instances
Eq Guard | |
Data Guard | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Guard -> c Guard # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Guard # dataTypeOf :: Guard -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Guard) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Guard) # gmapT :: (forall b. Data b => b -> b) -> Guard -> Guard # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r # gmapQ :: (forall d. Data d => d -> u) -> Guard -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Guard -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Guard -> m Guard # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Guard -> m Guard # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Guard -> m Guard # | |
Ord Guard | |
Show Guard | |
Generic Guard | |
type Rep Guard | |
Defined in Language.Haskell.TH.Syntax type Rep Guard = D1 (MetaData "Guard" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "NormalG" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Exp)) :+: C1 (MetaCons "PatG" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Stmt]))) |
Instances
Eq Stmt | |
Data Stmt | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Stmt -> c Stmt # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Stmt # dataTypeOf :: Stmt -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Stmt) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Stmt) # gmapT :: (forall b. Data b => b -> b) -> Stmt -> Stmt # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r # gmapQ :: (forall d. Data d => d -> u) -> Stmt -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Stmt -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Stmt -> m Stmt # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Stmt -> m Stmt # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Stmt -> m Stmt # | |
Ord Stmt | |
Show Stmt | |
Generic Stmt | |
Ppr Stmt | |
type Rep Stmt | |
Defined in Language.Haskell.TH.Syntax type Rep Stmt = D1 (MetaData "Stmt" "Language.Haskell.TH.Syntax" "template-haskell" False) ((C1 (MetaCons "BindS" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Pat) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Exp)) :+: C1 (MetaCons "LetS" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Dec]))) :+: (C1 (MetaCons "NoBindS" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Exp)) :+: C1 (MetaCons "ParS" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [[Stmt]])))) |
Instances
data DerivClause #
A single deriving
clause at the end of a datatype.
DerivClause (Maybe DerivStrategy) Cxt | { deriving stock (Eq, Ord) } |
Instances
type PatSynType = Type #
A Pattern synonym's type. Note that a pattern synonym's *fully* specified type has a peculiar shape coming with two forall quantifiers and two constraint contexts. For example, consider the pattern synonym
pattern P x1 x2 ... xn = some-pattern
P's complete type is of the following form
forall universals. required constraints => forall existentials. provided constraints => t1 -> t2 -> ... -> tn -> t
consisting of four parts:
1) the (possibly empty lists of) universally quantified type variables and required constraints on them. 2) the (possibly empty lists of) existentially quantified type variables and the provided constraints on them. 3) the types t1, t2, .., tn of x1, x2, .., xn, respectively 4) the type t of some-pattern, mentioning only universals.
Pattern synonym types interact with TH when (a) reifying a pattern synonym, (b) pretty printing, or (c) specifying a pattern synonym's type signature explicitly:
(a) Reification always returns a pattern synonym's *fully* specified type in abstract syntax.
(b) Pretty printing via pprPatSynType
abbreviates a pattern
synonym's type unambiguously in concrete syntax: The rule of
thumb is to print initial empty universals and the required
context as `() =>`, if existentials and a provided context
follow. If only universals and their required context, but no
existentials are specified, only the universals and their
required context are printed. If both or none are specified, so
both (or none) are printed.
(c) When specifying a pattern synonym's type explicitly with
PatSynSigD
either one of the universals, the existentials, or
their contexts may be left empty.
See the GHC user's guide for more information on pattern synonyms and their types: https://downloads.haskell.org/~ghc/latest/docs/html/ users_guide/syntax-extns.html#pattern-synonyms.
data TypeFamilyHead #
Common elements of OpenTypeFamilyD
and ClosedTypeFamilyD
. By
analogy with "head" for type classes and type class instances as
defined in Type classes: an exploration of the design space, the
TypeFamilyHead
is defined to be the elements of the declaration
between type family
and where
.
Instances
One equation of a type family instance or closed type family. The arguments are the left-hand-side type patterns and the right-hand-side result.
Instances
Eq TySynEqn | |
Data TySynEqn | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TySynEqn -> c TySynEqn # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TySynEqn # toConstr :: TySynEqn -> Constr # dataTypeOf :: TySynEqn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TySynEqn) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TySynEqn) # gmapT :: (forall b. Data b => b -> b) -> TySynEqn -> TySynEqn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TySynEqn -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TySynEqn -> r # gmapQ :: (forall d. Data d => d -> u) -> TySynEqn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TySynEqn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn # | |
Ord TySynEqn | |
Defined in Language.Haskell.TH.Syntax | |
Show TySynEqn | |
Generic TySynEqn | |
type Rep TySynEqn | |
Defined in Language.Haskell.TH.Syntax type Rep TySynEqn = D1 (MetaData "TySynEqn" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "TySynEqn" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Type]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Type))) |
Instances
Instances
Eq Callconv | |
Data Callconv | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Callconv -> c Callconv # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Callconv # toConstr :: Callconv -> Constr # dataTypeOf :: Callconv -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Callconv) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Callconv) # gmapT :: (forall b. Data b => b -> b) -> Callconv -> Callconv # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Callconv -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Callconv -> r # gmapQ :: (forall d. Data d => d -> u) -> Callconv -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Callconv -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Callconv -> m Callconv # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Callconv -> m Callconv # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Callconv -> m Callconv # | |
Ord Callconv | |
Defined in Language.Haskell.TH.Syntax | |
Show Callconv | |
Generic Callconv | |
type Rep Callconv | |
Defined in Language.Haskell.TH.Syntax type Rep Callconv = D1 (MetaData "Callconv" "Language.Haskell.TH.Syntax" "template-haskell" False) ((C1 (MetaCons "CCall" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "StdCall" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "CApi" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "Prim" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "JavaScript" PrefixI False) (U1 :: * -> *)))) |
Instances
Eq Safety | |
Data Safety | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Safety -> c Safety # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Safety # toConstr :: Safety -> Constr # dataTypeOf :: Safety -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Safety) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Safety) # gmapT :: (forall b. Data b => b -> b) -> Safety -> Safety # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Safety -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Safety -> r # gmapQ :: (forall d. Data d => d -> u) -> Safety -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Safety -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Safety -> m Safety # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Safety -> m Safety # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Safety -> m Safety # | |
Ord Safety | |
Show Safety | |
Generic Safety | |
type Rep Safety | |
Defined in Language.Haskell.TH.Syntax |
InlineP Name Inline RuleMatch Phases | |
SpecialiseP Name Type (Maybe Inline) Phases | |
SpecialiseInstP Type | |
RuleP String [RuleBndr] Exp Exp Phases | |
AnnP AnnTarget Exp | |
LineP Int String | |
CompleteP [Name] (Maybe Name) | { {-# COMPLETE C_1, ..., C_i [ :: T ] #-} } |
Instances
Instances
Eq Inline | |
Data Inline | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Inline -> c Inline # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Inline # toConstr :: Inline -> Constr # dataTypeOf :: Inline -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Inline) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Inline) # gmapT :: (forall b. Data b => b -> b) -> Inline -> Inline # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Inline -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Inline -> r # gmapQ :: (forall d. Data d => d -> u) -> Inline -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Inline -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Inline -> m Inline # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Inline -> m Inline # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Inline -> m Inline # | |
Ord Inline | |
Show Inline | |
Generic Inline | |
Ppr Inline | |
type Rep Inline | |
Defined in Language.Haskell.TH.Syntax |
Instances
Eq RuleMatch | |
Data RuleMatch | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RuleMatch -> c RuleMatch # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RuleMatch # toConstr :: RuleMatch -> Constr # dataTypeOf :: RuleMatch -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RuleMatch) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleMatch) # gmapT :: (forall b. Data b => b -> b) -> RuleMatch -> RuleMatch # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RuleMatch -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RuleMatch -> r # gmapQ :: (forall d. Data d => d -> u) -> RuleMatch -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RuleMatch -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch # | |
Ord RuleMatch | |
Defined in Language.Haskell.TH.Syntax | |
Show RuleMatch | |
Generic RuleMatch | |
Ppr RuleMatch | |
type Rep RuleMatch | |
Instances
Eq Phases | |
Data Phases | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Phases -> c Phases # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Phases # toConstr :: Phases -> Constr # dataTypeOf :: Phases -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Phases) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Phases) # gmapT :: (forall b. Data b => b -> b) -> Phases -> Phases # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Phases -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Phases -> r # gmapQ :: (forall d. Data d => d -> u) -> Phases -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Phases -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Phases -> m Phases # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Phases -> m Phases # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Phases -> m Phases # | |
Ord Phases | |
Show Phases | |
Generic Phases | |
Ppr Phases | |
type Rep Phases | |
Defined in Language.Haskell.TH.Syntax type Rep Phases = D1 (MetaData "Phases" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "AllPhases" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "FromPhase" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) :+: C1 (MetaCons "BeforePhase" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))) |
Instances
Eq RuleBndr | |
Data RuleBndr | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RuleBndr -> c RuleBndr # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RuleBndr # toConstr :: RuleBndr -> Constr # dataTypeOf :: RuleBndr -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RuleBndr) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleBndr) # gmapT :: (forall b. Data b => b -> b) -> RuleBndr -> RuleBndr # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RuleBndr -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RuleBndr -> r # gmapQ :: (forall d. Data d => d -> u) -> RuleBndr -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RuleBndr -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr # | |
Ord RuleBndr | |
Defined in Language.Haskell.TH.Syntax | |
Show RuleBndr | |
Generic RuleBndr | |
Ppr RuleBndr | |
type Rep RuleBndr | |
Defined in Language.Haskell.TH.Syntax type Rep RuleBndr = D1 (MetaData "RuleBndr" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "RuleVar" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "TypedRuleVar" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Type))) |
Instances
Eq AnnTarget | |
Data AnnTarget | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AnnTarget -> c AnnTarget # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AnnTarget # toConstr :: AnnTarget -> Constr # dataTypeOf :: AnnTarget -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AnnTarget) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnTarget) # gmapT :: (forall b. Data b => b -> b) -> AnnTarget -> AnnTarget # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AnnTarget -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AnnTarget -> r # gmapQ :: (forall d. Data d => d -> u) -> AnnTarget -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AnnTarget -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget # | |
Ord AnnTarget | |
Defined in Language.Haskell.TH.Syntax | |
Show AnnTarget | |
Generic AnnTarget | |
type Rep AnnTarget | |
Defined in Language.Haskell.TH.Syntax type Rep AnnTarget = D1 (MetaData "AnnTarget" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "ModuleAnnotation" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "TypeAnnotation" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)) :+: C1 (MetaCons "ValueAnnotation" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name)))) |
data SourceUnpackedness #
NoSourceUnpackedness | C a |
SourceNoUnpack | C { {-# NOUNPACK #-} } a |
SourceUnpack | C { {-# UNPACK #-} } a |
Instances
data SourceStrictness #
NoSourceStrictness | C a |
SourceLazy | C {~}a |
SourceStrict | C {!}a |
Instances
data DecidedStrictness #
Unlike SourceStrictness
and SourceUnpackedness
, DecidedStrictness
refers to the strictness that the compiler chooses for a data constructor
field, which may be different from what is written in source code. See
reifyConStrictness
for more information.
Instances
A single data constructor.
The constructors for Con
can roughly be divided up into two categories:
those for constructors with "vanilla" syntax (NormalC
, RecC
, and
InfixC
), and those for constructors with GADT syntax (GadtC
and
RecGadtC
). The ForallC
constructor, which quantifies additional type
variables and class contexts, can surround either variety of constructor.
However, the type variables that it quantifies are different depending
on what constructor syntax is used:
- If a
ForallC
surrounds a constructor with vanilla syntax, then theForallC
will only quantify existential type variables. For example:
data Foo a = forall b. MkFoo a b
In MkFoo
, ForallC
will quantify b
, but not a
.
- If a
ForallC
surrounds a constructor with GADT syntax, then theForallC
will quantify all type variables used in the constructor. For example:
data Bar a b where MkBar :: (a ~ b) => c -> MkBar a b
In MkBar
, ForallC
will quantify a
, b
, and c
.
NormalC Name [BangType] | C Int a |
RecC Name [VarBangType] | C { v :: Int, w :: a } |
InfixC BangType Name BangType | Int :+ a |
ForallC [TyVarBndr] Cxt Con | forall a. Eq a => C [a] |
GadtC [Name] [BangType] Type | C :: a -> b -> T b Int |
RecGadtC [Name] [VarBangType] Type | C :: { v :: Int } -> T b Int |
Instances
Bang SourceUnpackedness SourceStrictness | C { {-# UNPACK #-} !}a |
Instances
Eq Bang | |
Data Bang | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bang -> c Bang # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bang # dataTypeOf :: Bang -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bang) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bang) # gmapT :: (forall b. Data b => b -> b) -> Bang -> Bang # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r # gmapQ :: (forall d. Data d => d -> u) -> Bang -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Bang -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bang -> m Bang # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bang -> m Bang # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bang -> m Bang # | |
Ord Bang | |
Show Bang | |
Generic Bang | |
Ppr Bang | |
type Rep Bang | |
Defined in Language.Haskell.TH.Syntax type Rep Bang = D1 (MetaData "Bang" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Bang" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SourceUnpackedness) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SourceStrictness))) |
type VarBangType = (Name, Bang, Type) #
type StrictType = BangType #
As of template-haskell-2.11.0.0
, StrictType
has been replaced by
BangType
.
type VarStrictType = VarBangType #
As of template-haskell-2.11.0.0
, VarStrictType
has been replaced by
VarBangType
.
A pattern synonym's directionality.
Unidir | pattern P x {<-} p |
ImplBidir | pattern P x {=} p |
ExplBidir [Clause] | pattern P x {<-} p where P x = e |
Instances
Eq PatSynDir | |
Data PatSynDir | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PatSynDir -> c PatSynDir # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PatSynDir # toConstr :: PatSynDir -> Constr # dataTypeOf :: PatSynDir -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PatSynDir) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSynDir) # gmapT :: (forall b. Data b => b -> b) -> PatSynDir -> PatSynDir # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PatSynDir -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PatSynDir -> r # gmapQ :: (forall d. Data d => d -> u) -> PatSynDir -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PatSynDir -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir # | |
Ord PatSynDir | |
Defined in Language.Haskell.TH.Syntax | |
Show PatSynDir | |
Generic PatSynDir | |
Ppr PatSynDir | |
type Rep PatSynDir | |
Defined in Language.Haskell.TH.Syntax type Rep PatSynDir = D1 (MetaData "PatSynDir" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Unidir" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "ImplBidir" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ExplBidir" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Clause])))) |
data PatSynArgs #
A pattern synonym's argument type.
PrefixPatSyn [Name] | pattern P {x y z} = p |
InfixPatSyn Name Name | pattern {x P y} = p |
RecordPatSyn [Name] | pattern P { {x,y,z} } = p |
Instances
Instances
data FamilyResultSig #
Type family result signature
Instances
Instances
Eq TyLit | |
Data TyLit | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TyLit -> c TyLit # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TyLit # dataTypeOf :: TyLit -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TyLit) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyLit) # gmapT :: (forall b. Data b => b -> b) -> TyLit -> TyLit # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r # gmapQ :: (forall d. Data d => d -> u) -> TyLit -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TyLit -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TyLit -> m TyLit # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TyLit -> m TyLit # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TyLit -> m TyLit # | |
Ord TyLit | |
Show TyLit | |
Generic TyLit | |
Ppr TyLit | |
type Rep TyLit | |
Defined in Language.Haskell.TH.Syntax type Rep TyLit = D1 (MetaData "TyLit" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "NumTyLit" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Integer)) :+: C1 (MetaCons "StrTyLit" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))) |
Role annotations
NominalR | nominal |
RepresentationalR | representational |
PhantomR | phantom |
InferR | _ |
Instances
Eq Role | |
Data Role | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Role -> c Role # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Role # dataTypeOf :: Role -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Role) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role) # gmapT :: (forall b. Data b => b -> b) -> Role -> Role # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r # gmapQ :: (forall d. Data d => d -> u) -> Role -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Role -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Role -> m Role # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role # | |
Ord Role | |
Show Role | |
Generic Role | |
Ppr Role | |
type Rep Role | |
Defined in Language.Haskell.TH.Syntax type Rep Role = D1 (MetaData "Role" "Language.Haskell.TH.Syntax" "template-haskell" False) ((C1 (MetaCons "NominalR" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RepresentationalR" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "PhantomR" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "InferR" PrefixI False) (U1 :: * -> *))) |
Annotation target for reifyAnnotations
Instances
Eq AnnLookup | |
Data AnnLookup | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AnnLookup -> c AnnLookup # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AnnLookup # toConstr :: AnnLookup -> Constr # dataTypeOf :: AnnLookup -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AnnLookup) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnLookup) # gmapT :: (forall b. Data b => b -> b) -> AnnLookup -> AnnLookup # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AnnLookup -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AnnLookup -> r # gmapQ :: (forall d. Data d => d -> u) -> AnnLookup -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AnnLookup -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup # | |
Ord AnnLookup | |
Defined in Language.Haskell.TH.Syntax | |
Show AnnLookup | |
Generic AnnLookup | |
type Rep AnnLookup | |
Defined in Language.Haskell.TH.Syntax type Rep AnnLookup = D1 (MetaData "AnnLookup" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "AnnLookupModule" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Module)) :+: C1 (MetaCons "AnnLookupName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name))) |
To avoid duplication between kinds and types, they
are defined to be the same. Naturally, you would never
have a type be StarT
and you would never have a kind
be SigT
, but many of the other constructors are shared.
Note that the kind Bool
is denoted with ConT
, not
PromotedT
. Similarly, tuple kinds are made with TupleT
,
not PromotedTupleT
.
Give a default for a typeclass method that will be utilized by the instances
quasiquoter.
Defaults are declared by giving an annotation like:
{-# ann type MySubClass (Defaults 'mySuperclassMethod 'myDefaultDefinition) #-}
For example, we could modify Data.Traversable to work with instances
like so:
{-# language TemplateHaskell #-} module Data.Traversable where {- ... normal imports ... -} import Language.Haskell.TH.Instances.Defaults class (Functor t, Foldable t) => Traversable t where ... -- Same as normal {-# ANN type Traversable (Defaults 'fmap 'fmapDefault) #-} {-# ANN type Traversable (Defaults 'foldMap 'foldMapDefault) #-}
module MyData where import Data.Traversable data Foo a = Foo a a [instances| Travesable Foo where traverse f (Foo a a') = Foo <$> f a <*> f a'|]
will generate
instance Functor Foo where fmap = fmapDefault instance Foldable Foo where foldMap = foldMapDefault instance Travesable Foo where traverse f (Foo a a') = Foo <$> f a <*> f a'
Defaults | |
|
Instances
Data Defaults Source # | |
Defined in Language.Haskell.TH.Instances.Defaults gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Defaults -> c Defaults # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Defaults # toConstr :: Defaults -> Constr # dataTypeOf :: Defaults -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Defaults) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Defaults) # gmapT :: (forall b. Data b => b -> b) -> Defaults -> Defaults # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Defaults -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Defaults -> r # gmapQ :: (forall d. Data d => d -> u) -> Defaults -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Defaults -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Defaults -> m Defaults # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Defaults -> m Defaults # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Defaults -> m Defaults # | |
Show Defaults Source # | |