Closed yasuo-ozu closed 3 years ago
satysfi-azmath: 0.0.3 satysfi-highlight: 3d6bad
In ML, type identifiers such as result
can be shadowed so there can legally be 2 or more distinct types of the same name, though there's room to improve the error message.
Thanks for reporting. Which version of SATySFi did you use? I tried to reproduce the error, but I couldn’t see the same one by using v0.0.6
. A similar error has indeed occurred, however:
type checking 'option-ext.satyg' ...
! [Type Error] at "option-ext.satyg", line 7, character 0 to line 232, character 3:
The implementation of value 'ok-or' has type
'#a -> '#b option -> '#b '#a result
which is inconsistent with the type required by the signature
'#a -> '#b option -> '#b '#a result
Note: result
seems contained in satysfi-base
, not in satysfi-dist
.
It is possible that the result is a valid report of an error where two distinct type constructors named result
contradict each other, as @elpinal -san mentioned. Indeed, both satysfi-base
and satysfi-highlight
provide a type constructor named result
, so it is probably the case.
Also, I'm curious about the whole output of satysfi
command to know the exact ordering of files being typechecked, which will make the cause clear.
If the cause is the contradiction of two type constructors named result
, a simple workaround is to make (a forked version of) satysfi-highlight
dependent upon satysfi-base
and use result
contained in satysfi-base
instead of providing another result
.
More fundamental solution would be to redesign the module system of SATySFi so that name clashes can be avoided with more ease, but it seems taking several months; it is in progress now.
Sorry for late reply and thank you for the conversations. I understood that this problem is essentially not a problem of SATySFi. Later discussion about improvement of SATySFi's error message should be done in #262 .
I tried satysfi-highlight, and I encountered a strange error.
and error: