--apply'' :: (Monad' m) => m (a ->b) -> m a -> m b
--apply'' ma = bind' $ fmap'' ma

-- Exercise 14
-- Relative Difficulty: 6
-- actually a 'forM'
forM' :: (Monad' m) => [a] -> (a -> m b) -> m [b]
forM' as a_to_mb = foldr fn (return' []) as
  where
    fn a mlb =
         bind' (\x ->
         bind' (\lb ->
         return' (x : lb )) mlb ) (a_to_mb a)
forM' :: (Monad' m) => [a] -> (a -> m b) -> m [b]
forM' as a_to_mb = foldr fn (return' []) as
  where
    fn a mlb =
         bind' (\x ->
         bind' (\lb ->
         return' (x : lb )) mlb ) (a_to_mb a)
forM' as a_to_mb = foldr fn (return' []) as
  where
    fn a mlb =
         bind' (\x ->
         bind' (\lb ->
         return' (x : lb )) mlb ) (a_to_mb a)