Functions decode and decode' from aeson package are almost identical. But they have subtle difference described in documentation (posting only interesting part of docs here):
-- This function parses immediately, but defers conversion. See
-- 'json' for details.
decode :: (FromJSON a) => L.ByteString -> Maybe a
decode = decodeWith jsonEOF fromJSON
-- This function parses and performs conversion immediately. See
-- 'json'' for details.
decode' :: (FromJSON a) => L.ByteString -> Maybe a
decode' = decodeWith jsonEOF' fromJSON
I tried to read description of json and json' functions but still don't understand which one and when I should use because documentation is not clear enough. Can anybody describe more precisely the difference between two functions and provide some example with behavior explanation if possible?
UPDATE:
There are also decodeStrict and decodeStrict' functions. I'm not asking what is difference between decode' and decodeStrict for example which by the way is an interesting question as well. But what's lazy and what's strict here in all these functions is not obvious at all.