Skip to content

Ch7 Align definitions of combineList and sequence #155

Open

Description

@milesfrain

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions