-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
singletons-th: Make pr_scoped_vars a list of LocalVars, not Names
Doing so makes it possible to track the kinds of scoped type variables with greater precision during lambda lifting. See the golden output for the new `T613` test case to see an example of this in action. Fixes #613.
- Loading branch information
1 parent
22d2c8f
commit 9d5a811
Showing
7 changed files
with
86 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
singletons-base/tests/compile-and-dump/Promote/T613.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Promote/T613.hs:(0,0)-(0,0): Splicing declarations | ||
promote | ||
[d| f :: forall k (a :: k). Proxy a -> Proxy a | ||
f x | ||
= y | ||
where | ||
y = x |] | ||
======> | ||
f :: forall k (a :: k). Proxy a -> Proxy a | ||
f x | ||
= y | ||
where | ||
y = x | ||
type family Let0123456789876543210YSym0 k0123456789876543210 (a0123456789876543210 :: k0123456789876543210) (x0123456789876543210 :: Proxy a0123456789876543210) where | ||
Let0123456789876543210YSym0 k0123456789876543210 a0123456789876543210 x0123456789876543210 = Let0123456789876543210Y k0123456789876543210 a0123456789876543210 x0123456789876543210 | ||
type family Let0123456789876543210Y k0123456789876543210 (a0123456789876543210 :: k0123456789876543210) (x0123456789876543210 :: Proxy a0123456789876543210) where | ||
Let0123456789876543210Y k a x = x | ||
type FSym0 :: forall k (a :: k). (~>) (Proxy a) (Proxy a) | ||
data FSym0 :: (~>) (Proxy a) (Proxy a) | ||
where | ||
FSym0KindInference :: SameKind (Apply FSym0 arg) (FSym1 arg) => | ||
FSym0 a0123456789876543210 | ||
type instance Apply @(Proxy a) @(Proxy a) FSym0 a0123456789876543210 = F a0123456789876543210 | ||
instance SuppressUnusedWarnings FSym0 where | ||
suppressUnusedWarnings = snd ((,) FSym0KindInference ()) | ||
type FSym1 :: forall k (a :: k). Proxy a -> Proxy a | ||
type family FSym1 @k @(a :: k) (a0123456789876543210 :: Proxy a) :: Proxy a where | ||
FSym1 a0123456789876543210 = F a0123456789876543210 | ||
type F :: forall k (a :: k). Proxy a -> Proxy a | ||
type family F @k @(a :: k) (a :: Proxy a) :: Proxy a where | ||
F @k @a (x :: Proxy a) = Let0123456789876543210YSym0 k a x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module T613 where | ||
|
||
import Data.Proxy | ||
import Data.Proxy.Singletons | ||
import Data.Singletons.TH | ||
|
||
$(promote [d| | ||
f :: forall k (a :: k). Proxy a -> Proxy a | ||
f x = y | ||
where | ||
y = x | ||
|]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters