addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

John Cowan on Comparators: A Dynamic Type Class for Scheme

Haskell type classes such as Eq and Ord provide an escape hatch from ML-style polymorphic static typing, allowing ad-hoc polymorphism of the functions defined in a type class.  They are implemented by GHC using a record of functions, one for each function declared in the type class.  While developing Scheme libraries for the ongoing R7RS-large standard, I found a need to parameterize collections such as sets and hash tables with appropriate monomorphic procedures applicable to their elements.  The implementation method evolved over time to converge on the same solution, made directly accessible to the Scheme programmer using a new data type: comparators, which are a dynamically typed equivalent of type class Ord.

Join or login to comment.

  • John C.

    Looking at the above, it looks pretty opaque and daunting. The talk won't be, so Don't Panic!

    2 · July 23, 2014

  • John C.

    And now (thanks to Raymond Lacaze and Jeff Parker) with extra added musical entertainment! Be there or be a prime number!

    1 · August 11, 2014

Our Sponsors


    Colocation and hosting in downtown Manhattan

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy