User loginNavigation |
Strange functionI was toying with an object system in Haskell and I encountered (created?) the following function: f :: Contains r r' => (r' -> (a,r')) -> (r -> (a,r)) where any value of r contains a value of r': the function is the best answer I have found so far to the problem of "casting" a value of r to its supertype r', doing some work on it that gives a value of type a and a new value of r' and then replacing the resulting r' into the original value of type r. To me this reminds some sort of binding, but I was wondering if anyone here more expert than me could suggest a better interpretation of this operation. By giuseppemag at 2010-05-11 20:43 | LtU Forum | previous forum topic | next forum topic | other blogs | 4608 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 19 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago