Re: Zipping two sequences together with only cons, empty, foldr
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.
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) ++