| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusTx.Show.TH
Synopsis
- class Show a where
- showsPrec :: Integer -> a -> ShowS
- show :: a -> BuiltinString
- type ShowS = [BuiltinString] -> [BuiltinString]
- showString :: BuiltinString -> ShowS
- showSpace :: ShowS
- showCommaSpace :: ShowS
- showParen :: Bool -> ShowS -> ShowS
- appPrec :: Integer
- appPrec1 :: Integer
- concatBuiltinStrings :: [BuiltinString] -> BuiltinString
- deriveShow :: ConstructorInfo -> Q Match
- deriveShowExpForArg :: Integer -> Name -> Q Exp
- parenInfixConName :: Name -> String
Documentation
Conversion of values to BuiltinStrings. Unlike GHC.Show.Show, there is no
showList method, because there is no Show instance for String.
Instances
| Show BuiltinByteString # | |
Defined in PlutusTx.Show Methods showsPrec :: Integer -> BuiltinByteString -> ShowS # show :: BuiltinByteString -> BuiltinString # | |
| Show BuiltinData # | |
Defined in PlutusTx.Show | |
| Show BuiltinString # | |
Defined in PlutusTx.Show | |
| Show Integer # | |
Defined in PlutusTx.Show | |
| Show () # | |
Defined in PlutusTx.Show | |
| Show Bool # | |
Defined in PlutusTx.Show | |
| Show a => Show (Maybe a) # | |
Defined in PlutusTx.Show | |
| Show a => Show [a] # | |
Defined in PlutusTx.Show | |
| (Show a, Show b) => Show (Either a b) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b) => Show (These a b) # | |
Defined in PlutusTx.These | |
| (Show a, Show b) => Show (a, b) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c) => Show (a, b, c) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d) => Show (a, b, c, d) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s, Show t) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s, Show t, Show u) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s, Show t, Show u, Show v) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s, Show t, Show u, Show v, Show w) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s, Show t, Show u, Show v, Show w, Show x) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s, Show t, Show u, Show v, Show w, Show x, Show y) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s, Show t, Show u, Show v, Show w, Show x, Show y, Show z) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) # | |
Defined in PlutusTx.Show | |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s, Show t, Show u, Show v, Show w, Show x, Show y, Show z, Show t26) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, t26) # | |
Defined in PlutusTx.Show | |
type ShowS = [BuiltinString] -> [BuiltinString] #
Currently the only way to concatenate BuiltinStrings is appendString, whose cost
is linear in the total length of the two strings. A naive concatenation of multiple
BuiltinStrings costs O(n^2) in the worst case, where n is the total length. By
collecting the BuiltinStrings in a list and concatenating them in the end, the cost
can be reduced to O(n*logn). If we add a concatStrings builtin function in the future,
the cost can be further reduced to O(n).
Like ShowS, the purpose of the function type here is to turn list concatenation
into function composition.
showString :: BuiltinString -> ShowS #
showCommaSpace :: ShowS #
deriveShow :: ConstructorInfo -> Q Match #
Derive showsPrec body for a single data constructor.
deriveShowExpForArg :: Integer -> Name -> Q Exp #
Derive the showsPrec expression for showing a single constructor argument.
parenInfixConName :: Name -> String #
Add parens if it is an infix data constructor.