Using quickCheck for "99 Haskell problems" - problem 1
Most important point: Your answer does not do what is asked.

Question:


Prelude&gt; myLast [1,2,3,4]
4
Prelude&gt; myLast ['x','y','z']
'z'



Your implementation:

*Main&gt; myLast [1,2,3,4]
Right 4


You should quickCheck for the equivalence of the function you are asked to implement myLast xs == last xs (with appropriate type signatures),
or write a unit test suite comprising at least the cases given.

Other points:


import Data.Int is unused.
(xs !! 0) should be head xs
Nested parentheses should be used sparingly because trying to match them reduces readability. Composition using operators . and $ should be preferred:

-- instead of this
myLast xs = Right (head (reverse xs))
-- this reads better
myLast' xs = Right $ head $ reverse xs
-- this makes the composition of 3 steps more explicit
myLast'' = Right . head . reverse