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

Selection on records fails #4

Open
fxdpntthm opened this issue Nov 19, 2024 · 0 comments
Open

Selection on records fails #4

fxdpntthm opened this issue Nov 19, 2024 · 0 comments

Comments

@fxdpntthm
Copy link
Contributor

import RoHs.Language.Lib

type Coord = R '["x" := Int , "y" := Int]

type Color = R '[ "R" := Int , "G" := Int , "B" := Int]

type Pixel = R0 (Coord ~+~ Color)

coord :: R0 Coord
coord =  (labR0 @"x" (22 :: Int)) `cat0` (labR0 @"y" (11 :: Int))

color :: R0 Color
color =  (labR0 @"R" (101 :: Int))
         `cat0`  (labR0 @"B" (102 :: Int))
         `cat0`  (labR0 @"G" (103 :: Int))

p :: Pixel
p = coord `cat0` color

y :: Int = sel0 @"y" p
-- y returns 22 here and not 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant