I'm using the aeson
package. I have a datatype which uses Data.Tree
in its declaration. Like the following, only more complex:
data Foo = Foo {
bat :: Text
, xux :: Maybe Text
, tri :: Tree Text
}
I want to use Data.Aeson.TH
to generate a FromJSON
instance for this type.
$(deriveJSON defaultOptions ''Foo)
But Data.Tree
does not have a standard instance for FromJSON
, meaning that I would need to declare an orphan instace.
Is there some way to avoid creating that orphan instance, while still being able to use deriveJSON
?