> data Either' a b = Left' a | Right' b
>
> case' :: (a->g, b->g) -> Either' a b -> g
> case' (f, g) (Left' x) = f x
> case' (f, g) (Right' y) = g y
>
> plus' :: (a->b , g->d) -> Either' a g -> Either' b d
> plus' (f,g) = case' (Left' f, Right' g)
case' takes as first argument a tuple of funct
Shawn P. Garbett wrote:
> [...] But I get this error I've been unable to solve: [...]
The last line should read:
plus' (f,g) = case' (Left' . f, Right' . g)
i.e. the function composition operator was missing.
Cheers,
S.
___
Haskell-Cafe m