User loginNavigation |
Extensible tuples?I've been mulling over a language design issue which would be nicely solved if tuples behaved like a monoid. Is anyone aware of a language where tuples can be arbitrarily extended? For example, if # is the tuple extension operator:
f :: a -> b -> a#b
f x y = x # y
f 1 "dog" ==> (1,"dog")
f (1,"dog") true ==> (1,"dog",true)
f () ("dog", true) ==> ("dog", true)
It seems that type inference is still possible here, though I'm not sure exactly how it would work. (ie, how do you unify types a*b*c and d#e?) By Alex Rubinsteyn at 2008-11-10 05:33 | LtU Forum | previous forum topic | next forum topic | other blogs | 19481 reads
|
Browse archives
Active forum topics |
Recent comments
5 weeks 4 days ago
5 weeks 5 days ago
5 weeks 6 days ago
5 weeks 6 days ago
6 weeks 4 days ago
6 weeks 4 days ago
6 weeks 4 days ago
9 weeks 5 days ago
10 weeks 3 days ago
10 weeks 4 days ago