ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

Added FromJSON instance for Target #271

Closed meck closed 5 years ago

meck commented 5 years ago

I was working on a client for Hoogle as part of learning Haskell, and noticed that it would be good to have a ready Instance of fromJSON when I was using the Hoogle library for a json web client.

ndmitchell commented 5 years ago

Awesome patch!

ndmitchell commented 5 years ago

Let me know if you want a release to make your experimentation easier

ndmitchell commented 5 years ago

Btw, adding a test would be lovely, if you have the time/inclination. Just for one or two examples FromJSON/ToJSON is an identity.

meck commented 5 years ago

I just this minute discovered this was bad implementation, so you might want to revert it while I fix it and some tests. The optional records are encoded as {} if they are Nothing I thought they were omitted. Sorry

ndmitchell commented 5 years ago

Hehe, I'm not planning a release until you fix it, and it shouldn't break anything that doesn't use it, so will leave it for you to fix and test :)