Skip to content

Instantly share code, notes, and snippets.

@michaelochurch
Created June 4, 2015 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelochurch/59dd3d50aba701929fbb to your computer and use it in GitHub Desktop.
Save michaelochurch/59dd3d50aba701929fbb to your computer and use it in GitHub Desktop.
-- src/Data/Sum.purs
module Data.Sum where
import Data.Monoid
newtype Sum = Sum {getSum :: Number}
instance monoidSum :: Monoid Sum where
mempty = Sum 0
(<>) (Sum m) (Sum n) = Sum $ m + n
==========================================
$ grunt
Running "psc:all" (psc) task
>> Error creating file dist/Main.js
>>
Warning: Error at src/Data/Sum.purs line 7, column 1 - line 9, column 36:
Error in type class instance Data.Monoid.Monoid Data.Sum.Sum:
Error at src/Data/Sum.purs line 9, column 3 - line 9, column 36:
Member (<>) 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. Use --force to continue.
Aborted due to warnings.
==========================================
It's complaining about (<>) not being implemented, but the location it gives (L9, 3-36) is exactly where I implement it!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment