Closed BebeSparkelSparkel closed 4 years ago
No.
We'll need to coerce Word :-> c
to GenericData :-> c
, but that's not possible as Fun
isn't coercible in the first argument:
Test.QuickCheck> :i Fun
type role Fun nominal representational
Use either functionMap
with explicit instance definition or
{-# LANGUAGE DeriveAnyClass, DerivingStrategies, DeriveGeneric, ... #-}
newtype GenericData = GenericData Word
deriving stock (Show, Eq, Generic)
deriving newtype (Arbitrary)
deriving anyclass (Function)
Works great thanks
It doesn't seem possible to newtype derive an instance of
Function
. Is there a way to allow this?