aeson icon indicating copy to clipboard operation
aeson copied to clipboard

Replace Vector with Array?

Open Bodigrim opened this issue 3 years ago • 1 comments

Building aeson takes lots of time, even if a client uses only the most basic facilities. This matters not that much for local development (however depending on the frequency of cabal update it can get annoying too), but is a big deal for CI jobs, which often has cold cache.

A normal strategy would be to modularise aeson, separating Data.Aeson.Type into a package of its own. However, in this case it does not help much because Data.Aeson.Type incurs dependency on vector, which itself builds for ages, longer than the rest of aeson package.

Could we replace Data.Aeson.Type.Array from Vector Value to Array Value? Probably by making Data.Aeson.Type.Array an abstract data type, similar to KeyMap. I don't think aeson benefits on any way from vector fusion.

Bodigrim avatar Oct 26 '22 00:10 Bodigrim

Given how painful aeson-2 migration was, my opinion is that compilation time is not enough of a reason to do something like that.

I thought about this when making KeyMap module, but couldn't find a good reason. Vector is used quite universally, which in turn makes the recompilation argument even less strong: you likely well need to recompile vector for some other reason anyway.

phadej avatar Oct 26 '22 05:10 phadej