I was looking at the current example ‘hello world’ program for gi-gtk
, compiling with GHC 9.6.6, and was confused by the last line of (extract):
{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE OverloadedRecordDot #-}
{-# LANGUAGE OverloadedStrings #-}
...
main :: IO ()
main = do
app <- new Gtk.Application
[ #applicationId := "haskell-gi.example"
, On #activate (activate ?self)
]
void $ app.run Nothing
I realised that, with language extension OverloadedRecordDot
, app.run
could mean the same as run app
(where run
is an in-scope field label). However, I could not see where the run
field label was coming from.
I subsequently realised that app.run
here actually meant the same as #run app
, with #run
possible because of the language extension OverloadedLabels
.
My question is: is that (#field value
can be written value.field
) documented anywhere? I can’t see it mentioned in the following parts of the GHC 9.6.6 User Guide:
- 6.9.7. Overloaded labels — Glasgow Haskell Compiler 9.6.6 User's Guide
- 6.5.10. Overloaded record dot — Glasgow Haskell Compiler 9.6.6 User's Guide
EDIT: As explained by @taylorfausak below, my question was based on a false premise.