In the code below,
{-# LANGUAGE OverloadedLabels #-}
module Foo where
data R = R { x :: Int }
g :: Int
g = #x (R { x = 1 })
I expected this to type-check, but instead I get:
foo.hs:7:5: error:
• No instance for (GHC.OverloadedLabels.IsLabel "x" (R -> Int))
arising from the overloaded label ‘#x’
(maybe you haven't applied a function to enough arguments?)
• In the expression: #x
In the expression: #x (R {x = 1})
In an equation for ‘g’: g = #x (R {x = 1})
Given the Overloaded Record Fields proposal, I expected there to be a built-in instance of IsLabel "x" (R -> Int)
. Is this still the case or does the implementation deviate from the proposal?