Diff package adopts LiquidHaskell for static checks

Hello, dear haskellers!

I want to make a splash about LiquidHaskell being used for static checks in the Diff package, used transitively by more than 17000 packages according to hackage-revdeps [link].

Users of Diff aren’t affected, but Diff contributors can check the package with LiquidHaskell now [link]. This blog post tells the story of how it came to be [link]. And there is the now merged PR adding the initial checks [link].

Thanks much to the maintainers of Diff, David Fox and @Bodigrim. And thanks to Tweag for supporting my colleague @ninioArtillero to do this work.

Onwards and upwards, LiquidHaskell!

18 Likes

Out of curiosity, did Liquid Haskell find any bugs?

4 Likes

The static checks found no violations, but the process of adding the static checks requires a rather deep review of the code and the slim documentation. This review did surface an unlawful Ord instance [link]. The unlawful instance didn’t produce misbehavior of Diff though.

IIRC, no other bugs were uncovered, although there was plenty of insight to lower the effort of understanding the code with refactorings and documentation contributions. Together with the static checks, I find Diff a tad easier to change and review now.

5 Likes

Great stuff, thanks @facundominguez and @ninioArtillero !!!

1 Like