Skip to content

Allow forall in polymorphic instance heads #1120

@michaelficarra

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions