You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Soon Generically and Generically1 will be added to base 4.17, I notice that you implement generic instances for Override that duplicates the intended use of Generically.
It is possible to pass Override as an argument to Generically that makes use of the modified Generic instance of Override:
-- >> mempty @Ok-- Ok 0 1-- >> Ok 10 10 <> Ok 10 10-- Ok 20 100dataOk=OkIntIntderiving (Semigroup, Monoid)
viaGenerically
(OverrideOk
'[ At"Ok"0 (SumInt)
, At"Ok"1 (ProductInt)
]
)
Using this pattern you separate the generic behaviour from the overriding behaviour, which will be added separately by many libraries. You could possibly define a type level constant
Soon
Generically
andGenerically1
will be added to base 4.17, I notice that you implement generic instances forOverride
that duplicates the intended use ofGenerically
.It is possible to pass
Override
as an argument toGenerically
that makes use of the modifiedGeneric
instance ofOverride
:Using this pattern you separate the generic behaviour from the overriding behaviour, which will be added separately by many libraries. You could possibly define a type level constant
The text was updated successfully, but these errors were encountered: