[Haskell-cafe] Actual levity polymorphism

Tom Ellis tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk
Mon Jan 2 13:49:15 UTC 2023


On Mon, Jan 02, 2023 at 02:01:56PM +0100, J. Reinders wrote:
> I think theoretically a type class is indeed all you need even for
> representation polymorphism. I believe that is what the Sixten
> language [1] does.
> 
> Currently GHC rejects any levity polymorphic function arguments and
> local binders. Issue #15532 [2] tracks the possibility of relaxing
> these restrictions. The type class approach is mentioned in that
> thread.
> 
> I seem to recall another thread where there were more suggestions
> like a special form of type classes that is always guaranteed to
> monomorphise away and another suggestion that functions that are
> always guaranteed to inline can also be allowed to be representation
> polymorphic. But I can’t find this thread again.

Very helpful info, thanks Jaro!


More information about the Haskell-Cafe mailing list