On Sun, Nov 15, 2015 at 9:29 AM, Graham Gill <math.simplex@gmail.com> wrote:
More simply
> :t pure
pure :: Applicative f => a -> f a
> pure [1..5]
[1,2,3,4,5]

a must match a list of Nums, but then where did f go? Is ghci using some default instance?

Yes it is. The default instance is IO. It's a common gotcha, see

https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/interactive-evaluation.html#actions-at-prompt

and the example of how "return True" defaults to IO Bool.

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