Sitelet https://github.com/purescript/documentation/blob/master/errors/TransitiveExportError.md
Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 888 Bytes

File metadata and controls

45 lines (27 loc) · 888 Bytes

TransitiveExportError Error

Example

module Example (foo) where

data Bar

foo :: Bar -> Bar
foo x = x

Cause

This error occurs when one name is exported, but exporting that name requires some other name(s) to also be exported.

The example above generates the following error:

Error in module M:

An export for foo requires the following to also be exported:

Bar

PureScript requires any types appearing inside a type declaration to also be exported. Similar restrictions apply to things like type classes and type class member exports.

Fix

  • Follow the instructions in the error, and add the required names to the list of exports:

    module Example (foo, Bar) where
    
    data Bar
    
    foo :: Bar -> Bar
    foo x = x

Notes

See the language guide page on modules.