module Language.Haskell.Brittany.Internal.Transformations.Columns
( transformSimplifyColumns
)
where
#include "prelude.inc"
import Language.Haskell.Brittany.Internal.Utils
import Language.Haskell.Brittany.Internal.Config.Types
import Language.Haskell.Brittany.Internal.Types
import qualified Data.Generics.Uniplate.Direct as Uniplate
transformSimplifyColumns :: BriDoc -> BriDoc
transformSimplifyColumns :: BriDoc -> BriDoc
transformSimplifyColumns = (BriDoc -> Maybe BriDoc) -> BriDoc -> BriDoc
forall on. Uniplate on => (on -> Maybe on) -> on -> on
Uniplate.rewrite ((BriDoc -> Maybe BriDoc) -> BriDoc -> BriDoc)
-> (BriDoc -> Maybe BriDoc) -> BriDoc -> BriDoc
forall a b. (a -> b) -> a -> b
$ \case
BriDoc
BDEmpty -> Maybe BriDoc
forall a. Maybe a
Nothing
BDLit{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDSeq [BriDoc]
list | (BriDoc -> Bool) -> [BriDoc] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any (\case BDSeq{} -> Bool
True
BDEmpty{} -> Bool
True
BriDoc
_ -> Bool
False) [BriDoc]
list -> BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDSeq ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc]
list [BriDoc] -> (BriDoc -> [BriDoc]) -> [BriDoc]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
BriDoc
BDEmpty -> []
BDSeq [BriDoc]
l -> [BriDoc]
l
BriDoc
x -> [BriDoc
x]
BDSeq (BDCols ColSig
sig1 cols1 :: [BriDoc]
cols1@(BriDoc
_:[BriDoc]
_):[BriDoc]
rest)
| (BriDoc -> Bool) -> [BriDoc] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all (\case BriDoc
BDSeparator -> Bool
True; BriDoc
_ -> Bool
False) [BriDoc]
rest ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig1 ([BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
cols1 [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [[BriDoc] -> BriDoc
BDSeq ([BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
cols1BriDoc -> [BriDoc] -> [BriDoc]
forall a. a -> [a] -> [a]
:[BriDoc]
rest)])
BDLines [BriDoc]
lines | (BriDoc -> Bool) -> [BriDoc] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any (\case BDLines{} -> Bool
True
BDEmpty{} -> Bool
True
BriDoc
_ -> Bool
False) [BriDoc]
lines ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDLines ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ (BriDoc -> Bool) -> [BriDoc] -> [BriDoc]
forall a. (a -> Bool) -> [a] -> [a]
filter BriDoc -> Bool
isNotEmpty ([BriDoc] -> [BriDoc]) -> [BriDoc] -> [BriDoc]
forall a b. (a -> b) -> a -> b
$ [BriDoc]
lines [BriDoc] -> (BriDoc -> [BriDoc]) -> [BriDoc]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
BDLines [BriDoc]
l -> [BriDoc]
l
BriDoc
x -> [BriDoc
x]
BDAnnotationPrior AnnKey
annKey1 (BDSeq (BriDoc
l:[BriDoc]
lr)) ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDSeq (AnnKey -> BriDoc -> BriDoc
BDAnnotationPrior AnnKey
annKey1 BriDoc
lBriDoc -> [BriDoc] -> [BriDoc]
forall a. a -> [a] -> [a]
:[BriDoc]
lr)
BDAnnotationPrior AnnKey
annKey1 (BDLines (BriDoc
l:[BriDoc]
lr)) ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDLines (AnnKey -> BriDoc -> BriDoc
BDAnnotationPrior AnnKey
annKey1 BriDoc
lBriDoc -> [BriDoc] -> [BriDoc]
forall a. a -> [a] -> [a]
:[BriDoc]
lr)
BDAnnotationPrior AnnKey
annKey1 (BDCols ColSig
sig (BriDoc
l:[BriDoc]
lr)) ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig (AnnKey -> BriDoc -> BriDoc
BDAnnotationPrior AnnKey
annKey1 BriDoc
lBriDoc -> [BriDoc] -> [BriDoc]
forall a. a -> [a] -> [a]
:[BriDoc]
lr)
BDAnnotationRest AnnKey
annKey1 (BDSeq [BriDoc]
list) ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDSeq ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
list [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [AnnKey -> BriDoc -> BriDoc
BDAnnotationRest AnnKey
annKey1 (BriDoc -> BriDoc) -> BriDoc -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
list]
BDAnnotationRest AnnKey
annKey1 (BDLines [BriDoc]
list) ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDLines ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
list [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [AnnKey -> BriDoc -> BriDoc
BDAnnotationRest AnnKey
annKey1 (BriDoc -> BriDoc) -> BriDoc -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
list]
BDAnnotationRest AnnKey
annKey1 (BDCols ColSig
sig [BriDoc]
cols) ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
cols [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [AnnKey -> BriDoc -> BriDoc
BDAnnotationRest AnnKey
annKey1 (BriDoc -> BriDoc) -> BriDoc -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
cols]
BDAnnotationKW AnnKey
annKey1 Maybe AnnKeywordId
kw (BDSeq [BriDoc]
list) ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDSeq ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
list [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [AnnKey -> Maybe AnnKeywordId -> BriDoc -> BriDoc
BDAnnotationKW AnnKey
annKey1 Maybe AnnKeywordId
kw (BriDoc -> BriDoc) -> BriDoc -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
list]
BDAnnotationKW AnnKey
annKey1 Maybe AnnKeywordId
kw (BDLines [BriDoc]
list) ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDLines ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
list [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [AnnKey -> Maybe AnnKeywordId -> BriDoc -> BriDoc
BDAnnotationKW AnnKey
annKey1 Maybe AnnKeywordId
kw (BriDoc -> BriDoc) -> BriDoc -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
list]
BDAnnotationKW AnnKey
annKey1 Maybe AnnKeywordId
kw (BDCols ColSig
sig [BriDoc]
cols) ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
cols [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [AnnKey -> Maybe AnnKeywordId -> BriDoc -> BriDoc
BDAnnotationKW AnnKey
annKey1 Maybe AnnKeywordId
kw (BriDoc -> BriDoc) -> BriDoc -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
cols]
BDCols ColSig
sig1 cols1 :: [BriDoc]
cols1@(BriDoc
_:[BriDoc]
_)
| BDLines lines :: [BriDoc]
lines@(BriDoc
_:BriDoc
_:[BriDoc]
_) <- [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
cols1
, BDCols ColSig
sig2 [BriDoc]
cols2 <- [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
lines
, ColSig
sig1ColSig -> ColSig -> Bool
forall a. Eq a => a -> a -> Bool
==ColSig
sig2 ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDLines
[ ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig1 ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
cols1 [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [[BriDoc] -> BriDoc
BDLines ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
lines]
, ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig2 [BriDoc]
cols2
]
BDCols ColSig
sig1 cols1 :: [BriDoc]
cols1@(BriDoc
_:[BriDoc]
_)
| BDLines lines :: [BriDoc]
lines@(BriDoc
_:BriDoc
_:[BriDoc]
_) <- [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
cols1
, BDEnsureIndent BrIndent
_ (BDCols ColSig
sig2 [BriDoc]
cols2) <- [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
lines
, ColSig
sig1ColSig -> ColSig -> Bool
forall a. Eq a => a -> a -> Bool
==ColSig
sig2 ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDLines
[ ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig1 ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
cols1 [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [[BriDoc] -> BriDoc
BDLines ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
lines]
, ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig2 [BriDoc]
cols2
]
BDPar BrIndent
ind col1 :: BriDoc
col1@(BDCols ColSig
sig1 [BriDoc]
_) col2 :: BriDoc
col2@(BDCols ColSig
sig2 [BriDoc]
_) | ColSig
sig1ColSig -> ColSig -> Bool
forall a. Eq a => a -> a -> Bool
==ColSig
sig2 ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ BrIndent -> BriDoc -> BriDoc
BDAddBaseY BrIndent
ind ([BriDoc] -> BriDoc
BDLines [BriDoc
col1, BriDoc
col2])
BDPar BrIndent
ind col1 :: BriDoc
col1@(BDCols ColSig
sig1 [BriDoc]
_) (BDLines (col2 :: BriDoc
col2@(BDCols ColSig
sig2 [BriDoc]
_):[BriDoc]
rest))
| ColSig
sig1ColSig -> ColSig -> Bool
forall a. Eq a => a -> a -> Bool
==ColSig
sig2 ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ BrIndent -> BriDoc -> BriDoc -> BriDoc
BDPar BrIndent
ind ([BriDoc] -> BriDoc
BDLines [BriDoc
col1, BriDoc
col2]) ([BriDoc] -> BriDoc
BDLines [BriDoc]
rest)
BDPar BrIndent
ind (BDLines [BriDoc]
lines1) col2 :: BriDoc
col2@(BDCols ColSig
sig2 [BriDoc]
_)
| BDCols ColSig
sig1 [BriDoc]
_ <- [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
lines1
, ColSig
sig1ColSig -> ColSig -> Bool
forall a. Eq a => a -> a -> Bool
==ColSig
sig2 ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ BrIndent -> BriDoc -> BriDoc
BDAddBaseY BrIndent
ind ([BriDoc] -> BriDoc
BDLines ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc]
lines1 [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [BriDoc
col2])
BDPar BrIndent
ind (BDLines [BriDoc]
lines1) (BDLines (col2 :: BriDoc
col2@(BDCols ColSig
sig2 [BriDoc]
_):[BriDoc]
rest))
| BDCols ColSig
sig1 [BriDoc]
_ <- [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
lines1
, ColSig
sig1ColSig -> ColSig -> Bool
forall a. Eq a => a -> a -> Bool
==ColSig
sig2 ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ BrIndent -> BriDoc -> BriDoc -> BriDoc
BDPar BrIndent
ind ([BriDoc] -> BriDoc
BDLines ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc]
lines1 [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [BriDoc
col2]) ([BriDoc] -> BriDoc
BDLines [BriDoc]
rest)
BDCols ColSig
sig1 [BriDoc]
cols | BDPar BrIndent
_ind BriDoc
line (BDCols ColSig
sig2 [BriDoc]
cols2) <- [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
cols
, ColSig
sig1ColSig -> ColSig -> Bool
forall a. Eq a => a -> a -> Bool
==ColSig
sig2 ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDLines
[ ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig1 ([BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
cols [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [BriDoc
line])
, ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig2 [BriDoc]
cols2
]
BDCols ColSig
sig1 [BriDoc]
cols | BDPar BrIndent
ind BriDoc
line (BDLines [BriDoc]
lines) <- [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
cols
, BDCols ColSig
sig2 [BriDoc]
cols2 <- [BriDoc] -> BriDoc
forall a. [a] -> a
List.last [BriDoc]
lines
, ColSig
sig1ColSig -> ColSig -> Bool
forall a. Eq a => a -> a -> Bool
==ColSig
sig2 ->
BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> BriDoc
BDLines
[ ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig1 ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
cols [BriDoc] -> [BriDoc] -> [BriDoc]
forall a. [a] -> [a] -> [a]
++ [BrIndent -> BriDoc -> BriDoc -> BriDoc
BDPar BrIndent
ind BriDoc
line ([BriDoc] -> BriDoc
BDLines ([BriDoc] -> BriDoc) -> [BriDoc] -> BriDoc
forall a b. (a -> b) -> a -> b
$ [BriDoc] -> [BriDoc]
forall a. [a] -> [a]
List.init [BriDoc]
lines)]
, ColSig -> [BriDoc] -> BriDoc
BDCols ColSig
sig2 [BriDoc]
cols2
]
BDLines [BriDoc
x] -> BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ BriDoc
x
BDLines [] -> BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just (BriDoc -> Maybe BriDoc) -> BriDoc -> Maybe BriDoc
forall a b. (a -> b) -> a -> b
$ BriDoc
BDEmpty
BDSeq{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDCols{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BriDoc
BDSeparator -> Maybe BriDoc
forall a. Maybe a
Nothing
BDAddBaseY{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDBaseYPushCur{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDBaseYPop{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDIndentLevelPushCur{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDIndentLevelPop{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDPar{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDAlt{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDForceMultiline{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDForceSingleline{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDForwardLineMode{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDExternal{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDPlain{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDLines{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDAnnotationPrior{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDAnnotationKW{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDAnnotationRest{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDMoveToKWDP{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDEnsureIndent{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDSetParSpacing{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDForceParSpacing{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDDebug{} -> Maybe BriDoc
forall a. Maybe a
Nothing
BDNonBottomSpacing Bool
_ BriDoc
x -> BriDoc -> Maybe BriDoc
forall a. a -> Maybe a
Just BriDoc
x