virtual functions
23 Nov
2001
23 Nov
'01
11:54 p.m.
Hi, I seek an elegant solution to introduce in Haskell code (with GHC as it is currently) with capabilities akin to virtual functions in C++. Say, I have a module with functions for serial operations. I want to introduce another module with distributed operations but maintain function names. Polymorphism should resolve which underlying function is to be called by checking whether the caller wants to perform operations on a serial or a distributed structure. Example, sum sums elements in a local list. sum in the distributed module works on distributed lists. A third sum should sit on top of things and be visible to the user which chooses which sum is being talked about based on context. Cheers Rahul
9046
Age (days ago)
9046
Last active (days ago)
0 comments
1 participants
participants (1)
-
Rahul Bhargava