commercialhaskell/path

Adding 'Data' instance to Rel, File, Abs and Dir

Martinsos opened this issue · 4 comments

Is there are a particular reason why Rel, File, Abs and Dir are not deriving Data?

data Path b t is deriving Data, and what that does is create an instance Data for it where b and t also need to have instances of Data. However, since Rel, File, Abs and Dir don't have Data instances, this means that Path Rel File, Path Rel Dir, ... and so are not instances of Data.

I am encountering this is a problem now in https://github.com/wasp-lang/strong-path because I would like to make main type of StrongPath instance of Data, but the only thing stopping me from deriving Data is the fact that internally StrongPath uses Path Rel File, Path Rel Dir and so on, and those are not instances of Data.

I believe making Rel, File and similar instances of Data is as simple as just adding Data to deriving.

Sounds agreeable!

Sounds agreeable!

Ok! I created a very simple PR here #187 -> I think this should be it and I can see all the checks passing. Would love to get your eyes onto it also, just to make sure I haven't missed something.

This is long-fixed. Just closing this issue now.

This is long-fixed. Just closing this issue now.