Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: use type constructors outside a module #80

Open
nekketsuuu opened this issue May 29, 2018 · 1 comment
Open

Feature request: use type constructors outside a module #80

nekketsuuu opened this issue May 29, 2018 · 1 comment

Comments

@nekketsuuu
Copy link
Contributor

Currently, we cannot construct a value of a variant type defined in a module, outside the module. I want to use these constructors.

Example:

module M = struct type t = A end

% We cannot use M.A here
% let x = M.A  % <-- ! [Syntax Error at Lexer]: illegal token '.' in a program area

% M.t itself can be used
let-rec forever () = forever ()
let x : M.t = forever ()  % pass the type checking
@nekketsuuu
Copy link
Contributor Author

As of SATySFi 0.0.3, open of modules is implemented. Though the above example is failed as before, all examples in the following pass type checking.

% local open (1)
let x =
  open M in
  A
% local open (2)
let x = M.(A)
% global open
open M
let x = A

@gfngfn gfngfn added this to the v0.1.0 milestone Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants