
It's a bit tiresome to have to do this -- it'd be easier for the
#14917: Allow levity polymorphism in binding position -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ericson2314): programmer to say that all polymorphism can be specialised in this way, as .NET does -- but I think that's out of reach for us. Once we have the monomorphizing quantifiers, I would advocate for a language proposal to infer runtime rep parameters and {{{TYPE r}}} where where {{{Type}}} is inferred today. (Someday, I want to rewrite the RTS in Haskell...without getting RSI from wrist typing boilerplate :D)
And there are only a finite number of possiblities for {{{r}}}
Well, we'd also like to use this to statically prevent dictionary passing, and constraints are in generate infinitely inhabited. Also it would be nice to unbox aggregates in collections, maybe reusing the unboxed tuple and sum representations. That also creates infinite choices for {{{r}}} in principle. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14917#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler