[Ur] Signature Help

David Snider david at davidsnider.net
Mon May 9 20:12:03 EDT 2011


My functions all work fine, they just don't have any signatures applied to
them yet. It compiles but isn't as strict as I might like.

What I'm actually doing is taking Gian's UrBlog example and giving it a
Drupal-like template system.

On Mon, 09 May 2011 17:36:03 -0400, Adam Chlipala <adamc at impredicative.com>
wrote:
> Marc Weber wrote:
>> Very often you can get close by aksing the compiler to give hints. Eg by
>>
>>
>> let
>>
>>    f :: string ->  int = fun x ->  x * x
>>
>> in f 20
>>
>> you see that string doesn't match the integer/float operation.
>> So the compiler will tell about a missmatch talking about what it
>> expects.
>>
> 
> Given David's problem, it should be even simpler to include a signature
> entry for the function in the .urs file, giving it type [int].  The
> compiler will surely complain about that and give the proper type.
> 
> BTW, readers should keep in mind that Marc's example above isn't using
> valid Ur/Web syntax. ;)
> 
> David, if you are having trouble writing your function in the first
> place, not just determining its type, feel free to ask again with more
> problem detail.
> 
> _______________________________________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur




More information about the Ur mailing list