Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

No instance nor default method for class operation put (cereal 0.5) #678

Closed
JPMoresmau opened this issue Nov 3, 2015 · 18 comments
Closed

Comments

@JPMoresmau
Copy link
Contributor

I run ghc-mod at the root of a haskell project, I get:

ghc-mod: Language/Haskell/GhcMod/Types.hs:404:10-39: No instance nor default method for class operation put

I have 5.4
ghc-mod --version
ghc-mod version 5.4.0.0 compiled by GHC 7.10.1

I have another 5.4.0.0 install in another directory (same ghc, different sandbox) that works. The one that works has cereal 0.4.1.1 installed, the one that doesn't cereal-0.5.0.0. I realize this is a very recent version uploaded yesterday, is ghc-mod not compatible with it?

@cnd
Copy link
Contributor

cnd commented Nov 4, 2015

what if we will

instance Serialize CabalHelper.Programs where
  put = ... and I don't know what here :)

really please help me with that

@DanielG
Copy link
Owner

DanielG commented Nov 4, 2015

Serialize has default instances via GHC.Generics, IIRC you just need to add a deriving clause for that:

deriving instance Generic Whatever

@cnd
Copy link
Contributor

cnd commented Nov 5, 2015

It feels more complicated since CabalHelper.Programs already deriving Generic

@DanielG
Copy link
Owner

DanielG commented Nov 5, 2015

Looking at the diff cereal-0.4.1.1..cereal-0.5.0.0, I can't see any changes to relevant class instances so I'm not sure what's going on.

@chamini2
Copy link

I'm getting this issue using atom-haskell/haskell-ghc-mod

@ciez
Copy link

ciez commented Nov 11, 2015

ghc-mod list
throws
ghc-mod: Language/Haskell/GhcMod/Types.hs:404:10-39: No instance nor default method for class operation get

@DanielG
Copy link
Owner

DanielG commented Nov 11, 2015

Please reinstall ghc-mod after running cabal update, I uploaded updated cabal metadata that includes a version constraint for cereal.

@ciez
Copy link

ciez commented Nov 11, 2015

just did
cabal update
cabal --no-require-sandbox --reinstall install ghc-mod

ghc-mod-5.4.0.0 (reinstall) (changes: async-2.0.2 added)

same error:
ghc-mod: Language/Haskell/GhcMod/Types.hs:404:10-39: No instance nor default method for class operation get

@DanielG
Copy link
Owner

DanielG commented Nov 11, 2015

How about what I suggested here: #680 (comment) ?

@ciez
Copy link

ciez commented Nov 11, 2015

0.5.0.0 cereal is installed..

@DanielG
Copy link
Owner

DanielG commented Nov 11, 2015

Argh looks like I got the constraint wrong: https://github.com/kazu-yamamoto/ghc-mod/blob/master/ghc-mod.cabal#L150 I'll upload another cabal metadata revision later.

@DanielG
Copy link
Owner

DanielG commented Nov 11, 2015

@ciez what do you mean it's not installed?

@ciez
Copy link

ciez commented Nov 11, 2015

I was checking from a sandboxed dir where there is no cereal.

.cabal dir where ghc-mod is installed does show cereal 5.0.0
reinstalling ghc-mod with cereal constraint worked.

ta, Daniel

@DanielG
Copy link
Owner

DanielG commented Nov 12, 2015

I've uploaded the updated metadata now so it should work for now. I would appreciate if anyone would look into what's really going on here though.

@DanielG
Copy link
Owner

DanielG commented Nov 18, 2015

I've replaced cereal with binary now, really should've been doing this from the beginning since it comes with GHC. Anyways this should be fixed now. Just remember to rm -r dist/ || rm -r .stack-work since the caches won't get invalidated in the git version because the version number hasn't changed yet.

@DanielG
Copy link
Owner

DanielG commented Nov 26, 2015

Can you guys please test and confirm this actually works so I can close this issue?

@JPMoresmau
Copy link
Contributor Author

Done a clean build on a new install, no issue. No cereal in the dependency list, so I guess we're good!

@DanielG
Copy link
Owner

DanielG commented Nov 26, 2015

Well yeah cereal is gone but you never know if I broke something while I was ripping that out ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants