GithubHelp home page GithubHelp logo

Comments (4)

ddssff avatar ddssff commented on May 25, 2024

I have done this, the result is here: seereason@0340f83

I expect to start testing it soon. It replaces the existing default signatures of getCopy and putCopy because they are dangerous. - they simply call the serialization method, no migrations are performed, and any embedded safecopy types are not decoded correctly.

One issue is that the order in which the values are output is different, and I don't really understand the order that the current code is using. I will file an issue about this pointing to the test code included in this patch.

from safecopy.

ddssff avatar ddssff commented on May 25, 2024

Ok, I understand it better and I've finished the implementation so it inter operates with the current template haskell instances. Now to take it for a spin.

from safecopy.

ddssff avatar ddssff commented on May 25, 2024

Still needs some tweaks.

from safecopy.

ddssff avatar ddssff commented on May 25, 2024

Release notes:

  1. It should now be possible to replace any use of $(deriveSafeCopy 3 extension ''Foo) with a standalone instance such as deriving instance SafeCopy Foo where version = 3; kind = extension. If version happens to be 1 and kind happens to be base you can just add SafeCopy to the deriving clause of the type.

  2. hypothesize (but I haven't yet experienced the situation) where there may be places in existing repositories where the old default putCopy and getCopy functions output something that would not be readable by this new instance. As I say, this hasn't happened to me yet, but if it did it might be fixed with an instance such as

deriving instance SafeCopy Foo where version = 3; kind = extension; getCopy = get; putCopy = put
  1. The new instances currently require the type parameters to have a Typeable instance. Welcoming suggestions how to avoid this.

  2. If you see the following it means you have to derive a Generic instance:
    • No instance for (safecopy-0.9.5:Data.SafeCopy.SafeCopy.GGetCopy
    (GHC.Generics.Rep (ReportMap_4 report))
    safecopy-0.9.5:Data.SafeCopy.SafeCopy.DatatypeInfo)
    arising from a use of ‘safecopy-0.9.5:Data.SafeCopy.SafeCopy.$dmgetCopy’

from safecopy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.