[Ur] Signature Help
Adam Chlipala
adamc at impredicative.com
Mon May 9 17:36:03 EDT 2011
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.
More information about the Ur
mailing list