On 11/14/2015 9:58 PM, Kim-Ee Yeoh wrote:
[...]
and the example of how "return True" defaults to IO Bool.

Thanks Kim-Ee, that makes it clear.


Might I compliment you on this:

sequenceA' :: Applicative f => [f a] -> f [a]
sequenceA' = foldr (\fa fla -> (:) <$> fa <*> fla) (pure [])

There are strong arguments that this is the best way of writing sequenceA.

-- Kim-Ee

Thanks, but it just seemed the most straightforward thing to do at my present level of understanding.

Are there substantially different ways to define sequenceA? I'm interested to read the arguments if you can give a pointer to a post somewhere.

Graham