Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch7 Align definitions of combineList and sequence #155

Open
milesfrain opened this issue May 21, 2020 · 0 comments
Open

Ch7 Align definitions of combineList and sequence #155

milesfrain opened this issue May 21, 2020 · 0 comments

Comments

@milesfrain
Copy link
Member

This chapter describes how to create combineList, then compares it to the more general sequence:

combineList :: forall f a. Applicative f => List (f a) -> f (List a)
sequence    :: forall a m. Applicative m => t    (m a) -> m (   t a)

The connection would be more obvious though if the same type variables were used:

combineList :: forall a m. Applicative m => List (m a) -> m (List a)
sequence    :: forall a m. Applicative m => t    (m a) -> m (   t a)

It's tempting to just replace f with m in combineList but then there's a disconnect with an earlier connection to Apply which uses f.

class Apply f <= Applicative f where
  pure :: forall a. a -> f a

So this seems like a bigger task of settling on a naming convention to use for type variables and then updating the libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant