gagandeepb / Frames-beam

Accessing Postgres in a data frame in Haskell
BSD 3-Clause "New" or "Revised" License
24 stars 3 forks source link

fails to build when added as a stack dependency #19

Closed o1lo01ol1o closed 5 years ago

o1lo01ol1o commented 6 years ago

upon building my project:

• Couldn't match kind ‘*’
                         with ‘(ghc-prim-0.5.1.1:GHC.Types.Symbol, *)’
          When matching the kind of ‘ZipTypes b_names b_rs’
          Expected type: b Identity
                         -> Frames.Rec.Record (ZipTypes b_names b_rs)
            Actual type: b Identity
                         -> Data.Vinyl.Core.Rec
                              Data.Vinyl.Functor.Identity (ZipTypes b_names b_rs)
        • In the first argument of ‘map’, namely ‘createRecId’
          In the expression: map createRecId bQRes
          In an equation for ‘bRecs’: bRecs = map createRecId bQRes
        • Relevant bindings include
            bRecs :: [Frames.Rec.Record (ZipTypes b_names b_rs)]
              (bound at src/Frames/SQL/Beam/Postgres/Query.hs:66:5)
            join2 :: JoinQueryResults a b
                     -> FrameRec (ZipTypes a_names a_rs ++ ZipTypes b_names b_rs)
              (bound at src/Frames/SQL/Beam/Postgres/Query.hs:61:1)

using this stack.yaml

resolver: lts-11.7
packages:
- .
extra-deps:
- Frames-0.5.0
- beam-core-0.7.2.2
- beam-migrate-0.3.2.1
- beam-postgres-0.3.2.2
- vinyl-0.10.0
- Frames-beam-0.1.0.1
o1lo01ol1o commented 6 years ago

Looks like this is an issue with vinyl-0.10.0; vinyl-0.8.1.1 compiles.

gagandeepb commented 6 years ago

The source of this appears to be the fact the dependency on Frames-0.5.0, which in turn depends on vinyl >= 0.10.0.

More specifically, in Frames-0.4.0:

type Record = Rec Identity

But in Frames-0.5.0:

type Record = FieldRec
-- and
type FieldRec = Rec ElField

I think, for now, putting an upper bound on Frames and vinyl should fix this. Let me push an update. Thanks for raising this.

gagandeepb commented 6 years ago

Frames-beam-0.1.0.2 is on Hackage now. @o1lo01ol1o can I close this ?

ocramz commented 6 years ago

I'm not familiar with the reasons behind the change in Frames-0.5.0, but I'd suggest to instead modify Frames-beam to use the new Frames representation, rather than being locked to an obsolete version.

o1lo01ol1o commented 6 years ago

It is likely that it has to do with the new Categorical representation in Frames. This allows many useful things, like the use of discrimination for joins. I would think supporting 5.0 would be preferable.

Sent from my iPhone

On Sep 1, 2018, at 4:11 PM, Marco Zocca notifications@github.com wrote:

I'm not familiar with the reasons behind the change in Frames-0.5.0, but I'd suggest to instead modify Frames-beam to use the new Frames representation, rather than being locked to an obsolete version.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

gagandeepb commented 6 years ago

@o1lo01ol1o New version with support for Frames-0.5.0 and vinyl-0.10.0 is on Hackage now. Do give it another try and let me know how it goes.