If I have following algebraic data type
type MyVal = Either String Int
and have a list containing element of type MyVal
ls = [Right 1, Right 2, Right 3]
xs = [Right 1, Left "error", Right 3]
now, I want write function to find out that is my list having all the value of 'Right' then it should return True otherwise False.
In case of ls
it will return True and for xs
it will return False.
How can I do that?
I have tried using all
function but could not able to use it correctly.