purescript-0.11.2: PureScript Programming Language Compiler

Safe HaskellNone




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.

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.