Tighten Construct constraint

Although we technically only "need" `Functor f` and `GConstruct` will in
turn imply `Applicative f`, it would be nice for the benefit of users if
it were clear in the signature that `Applicative` were required.
This commit is contained in:
Tom Harding 2019-08-05 09:13:41 +01:00
parent 609b212307
commit 4275824514

View File

@ -74,7 +74,7 @@ instance Applicative f => GConstruct f (K1 index inner) where
gconstruct (K1 x) = fmap K1 x
gdeconstruct (K1 x) = K1 (pure x)
instance (Functor f, Generic structure, GConstruct f (Rep structure))
instance (Applicative f, Generic structure, GConstruct f (Rep structure))
=> Construct f structure where
construct = fmap to . gconstruct . runHKD
deconstruct = HKD . gdeconstruct @f . from