Maxime Henrion committed 05aafc5

It turns out that the V1 instance isn't necessary, even when we want to derive
instances for types that are tagged using other types without constructors
(also called phantom types). Those don't make it to the Generic representation.
For example, the following code works just fine without a V1 instance:

data Tag1
data Tag2

data Foo a = Foo Int

foo1 :: Int -> Foo Tag1
foo1 = Foo

foo2 :: Int -> Foo Tag2
foo2 = Foo

instance DeepSeq (Foo a)

  • Participants
  • Parent commits 92cd73e

Comments (0)

Files changed (1)

File src/Control/DeepSeq.hs

 class GDeepSeq f where
   grnf :: f a -> ()
-instance GDeepSeq V1 where
-  grnf _ = ()
 instance GDeepSeq U1 where
   grnf _ = ()