reprinter-0.3.0.0: Scrap Your Reprinter
Safe HaskellNone
LanguageHaskell2010

Text.Reprinter.Example

Synopsis

Documentation

type AST a = [Decl a] Source #

data Decl a Source #

Constructors

Decl a Span String (Expr a) 

Instances

Instances details
Eq a => Eq (Decl a) Source # 
Instance details

Defined in Text.Reprinter.Example

Methods

(==) :: Decl a -> Decl a -> Bool #

(/=) :: Decl a -> Decl a -> Bool #

Data a => Data (Decl a) Source # 
Instance details

Defined in Text.Reprinter.Example

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Decl a -> c (Decl a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Decl a) #

toConstr :: Decl a -> Constr #

dataTypeOf :: Decl a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Decl a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Decl a)) #

gmapT :: (forall b. Data b => b -> b) -> Decl a -> Decl a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Decl a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Decl a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Decl a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Decl a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Decl a -> m (Decl a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Decl a -> m (Decl a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Decl a -> m (Decl a) #

Show a => Show (Decl a) Source # 
Instance details

Defined in Text.Reprinter.Example

Methods

showsPrec :: Int -> Decl a -> ShowS #

show :: Decl a -> String #

showList :: [Decl a] -> ShowS #

data Expr a Source #

Constructors

Plus a Span (Expr a) (Expr a) 
Var a Span String 
Const a Span Int 

Instances

Instances details
Eq a => Eq (Expr a) Source # 
Instance details

Defined in Text.Reprinter.Example

Methods

(==) :: Expr a -> Expr a -> Bool #

(/=) :: Expr a -> Expr a -> Bool #

Data a => Data (Expr a) Source # 
Instance details

Defined in Text.Reprinter.Example

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Expr a -> c (Expr a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Expr a) #

toConstr :: Expr a -> Constr #

dataTypeOf :: Expr a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Expr a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expr a)) #

gmapT :: (forall b. Data b => b -> b) -> Expr a -> Expr a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Expr a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Expr a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Expr a -> m (Expr a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr a -> m (Expr a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr a -> m (Expr a) #

Show a => Show (Expr a) Source # 
Instance details

Defined in Text.Reprinter.Example

Methods

showsPrec :: Int -> Expr a -> ShowS #

show :: Expr a -> String #

showList :: [Expr a] -> ShowS #

Refactorable (Expr Bool) Source # 
Instance details

Defined in Text.Reprinter.Example

prettyExpr :: Expr a -> String Source #

Print an expression in canonical string form.

refactor :: String -> String Source #

Parse and refactor, then run the reprinter with the original source and updated AST.