purescript-0.15.7: PureScript Programming Language Compiler
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.PureScript.AST.Exported

Synopsis

Documentation

exportedDeclarations :: Module -> [Declaration] Source #

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.

Kind signatures declarations are also exported if their associated declaration is exported.

isExported :: Maybe [DeclarationRef] -> Declaration -> Bool Source #

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.