Add support for OverloadedLabels #244

Merged
eborden merged 5 commits from add-overloaded-labels into master 2019-06-24 02:31:05 +02:00
2 changed files with 19 additions and 3 deletions

View File

@ -130,3 +130,13 @@ func = do
hello
|]
pure True
###############################################################################
## OverloadedLabels
#test bare label
{-# LANGUAGE OverloadedLabels #-}
foo = #bar
#test applied and composed label
{-# LANGUAGE OverloadedLabels #-}
foo = #bar . #baz $ fmap #foo xs

View File

@ -55,9 +55,15 @@ layoutExpr lexpr@(L _ expr) = do
HsRecFld{} -> do
-- TODO
briDocByExactInlineOnly "HsRecFld" lexpr
HsOverLabel{} -> do
-- TODO
briDocByExactInlineOnly "HsOverLabel{}" lexpr
#if MIN_VERSION_ghc(8,6,0) /* ghc-8.6 */
HsOverLabel _ext _reboundFromLabel name ->
#elif MIN_VERSION_ghc(8,2,0) /* ghc-8.2 8.4 */
HsOverLabel _reboundFromLabel name ->
#else /* ghc-8.0 */
HsOverLabel name ->
#endif
let label = FastString.unpackFS name
in docLit . Text.pack $ '#' : label
HsIPVar{} -> do
-- TODO
briDocByExactInlineOnly "HsOverLabel{}" lexpr