A Haskell version of tRayce