on master help sign in
Misc refactoring around "::" symbols
commitc895ef49be9fcc6cac6a10bd062df99ddca599cc authorMark Karpov <markkarpov92@gmail.com> dateMon 1 Jun 2020, 11:16 (6 years ago) parenta99cff0
2 files changed+18−18
src/Ormolu/Printer/Meat/Declaration/Signature.hs+16−16 src/Ormolu/Printer/Meat/Type.hs+2−2
src/Ormolu/Printer/Meat/Declaration/Signature.hs+16−16
@@ -56,15 +56,14 @@ p_typeSig indentTail (n : ns) hswc = do
5656p_typeAscription ::
5757 LHsSigWcType GhcPs ->
5858 R ()
59−p_typeAscription HsWC {..} = do
59+p_typeAscription HsWC {..} = inci $ do
6060 space
61− inci $ do
62− txt "::"
63− let t = hsib_body hswc_body
64− if hasDocStrings (unLoc t)
65− then newline
66− else breakpoint
67− located t p_hsType
61+ txt "::"
62+ let t = hsib_body hswc_body
63+ if hasDocStrings (unLoc t)
64+ then newline
65+ else breakpoint
66+ located t p_hsType
6867p_typeAscription (XHsWildCardBndrs x) = noExtCon x
6968
7069p_patSynSig ::
@@ -226,12 +225,13 @@ p_sccSig loc literal = pragma "SCC" . inci $ do
226225p_standaloneKindSig :: StandaloneKindSig GhcPs -> R ()
227226p_standaloneKindSig (StandaloneKindSig NoExtField name bndrs) = do
228227 txt "type"
229− space
230− p_rdrName name
231− space
232− txt "::"
233− breakpoint
234− inci $ case bndrs of
235− HsIB NoExtField sig -> located sig p_hsType
236− XHsImplicitBndrs x -> noExtCon x
228+ inci $ do
229+ space
230+ p_rdrName name
231+ space
232+ txt "::"
233+ breakpoint
234+ case bndrs of
235+ HsIB NoExtField sig -> located sig p_hsType
236+ XHsImplicitBndrs x -> noExtCon x
237237p_standaloneKindSig (XStandaloneKindSig c) = noExtCon c
src/Ormolu/Printer/Meat/Type.hs+2−2
@@ -117,9 +117,9 @@ p_hsType' multilineArgs docStyle = \case
117117 HsStarTy NoExtField _ -> txt "*"
118118 HsKindSig NoExtField t k -> sitcc $ do
119119 located t p_hsType
120− space -- FIXME
121− txt "::"
122120 space
121+ txt "::"
122+ breakpoint
123123 inci (located k p_hsType)
124124 HsSpliceTy NoExtField splice -> p_hsSplice splice
125125 HsDocTy NoExtField t str ->