Open
Description
When deriving ToValue
instances I get a warning No explicit implementation for 'toValue'
. For instance,
data MixInput = MixInput
{ nameKey :: Maybe Text
, mixItems :: ![MixItemInput] -- an instance of ToValue
} deriving (Show, Generic)
instance FromValue MixInput
instance ToValue MixInput <<< Warning -> generates an error when evaluated
instance HasAnnotatedInputType MixInput
instance Defaultable MixInput
Update
In my experience, the App compiles, but generates a runtime error when the toValue
instance is evaluated.
So for instance, the following compiles And avoids any runtime errors.
instance ToValue MixInput where
toValue MixInput {..}
= toValue $ fromJust $ objectFromList
[ ("nameKey", toValue (toValue @Text <$> nameKey))
, ("mixItems", toValue (toValue @MixItemInput <$> mixItems))
]
instance ToValue MixItemInput where
etc..
Question
Is this behavior/feedback by design?
- E
Metadata
Metadata
Assignees
Labels
No labels