ghc icon indicating copy to clipboard operation
ghc copied to clipboard

Easier recursive aliases

Open aspiwack opened this issue 6 years ago • 2 comments
trafficstars

The game plan is:

  • All variables are annotated with a list [(Name, Mult)] corresponding to the usage environment of their left-hand side.
  • This is in addition to the multiplicity annotation, but the intention is that, eventually, lambda-bound variables receive a only a multiplicity, and let-bound variables only a usage environment annotation (sharing the same field).
  • This needs to be maintained throughout core-to-core passes (whenever one creates a lambda-bound binder, and in case-of-case for join points (which was the initial motivation)).
  • I haven't tried to be efficient.
  • Possibly other things I forget.

aspiwack avatar Nov 21 '19 17:11 aspiwack

Small failing testcase, with -O -dcore-lint:

module Base  where

data Map   = Bin Int !Map | Tip

go :: Map -> Map
go Tip       = Bin 0 Tip
go (Bin _ r) = Bin 0 (go r)

This passes with -fno-worker-wrapper, likely the same cause as why the build fails in MkIface.

monoidal avatar Nov 21 '19 18:11 monoidal

I've marked the comments about CoVar as "resolved" since they'll be handled at https://gitlab.haskell.org/ghc/ghc/merge_requests/2268.

monoidal avatar Dec 03 '19 14:12 monoidal