4 ms·
Thank you for that. I will now find out the real implementations of Haskell's pure, <$>, and join.
by fogus 15y ago
Thank you for that. I will now find out the real implementations of Haskell's pure, <$>, and join.
- Tyr42 15y agoWell, 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]