Language.PureScript.AST.Exported

purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.AST.Exported

Synopsis

- exportedDeclarations :: Module -> [Declaration]
- isExported :: Maybe [DeclarationRef] -> Declaration -> Bool

# Documentation

exportedDeclarations :: Module -> [Declaration] #

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 #

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.