Impl. layouting of TypeApplication, fixes #38

pull/46/head
Lennart Spitzner 2017-07-28 18:00:31 +02:00
parent aa74ec11ba
commit 00ad6c71b9
3 changed files with 20 additions and 3 deletions

View File

@ -933,6 +933,11 @@ runBrittany tabSize text = do
}
parsePrintModule config text
#test issue 38
{-# LANGUAGE TypeApplications #-}
foo = bar @Baz
###############################################################################
###############################################################################

View File

@ -167,9 +167,20 @@ layoutExpr lexpr@(L _ expr) = docWrapNode lexpr $ case expr of
expDoc1
expDoc2
]
HsAppType{} -> do
-- TODO
briDocByExactInlineOnly "HsAppType{}" lexpr
HsAppType exp1 (HsWC _ _ ty1) -> do
t <- docSharedWrapper layoutType ty1
e <- docSharedWrapper layoutExpr exp1
docAlt
[ docSeq
[ docForceSingleline e
, docSeparator
, docLit $ Text.pack "@"
, docForceSingleline t
]
, docPar
e
(docSeq [docLit $ Text.pack "@", t ])
]
HsAppTypeOut{} -> do
-- TODO
briDocByExactInlineOnly "HsAppTypeOut{}" lexpr

View File

@ -62,6 +62,7 @@ infixl 4 <&>
(.>) :: (a -> b) -> (b -> c) -> (a -> c)
f .> g = g . f
infixl 9 .>
evaluateDeep :: NFData a => a -> IO a
evaluateDeep = evaluate . force