FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow modules to re-export modules as qualified · Issue #2478 · purescript/purescript · GitHub

Allow modules to re-export modules as qualified #2478

Description

Suggestion from @natefaubion.

Something vaguely like:

module MyPrelude
  ( module Data.Map as M
  ...
  ) where

import Data.Map

Then you can:

import MyPrelude

myInsert = M.insert

or:

import MyPrelude as MP

myInsert = MP.M.insert

etc.

After giving it some thought, I think it would be pretty nice to have. I'm not sure exactly how we'd want to deal with the syntax for making it work in the exports though - I'd prefer not to have as M in the exports (using the same naming within the module as with what it exports is better I think), but also I don't think we want to automatically include qualification when an import has it, as it will prevent the current useful behaviour of:

module A
  ( ...
  , module Exports
  ) where

import Foo (x, y, z) as Exports
import Bar (a, b, c) as Exports

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL