aeson icon indicating copy to clipboard operation
aeson copied to clipboard

Pass runtime configuration to parseJSON

Open michalc opened this issue 8 years ago • 2 comments

Is there a way to pass options, found at runtime, to parseJSON?

(Inspired by the SO question https://stackoverflow.com/q/44516946/1319998)

michalc avatar Jun 16 '17 20:06 michalc

the Reifies example in the SO answer is the way to pass run-time information into instances. Universal approach for all instances, not only FromJSON.

phadej avatar Jun 16 '17 20:06 phadej

@phadej According to the author of the answer in comments, Reifies can't be used to pass runtime information into decode, so it then, presumably, can't pass it to parseJSON... is that right?

michalc avatar Jun 17 '17 16:06 michalc