[Haskell-cafe] Actual levity polymorphism

Carter Schonwald carter.schonwald at gmail.com
Fri Jan 6 16:51:30 UTC 2023


i've written (more opaquely than i'd like), about this topic a few times ,
including on that ticket
https://gitlab.haskell.org/ghc/ghc/-/issues/14917#note_230433 !

ultimately, you want some notion of function types /lambdas that have the
equivalent to the C++ Const-Eval / C++ Template arg "compile time
instantiation is the only allowed flavor".

for the particulars in the context of runtime rep levity, my intuitions
break down, but i've had examples of the sort of "must be resolved at
compile time" where for the behavior i'd need isn't expressible using type
classes because those can be instantiated abstractly rather than
concretely and still be valid programs.

granted i'm not terribly current on the state of play in >= ghc 9.4 for
this stuff, but i would not be surprised if the architectural hooks needed
for a "strict staging lambda" arent there yet. (you can manufacture some of
this stuff with typed template haskell, BUT theres no mechanism for
expressing the primops that certain uses cases, like SIMD shuffle, would
need)

On Mon, Jan 2, 2023 at 9:18 AM J. Reinders <jaro.reinders at gmail.com> wrote:

> No, I found it. It is this GHC issue:
>
> https://gitlab.haskell.org/ghc/ghc/-/issues/14917
>
> > On 2 Jan 2023, at 15:07, Tom Ellis <
> tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote:
> >
> > On Mon, Jan 02, 2023 at 02:01:56PM +0100, J. Reinders wrote:
> >> 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
> >
> > Perhaps this?
> >
> >
> https://github.com/ghc-proposals/ghc-proposals/pull/454#issuecomment-1030258076
> > _______________________________________________
> > Haskell-Cafe mailing list
> > To (un)subscribe, modify options or view archives go to:
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> > Only members subscribed via the mailman list are allowed to post.
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20230106/92a15261/attachment.html>


More information about the Haskell-Cafe mailing list