Skip to content

Feature Request: meta modules re-exporting a lot of definitions #153

@gallais

Description

@gallais

Would it make sense to define a meta module Data exporting a lot of the standard data structures? Because we can have a lot of functions with similar names in these various modules, it would only expose the type and its constructors (Agda can disambiguate them in a type-directed manner) and provide a short name to refer to the module itself.

For instance:

module Data where

import Data.Nat
import Data.Fin hiding (module Fin)
import Data.List
import Data.Vec hiding (module Vec)

module Nat = Data.Nat
open Nat using (ℕ ; zero ; suc) public
module Fin = Data.Fin
open Fin using (Fin ; zero ; suc) public
module List = Data.List
open List using (List ; [] ; _∷_) public
module Vec  = Data.Vec
open Vec using (Vec ; [] ; _∷_) public

-- etc.

We can also think of defining e.g. a Prelude module which would also re-export content Function, Relation.Binary.PropositionalEquality, etc. Basically all of the really useful modules.

This type of module which is purely re-exporting (potentially renamed) constants could also be relevant to #60: it'd be a way to provide saner naming conventions whilst maintaining backwards compatibility.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions