Skip to content

Clarify ExtraneousClassMember vs. MissingClassMember#1163

Merged
paf31 merged 1 commit intopurescript:masterfrom
mjgpy3:1142_extra_type_class_member_error
Jun 14, 2015
Merged

Clarify ExtraneousClassMember vs. MissingClassMember#1163
paf31 merged 1 commit intopurescript:masterfrom
mjgpy3:1142_extra_type_class_member_error

Conversation

@mjgpy3
Copy link
Copy Markdown
Contributor

@mjgpy3 mjgpy3 commented Jun 13, 2015

Resolves #1142.

Example showing correctness of existing "missing class member":

module Foobar where

class Foobarable m where
  foobar :: m
  oops :: m

data Blah = Beanz | Spaz

newtype Fooample = Fooample Blah

instance foobarableFooample :: Foobarable Fooample where
  foobar = Fooample Beanz

Errors with:

Error:
Error in type class instance Foobar.Foobarable Foobar.Fooample:
Error at /home/michael/dev/contrib/Foobar.purs line 11, column 1 - line 12, column 21:
Member oops has not been implemented
See https://github.com/purescript/purescript/wiki/Error-Code-MissingClassMember for more information, or to contribute content related to this error.

Example showing new error:

module Foobar where

class Foobarable m where
  foobar :: m

data Blah = Beanz | Spaz

newtype Fooample = Fooample Blah

instance foobarableFooample :: Foobarable Fooample where
  foobar = Fooample Beanz
  oops = Fooample Spaz

Errors with:

Error:
Error in type class instance Foobar.Foobarable Foobar.Fooample:
Error at /home/michael/dev/contrib/Foobar.purs line 12, column 3 - line 12, column 19:
Member oops does not belong to the class being instantiated
See https://github.com/purescript/purescript/wiki/Error-Code-ExtraneousClassMember for more information, or to contribute content related to this error.

@garyb
Copy link
Copy Markdown
Member

garyb commented Jun 13, 2015

👍

@mjgpy3
Copy link
Copy Markdown
Contributor Author

mjgpy3 commented Jun 14, 2015

@paf31 does this look correct?

paf31 added a commit that referenced this pull request Jun 14, 2015
Clarify ExtraneousClassMember vs. MissingClassMember
@paf31 paf31 merged commit 2c43ca9 into purescript:master Jun 14, 2015
@paf31
Copy link
Copy Markdown
Contributor

paf31 commented Jun 14, 2015

Looks great, thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants