Why does application of `sequence` on List of Lists lead to computation of its Cartesian Product?
问题 My question is about the sequence function in Prelude , the signature of which is as follows: sequence :: Monad m => [m a] -> m [a] I understand how this function works for List of Maybe s. For example, applying sequence on [Just 3, Just 9] gives Just [3, 9] . I noticed that applying sequence on List of List s gives its Cartesian Product. Can someone please help me understand how/why this happens? 回答1: This works because using lists as monads in Haskell makes them model indeterminism.