Re: Zipping two sequences together with only cons, empty, foldr

1999-07-01 Thread Valery Trifonov
Kevin Atkinson wrote: > > Laszlo Nemeth wrote: [snip] > > foldr (\ a g ys -> case ys of > > [] -> empty > > (b:bs) -> (a,b) `cons` g bs) > > (\ _ -> []) > > But only for lists. As you are patern matching on ":". Apply the old "predecessor" tric

Re: Question about a monad property.

1998-06-05 Thread Valery Trifonov
S.M.Kahrs wrote: > > > f (x then k) = x then (f . k)(*) > > = x then (\y -> f (k y)) > > [...] > > In the case of the list monad (M a = [a]), equation (*) > > holds only if $f$ is a morphism over the concat operator > > i.e. f (u ++ v) = (f u) ++