[Ur] Simple type level function Name -> Name - are there funnier examples?
Marc Weber
marco-oweber at gmx.de
Tue Apr 12 22:12:31 EDT 2011
This is fun:
con change_name :: Name -> Name = fn _ => #Boo
con n2 :: Name = change_name #Arbitrary
val my_rec_abc : $[n2=int] = { Boo = 1 }
val my_rec_abc : {Boo : int} = my_rec_abc
however something more funny does no longer work:
con change_name_toggle :: Name -> Name = fn name =>
case name of
#Boo => #Bar
|#Bar => #Boo
So is there any way (more than one) to implement such function?
What else can be done with names? There are no operations such as
"prefix them with db_" or such, are there?
I'm trying to come up with samples for each line of the manual ..
Marc Weber
More information about the Ur
mailing list