What does A mean in sequence A?

What does sequenceATraversable mean ? Why is there capital A at the end? I have been studying Haskell for several months, and this is one of the things that bothered me for a while.

+4
source share
1 answer

“A” means Applicative, as in the case of limitation in sequenceA:

sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)

That "A" is the fruit of a historical catastrophe. Haskell once existed neither Applicative, nor Traversable. However, the function, exactly the same as sequenceAit already existed, except that it had a much more specific type:

sequence :: Monad m => [m a] -> m [a]

Applicative Traversable, Traversable [1]:

sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)

sequence Monad . Applicative . , Applicative Monad, , Applicative sequence , Applicative . , "A" .


[1]: , , Prelude - .

+7

Source: https://habr.com/ru/post/1658473/


All Articles