Add Haskell solution to trinary