[Ur] Code reuse and type constraints

Adam Chlipala adamc at csail.mit.edu
Wed Feb 11 08:12:58 EST 2015


Oops, bitten again by special status for keywords!  I forgot that [SET] 
is a keyword (because it's an SQL keyword).  Changing to another 
identifier like [FSET] works.

On 02/11/2015 05:29 AM, Gabriel Riba wrote:
> Adam Chlipala <adamc <at> csail.mit.edu> writes:
>
>> The solution is again a standard ML idiom.
>>
>> signature SET = sig
>>     type item
>>     type t
>>     val empty: t
>>     val singleton : item -> t
>>     val insert: item -> t -> t
>>     val member: item -> t -> bool
>>     val foldr: b ::: Type -> (item -> b -> b) -> b -> t -> b
>> end
> Signature definitions (signature SET = sig ... end) make the parser fail. It
> works otherwise.



More information about the Ur mailing list