Comments (3)
I faced the same bug and had to derive all those things by hand. Have you found any better workarounds?
By the way, it seems that there has been no maintainer for one year...
from acid-state.
With acid-state 0.9.x and GHC 7.10.3 this example still fails, though with a different error:
[1 of 1] Compiling Test ( /tmp/G.hs, interpreted )
/tmp/G.hs:28:1:
Couldn't match type ‘IxSetStore κ’ with ‘IxSet (Entry κ)’
arising from trying to show that the representations of
‘safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.Kind
(IxSet (Entry κ))’ and
‘safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.Kind
(IxSetStore κ)’ are the same
Relevant role signatures:
type role safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.Kind nominal
type role IxSet nominal
type role Entry representational
type role IxSetStore nominal
Relevant bindings include
kind :: safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.Kind (IxSetStore κ)
(bound at /tmp/G.hs:28:1)
In the expression:
GHC.Prim.coerce
(kind ::
safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.Kind (IxSet (Entry κ))) ::
safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.Kind (IxSetStore κ)
In an equation for ‘kind’:
kind
= GHC.Prim.coerce
(kind ::
safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.Kind (IxSet (Entry κ))) ::
safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.Kind (IxSetStore κ)
When typechecking the code for ‘kind’
in a derived instance for ‘SafeCopy (IxSetStore κ)’:
To see the code I am typechecking, use -ddump-deriv
In the instance declaration for ‘SafeCopy (IxSetStore κ)’
Failed, modules loaded: none.
Prelude>
using deriving
to create SafeCopy
instances for newtypes
is known to have some issues. Attempting to use deriveSafeCopy
results in:
[1 of 1] Compiling Test ( /tmp/G.hs, interpreted )
/tmp/G.hs:29:1:
Could not deduce (Ord κ)
arising from a use of ‘safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.getSafeGet’
from the context (SafeCopy κ)
bound by the instance declaration at /tmp/G.hs:29:1-35
Possible fix:
add (Ord κ) to the context of the instance declaration
In a stmt of a 'do' block:
safeGet_IxSetEntryκ_aeaB <- safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.getSafeGet
In the second argument of ‘Data.Serialize.Get.label’, namely
‘do { safeGet_IxSetEntryκ_aeaB <- safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.getSafeGet;
((return IxSetStore) <*> safeGet_IxSetEntryκ_aeaB) }’
In the first argument of ‘safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.contain’, namely
‘Data.Serialize.Get.label
"Test.IxSetStore:"
(do { safeGet_IxSetEntryκ_aeaB <- safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.getSafeGet;
((return IxSetStore) <*> safeGet_IxSetEntryκ_aeaB) })’
/tmp/G.hs:29:1:
Could not deduce (Ord κ)
arising from a use of ‘safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.getSafePut’
from the context (SafeCopy κ)
bound by the instance declaration at /tmp/G.hs:29:1-35
Possible fix:
add (Ord κ) to the context of the instance declaration
In a stmt of a 'do' block:
safePut_IxSetEntryκ_aeaA <- safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.getSafePut
In the first argument of ‘safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.contain’, namely
‘do { safePut_IxSetEntryκ_aeaA <- safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.getSafePut;
safePut_IxSetEntryκ_aeaA arg_aeaz;
return () }’
In the expression:
safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.contain
(do { safePut_IxSetEntryκ_aeaA <- safecopy-0.9.0.1:Data.SafeCopy.SafeCopy.getSafePut;
safePut_IxSetEntryκ_aeaA arg_aeaz;
return () })
Failed, modules loaded: none.
Prelude>
from acid-state.
In GHC 8.4.2 and acid-state master this fails with
• Couldn't match type ‘IxSet (Entry κ)’ with ‘IxSetStore κ’
arising from a use of ‘GHC.Prim.coerce’
• In the expression:
GHC.Prim.coerce
@(safecopy-0.9.4.1:Data.SafeCopy.SafeCopy.Kind (IxSet (Entry κ)))
@(safecopy-0.9.4.1:Data.SafeCopy.SafeCopy.Kind (IxSetStore κ))
kind
In an equation for ‘kind’:
kind
= GHC.Prim.coerce
@(safecopy-0.9.4.1:Data.SafeCopy.SafeCopy.Kind (IxSet (Entry κ)))
@(safecopy-0.9.4.1:Data.SafeCopy.SafeCopy.Kind (IxSetStore κ))
kind
When typechecking the code for ‘kind’
in a derived instance for ‘SafeCopy (IxSetStore κ)’:
To see the code I am typechecking, use -ddump-deriv
In the instance declaration for ‘SafeCopy (IxSetStore κ)’
• Relevant bindings include
kind :: safecopy-0.9.4.1:Data.SafeCopy.SafeCopy.Kind (IxSetStore κ)
(bound at ParameterisedState.hs:29:1)
|
29 | deriving instance (SafeCopy κ, Typeable κ, Ord κ) ⇒ SafeCopy (IxSetStore κ)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
which seems correct as this line of code is simply incompatible with roles-based GeneralizedNewtypeDeriving
; see acid-state/safecopy#12. There may well still be issues with parameterised types and safecopy (see also acid-state/safecopy#29) but AFAICS it is now possible to use acid-state with parameterised state types, so I'm closing this.
from acid-state.
Related Issues (20)
- Get size of acid-state? HOT 3
- Failed to build acid-state-0.15.1 HOT 8
- acid-state fails to build with GHC 8.8.1 HOT 1
- Changelog entry for 0.16 is missing HOT 1
- Test suite fails on macOS HOT 8
- build fails on ghc 9.0.1 HOT 1
- Hackage release needed for GHC 9.0.2 support HOT 2
- Benchmark `loading-benchmark` fails to build with GHC 7.10 HOT 3
- GHC versions covered by AppVeyor CI HOT 3
- acid-state on cluster HOT 1
- Haddocks for Data.Acid.Memory.Pure.AcidState are misleading HOT 1
- Database seems empty after ctrl+c HOT 4
- Build failures with mtl-2.3
- Support GHC 9.4 HOT 1
- README: possibly outdated irc link
- Build failure with unix-2.8 (GHC 9.6)
- Support GHC 9.6
- Build failure with template-haskell-2.21 (GHC 9.8)
- Benchmarks fail to build on GHC 9.8 due to `system-filepath`
- Unnecessary use of strict bytestrings in Data.Acid.Log HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acid-state.