SATySFi icon indicating copy to clipboard operation
SATySFi copied to clipboard

Can't publish constructor

Open puripuri2100 opened this issue 4 years ago • 3 comments

module test : sig
  type t = Hoge | Fuga
end = struct
  type t = Hoge | Fuga
end

% ==>
% ! [Syntax Error at Parser] at "file.satyh", line 2, characters 9-10:

puripuri2100 avatar Sep 29 '19 02:09 puripuri2100

Same here, is this by design?

yuhr avatar Jul 19 '20 02:07 yuhr

Currently this is a limitation of SATySFi; a type including public constructors must be defined in the top level. But this is not by design, I suppose. @gfngfn said this is just "not implemented yet": https://twitter.com/bd_gfngfn/status/1178332243514646528.

nekketsuuu avatar Jul 19 '20 07:07 nekketsuuu

Currently this is a limitation of SATySFi; a type including public constructors must be defined in the top level.

Yes, it is. As said above, a simple workaround is to define the type in the top-level scope.

These days, however, I plan to extend SATySFi’s module system into the one based on F-ing modules [1]. Since this formalization supports the exposure of type definitions in modules, we will probably be able to provide such functionality.

References

  1. Andreas Rossberg, Claudio Russo, and Derek Dreyer. F-ing modules. Journal of Functional Programming, 24(5), pp. 529–607, 2014.

gfngfn avatar Jul 19 '20 11:07 gfngfn