[m-users.] Higher-order predicates and functions and equivalence types.

Volker Wysk post at volker-wysk.de
Sat Aug 28 17:00:42 AEST 2021


Am Freitag, dem 27.08.2021 um 20:26 +0100 schrieb Sean Charles
(emacstheviking):
> Hi,
> 
> I have a type definition like this:
> 
> :- type tcon
>     --->    tcon(
>                 options  :: felt_options,
>                 output   :: list(rop),
>                 warnings :: lserror,
>                 errors   :: lserror,
>                 render   :: pred(instruction::in, string::in, string::out) is semidet
>                 % ENV[] stack can go in here too
>             ).
> 
> The `render` field, I wanted to be able to code this something like:
> 
>     render :: foo
> 
> where foo would have been defined as
> 
> :- type foo = (pred(instruction::in, string::in, string::out) is semidet).

I'm not sure, but you have the type and modes in your type "foo". I think
you can only have the type in a type synonym. You also need to equal signs.

Cheers,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20210828/38c94150/attachment.sig>


More information about the users mailing list