fromJSON takes a converter function