clash-lib-1.8.1: Clash: a functional hardware description language - As a library

Copyright | (C) 2012-2016 University of Twente 2016 Myrtle Software Ltd 2021-2022 QBayLogic B.V.
License | BSD2 (see the file LICENSE)
Maintainer | QBayLogic B.V. <devops@qbaylogic.com>
Safe Haskell | Safe-Inferred
Language | Haskell2010

Clash.Core.Pretty

Contents

- Orphan instances

Description

PrettyPrec printing class and instances for CoreHW

Synopsis

- class PrettyPrec p where
  - pprPrec :: Monad m => Rational -> p -> m ClashDoc
  - pprPrec' :: Monad m => PrettyOptions -> Rational -> p -> m ClashDoc
- data PrettyOptions = PrettyOptions {
  - displayUniques :: Bool
  - displayTypes :: Bool
  - displayQualifiers :: Bool
  - displayTicks :: Bool
  }
- type ClashDoc = Doc ClashAnnotation
- data ClashAnnotation
  - = AnnContext CoreContext
  - | AnnSyntax SyntaxElement
- data SyntaxElement
  - = Keyword
  - | LitS
  - | Type
  - | Unique
  - | Qualifier
  - | Ticky
- ppr :: PrettyPrec p => p -> ClashDoc
- ppr' :: PrettyPrec p => PrettyOptions -> p -> ClashDoc
- showPpr :: PrettyPrec p => p -> String
- showPpr' :: PrettyPrec p => PrettyOptions -> p -> String
- tracePprId :: PrettyPrec p => p -> p
- tracePpr :: PrettyPrec p => p -> a -> a
- fromPpr :: PrettyPrec a => a -> Doc ()

# Documentation

class PrettyPrec p where Source #

PrettyPrec printing Show-like typeclass

Minimal complete definition

pprPrec

Methods

pprPrec :: Monad m => Rational -> p -> m ClashDoc Source #

pprPrec' :: Monad m => PrettyOptions -> Rational -> p -> m ClashDoc Source #

#### Instances

Instances details

PrettyPrec DataCon Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> DataCon -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> DataCon -> m ClashDoc Source #
PrettyPrec Literal Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> Literal -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> Literal -> m ClashDoc Source #
PrettyPrec Pat Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> Pat -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> Pat -> m ClashDoc Source #
PrettyPrec Term Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> Term -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> Term -> m ClashDoc Source #
PrettyPrec TickInfo Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> TickInfo -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> TickInfo -> m ClashDoc Source #
PrettyPrec TyCon Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> TyCon -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> TyCon -> m ClashDoc Source #
PrettyPrec LitTy Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> LitTy -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> LitTy -> m ClashDoc Source #
PrettyPrec Type Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> Type -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> Type -> m ClashDoc Source #
PrettyPrec SrcSpan Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> SrcSpan -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> SrcSpan -> m ClashDoc Source #
PrettyPrec Text Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> Text -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> Text -> m ClashDoc Source #
PrettyPrec (Name a) Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> Name a -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> Name a -> m ClashDoc Source #
PrettyPrec (Var a) Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> Var a -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> Var a -> m ClashDoc Source #
PrettyPrec a => PrettyPrec [a] Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> [a] -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> [a] -> m ClashDoc Source #
PrettyPrec (Id, Term) Source # |
Instance details Defined in Clash.Core.Pretty Methods pprPrec :: Monad m => Rational -> (Id, Term) -> m ClashDoc Source # pprPrec' :: Monad m => PrettyOptions -> Rational -> (Id, Term) -> m ClashDoc Source #

data PrettyOptions Source #

Options for the pretty-printer, controlling which elements to hide.

Constructors

PrettyOptions |

Fields

- displayUniques :: Bool

  whether to display unique identifiers

- displayTypes :: Bool

  whether to display type information

- displayQualifiers :: Bool

  whether to display module qualifiers

- displayTicks :: Bool

  whether to display ticks

#### Instances

Instances details

Default PrettyOptions Source # |
Instance details Defined in Clash.Core.Pretty Methods def :: PrettyOptions #

type ClashDoc = Doc ClashAnnotation Source #

Clash's specialized `Doc` type holds metadata of type `ClashAnnotation`.

data ClashAnnotation Source #

Annotations carried on pretty-printed code.

Constructors

AnnContext CoreContext | marking navigation to a different context
AnnSyntax SyntaxElement | marking a specific sort of syntax

#### Instances

Instances details

Eq ClashAnnotation Source # |
Instance details Defined in Clash.Core.Pretty Methods (==) :: ClashAnnotation -> ClashAnnotation -> Bool Source # (/=) :: ClashAnnotation -> ClashAnnotation -> Bool Source #

data SyntaxElement Source #

Specific places in the program syntax.

Constructors

Keyword |
LitS |
Type |
Unique |
Qualifier |
Ticky |

#### Instances

Instances details

Show SyntaxElement Source # |
Instance details Defined in Clash.Core.Pretty Methods showsPrec :: Int -> SyntaxElement -> ShowS Source # show :: SyntaxElement -> String Source # showList :: [SyntaxElement] -> ShowS Source #
Eq SyntaxElement Source # |
Instance details Defined in Clash.Core.Pretty Methods (==) :: SyntaxElement -> SyntaxElement -> Bool Source # (/=) :: SyntaxElement -> SyntaxElement -> Bool Source #

ppr :: PrettyPrec p => p -> ClashDoc Source #

ppr' :: PrettyPrec p => PrettyOptions -> p -> ClashDoc Source #

showPpr :: PrettyPrec p => p -> String Source #

Print a PrettyPrec thing to a String

showPpr' :: PrettyPrec p => PrettyOptions -> p -> String Source #

tracePprId :: PrettyPrec p => p -> p Source #

tracePpr :: PrettyPrec p => p -> a -> a Source #

fromPpr :: PrettyPrec a => a -> Doc () Source #

# Orphan instances

ClashPretty Term Source # |
Instance details Methods clashPretty :: Term -> Doc () Source #
ClashPretty Type Source # |
Instance details Methods clashPretty :: Type -> Doc () Source #
Pretty LitTy Source # |
Instance details Methods pretty :: LitTy -> Doc ann Source # prettyList :: [LitTy] -> Doc ann Source #
ClashPretty (Name a) Source # |
Instance details Methods clashPretty :: Name a -> Doc () Source #
ClashPretty (Var a) Source # |
Instance details Methods clashPretty :: Var a -> Doc () Source #