haskell trinary