I have two composed applicative functors Maybe [Integer]
and want to combine them with <$>
/<*>
but I am stuck with applying the applicative operation. The following does not typecheck:
(<*>) (<*>) ((<$>) ((+) <$>) $ Just [1,2,3]) $ Just [4,5,6]
Expected result:
Just [5,6,7,6,7,8,7,8,9]
The functor part works, i.e. the intermediate value passed to <*>
as the first argument is Just [Integer -> Integer]
. I am used to S-expressions so I have a hard time with the Haskell syntax. I know of Compose
but I am interested in the mere composition wihtout abstraction.