pire-0.2.4

Copyright(c) Andreas Reuleaux 2015 - 2018
LicenseBSD2
MaintainerAndreas Reuleaux <rx@a-rx.info>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Pretty

Contents

Description

pretty printing, approach copied from Ermine and adapted to Pire, Prettyprint, parts copied/adapted from Pi-forall

Synopsis

Documentation

_pprint :: Applicative f => Expr a a -> Int -> (a -> Int -> f (Doc ann)) -> f (Doc ann) Source #

pretty printing in a naive manner: instantiating scopes, (and ignoring annotations for now)

pprint :: (Applicative f, Pretty a) => Expr a a -> f (Doc ann) Source #

prettyExpr :: (Applicative f, MonadReader PrettyInfo f) => Expr t a -> [String] -> Int -> (t -> Int -> f (Doc Ann)) -> (a -> Int -> f (Doc Ann)) -> f (Doc Ann) Source #

prettyExpr_ :: (Applicative f, MonadReader PrettyInfo f) => Expr t a -> [String] -> Int -> (t -> Int -> f (Doc Ann)) -> (a -> Int -> f (Doc Ann)) -> f (Doc Ann) Source #

prettyAnnot :: MonadReader PrettyInfo m => Annot t a -> [String] -> Int -> (t -> Int -> m (Doc Ann)) -> (a -> Int -> m (Doc Ann)) -> m (Doc Ann) Source #

prettyArg :: MonadReader PrettyInfo m => Arg t a -> [String] -> Int -> (t -> Int -> m (Doc Ann)) -> (a -> Int -> m (Doc Ann)) -> m (Doc Ann) Source #

prettyMatch :: MonadReader PrettyInfo m => Match t a -> [String] -> Int -> (t -> Int -> m (Doc Ann)) -> (a -> Int -> m (Doc Ann)) -> m (Doc Ann) Source #

prettyPattern :: Applicative f => Pattern t -> [String] -> Int -> (t -> Int -> f (Doc Ann)) -> f (Doc Ann) Source #

prettyDecl :: (Applicative f, MonadReader PrettyInfo f) => Decl t a -> [String] -> Int -> (t -> Int -> f (Doc Ann)) -> (a -> Int -> f (Doc Ann)) -> f (Doc Ann) Source #

prettyTele :: (Applicative f, MonadReader PrettyInfo f) => Telescope t a -> [String] -> Int -> (t -> Int -> f (Doc Ann)) -> (a -> Int -> f (Doc Ann)) -> f (Doc Ann) Source #

prettyConstructorDef :: (Applicative f, MonadReader PrettyInfo f) => ConstructorDef t a -> [String] -> Int -> (t -> Int -> f (Doc Ann)) -> (a -> Int -> f (Doc Ann)) -> f (Doc Ann) Source #

prettyModule :: (Applicative f, MonadReader PrettyInfo f) => Module t a -> [String] -> Int -> (t -> Int -> f (Doc Ann)) -> (a -> Int -> f (Doc Ann)) -> f (Doc Ann) Source #

lamPatterns :: Applicative f => t -> [String] -> (t -> Int -> f (Doc ann)) -> (HashMap Int String, f (Doc ann)) Source #

Orphan instances

Pretty (Pattern String) Source # 

Methods

pretty :: Pattern String -> Doc ann #

prettyList :: [Pattern String] -> Doc ann #

Pretty (Pattern Text) Source # 

Methods

pretty :: Pattern Text -> Doc ann #

prettyList :: [Pattern Text] -> Doc ann #

PrettyAnn (Pattern String) Source # 
PrettyAnn (Pattern Text) Source # 
Pretty (Module String String) Source # 
Pretty (Module Text Text) Source # 

Methods

pretty :: Module Text Text -> Doc ann #

prettyList :: [Module Text Text] -> Doc ann #

Pretty (ConstructorDef String String) Source # 
Pretty (ConstructorDef Text Text) Source # 
Pretty (Telescope String String) Source # 
Pretty (Telescope Text Text) Source # 

Methods

pretty :: Telescope Text Text -> Doc ann #

prettyList :: [Telescope Text Text] -> Doc ann #

Pretty (Decl String String) Source # 

Methods

pretty :: Decl String String -> Doc ann #

prettyList :: [Decl String String] -> Doc ann #

Pretty (Decl Text Text) Source # 

Methods

pretty :: Decl Text Text -> Doc ann #

prettyList :: [Decl Text Text] -> Doc ann #

Pretty (Arg String String) Source # 

Methods

pretty :: Arg String String -> Doc ann #

prettyList :: [Arg String String] -> Doc ann #

Pretty (Arg Text Text) Source # 

Methods

pretty :: Arg Text Text -> Doc ann #

prettyList :: [Arg Text Text] -> Doc ann #

Pretty (Match String String) Source # 

Methods

pretty :: Match String String -> Doc ann #

prettyList :: [Match String String] -> Doc ann #

Pretty (Match Text Text) Source # 

Methods

pretty :: Match Text Text -> Doc ann #

prettyList :: [Match Text Text] -> Doc ann #

Pretty (Expr String String) Source # 

Methods

pretty :: Expr String String -> Doc ann #

prettyList :: [Expr String String] -> Doc ann #

Pretty (Expr Text Text) Source # 

Methods

pretty :: Expr Text Text -> Doc ann #

prettyList :: [Expr Text Text] -> Doc ann #

PrettyAnn (Module String String) Source # 
PrettyAnn (Module Text Text) Source # 
PrettyAnn (ConstructorDef String String) Source # 
PrettyAnn (ConstructorDef Text Text) Source # 
PrettyAnn (Telescope String String) Source # 
PrettyAnn (Telescope Text Text) Source # 
PrettyAnn (Decl String String) Source # 
PrettyAnn (Decl Text Text) Source # 
PrettyAnn (Arg String String) Source # 
PrettyAnn (Arg Text Text) Source # 
PrettyAnn (Match String String) Source # 
PrettyAnn (Match Text Text) Source # 
PrettyAnn (Annot Text Text) Source # 
PrettyAnn (Expr String String) Source # 
PrettyAnn (Expr Text Text) Source #