I was playing with different ways of composing type-synonymed rows together and I hit a compilation error that I can't understand.
Is this a bug in the type-checker? Perhaps the record field accessor (the .page code here) doesn't have access to the Union constraint?
module Main where
import Prelude
type PaginationRow = ( page :: Int )
f :: forall r. Union PaginationRow () r => Record r -> String
f r = "Page = " <> show r.page
-- Could not match type r1 with type ( page :: to | t1 )
g :: forall r. Union ( page :: Int ) () r => Record r -> Int
g r = r.page
-- Could not match type r1 with type ( page :: Int | t0 )
-- (Fixed the error messages - they were both `page :: String` before)
I was playing with different ways of composing type-synonymed rows together and I hit a compilation error that I can't understand.
Is this a bug in the type-checker? Perhaps the record field accessor (the
.pagecode here) doesn't have access to theUnionconstraint?