gleam-lang/gleam

Re-export types and values from other modules

オープン

#614 opened on 2020/05/28

 (27 件のコメント) (13 件のリアクション) (0 人の担当者)Rust (960 件のフォーク)batch import
discussionhelp wanted

Repository metrics

Stars
 (21,417 個のスター)
PR merge metrics
 (平均マージ 10d 19h) (30d で 69 merged PRs)

説明

It would be nice to be able to re-export a type or function from another module.

Here's an idea for a syntax:

// one.gleam
pub type MyType {
  MyConstructor
}

pub fn my_function() -> Nil {
  Nil
}
// two.gleam

import two.{pub MyType, pub MyConstructor, pub my_function}

Questions

Should it be permitted to export only a subset of a type's constructors? This would mean it would not possible for users to pattern match on all records as only some have been exported. The above syntax would allow that.

コントリビューターガイド