diff options
author | sheaf <sam.derbyshire@gmail.com> | 2022-06-06 15:07:16 +0200 |
---|---|---|
committer | sheaf <sam.derbyshire@gmail.com> | 2022-06-06 18:13:08 +0200 |
commit | 432d56a4e2df8d969c248fb128a2e42b2584fa0b (patch) | |
tree | 0cba4b9936597fb0dbd8fc8b8f2e6e6f892492ed /testsuite/tests/rep-poly/RepPolyTuple2.hs | |
parent | 04209f2a6a49f6cdc116b5cb73ccd1749c90f88b (diff) | |
download | haskell-wip/tcRemainingValArgs.tar.gz |
Typecheck remaining ValArgs in rebuildHsAppswip/tcRemainingValArgs
This patch refactors hasFixedRuntimeRep_remainingValArgs, renaming it
to tcRemainingValArgs. The logic is moved to rebuildHsApps, which
ensures consistent behaviour across tcApp and quickLookArg1/tcEValArg.
This patch also refactors the treatment of stupid theta for data
constructors, changing the place we drop stupid theta arguments
from dsConLike to mkDataConRep (now the datacon wrapper drops these
arguments).
We decided not to implement PHASE 2 of the FixedRuntimeRep plan for
these remaining ValArgs. Future directions are outlined on the wiki:
https://gitlab.haskell.org/ghc/ghc/-/wikis/Remaining-ValArgs
Fixes #21544 and #21650
Diffstat (limited to 'testsuite/tests/rep-poly/RepPolyTuple2.hs')
-rw-r--r-- | testsuite/tests/rep-poly/RepPolyTuple2.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/rep-poly/RepPolyTuple2.hs b/testsuite/tests/rep-poly/RepPolyTuple2.hs new file mode 100644 index 0000000000..43e590587b --- /dev/null +++ b/testsuite/tests/rep-poly/RepPolyTuple2.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE UnboxedTuples #-} + +module RepPolyTuple2 where + +import GHC.Exts + +type RR :: RuntimeRep +type family RR where { RR = FloatRep } +type F :: TYPE RR +type family F where { F = Float# } + +{-# NOINLINE expensive #-} +expensive :: Float -> Float +expensive x = cos x ** 123.45 + +tup x = (# , #) @LiftedRep @RR (expensive x) |