4 ms·
Well, here's the type signatures for each: pure (== return) :: (Applicative f) => a -> f a <$> (== fmap) :: (Functor f) => (a -> b) -> (f a -> f b)
by Tyr42 15y ago
Well, here's the type signatures for each:
pure (== return) :: (Applicative f) => a -> f a
<$> (== fmap) :: (Functor f) => (a -> b) -> (f a -> f b)
join :: (Monad m) => m (m a) -> m a
All of these are polymorphic, and example in the case of lists would be
pure x = [x]
odd <$> [1,2,3] == [True, False, True]
join [[1,2], [3], [4,5]] = [1,2,3,4,5]