Elektrine lite

← Feed

@joe@f.duriansoftware.com

2026-10-20 17:58 UTC

@pervognsen@mastodon.social @zwarich@hachyderm.io @slava@mathstodon.xyz even by that metric, typeclasses are fairly parametric, in that they're basically an implicit `Dictionary a` parameter

Replies (2)

  • @pervognsen@mastodon.social 2026-10-20 18:01

    @joe@f.duriansoftware.com @zwarich@hachyderm.io @slava@mathstodon.xyz Yeah, key word being implicit! Instance inference has the same 'gather a bunch of non-local candidates' property as ad-hoc overloading.

    Open ##5166525

  • @zwarich@hachyderm.io 2026-10-20 18:00

    @joe@f.duriansoftware.com @pervognsen@mastodon.social @slava@mathstodon.xyz Strachey's original definition: > In ad hoc polymorphism there is no single systematic way of determining the type of the result from the type of the arguments. There may be several rules of limited extent which reduce the number of cases, but these are themselves ad hoc both in scope and content. All the ordinary arithmetic operators and functions come into this category. It seems, moreover, that the automatic insertion of transfer functions by the compiling system is limited to this class. In my mind, type classes are more like a single rule based on implicit parameters than "automatic insertion of transfer functions by the compiling system".

    Open ##5431296