-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | PureScript Programming Language Abstract Syntax Tree -- -- Defines the underlying syntax of the PureScript Programming Language. @package purescript-ast @version 0.1.1.0 -- | Fresh variable supply module Control.Monad.Supply newtype SupplyT m a SupplyT :: StateT Integer m a -> SupplyT m a [unSupplyT] :: SupplyT m a -> StateT Integer m a runSupplyT :: Integer -> SupplyT m a -> m (a, Integer) evalSupplyT :: Functor m => Integer -> SupplyT m a -> m a type Supply = SupplyT Identity runSupply :: Integer -> Supply a -> (a, Integer) evalSupply :: Integer -> Supply a -> a instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Monad.Supply.SupplyT m) instance GHC.Base.MonadPlus m => GHC.Base.Alternative (Control.Monad.Supply.SupplyT m) instance Control.Monad.Reader.Class.MonadReader r m => Control.Monad.Reader.Class.MonadReader r (Control.Monad.Supply.SupplyT m) instance Control.Monad.Writer.Class.MonadWriter w m => Control.Monad.Writer.Class.MonadWriter w (Control.Monad.Supply.SupplyT m) instance Control.Monad.Error.Class.MonadError e m => Control.Monad.Error.Class.MonadError e (Control.Monad.Supply.SupplyT m) instance Control.Monad.Trans.Class.MonadTrans Control.Monad.Supply.SupplyT instance GHC.Base.Monad m => GHC.Base.Monad (Control.Monad.Supply.SupplyT m) instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Monad.Supply.SupplyT m) instance GHC.Base.Functor m => GHC.Base.Functor (Control.Monad.Supply.SupplyT m) -- | A class for monads supporting a supply of fresh names module Control.Monad.Supply.Class class Monad m => MonadSupply m fresh :: MonadSupply m => m Integer peek :: MonadSupply m => m Integer fresh :: (MonadSupply m, MonadTrans t, MonadSupply n, m ~ t n) => m Integer peek :: (MonadSupply m, MonadTrans t, MonadSupply n, m ~ t n) => m Integer freshName :: MonadSupply m => m Text instance GHC.Base.Monad m => Control.Monad.Supply.Class.MonadSupply (Control.Monad.Supply.SupplyT m) instance Control.Monad.Supply.Class.MonadSupply m => Control.Monad.Supply.Class.MonadSupply (Control.Monad.Trans.State.Lazy.StateT s m) instance (GHC.Base.Monoid w, Control.Monad.Supply.Class.MonadSupply m) => Control.Monad.Supply.Class.MonadSupply (Control.Monad.Trans.Writer.Lazy.WriterT w m) -- | Defines the types of source code comments module Language.PureScript.Comments data Comment LineComment :: Text -> Comment BlockComment :: Text -> Comment instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.Comments.Comment instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.Comments.Comment instance GHC.Generics.Generic Language.PureScript.Comments.Comment instance GHC.Classes.Ord Language.PureScript.Comments.Comment instance GHC.Classes.Eq Language.PureScript.Comments.Comment instance GHC.Show.Show Language.PureScript.Comments.Comment instance Control.DeepSeq.NFData Language.PureScript.Comments.Comment instance Codec.Serialise.Class.Serialise Language.PureScript.Comments.Comment -- | Source position information module Language.PureScript.AST.SourcePos -- | Source annotation - position information and comments. type SourceAnn = (SourceSpan, [Comment]) -- | Source position information data SourcePos SourcePos :: Int -> Int -> SourcePos -- | Line number [sourcePosLine] :: SourcePos -> Int -- | Column number [sourcePosColumn] :: SourcePos -> Int displaySourcePos :: SourcePos -> Text displaySourcePosShort :: SourcePos -> Text data SourceSpan SourceSpan :: String -> SourcePos -> SourcePos -> SourceSpan -- | Source name [spanName] :: SourceSpan -> String -- | Start of the span [spanStart] :: SourceSpan -> SourcePos -- | End of the span [spanEnd] :: SourceSpan -> SourcePos displayStartEndPos :: SourceSpan -> Text displayStartEndPosShort :: SourceSpan -> Text displaySourceSpan :: FilePath -> SourceSpan -> Text internalModuleSourceSpan :: String -> SourceSpan nullSourceSpan :: SourceSpan nullSourceAnn :: SourceAnn pattern NullSourceSpan :: SourceSpan pattern NullSourceAnn :: SourceAnn nonEmptySpan :: SourceAnn -> Maybe SourceSpan widenSourceSpan :: SourceSpan -> SourceSpan -> SourceSpan widenSourceAnn :: SourceAnn -> SourceAnn -> SourceAnn instance Codec.Serialise.Class.Serialise Language.PureScript.AST.SourcePos.SourcePos instance Control.DeepSeq.NFData Language.PureScript.AST.SourcePos.SourcePos instance GHC.Generics.Generic Language.PureScript.AST.SourcePos.SourcePos instance GHC.Classes.Ord Language.PureScript.AST.SourcePos.SourcePos instance GHC.Classes.Eq Language.PureScript.AST.SourcePos.SourcePos instance GHC.Show.Show Language.PureScript.AST.SourcePos.SourcePos instance Codec.Serialise.Class.Serialise Language.PureScript.AST.SourcePos.SourceSpan instance Control.DeepSeq.NFData Language.PureScript.AST.SourcePos.SourceSpan instance GHC.Generics.Generic Language.PureScript.AST.SourcePos.SourceSpan instance GHC.Classes.Ord Language.PureScript.AST.SourcePos.SourceSpan instance GHC.Classes.Eq Language.PureScript.AST.SourcePos.SourceSpan instance GHC.Show.Show Language.PureScript.AST.SourcePos.SourceSpan instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.AST.SourcePos.SourceSpan instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.AST.SourcePos.SourceSpan instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.AST.SourcePos.SourcePos instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.AST.SourcePos.SourcePos module Language.PureScript.Crash -- | A compatibility wrapper for the GHC.Stack.HasCallStack -- constraint. type HasCallStack = HasCallStack -- | Exit with an error message and a crash report link. internalError :: HasCallStack => String -> a -- | Operators fixity and associativity module Language.PureScript.AST.Operators -- | A precedence level for an infix operator type Precedence = Integer -- | Associativity for infix operators data Associativity Infixl :: Associativity Infixr :: Associativity Infix :: Associativity showAssoc :: Associativity -> String readAssoc :: String -> Associativity -- | Fixity data for infix operators data Fixity Fixity :: Associativity -> Precedence -> Fixity instance GHC.Generics.Generic Language.PureScript.AST.Operators.Associativity instance GHC.Classes.Ord Language.PureScript.AST.Operators.Associativity instance GHC.Classes.Eq Language.PureScript.AST.Operators.Associativity instance GHC.Show.Show Language.PureScript.AST.Operators.Associativity instance GHC.Generics.Generic Language.PureScript.AST.Operators.Fixity instance GHC.Classes.Ord Language.PureScript.AST.Operators.Fixity instance GHC.Classes.Eq Language.PureScript.AST.Operators.Fixity instance GHC.Show.Show Language.PureScript.AST.Operators.Fixity instance Control.DeepSeq.NFData Language.PureScript.AST.Operators.Fixity instance Codec.Serialise.Class.Serialise Language.PureScript.AST.Operators.Fixity instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.AST.Operators.Fixity instance Control.DeepSeq.NFData Language.PureScript.AST.Operators.Associativity instance Codec.Serialise.Class.Serialise Language.PureScript.AST.Operators.Associativity instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.AST.Operators.Associativity instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.AST.Operators.Associativity -- | Data types for names module Language.PureScript.Names -- | A sum of the possible name types, useful for error and lint messages. data Name IdentName :: Ident -> Name ValOpName :: OpName 'ValueOpName -> Name TyName :: ProperName 'TypeName -> Name TyOpName :: OpName 'TypeOpName -> Name DctorName :: ProperName 'ConstructorName -> Name TyClassName :: ProperName 'ClassName -> Name ModName :: ModuleName -> Name getIdentName :: Name -> Maybe Ident getValOpName :: Name -> Maybe (OpName 'ValueOpName) getTypeName :: Name -> Maybe (ProperName 'TypeName) getTypeOpName :: Name -> Maybe (OpName 'TypeOpName) getDctorName :: Name -> Maybe (ProperName 'ConstructorName) getClassName :: Name -> Maybe (ProperName 'ClassName) getModName :: Name -> Maybe ModuleName -- | Names for value identifiers data Ident -- | An alphanumeric identifier Ident :: Text -> Ident -- | A generated name for an identifier GenIdent :: Maybe Text -> Integer -> Ident -- | A generated name used only for type-checking UnusedIdent :: Ident runIdent :: Ident -> Text showIdent :: Ident -> Text freshIdent :: MonadSupply m => Text -> m Ident freshIdent' :: MonadSupply m => m Ident -- | Operator alias names. newtype OpName (a :: OpNameType) OpName :: Text -> OpName (a :: OpNameType) [runOpName] :: OpName (a :: OpNameType) -> Text showOp :: OpName a -> Text -- | The closed set of operator alias types. data OpNameType ValueOpName :: OpNameType TypeOpName :: OpNameType AnyOpName :: OpNameType eraseOpName :: OpName a -> OpName 'AnyOpName coerceOpName :: OpName a -> OpName b -- | Proper names, i.e. capitalized names for e.g. module names, type//data -- constructors. newtype ProperName (a :: ProperNameType) ProperName :: Text -> ProperName (a :: ProperNameType) [runProperName] :: ProperName (a :: ProperNameType) -> Text -- | The closed set of proper name types. data ProperNameType TypeName :: ProperNameType ConstructorName :: ProperNameType ClassName :: ProperNameType Namespace :: ProperNameType -- | Coerces a ProperName from one ProperNameType to another. This should -- be used with care, and is primarily used to convert ClassNames into -- TypeNames after classes have been desugared. coerceProperName :: ProperName a -> ProperName b -- | Module names newtype ModuleName ModuleName :: Text -> ModuleName runModuleName :: ModuleName -> Text moduleNameFromString :: Text -> ModuleName isBuiltinModuleName :: ModuleName -> Bool -- | A qualified name, i.e. a name with an optional module name data Qualified a Qualified :: Maybe ModuleName -> a -> Qualified a showQualified :: (a -> Text) -> Qualified a -> Text getQual :: Qualified a -> Maybe ModuleName -- | Provide a default module name, if a name is unqualified qualify :: ModuleName -> Qualified a -> (ModuleName, a) -- | Makes a qualified value from a name and module name. mkQualified :: a -> ModuleName -> Qualified a -- | Remove the module name from a qualified name disqualify :: Qualified a -> a -- | Remove the qualification from a value when it is qualified with a -- particular module name. disqualifyFor :: Maybe ModuleName -> Qualified a -> Maybe a -- | Checks whether a qualified value is actually qualified with a module -- reference isQualified :: Qualified a -> Bool -- | Checks whether a qualified value is not actually qualified with a -- module reference isUnqualified :: Qualified a -> Bool -- | Checks whether a qualified value is qualified with a particular module isQualifiedWith :: ModuleName -> Qualified a -> Bool instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.Names.Ident instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.Names.Ident instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.Names.ModuleName instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.Names.ModuleName instance Data.Aeson.Types.ToJSON.ToJSONKey Language.PureScript.Names.ModuleName instance Data.Aeson.Types.FromJSON.FromJSONKey Language.PureScript.Names.ModuleName instance Data.Aeson.Types.ToJSON.ToJSON a => Data.Aeson.Types.ToJSON.ToJSON (Language.PureScript.Names.Qualified a) instance Data.Aeson.Types.FromJSON.FromJSON a => Data.Aeson.Types.FromJSON.FromJSON (Language.PureScript.Names.Qualified a) instance GHC.Generics.Generic Language.PureScript.Names.Ident instance GHC.Classes.Ord Language.PureScript.Names.Ident instance GHC.Classes.Eq Language.PureScript.Names.Ident instance GHC.Show.Show Language.PureScript.Names.Ident instance GHC.Generics.Generic (Language.PureScript.Names.OpName a) instance GHC.Classes.Ord (Language.PureScript.Names.OpName a) instance GHC.Classes.Eq (Language.PureScript.Names.OpName a) instance GHC.Show.Show (Language.PureScript.Names.OpName a) instance GHC.Generics.Generic (Language.PureScript.Names.ProperName a) instance GHC.Classes.Ord (Language.PureScript.Names.ProperName a) instance GHC.Classes.Eq (Language.PureScript.Names.ProperName a) instance GHC.Show.Show (Language.PureScript.Names.ProperName a) instance Codec.Serialise.Class.Serialise Language.PureScript.Names.ModuleName instance GHC.Generics.Generic Language.PureScript.Names.ModuleName instance GHC.Classes.Ord Language.PureScript.Names.ModuleName instance GHC.Classes.Eq Language.PureScript.Names.ModuleName instance GHC.Show.Show Language.PureScript.Names.ModuleName instance GHC.Generics.Generic Language.PureScript.Names.Name instance GHC.Show.Show Language.PureScript.Names.Name instance GHC.Classes.Ord Language.PureScript.Names.Name instance GHC.Classes.Eq Language.PureScript.Names.Name instance GHC.Generics.Generic (Language.PureScript.Names.Qualified a) instance Data.Traversable.Traversable Language.PureScript.Names.Qualified instance Data.Foldable.Foldable Language.PureScript.Names.Qualified instance GHC.Base.Functor Language.PureScript.Names.Qualified instance GHC.Classes.Ord a => GHC.Classes.Ord (Language.PureScript.Names.Qualified a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.PureScript.Names.Qualified a) instance GHC.Show.Show a => GHC.Show.Show (Language.PureScript.Names.Qualified a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.PureScript.Names.Qualified a) instance Codec.Serialise.Class.Serialise a => Codec.Serialise.Class.Serialise (Language.PureScript.Names.Qualified a) instance Control.DeepSeq.NFData Language.PureScript.Names.Name instance Codec.Serialise.Class.Serialise Language.PureScript.Names.Name instance Control.DeepSeq.NFData Language.PureScript.Names.ModuleName instance Control.DeepSeq.NFData (Language.PureScript.Names.ProperName a) instance Codec.Serialise.Class.Serialise (Language.PureScript.Names.ProperName a) instance Data.Aeson.Types.ToJSON.ToJSON (Language.PureScript.Names.ProperName a) instance Data.Aeson.Types.FromJSON.FromJSON (Language.PureScript.Names.ProperName a) instance Control.DeepSeq.NFData (Language.PureScript.Names.OpName a) instance Codec.Serialise.Class.Serialise (Language.PureScript.Names.OpName a) instance Data.Aeson.Types.ToJSON.ToJSON (Language.PureScript.Names.OpName a) instance Data.Aeson.Types.FromJSON.FromJSON (Language.PureScript.Names.OpName a) instance Control.DeepSeq.NFData Language.PureScript.Names.Ident instance Codec.Serialise.Class.Serialise Language.PureScript.Names.Ident -- | Various constants which refer to things in Prim module Language.PureScript.Constants.Prim undefined :: forall a. IsString a => a partial :: forall a. IsString a => a pattern Prim :: ModuleName pattern Partial :: Qualified (ProperName 'ClassName) pattern Record :: Qualified (ProperName 'TypeName) pattern Type :: Qualified (ProperName 'TypeName) pattern Constraint :: Qualified (ProperName 'TypeName) pattern Function :: Qualified (ProperName 'TypeName) pattern Array :: Qualified (ProperName 'TypeName) pattern Row :: Qualified (ProperName 'TypeName) pattern PrimBoolean :: ModuleName booleanTrue :: Qualified (ProperName 'TypeName) booleanFalse :: Qualified (ProperName 'TypeName) pattern PrimCoerce :: ModuleName pattern Coercible :: Qualified (ProperName 'ClassName) pattern PrimOrdering :: ModuleName orderingLT :: Qualified (ProperName 'TypeName) orderingEQ :: Qualified (ProperName 'TypeName) orderingGT :: Qualified (ProperName 'TypeName) pattern PrimRow :: ModuleName pattern RowUnion :: Qualified (ProperName 'ClassName) pattern RowNub :: Qualified (ProperName 'ClassName) pattern RowCons :: Qualified (ProperName 'ClassName) pattern RowLacks :: Qualified (ProperName 'ClassName) pattern PrimRowList :: ModuleName pattern RowToList :: Qualified (ProperName 'ClassName) pattern RowListNil :: Qualified (ProperName 'TypeName) pattern RowListCons :: Qualified (ProperName 'TypeName) pattern PrimSymbol :: ModuleName pattern SymbolCompare :: Qualified (ProperName 'ClassName) pattern SymbolAppend :: Qualified (ProperName 'ClassName) pattern SymbolCons :: Qualified (ProperName 'ClassName) pattern PrimTypeError :: ModuleName pattern Fail :: Qualified (ProperName 'ClassName) pattern Warn :: Qualified (ProperName 'ClassName) primModules :: [ModuleName] typ :: forall a. IsString a => a kindBoolean :: forall a. IsString a => a kindOrdering :: forall a. IsString a => a kindRowList :: forall a. IsString a => a symbol :: forall a. IsString a => a doc :: forall a. IsString a => a row :: forall a. IsString a => a constraint :: forall a. IsString a => a prim :: forall a. IsString a => a moduleBoolean :: forall a. IsString a => a moduleCoerce :: forall a. IsString a => a moduleOrdering :: forall a. IsString a => a moduleRow :: forall a. IsString a => a moduleRowList :: forall a. IsString a => a moduleSymbol :: forall a. IsString a => a typeError :: forall a. IsString a => a module Language.PureScript.PSString -- | Strings in PureScript are sequences of UTF-16 code units, which do not -- necessarily represent UTF-16 encoded text. For example, it is -- permissible for a string to contain *lone surrogates,* i.e. characters -- in the range U+D800 to U+DFFF which do not appear as a part of a -- surrogate pair. -- -- The Show instance for PSString produces a string literal which would -- represent the same data were it inserted into a PureScript source -- file. -- -- Because JSON parsers vary wildly in terms of how they deal with lone -- surrogates in JSON strings, the ToJSON instance for PSString produces -- JSON strings where that would be safe (i.e. when there are no lone -- surrogates), and arrays of UTF-16 code units (integers) otherwise. data PSString toUTF16CodeUnits :: PSString -> [Word16] -- | Attempt to decode a PSString as UTF-16 text. This will fail (returning -- Nothing) if the argument contains lone surrogates. decodeString :: PSString -> Maybe Text -- | Decode a PSString as UTF-16. Lone surrogates in the input are -- represented in the output with the Left constructor; characters which -- were successfully decoded are represented with the Right constructor. decodeStringEither :: PSString -> [Either Word16 Char] -- | Decode a PSString as UTF-16 text. Lone surrogates will be replaced -- with U+FFFD REPLACEMENT CHARACTER decodeStringWithReplacement :: PSString -> String -- | Pretty print a PSString, using PureScript escape sequences. prettyPrintString :: PSString -> Text -- | Pretty print a PSString, using JavaScript escape sequences. Intended -- for use in compiled JS output. prettyPrintStringJS :: PSString -> Text mkString :: Text -> PSString instance GHC.Generics.Generic Language.PureScript.PSString.PSString instance GHC.Base.Monoid Language.PureScript.PSString.PSString instance GHC.Base.Semigroup Language.PureScript.PSString.PSString instance GHC.Classes.Ord Language.PureScript.PSString.PSString instance GHC.Classes.Eq Language.PureScript.PSString.PSString instance Control.DeepSeq.NFData Language.PureScript.PSString.PSString instance Codec.Serialise.Class.Serialise Language.PureScript.PSString.PSString instance GHC.Show.Show Language.PureScript.PSString.PSString instance Data.String.IsString Language.PureScript.PSString.PSString instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.PSString.PSString instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.PSString.PSString module Language.PureScript.Label -- | Labels are used as record keys and row entry names. Labels newtype -- PSString because records are indexable by PureScript strings at -- runtime. newtype Label Label :: PSString -> Label [runLabel] :: Label -> PSString instance GHC.Generics.Generic Language.PureScript.Label.Label instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.Label.Label instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.Label.Label instance GHC.Base.Monoid Language.PureScript.Label.Label instance GHC.Base.Semigroup Language.PureScript.Label.Label instance Data.String.IsString Language.PureScript.Label.Label instance GHC.Classes.Ord Language.PureScript.Label.Label instance GHC.Classes.Eq Language.PureScript.Label.Label instance GHC.Show.Show Language.PureScript.Label.Label instance Control.DeepSeq.NFData Language.PureScript.Label.Label instance Codec.Serialise.Class.Serialise Language.PureScript.Label.Label -- | The core functional representation for literal values. module Language.PureScript.AST.Literals -- | Data type for literal values. Parameterised so it can be used for -- Exprs and Binders. data Literal a -- | A numeric literal NumericLiteral :: Either Integer Double -> Literal a -- | A string literal StringLiteral :: PSString -> Literal a -- | A character literal CharLiteral :: Char -> Literal a -- | A boolean literal BooleanLiteral :: Bool -> Literal a -- | An array literal ArrayLiteral :: [a] -> Literal a -- | An object literal ObjectLiteral :: [(PSString, a)] -> Literal a instance GHC.Base.Functor Language.PureScript.AST.Literals.Literal instance GHC.Show.Show a => GHC.Show.Show (Language.PureScript.AST.Literals.Literal a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Language.PureScript.AST.Literals.Literal a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.PureScript.AST.Literals.Literal a) -- | Data types for roles. module Language.PureScript.Roles -- | The role of a type constructor's parameter. data Role -- | This parameter's identity affects the representation of the type it is -- parameterising. Nominal :: Role -- | This parameter's representation affects the representation of the type -- it is parameterising. Representational :: Role -- | This parameter has no effect on the representation of the type it is -- parameterising. Phantom :: Role displayRole :: Role -> Text instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.Roles.Role instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.Roles.Role instance GHC.Generics.Generic Language.PureScript.Roles.Role instance GHC.Classes.Ord Language.PureScript.Roles.Role instance GHC.Classes.Eq Language.PureScript.Roles.Role instance GHC.Show.Show Language.PureScript.Roles.Role instance Control.DeepSeq.NFData Language.PureScript.Roles.Role instance Codec.Serialise.Class.Serialise Language.PureScript.Roles.Role -- | Common functions for implementing generic traversals module Language.PureScript.Traversals fstM :: Functor f => (a -> f c) -> (a, b) -> f (c, b) sndM :: Functor f => (b -> f c) -> (a, b) -> f (a, c) thirdM :: Functor f => (c -> f d) -> (a, b, c) -> f (a, b, d) pairM :: Applicative f => (a -> f c) -> (b -> f d) -> (a, b) -> f (c, d) maybeM :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) eitherM :: Applicative f => (a -> f c) -> (b -> f d) -> Either a b -> f (Either c d) defS :: Monad m => st -> val -> m (st, val) -- | Data types for types module Language.PureScript.Types type SourceType = Type SourceAnn type SourceConstraint = Constraint SourceAnn -- | An identifier for the scope of a skolem variable newtype SkolemScope SkolemScope :: Int -> SkolemScope [runSkolemScope] :: SkolemScope -> Int -- | The type of types data Type a -- | A unification variable of type Type TUnknown :: a -> Int -> Type a -- | A named type variable TypeVar :: a -> Text -> Type a -- | A type-level string TypeLevelString :: a -> PSString -> Type a -- | A type wildcard, as would appear in a partial type synonym TypeWildcard :: a -> Maybe Text -> Type a -- | A type constructor TypeConstructor :: a -> Qualified (ProperName 'TypeName) -> Type a -- | A type operator. This will be desugared into a type constructor during -- the "operators" phase of desugaring. TypeOp :: a -> Qualified (OpName 'TypeOpName) -> Type a -- | A type application TypeApp :: a -> Type a -> Type a -> Type a -- | Explicit kind application KindApp :: a -> Type a -> Type a -> Type a -- | Forall quantifier ForAll :: a -> Text -> Maybe (Type a) -> Type a -> Maybe SkolemScope -> Type a -- | A type with a set of type class constraints ConstrainedType :: a -> Constraint a -> Type a -> Type a -- | A skolem constant Skolem :: a -> Text -> Maybe (Type a) -> Int -> SkolemScope -> Type a -- | An empty row REmpty :: a -> Type a -- | A non-empty row RCons :: a -> Label -> Type a -> Type a -> Type a -- | A type with a kind annotation KindedType :: a -> Type a -> Type a -> Type a -- | Binary operator application. During the rebracketing phase of -- desugaring, this data constructor will be removed. BinaryNoParensType :: a -> Type a -> Type a -> Type a -> Type a -- | Explicit parentheses. During the rebracketing phase of desugaring, -- this data constructor will be removed. -- -- Note: although it seems this constructor is not used, it _is_ useful, -- since it prevents certain traversals from matching. ParensInType :: a -> Type a -> Type a srcTUnknown :: Int -> SourceType srcTypeVar :: Text -> SourceType srcTypeLevelString :: PSString -> SourceType srcTypeWildcard :: SourceType srcTypeConstructor :: Qualified (ProperName 'TypeName) -> SourceType srcTypeOp :: Qualified (OpName 'TypeOpName) -> SourceType srcTypeApp :: SourceType -> SourceType -> SourceType srcKindApp :: SourceType -> SourceType -> SourceType srcForAll :: Text -> Maybe SourceType -> SourceType -> Maybe SkolemScope -> SourceType srcConstrainedType :: SourceConstraint -> SourceType -> SourceType srcREmpty :: SourceType srcRCons :: Label -> SourceType -> SourceType -> SourceType srcKindedType :: SourceType -> SourceType -> SourceType srcBinaryNoParensType :: SourceType -> SourceType -> SourceType -> SourceType srcParensInType :: SourceType -> SourceType pattern REmptyKinded :: forall a. a -> Maybe (Type a) -> Type a toREmptyKinded :: forall a. Type a -> Maybe (a, Maybe (Type a)) isREmpty :: forall a. Type a -> Bool -- | Additional data relevant to type class constraints data ConstraintData -- | Data to accompany a Partial constraint generated by the exhaustivity -- checker. It contains (rendered) binder information for those binders -- which were not matched, and a flag indicating whether the list was -- truncated or not. Note: we use Text here because using -- Binder would introduce a cyclic dependency in the module -- graph. PartialConstraintData :: [[Text]] -> Bool -> ConstraintData -- | A typeclass constraint data Constraint a Constraint :: a -> Qualified (ProperName 'ClassName) -> [Type a] -> [Type a] -> Maybe ConstraintData -> Constraint a -- | constraint annotation [constraintAnn] :: Constraint a -> a -- | constraint class name [constraintClass] :: Constraint a -> Qualified (ProperName 'ClassName) -- | kind arguments [constraintKindArgs] :: Constraint a -> [Type a] -- | type arguments [constraintArgs] :: Constraint a -> [Type a] -- | additional data relevant to this constraint [constraintData] :: Constraint a -> Maybe ConstraintData srcConstraint :: Qualified (ProperName 'ClassName) -> [SourceType] -> [SourceType] -> Maybe ConstraintData -> SourceConstraint mapConstraintArgs :: ([Type a] -> [Type a]) -> Constraint a -> Constraint a overConstraintArgs :: Functor f => ([Type a] -> f [Type a]) -> Constraint a -> f (Constraint a) mapConstraintKindArgs :: ([Type a] -> [Type a]) -> Constraint a -> Constraint a overConstraintKindArgs :: Functor f => ([Type a] -> f [Type a]) -> Constraint a -> f (Constraint a) mapConstraintArgsAll :: ([Type a] -> [Type a]) -> Constraint a -> Constraint a overConstraintArgsAll :: Applicative f => ([Type a] -> f [Type a]) -> Constraint a -> f (Constraint a) constraintDataToJSON :: ConstraintData -> Value constraintToJSON :: (a -> Value) -> Constraint a -> Value typeToJSON :: forall a. (a -> Value) -> Type a -> Value constraintDataFromJSON :: Value -> Parser ConstraintData constraintFromJSON :: forall a. Parser a -> (Value -> Parser a) -> Value -> Parser (Constraint a) typeFromJSON :: forall a. Parser a -> (Value -> Parser a) -> Value -> Parser (Type a) data RowListItem a RowListItem :: a -> Label -> Type a -> RowListItem a [rowListAnn] :: RowListItem a -> a [rowListLabel] :: RowListItem a -> Label [rowListType] :: RowListItem a -> Type a srcRowListItem :: Label -> SourceType -> RowListItem SourceAnn -- | Convert a row to a list of pairs of labels and types rowToList :: Type a -> ([RowListItem a], Type a) -- | Convert a row to a list of pairs of labels and types, sorted by the -- labels. rowToSortedList :: Type a -> ([RowListItem a], Type a) -- | Convert a list of labels and types to a row rowFromList :: ([RowListItem a], Type a) -> Type a -- | Align two rows of types, splitting them into three parts: -- --
-- type role T representational phantom ---- -- In this example, T is the identifier and -- [representational, phantom] is the list of roles (T -- presumably having two parameters). data RoleDeclarationData RoleDeclarationData :: !SourceAnn -> !ProperName 'TypeName -> ![Role] -> RoleDeclarationData [rdeclSourceAnn] :: RoleDeclarationData -> !SourceAnn [rdeclIdent] :: RoleDeclarationData -> !ProperName 'TypeName [rdeclRoles] :: RoleDeclarationData -> ![Role] -- | A type declaration assigns a type to an identifier, eg: -- --
-- identity :: forall a. a -> a ---- -- In this example identity is the identifier and forall a. -- a -> a the type. data TypeDeclarationData TypeDeclarationData :: !SourceAnn -> !Ident -> !SourceType -> TypeDeclarationData [tydeclSourceAnn] :: TypeDeclarationData -> !SourceAnn [tydeclIdent] :: TypeDeclarationData -> !Ident [tydeclType] :: TypeDeclarationData -> !SourceType overTypeDeclaration :: (TypeDeclarationData -> TypeDeclarationData) -> Declaration -> Declaration getTypeDeclaration :: Declaration -> Maybe TypeDeclarationData unwrapTypeDeclaration :: TypeDeclarationData -> (Ident, SourceType) -- | A value declaration assigns a name and potential binders, to an -- expression (or multiple guarded expressions). -- --
-- double x = x + x ---- -- In this example double is the identifier, x is a -- binder and x + x is the expression. data ValueDeclarationData a ValueDeclarationData :: !SourceAnn -> !Ident -> !NameKind -> ![Binder] -> !a -> ValueDeclarationData a [valdeclSourceAnn] :: ValueDeclarationData a -> !SourceAnn -- | The declared value's name [valdeclIdent] :: ValueDeclarationData a -> !Ident -- | Whether or not this value is exported/visible [valdeclName] :: ValueDeclarationData a -> !NameKind [valdeclBinders] :: ValueDeclarationData a -> ![Binder] [valdeclExpression] :: ValueDeclarationData a -> !a overValueDeclaration :: (ValueDeclarationData [GuardedExpr] -> ValueDeclarationData [GuardedExpr]) -> Declaration -> Declaration getValueDeclaration :: Declaration -> Maybe (ValueDeclarationData [GuardedExpr]) pattern ValueDecl :: SourceAnn -> Ident -> NameKind -> [Binder] -> [GuardedExpr] -> Declaration data DataConstructorDeclaration DataConstructorDeclaration :: !SourceAnn -> !ProperName 'ConstructorName -> ![(Ident, SourceType)] -> DataConstructorDeclaration [dataCtorAnn] :: DataConstructorDeclaration -> !SourceAnn [dataCtorName] :: DataConstructorDeclaration -> !ProperName 'ConstructorName [dataCtorFields] :: DataConstructorDeclaration -> ![(Ident, SourceType)] mapDataCtorFields :: ([(Ident, SourceType)] -> [(Ident, SourceType)]) -> DataConstructorDeclaration -> DataConstructorDeclaration traverseDataCtorFields :: Monad m => ([(Ident, SourceType)] -> m [(Ident, SourceType)]) -> DataConstructorDeclaration -> m DataConstructorDeclaration -- | The data type of declarations data Declaration -- | A data type declaration (data or newtype, name, arguments, data -- constructors) DataDeclaration :: SourceAnn -> DataDeclType -> ProperName 'TypeName -> [(Text, Maybe SourceType)] -> [DataConstructorDeclaration] -> Declaration -- | A minimal mutually recursive set of data type declarations DataBindingGroupDeclaration :: NonEmpty Declaration -> Declaration -- | A type synonym declaration (name, arguments, type) TypeSynonymDeclaration :: SourceAnn -> ProperName 'TypeName -> [(Text, Maybe SourceType)] -> SourceType -> Declaration -- | A kind signature declaration KindDeclaration :: SourceAnn -> KindSignatureFor -> ProperName 'TypeName -> SourceType -> Declaration -- | A role declaration (name, roles) RoleDeclaration :: {-# UNPACK #-} !RoleDeclarationData -> Declaration -- | A type declaration for a value (name, ty) TypeDeclaration :: {-# UNPACK #-} !TypeDeclarationData -> Declaration -- | A value declaration (name, top-level binders, optional guard, value) ValueDeclaration :: {-# UNPACK #-} !ValueDeclarationData [GuardedExpr] -> Declaration -- | A declaration paired with pattern matching in let-in expression -- (binder, optional guard, value) BoundValueDeclaration :: SourceAnn -> Binder -> Expr -> Declaration -- | A minimal mutually recursive set of value declarations BindingGroupDeclaration :: NonEmpty ((SourceAnn, Ident), NameKind, Expr) -> Declaration -- | A foreign import declaration (name, type) ExternDeclaration :: SourceAnn -> Ident -> SourceType -> Declaration -- | A data type foreign import (name, kind) ExternDataDeclaration :: SourceAnn -> ProperName 'TypeName -> SourceType -> Declaration -- | A fixity declaration FixityDeclaration :: SourceAnn -> Either ValueFixity TypeFixity -> Declaration -- | A module import (module name, qualifiedunqualifiedhiding, -- optional "qualified as" name) ImportDeclaration :: SourceAnn -> ModuleName -> ImportDeclarationType -> Maybe ModuleName -> Declaration -- | A type class declaration (name, argument, implies, member -- declarations) TypeClassDeclaration :: SourceAnn -> ProperName 'ClassName -> [(Text, Maybe SourceType)] -> [SourceConstraint] -> [FunctionalDependency] -> [Declaration] -> Declaration -- | A type instance declaration (instance chain, chain index, name, -- dependencies, class name, instance types, member declarations) TypeInstanceDeclaration :: SourceAnn -> [Ident] -> Integer -> Ident -> [SourceConstraint] -> Qualified (ProperName 'ClassName) -> [SourceType] -> TypeInstanceBody -> Declaration data ValueFixity ValueFixity :: Fixity -> Qualified (Either Ident (ProperName 'ConstructorName)) -> OpName 'ValueOpName -> ValueFixity data TypeFixity TypeFixity :: Fixity -> Qualified (ProperName 'TypeName) -> OpName 'TypeOpName -> TypeFixity pattern ValueFixityDeclaration :: SourceAnn -> Fixity -> Qualified (Either Ident (ProperName 'ConstructorName)) -> OpName 'ValueOpName -> Declaration pattern TypeFixityDeclaration :: SourceAnn -> Fixity -> Qualified (ProperName 'TypeName) -> OpName 'TypeOpName -> Declaration -- | The members of a type class instance declaration data TypeInstanceBody -- | This is a derived instance DerivedInstance :: TypeInstanceBody -- | This is an instance derived from a newtype NewtypeInstance :: TypeInstanceBody -- | This is an instance derived from a newtype, desugared to include a -- dictionary for the type under the newtype. NewtypeInstanceWithDictionary :: Expr -> TypeInstanceBody -- | This is a regular (explicit) instance ExplicitInstance :: [Declaration] -> TypeInstanceBody mapTypeInstanceBody :: ([Declaration] -> [Declaration]) -> TypeInstanceBody -> TypeInstanceBody -- | A traversal for TypeInstanceBody traverseTypeInstanceBody :: Applicative f => ([Declaration] -> f [Declaration]) -> TypeInstanceBody -> f TypeInstanceBody -- | What sort of declaration the kind signature applies to. data KindSignatureFor DataSig :: KindSignatureFor NewtypeSig :: KindSignatureFor TypeSynonymSig :: KindSignatureFor ClassSig :: KindSignatureFor declSourceAnn :: Declaration -> SourceAnn declSourceSpan :: Declaration -> SourceSpan declName :: Declaration -> Maybe Name -- | Test if a declaration is a value declaration isValueDecl :: Declaration -> Bool -- | Test if a declaration is a data type declaration isDataDecl :: Declaration -> Bool -- | Test if a declaration is a type synonym declaration isTypeSynonymDecl :: Declaration -> Bool -- | Test if a declaration is a module import isImportDecl :: Declaration -> Bool -- | Test if a declaration is a role declaration isRoleDecl :: Declaration -> Bool -- | Test if a declaration is a data type foreign import isExternDataDecl :: Declaration -> Bool -- | Test if a declaration is a fixity declaration isFixityDecl :: Declaration -> Bool getFixityDecl :: Declaration -> Maybe (Either ValueFixity TypeFixity) -- | Test if a declaration is a foreign import isExternDecl :: Declaration -> Bool -- | Test if a declaration is a type class instance declaration isTypeClassInstanceDecl :: Declaration -> Bool -- | Test if a declaration is a type class declaration isTypeClassDecl :: Declaration -> Bool -- | Test if a declaration is a kind signature declaration. isKindDecl :: Declaration -> Bool -- | Recursively flatten data binding groups in the list of declarations flattenDecls :: [Declaration] -> [Declaration] -- | A guard is just a boolean-valued expression that appears alongside a -- set of binders data Guard ConditionGuard :: Expr -> Guard PatternGuard :: Binder -> Expr -> Guard -- | The right hand side of a binder in value declarations and case -- expressions. data GuardedExpr GuardedExpr :: [Guard] -> Expr -> GuardedExpr pattern MkUnguarded :: Expr -> GuardedExpr -- | Data type for expressions and terms data Expr -- | A literal value Literal :: SourceSpan -> Literal Expr -> Expr -- | A prefix -, will be desugared UnaryMinus :: SourceSpan -> Expr -> Expr -- | Binary operator application. During the rebracketing phase of -- desugaring, this data constructor will be removed. BinaryNoParens :: Expr -> Expr -> Expr -> Expr -- | Explicit parentheses. During the rebracketing phase of desugaring, -- this data constructor will be removed. -- -- Note: although it seems this constructor is not used, it _is_ useful, -- since it prevents certain traversals from matching. Parens :: Expr -> Expr -- | An record property accessor expression (e.g. `obj.x` or `_.x`). -- Anonymous arguments will be removed during desugaring and expanded -- into a lambda that reads a property from a record. Accessor :: PSString -> Expr -> Expr -- | Partial record update ObjectUpdate :: Expr -> [(PSString, Expr)] -> Expr -- | Object updates with nested support: `x { foo { bar = e } }` Replaced -- during desugaring into a Let and nested ObjectUpdates ObjectUpdateNested :: Expr -> PathTree Expr -> Expr -- | Function introduction Abs :: Binder -> Expr -> Expr -- | Function application App :: Expr -> Expr -> Expr -- | Hint that an expression is unused. This is used to ignore type class -- dictionaries that are necessarily empty. The inner expression lets us -- solve subgoals before eliminating the whole expression. The code gen -- will render this as undefined, regardless of what the inner -- expression is. Unused :: Expr -> Expr -- | Variable Var :: SourceSpan -> Qualified Ident -> Expr -- | An operator. This will be desugared into a function during the -- "operators" phase of desugaring. Op :: SourceSpan -> Qualified (OpName 'ValueOpName) -> Expr -- | Conditional (if-then-else expression) IfThenElse :: Expr -> Expr -> Expr -> Expr -- | A data constructor Constructor :: SourceSpan -> Qualified (ProperName 'ConstructorName) -> Expr -- | A case expression. During the case expansion phase of desugaring, -- top-level binders will get desugared into case expressions, hence the -- need for guards and multiple binders per branch here. Case :: [Expr] -> [CaseAlternative] -> Expr -- | A value with a type annotation TypedValue :: Bool -> Expr -> SourceType -> Expr -- | A let binding Let :: WhereProvenance -> [Declaration] -> Expr -> Expr -- | A do-notation block Do :: Maybe ModuleName -> [DoNotationElement] -> Expr -- | An ado-notation block Ado :: Maybe ModuleName -> [DoNotationElement] -> Expr -> Expr -- | An application of a typeclass dictionary constructor. The value should -- be an ObjectLiteral. TypeClassDictionaryConstructorApp :: Qualified (ProperName 'ClassName) -> Expr -> Expr -- | A placeholder for a type class dictionary to be inserted later. At the -- end of type checking, these placeholders will be replaced with actual -- expressions representing type classes dictionaries which can be -- evaluated at runtime. The constructor arguments represent (in order): -- whether or not to look at superclass implementations when searching -- for a dictionary, the type class name and instance type, and the type -- class dictionaries in scope. TypeClassDictionary :: SourceConstraint -> Map (Maybe ModuleName) (Map (Qualified (ProperName 'ClassName)) (Map (Qualified Ident) (NonEmpty NamedDict))) -> [ErrorMessageHint] -> Expr -- | A typeclass dictionary accessor, the implementation is left -- unspecified until CoreFn desugaring. TypeClassDictionaryAccessor :: Qualified (ProperName 'ClassName) -> Ident -> Expr -- | A placeholder for a superclass dictionary to be turned into a -- TypeClassDictionary during typechecking DeferredDictionary :: Qualified (ProperName 'ClassName) -> [SourceType] -> Expr -- | A placeholder for an anonymous function argument AnonymousArgument :: Expr -- | A typed hole that will be turned into a hint/error during typechecking Hole :: Text -> Expr -- | A value with source position information PositionedValue :: SourceSpan -> [Comment] -> Expr -> Expr -- | Metadata that tells where a let binding originated data WhereProvenance -- | The let binding was originally a where clause FromWhere :: WhereProvenance -- | The let binding was always a let binding FromLet :: WhereProvenance -- | An alternative in a case statement data CaseAlternative CaseAlternative :: [Binder] -> [GuardedExpr] -> CaseAlternative -- | A collection of binders with which to match the inputs [caseAlternativeBinders] :: CaseAlternative -> [Binder] -- | The result expression or a collect of guarded expressions [caseAlternativeResult] :: CaseAlternative -> [GuardedExpr] -- | A statement in a do-notation block data DoNotationElement -- | A monadic value without a binder DoNotationValue :: Expr -> DoNotationElement -- | A monadic value with a binder DoNotationBind :: Binder -> Expr -> DoNotationElement -- | A let statement, i.e. a pure value with a binder DoNotationLet :: [Declaration] -> DoNotationElement -- | A do notation element with source position information PositionedDoNotationElement :: SourceSpan -> [Comment] -> DoNotationElement -> DoNotationElement newtype PathTree t PathTree :: AssocList PSString (PathNode t) -> PathTree t data PathNode t Leaf :: t -> PathNode t Branch :: PathTree t -> PathNode t newtype AssocList k t AssocList :: [(k, t)] -> AssocList k t [runAssocList] :: AssocList k t -> [(k, t)] isTrueExpr :: Expr -> Bool instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.AST.Declarations.ExportSource instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.AST.Declarations.ExportSource instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.AST.Declarations.ImportDeclarationType instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.AST.Declarations.ImportDeclarationType instance Data.Aeson.Types.ToJSON.ToJSON Language.PureScript.AST.Declarations.DeclarationRef instance Data.Aeson.Types.FromJSON.FromJSON Language.PureScript.AST.Declarations.DeclarationRef instance GHC.Show.Show Language.PureScript.AST.Declarations.TypeSearch instance GHC.Classes.Eq Language.PureScript.AST.Declarations.HintCategory instance GHC.Show.Show Language.PureScript.AST.Declarations.HintCategory instance Codec.Serialise.Class.Serialise Language.PureScript.AST.Declarations.ExportSource instance Control.DeepSeq.NFData Language.PureScript.AST.Declarations.ExportSource instance GHC.Generics.Generic Language.PureScript.AST.Declarations.ExportSource instance GHC.Show.Show Language.PureScript.AST.Declarations.ExportSource instance GHC.Classes.Ord Language.PureScript.AST.Declarations.ExportSource instance GHC.Classes.Eq Language.PureScript.AST.Declarations.ExportSource instance Codec.Serialise.Class.Serialise Language.PureScript.AST.Declarations.DeclarationRef instance Control.DeepSeq.NFData Language.PureScript.AST.Declarations.DeclarationRef instance GHC.Generics.Generic Language.PureScript.AST.Declarations.DeclarationRef instance GHC.Show.Show Language.PureScript.AST.Declarations.DeclarationRef instance Codec.Serialise.Class.Serialise Language.PureScript.AST.Declarations.ImportDeclarationType instance GHC.Generics.Generic Language.PureScript.AST.Declarations.ImportDeclarationType instance GHC.Show.Show Language.PureScript.AST.Declarations.ImportDeclarationType instance GHC.Classes.Eq Language.PureScript.AST.Declarations.ImportDeclarationType instance GHC.Classes.Eq Language.PureScript.AST.Declarations.RoleDeclarationData instance GHC.Show.Show Language.PureScript.AST.Declarations.RoleDeclarationData instance GHC.Classes.Eq Language.PureScript.AST.Declarations.TypeDeclarationData instance GHC.Show.Show Language.PureScript.AST.Declarations.TypeDeclarationData instance Data.Traversable.Traversable Language.PureScript.AST.Declarations.ValueDeclarationData instance Data.Foldable.Foldable Language.PureScript.AST.Declarations.ValueDeclarationData instance GHC.Base.Functor Language.PureScript.AST.Declarations.ValueDeclarationData instance GHC.Show.Show a => GHC.Show.Show (Language.PureScript.AST.Declarations.ValueDeclarationData a) instance GHC.Classes.Eq Language.PureScript.AST.Declarations.DataConstructorDeclaration instance GHC.Show.Show Language.PureScript.AST.Declarations.DataConstructorDeclaration instance GHC.Show.Show Language.PureScript.AST.Declarations.ValueFixity instance GHC.Classes.Ord Language.PureScript.AST.Declarations.ValueFixity instance GHC.Classes.Eq Language.PureScript.AST.Declarations.ValueFixity instance GHC.Show.Show Language.PureScript.AST.Declarations.TypeFixity instance GHC.Classes.Ord Language.PureScript.AST.Declarations.TypeFixity instance GHC.Classes.Eq Language.PureScript.AST.Declarations.TypeFixity instance GHC.Show.Show Language.PureScript.AST.Declarations.KindSignatureFor instance GHC.Classes.Ord Language.PureScript.AST.Declarations.KindSignatureFor instance GHC.Classes.Eq Language.PureScript.AST.Declarations.KindSignatureFor instance GHC.Show.Show Language.PureScript.AST.Declarations.WhereProvenance instance Data.Traversable.Traversable (Language.PureScript.AST.Declarations.AssocList k) instance GHC.Base.Functor (Language.PureScript.AST.Declarations.AssocList k) instance Data.Foldable.Foldable (Language.PureScript.AST.Declarations.AssocList k) instance (GHC.Classes.Ord k, GHC.Classes.Ord t) => GHC.Classes.Ord (Language.PureScript.AST.Declarations.AssocList k t) instance (GHC.Classes.Eq k, GHC.Classes.Eq t) => GHC.Classes.Eq (Language.PureScript.AST.Declarations.AssocList k t) instance (GHC.Show.Show k, GHC.Show.Show t) => GHC.Show.Show (Language.PureScript.AST.Declarations.AssocList k t) instance Data.Traversable.Traversable Language.PureScript.AST.Declarations.PathNode instance Data.Foldable.Foldable Language.PureScript.AST.Declarations.PathNode instance GHC.Base.Functor Language.PureScript.AST.Declarations.PathNode instance GHC.Classes.Ord t => GHC.Classes.Ord (Language.PureScript.AST.Declarations.PathNode t) instance GHC.Classes.Eq t => GHC.Classes.Eq (Language.PureScript.AST.Declarations.PathNode t) instance GHC.Show.Show t => GHC.Show.Show (Language.PureScript.AST.Declarations.PathNode t) instance Data.Traversable.Traversable Language.PureScript.AST.Declarations.PathTree instance Data.Foldable.Foldable Language.PureScript.AST.Declarations.PathTree instance GHC.Base.Functor Language.PureScript.AST.Declarations.PathTree instance GHC.Classes.Ord t => GHC.Classes.Ord (Language.PureScript.AST.Declarations.PathTree t) instance GHC.Classes.Eq t => GHC.Classes.Eq (Language.PureScript.AST.Declarations.PathTree t) instance GHC.Show.Show t => GHC.Show.Show (Language.PureScript.AST.Declarations.PathTree t) instance GHC.Show.Show Language.PureScript.AST.Declarations.ErrorMessageHint instance GHC.Show.Show Language.PureScript.AST.Declarations.CaseAlternative instance GHC.Show.Show Language.PureScript.AST.Declarations.TypeInstanceBody instance GHC.Show.Show Language.PureScript.AST.Declarations.Guard instance GHC.Show.Show Language.PureScript.AST.Declarations.GuardedExpr instance GHC.Show.Show Language.PureScript.AST.Declarations.Declaration instance GHC.Show.Show Language.PureScript.AST.Declarations.DoNotationElement instance GHC.Show.Show Language.PureScript.AST.Declarations.Expr instance GHC.Show.Show Language.PureScript.AST.Declarations.Module instance GHC.Classes.Eq Language.PureScript.AST.Declarations.DeclarationRef instance GHC.Classes.Ord Language.PureScript.AST.Declarations.DeclarationRef -- | AST traversal helpers module Language.PureScript.AST.Traversals guardedExprM :: Applicative m => (Guard -> m Guard) -> (Expr -> m Expr) -> GuardedExpr -> m GuardedExpr mapGuardedExpr :: (Guard -> Guard) -> (Expr -> Expr) -> GuardedExpr -> GuardedExpr litM :: Monad m => (a -> m a) -> Literal a -> m (Literal a) everywhereOnValues :: (Declaration -> Declaration) -> (Expr -> Expr) -> (Binder -> Binder) -> (Declaration -> Declaration, Expr -> Expr, Binder -> Binder) everywhereOnValuesTopDownM :: forall m. Monad m => (Declaration -> m Declaration) -> (Expr -> m Expr) -> (Binder -> m Binder) -> (Declaration -> m Declaration, Expr -> m Expr, Binder -> m Binder) everywhereOnValuesM :: forall m. Monad m => (Declaration -> m Declaration) -> (Expr -> m Expr) -> (Binder -> m Binder) -> (Declaration -> m Declaration, Expr -> m Expr, Binder -> m Binder) everythingOnValues :: forall r. (r -> r -> r) -> (Declaration -> r) -> (Expr -> r) -> (Binder -> r) -> (CaseAlternative -> r) -> (DoNotationElement -> r) -> (Declaration -> r, Expr -> r, Binder -> r, CaseAlternative -> r, DoNotationElement -> r) everythingWithContextOnValues :: forall s r. s -> r -> (r -> r -> r) -> (s -> Declaration -> (s, r)) -> (s -> Expr -> (s, r)) -> (s -> Binder -> (s, r)) -> (s -> CaseAlternative -> (s, r)) -> (s -> DoNotationElement -> (s, r)) -> (Declaration -> r, Expr -> r, Binder -> r, CaseAlternative -> r, DoNotationElement -> r) everywhereWithContextOnValuesM :: forall m s. Monad m => s -> (s -> Declaration -> m (s, Declaration)) -> (s -> Expr -> m (s, Expr)) -> (s -> Binder -> m (s, Binder)) -> (s -> CaseAlternative -> m (s, CaseAlternative)) -> (s -> DoNotationElement -> m (s, DoNotationElement)) -> (Declaration -> m Declaration, Expr -> m Expr, Binder -> m Binder, CaseAlternative -> m CaseAlternative, DoNotationElement -> m DoNotationElement) data ScopedIdent LocalIdent :: Ident -> ScopedIdent ToplevelIdent :: Ident -> ScopedIdent inScope :: Ident -> Set ScopedIdent -> Bool everythingWithScope :: forall r. Monoid r => (Set ScopedIdent -> Declaration -> r) -> (Set ScopedIdent -> Expr -> r) -> (Set ScopedIdent -> Binder -> r) -> (Set ScopedIdent -> CaseAlternative -> r) -> (Set ScopedIdent -> DoNotationElement -> r) -> (Set ScopedIdent -> Declaration -> r, Set ScopedIdent -> Expr -> r, Set ScopedIdent -> Binder -> r, Set ScopedIdent -> CaseAlternative -> r, Set ScopedIdent -> DoNotationElement -> r) accumTypes :: Monoid r => (SourceType -> r) -> (Declaration -> r, Expr -> r, Binder -> r, CaseAlternative -> r, DoNotationElement -> r) -- | Map a function over type annotations appearing inside a value overTypes :: (SourceType -> SourceType) -> Expr -> Expr instance GHC.Classes.Ord Language.PureScript.AST.Traversals.ScopedIdent instance GHC.Classes.Eq Language.PureScript.AST.Traversals.ScopedIdent instance GHC.Show.Show Language.PureScript.AST.Traversals.ScopedIdent module Language.PureScript.AST.Exported -- | Return a list of all declarations which are exported from a module. -- This function descends into data declarations to filter out unexported -- data constructors, and also filters out type instance declarations if -- they refer to classes or types which are not themselves exported. -- -- Note that this function assumes that the module has already had its -- imports desugared using desugarImports. It will produce -- incorrect results if this is not the case - for example, type class -- instances will be incorrectly removed in some cases. -- -- The returned declarations are in the same order as they appear in the -- export list, unless there is no export list, in which case they appear -- in the same order as they do in the source file. exportedDeclarations :: Module -> [Declaration] -- | Test if a declaration is exported, given a module's export list. Note -- that this function does not account for type instance declarations of -- non-exported types, or non-exported data constructors. Therefore, you -- should prefer exportedDeclarations to this function, where -- possible. isExported :: Maybe [DeclarationRef] -> Declaration -> Bool -- | The initial PureScript AST module Language.PureScript.AST