From f3ace5ca2af541e62e7f394b1e58980048be17eb Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 7 Mar 2018 19:00:41 -0500 Subject: [PATCH] Give an instance of GNewtype1. --- src/Control/Abstract/Analysis.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Control/Abstract/Analysis.hs b/src/Control/Abstract/Analysis.hs index 12f9bac75..bb0a228b7 100644 --- a/src/Control/Abstract/Analysis.hs +++ b/src/Control/Abstract/Analysis.hs @@ -12,6 +12,7 @@ import Control.Effect as X import Control.Monad.Effect.Fail as X import Control.Monad.Effect.Reader as X import Control.Monad.Effect.State as X +import Data.Coerce import Prologue type family TermFor (m :: * -> *) @@ -48,3 +49,8 @@ class GNewtype1 n where gpack1 :: GO1 n a -> n a gunpack1 :: n a -> GO1 n a + +instance GNewtype1 (D1 d (C1 c (S1 s (Rec1 a)))) where + type GO1 (D1 d (C1 c (S1 s (Rec1 a)))) = a + gpack1 = coerce + gunpack1 = coerce