[m-dev.] documenting typed insts
jfischer at opturion.com
Tue Jan 7 20:39:42 AEDT 2020
On Tue, 7 Jan 2020, Zoltan Somogyi wrote:
> On Tue, 7 Jan 2020 19:48:31 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
>> 3. Since the intention is that insts will eventually be required to
>> be typed, documenting the syntax etc. would allow users to begin making
>> that transition now.
>> Is there any documentation for this feature about?
> No. The commit message says:
> There is no documentation of the new language extension yet, since it is
> not yet really useful. That would come later, when we check that an inst
> specified as for being for a specific type is used only on values
> of that type. We would also need to resolve the two issues marked with
> "XXX IFTC" in the diff.
Is that not done? If I do
:- type tm ---> walking ; cycling ; car.
:- type fruit ---> lemon ; orange ; apple.
:- inst citrus for fruit/0 ---> lemon ; walking.
I get an error about the inst defintion.
foo.m:010: Error: inst `citrus'/0 is declared to be for type `foo.fruit'/0, but
foo.m:010: its top level function symbol `walking'/0 is not a function symbol
foo.m:010: of that type.
Or is the commit message referring to something else?
More information about the developers