Skip to content

Allow forall in polymorphic instance heads #1120

Description

@michaelficarra

I believe these are the only places where we don't require forall. Examples from the website:

class Sized a where
  size :: a -> Number

instance sizedArray :: (Sized a) => Sized [a] where
  size [] = 0
  size (x : xs) = size x + size xs

Proposed new requirement:

class forall a. Sized a where
  size :: a -> Number

instance sizedArray :: forall a. (Sized a) => Sized [a] where
  size [] = 0
  size (x : xs) = size x + size xs

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions