From 8d2a759dcb2ad886e39e01d27e4f15ba1c52c7ba Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Mon, 9 May 2011 14:11:51 -0700 Subject: [PATCH] add hetmet_unflatten --- GHC/HetMet/CodeTypes.hs | 18 ++++++++++++------ GHC/HetMet/Private.hs | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/GHC/HetMet/CodeTypes.hs b/GHC/HetMet/CodeTypes.hs index 424551b..d7dcac2 100644 --- a/GHC/HetMet/CodeTypes.hs +++ b/GHC/HetMet/CodeTypes.hs @@ -5,6 +5,7 @@ module GHC.HetMet.CodeTypes ( hetmet_csp, hetmet_flatten, pga_flatten, + pga_unflatten, pga_flattened_id, GuestIntegerLiteral, guestIntegerLiteral, GuestStringLiteral, guestStringLiteral, @@ -32,9 +33,9 @@ hetmet_flatten :: forall g . GArrowSTKC g (,) () => forall x y. - <[ x -> y ]>@g + <[ y ]>@g -> - (g x y) + (g () y) hetmet_flatten x = unG (pga_flatten x) -- After the flattening pass the argument and result types of this @@ -44,14 +45,19 @@ hetmet_flatten x = unG (pga_flatten x) -- type-inference/checking: pga_flatten :: forall g x y. - <[ x -> y ]>@g -> - PGArrow g x y + <[ y ]>@g -> + PGArrow g () y pga_flatten = error "hetmet_flatten should never be evaluated; did you forget to compile with -fcoqpass?" +pga_unflatten :: + forall g x y. + PGArrow g () y -> + <[ y ]>@g +pga_unflatten = error "hetmet_flatten should never be evaluated; did you forget to compile with -fcoqpass?" pga_flattened_id :: forall g x y. - PGArrow g x y -> - PGArrow g x y + PGArrow g () y -> + PGArrow g () y pga_flattened_id x = x diff --git a/GHC/HetMet/Private.hs b/GHC/HetMet/Private.hs index 68861a0..a55d282 100644 --- a/GHC/HetMet/Private.hs +++ b/GHC/HetMet/Private.hs @@ -10,7 +10,7 @@ -- Portability : portable module GHC.HetMet.Private ( - PGArrow (unG), + PGArrow (..), pga_id, pga_comp, pga_first, -- 1.7.10.4