Re: Intro to Functional Prog. by Bird, Section 2.5

2002-01-02 Thread senganb
> 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

Re: Intro to Functional Prog. by Bird, Section 2.5

2002-01-02 Thread Sven Panne
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