unison-pretty-printer-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Util.Pretty

Synopsis

Documentation

data Pretty s Source #

Instances

Instances details
Functor Pretty Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

fmap :: (a -> b) -> Pretty a -> Pretty b #

(<$) :: a -> Pretty b -> Pretty a #

IsString s => IsString (Pretty s) Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

fromString :: String -> Pretty s #

Monoid (Pretty s) Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

mempty :: Pretty s #

mappend :: Pretty s -> Pretty s -> Pretty s #

mconcat :: [Pretty s] -> Pretty s #

Semigroup (Pretty s) Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

(<>) :: Pretty s -> Pretty s -> Pretty s #

sconcat :: NonEmpty (Pretty s) -> Pretty s #

stimes :: Integral b => b -> Pretty s -> Pretty s #

Show s => Show (Pretty s) Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

showsPrec :: Int -> Pretty s -> ShowS #

show :: Pretty s -> String #

showList :: [Pretty s] -> ShowS #

Eq s => Eq (Pretty s) Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

(==) :: Pretty s -> Pretty s -> Bool #

(/=) :: Pretty s -> Pretty s -> Bool #

align :: (ListLike s Char, IsString s) => [(Pretty s, Pretty s)] -> [Pretty s] Source #

align' :: (ListLike s Char, IsString s) => [(Pretty s, Maybe (Pretty s))] -> [(Pretty s, Pretty s)] Source #

alternations :: ListLike s c => (c -> Bool) -> s -> [s] Source #

backticked' :: IsString s => Pretty s -> Pretty s -> Pretty s Source #

Attach some punctuation after the closing backtick.

boxForkLeft :: forall s. (ListLike s Char, IsString s) => [Pretty s] -> [Pretty s] Source #

boxLeft :: forall s. (ListLike s Char, IsString s) => [Pretty s] -> [Pretty s] Source #

boxLeftM :: forall m s. (Monad m, ListLike s Char, IsString s) => [m (Pretty s)] -> [m (Pretty s)] Source #

boxRight :: forall s. (ListLike s Char, IsString s) => [Pretty s] -> [Pretty s] Source #

boxRightM :: forall m s. (Monad m, ListLike s Char, IsString s) => [m (Pretty s)] -> [m (Pretty s)] Source #

excerptSep' :: IsString s => Maybe Int -> (Int -> Pretty s) -> Pretty s -> [Pretty s] -> Pretty s Source #

column2 :: (ListLike s Char, IsString s) => [(Pretty s, Pretty s)] -> Pretty s Source #

column2sep :: (ListLike s Char, IsString s) => Pretty s -> [(Pretty s, Pretty s)] -> Pretty s Source #

column2M :: (Applicative m, ListLike s Char, IsString s) => [m (Pretty s, Pretty s)] -> m (Pretty s) Source #

column2UnzippedM :: forall m s. (ListLike s Char, IsString s, Monad m) => Pretty s -> [m (Pretty s)] -> [m (Pretty s)] -> m (Pretty s) Source #

column3 :: (ListLike s Char, IsString s) => [(Pretty s, Pretty s, Pretty s)] -> Pretty s Source #

column3M :: (ListLike s Char, IsString s, Monad m) => [m (Pretty s, Pretty s, Pretty s)] -> m (Pretty s) Source #

column3UnzippedM :: forall m s. (ListLike s Char, IsString s, Monad m) => Pretty s -> [m (Pretty s)] -> [m (Pretty s)] -> [m (Pretty s)] -> m (Pretty s) Source #

column3sep :: (ListLike s Char, IsString s) => Pretty s -> [(Pretty s, Pretty s, Pretty s)] -> Pretty s Source #

columnNHeader :: [Pretty ColorText] -> [[Pretty ColorText]] -> Pretty ColorText Source #

Creates an aligned table with an arbitrary number of columns and column headers. Ensure all rows have the same number of columns or the alignment may be off.

commas :: (Foldable f, IsString s) => f (Pretty s) -> Pretty s Source #

flatMap :: (s -> Pretty s2) -> Pretty s -> Pretty s2 Source #

hang' :: (ListLike s Char, IsString s) => Pretty s -> Pretty s -> Pretty s -> Pretty s Source #

hang :: (ListLike s Char, IsString s) => Pretty s -> Pretty s -> Pretty s Source #

isEmpty :: Eq s => IsString s => Pretty s -> Bool Source #

lines :: (Foldable f, IsString s) => f (Pretty s) -> Pretty s Source #

lit :: (IsString s, ListLike s Char) => s -> Pretty s Source #

map :: ListLike s2 Char => (s -> s2) -> Pretty s -> Pretty s2 Source #

nest :: (ListLike s Char, IsString s) => Pretty s -> Pretty s -> Pretty s Source #

num :: (Show n, Num n, IsString s) => n -> Pretty s Source #

leftJustify :: (Eq s, ListLike s Char, IsString s) => [(Pretty s, a)] -> [(Pretty s, a)] Source #

nonEmpty :: (Foldable f, IsString s) => f (Pretty s) -> [Pretty s] Source #

numbered :: (Foldable f, ListLike s Char, IsString s) => (Int -> Pretty s) -> f (Pretty s) -> Pretty s Source #

render :: (Monoid s, IsString s) => Width -> Pretty s -> s Source #

sep :: (Foldable f, IsString s) => Pretty s -> f (Pretty s) -> Pretty s Source #

sepNonEmpty :: (Foldable f, IsString s) => Pretty s -> f (Pretty s) -> Pretty s Source #

sepSpaced :: (Foldable f, IsString s) => Pretty s -> f (Pretty s) -> Pretty s Source #

shown :: (Show a, IsString s) => a -> Pretty s Source #

pshown :: (Show a, IsString s) => a -> Pretty s Source #

Like shown, but uses a pretty layout (so long as the Show instance is derived).

spaceIfNeeded :: Eq s => IsString s => Pretty s -> Pretty s -> Pretty s Source #

spaced :: (Foldable f, IsString s) => f (Pretty s) -> Pretty s Source #

spacedMap :: (Foldable f, IsString s) => (a -> Pretty s) -> f a -> Pretty s Source #

spacedTraverse :: (Traversable f, IsString s, Applicative m) => (a -> m (Pretty s)) -> f a -> m (Pretty s) Source #

surroundCommas :: (Foldable f, IsString s) => Pretty s -> Pretty s -> f (Pretty s) -> Pretty s Source #

table :: (IsString s, ListLike s Char) => [[Pretty s]] -> Pretty s Source #

wrap' :: IsString s => (s -> [Pretty s]) -> Pretty s -> Pretty s Source #

newtype Width Source #

Constructors

Width 

Fields

Instances

Instances details
Bounded Width Source # 
Instance details

Defined in Unison.Util.Pretty

Generic Width Source # 
Instance details

Defined in Unison.Util.Pretty

Associated Types

type Rep Width :: Type -> Type #

Methods

from :: Width -> Rep Width x #

to :: Rep Width x -> Width #

Num Width Source # 
Instance details

Defined in Unison.Util.Pretty

Show Width Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

showsPrec :: Int -> Width -> ShowS #

show :: Width -> String #

showList :: [Width] -> ShowS #

Eq Width Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

(==) :: Width -> Width -> Bool #

(/=) :: Width -> Width -> Bool #

Ord Width Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

compare :: Width -> Width -> Ordering #

(<) :: Width -> Width -> Bool #

(<=) :: Width -> Width -> Bool #

(>) :: Width -> Width -> Bool #

(>=) :: Width -> Width -> Bool #

max :: Width -> Width -> Width #

min :: Width -> Width -> Width #

type Rep Width Source # 
Instance details

Defined in Unison.Util.Pretty

type Rep Width = D1 ('MetaData "Width" "Unison.Util.Pretty" "unison-pretty-printer-0.0.0-7eP78gmaawhEeTiIoaM5Kn" 'True) (C1 ('MetaCons "Width" 'PrefixI 'True) (S1 ('MetaSel ('Just "widthToInt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

Exported for testing

data Delta Source #

Instances

Instances details
Monoid Delta Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

mempty :: Delta #

mappend :: Delta -> Delta -> Delta #

mconcat :: [Delta] -> Delta #

Semigroup Delta Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

(<>) :: Delta -> Delta -> Delta #

sconcat :: NonEmpty Delta -> Delta #

stimes :: Integral b => b -> Delta -> Delta #

Show Delta Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

showsPrec :: Int -> Delta -> ShowS #

show :: Delta -> String #

showList :: [Delta] -> ShowS #

Eq Delta Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

(==) :: Delta -> Delta -> Bool #

(/=) :: Delta -> Delta -> Bool #

Ord Delta Source # 
Instance details

Defined in Unison.Util.Pretty

Methods

compare :: Delta -> Delta -> Ordering #

(<) :: Delta -> Delta -> Bool #

(<=) :: Delta -> Delta -> Bool #

(>) :: Delta -> Delta -> Bool #

(>=) :: Delta -> Delta -> Bool #

max :: Delta -> Delta -> Delta #

min :: Delta -> Delta -> Delta #