I have one function first with type: Int -> [a] -> (Error ([a],[a])) and a second function second with type: [a] -> [a] -> [a]
I am trying to make a third function now that uses the above functions.
the type I have for this function is: [Int] -> [a] -> Error [a]
I have been given these types to work around so cant change them.
This is what I tried:
last :: [Int] -> [a] -> Error [a]
last (x:xs) list = second (first x list)
Can you pass outputs from functions that use the error function in to others?
Just :: a -> Maybe a.FandQare not data constructors.Errorhere? The answer from Martinho seems to imply that it is a monad, is it so?