[Haskell-cafe] Strong duck typing / structural subtyping / type class aliases / ??? in Haskell

wren ng thornton wren at freegeek.org
Fri Sep 25 23:39:24 EDT 2009

Peter Verswyvelen wrote:
> After having read an email in the cafe about the Noop language & Self
> language, I realized that what I really would like to have is "strong duck
> typing" on records (or is it called structural subtyping? or
> prototype-based-objects? or something like that)

The common name for (one form of) what you're seeking is "row polymorphism":


This is implemented in OCaml but, like most OO features in functional 
languages, it is often ignored or forgotten about. As others've 
mentioned, there are some cases where row polymorphism is really nice, 
but it's not always semantically coherent.

Live well,

More information about the Haskell-Cafe mailing list