GithubHelp home page GithubHelp logo

Comments (11)

paf31 avatar paf31 commented on July 24, 2024 2

I think we should move the minimal amount of stuff needed to support this (i.e. RowList and classes) into Prelude as part of the 0.12.0 updates.

from purescript-record.

hdgarrood avatar hdgarrood commented on July 24, 2024 1

Do you think it might be worth considering doing it before then? Just because all the stuff is already there and ready to go, it seems a shame to wait, and even after 0.12 is out I think it would be nice if people could take advantage of this without having to upgrade. Presumably this would only be a minor-level change for Prelude, and I don't think that would cause a huge amount of hassle since most people seem to be using caret (^) bounds for most dependencies..?

from purescript-record.

garyb avatar garyb commented on July 24, 2024

It'll probably happen, but it requires some reorganisation of the libraries - the instances for records will have to live with the class definitions to prevent them from being orphans (since record is a Prim type) - so for that to happen, -typelevel-prelude needs to be merged with or moved above -prelude in the dependency hierarchy.

from purescript-record.

matthewleon avatar matthewleon commented on July 24, 2024

FWIW, in the meantime I've created this, which I find helpful: https://github.com/matthewleon/purescript-record-show

from purescript-record.

paf31 avatar paf31 commented on July 24, 2024

We definitely could, especially since there is no plan for continued work on 0.12 right now anyway.

from purescript-record.

hdgarrood avatar hdgarrood commented on July 24, 2024

Great! Looking at @matthewleon's record-show library, I guess that means the following would need to be moved above or into Prelude in the dependency hierarchy:

import Data.Record (get, delete)
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
import Type.Prelude (class RowToList, class RowLacks)
import Type.Row (kind RowList, Nil, Cons, RLProxy(..))

Does that seem doable? Or is there maybe a way of achieving this without using all of these?

from purescript-record.

hdgarrood avatar hdgarrood commented on July 24, 2024

Come to think of it I suppose we could avoid the record dependency by cheating and using the FFI...? Also we could probably switch out delete for a version of unsafeCoerce which is specialised to have the same type, in order to avoid doing unnecessary work.

from purescript-record.

matthewleon avatar matthewleon commented on July 24, 2024

Come to think of it I suppose we could avoid the record dependency by cheating and using the FFI...?

Is there FFI use elsewhere in the Prelude?

from purescript-record.

hdgarrood avatar hdgarrood commented on July 24, 2024

Yes; most of the Show instances need it, for example.

from purescript-record.

hdgarrood avatar hdgarrood commented on July 24, 2024

On second thoughts, since we are moving some of these classes in 0.12, it's probably best to wait until 0.12. See purescript/purescript#2903

from purescript-record.

garyb avatar garyb commented on July 24, 2024

These now exist in the 0.12 version of the prelude.

from purescript-record.

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.