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.

  • Hery R. R.

    Hmm I missed the RDVP window. Any chance to get in still?

    August 12

    • John C.

      AFAIK the more the merrier, providing we don't run out of chairs.

      August 12

    • Hery R. R.

      Cool, thanks!

      August 12

  • John C.

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

    2 · July 23

  • 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

Our Sponsors


    Colocation and hosting in downtown Manhattan

People in this
Meetup are also in:

Imagine having a community behind you

Get started Learn more

We just grab a coffee and speak French. Some people have been coming every week for months... it creates a kind of warmth to the group.

Rafaël, started French Conversation Group

Start your Meetup today

Act now and get 50% off.
Until February 1.

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