4 ms·
> Ideally the compiler figures out the types so you don't have to. Doesn't it cause unintended API breaks because type changed from, say, a single type to unio
by higerordermap 6y ago
> Ideally the compiler figures out the types so you don't have to.
Doesn't it cause unintended API breaks because type changed from, say, a single type to union type, without changing any annotations?
- pyrale 6y agoIf that change goes through your whole program without causing any breakage, from Haskell's point of view it's a good change. If you have an API that exposes data to external systems, that may cause an integration breakage, indeed. That is why Haskell users like to use libs like Servant, which let you specify your API as a type. This way, if you change your system, your API has to change aswell. Another benefit of Servant is that you can generate swagger and clients for other languages easily, which your users can use in their own build to get type safety too.