Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename columns #177

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/Frames/Melt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@
RDeleteAll '[] ts = ts
RDeleteAll (s ': ss) ts = RDeleteAll ss (RDelete s ts)

transform :: forall rs as bs . (as ⊆ rs, RDeleteAll as rs ⊆ rs)
=> (Record as -> Record bs) -> Record rs -> Record (RDeleteAll as rs ++ bs)
transform f xs = rcast @(RDeleteAll as rs) xs `rappend` f (rcast xs)

Check failure on line 63 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Illegal visible type application ‘@(RDeleteAll as rs)’

Check failure on line 63 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.4.7

Pattern syntax in expression context: rcast@(RDeleteAll as rs)

Check failure on line 63 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Illegal visible type application ‘@(RDeleteAll as rs)’

-- | Rename a column
retypeColumn :: forall x y rs . ( V.KnownField x

Check failure on line 66 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Not in scope: type constructor or class ‘V.KnownField’

Check failure on line 66 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Not in scope: type constructor or class ‘V.KnownField’
, V.KnownField y

Check failure on line 67 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Not in scope: type constructor or class ‘V.KnownField’

Check failure on line 67 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Not in scope: type constructor or class ‘V.KnownField’
, V.Snd x ~ V.Snd y

Check failure on line 68 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Not in scope: type constructor or class ‘V.Snd’

Check failure on line 68 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Not in scope: type constructor or class ‘V.Snd’

Check failure on line 68 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Not in scope: type constructor or class ‘V.Snd’

Check failure on line 68 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Not in scope: type constructor or class ‘V.Snd’
, ElemOf rs x
, RDelete x rs ⊆ rs)
=> Record rs -> Record (RDelete x rs V.++ '[y])

Check failure on line 71 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Not in scope: type constructor or class ‘V.++’

Check failure on line 71 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Not in scope: type constructor or class ‘V.++’
retypeColumn = transform @rs @'[x] @'[y] (\r -> (rgetField @x r &: V.RNil))

Check failure on line 72 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Illegal visible type application ‘@rs

Check failure on line 72 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Illegal visible type application ‘@'[x]’

Check failure on line 72 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Illegal visible type application ‘@'[y]’

Check failure on line 72 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

Illegal visible type application ‘@x

Check failure on line 72 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Illegal visible type application ‘@rs

Check failure on line 72 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Illegal visible type application ‘@'[x]’

Check failure on line 72 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Illegal visible type application ‘@'[y]’

Check failure on line 72 in src/Frames/Melt.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Illegal visible type application ‘@x

-- | This is 'melt', but the variables are at the front of the record,
-- which reads a bit odd.
meltRow' :: forall proxy vs ts ss. (vs ⊆ ts, ss ⊆ ts, vs ~ RDeleteAll ss ts,
Expand Down
Loading