[Haskell-cafe] Request For Feedback: Emulating OO-style dispatch for binding ...

aditya siram aditya.siram at gmail.com
Tue Dec 16 18:41:09 UTC 2014


I am writing a GUI binding but unfortunately could not find a OO-style
dispatching scheme that I was happy with so I wrote my own (
https://gist.github.com/deech/6528a75e480378182052 ).

The design goal is to:
- provide a single function that will dispatch to a custom implementation
based on the type of argument it is given
- allow the user to extend and subclass the hierarchy and override
functions in a way that doesn't involve recompiling the binding
- use as few new extensions as possible
- provide as familiar an API as possible, thereby allowing users to
leverage existing documentation maintained by the C++ project.

The look-and-feel of the API is on lines 128-140.

It should just be a stand-alone file that can be loaded into GHCI.

Thanks for your feedback!
-deech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141216/dd3c49bf/attachment.html>


More information about the Haskell-Cafe mailing list