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 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 expDoc1
expDoc2 expDoc2
] ]
HsAppType{} -> do HsAppType exp1 (HsWC _ _ ty1) -> do
-- TODO t <- docSharedWrapper layoutType ty1
briDocByExactInlineOnly "HsAppType{}" lexpr e <- docSharedWrapper layoutExpr exp1
docAlt
[ docSeq
[ docForceSingleline e
, docSeparator
, docLit $ Text.pack "@"
, docForceSingleline t
]
, docPar
e
(docSeq [docLit $ Text.pack "@", t ])
]
HsAppTypeOut{} -> do HsAppTypeOut{} -> do
-- TODO -- TODO
briDocByExactInlineOnly "HsAppTypeOut{}" lexpr briDocByExactInlineOnly "HsAppTypeOut{}" lexpr

View File

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