-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
enhancementNew feature or requestNew feature or request
Description
When trying to bind to an existing datatype (like Aeson.Value, for example), I believe I should add a custom rewrite rule, like:
rewrites:
- from: "Data.AesonBind.Value"
to: "Value"
importing: "Data.Aeson"
- from: "Data.AesonBind.Number"
to: "Number"
importing: "Data.Aeson"When compiled, using Number will result in the following import:
import Data.Aeson (Number, Value)But this results in a compile error, as the code should be
import Data.Aeson (Value(Number))I'm not sure if support this kind of use-case makes sense for the project, but IMO it's a good feature to have when supporting binding to existing Haskell.
A possible solution I was thinking about would be adding an optional constructorOf field to the rewrite rules, so we could write it in the following way:
rewrites:
- from: "Data.AesonBind.Value"
to: "Value"
importing: "Data.Aeson"
- from: "Data.AesonBind.Number"
to: "Number"
importing: "Data.Aeson"
constructorOf: "Value"And it would generate the proper import.
I'd be happy to work on this if the feature makes sense 😊
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request