mirror of
https://github.com/i-am-tom/higgledy.git
synced 2024-08-17 03:50:23 +03:00
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:
parent
609b212307
commit
4275824514
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user