Gilbert-Johnson-Keerthi algorithm implemented in Haskell.