| Copyright | Copyright (c) 2019-2025 Travis Cardwell |
|---|---|
| License | MIT |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.TTC.Wrapper
Contents
Description
This module defines a newtype wrapper for each Textual data type.
Each wrapper has a Render instance that converts the wrapped type and
a Parse instance that wraps the argument (never failing). Data types
that are coercible to a Textual data type can use these wrappers to
derive instances using DerivingVia.
See the wrapper example program in the ttc-examples directory of the
source repository.
Synopsis
- newtype WrapperS = WrapperS {
- unWrapperS :: String
- newtype WrapperT = WrapperT {
- unWrapperT :: Text
- newtype WrapperTL = WrapperTL {
- unWrapperTL :: Text
- newtype WrapperTLB = WrapperTLB {}
- newtype WrapperST = WrapperST {}
- newtype WrapperBS = WrapperBS {}
- newtype WrapperBSL = WrapperBSL {}
- newtype WrapperBSB = WrapperBSB {}
- newtype WrapperSBS = WrapperSBS {}
Wrapper Types
String wrapper type
Since: 1.5.0.0
Constructors
| WrapperS | |
Fields
| |
Strict Text wrapper type
Since: 1.5.0.0
Constructors
| WrapperT | |
Fields
| |
Lazy Text wrapper type
Since: 1.5.0.0
Constructors
| WrapperTL | |
Fields
| |
newtype WrapperTLB Source #
Text Builder wrapper type
Since: 1.5.0.0
Constructors
| WrapperTLB | |
Fields | |
Instances
| Parse WrapperTLB Source # | |
Defined in Data.TTC.Wrapper | |
| Render WrapperTLB Source # | |
Defined in Data.TTC.Wrapper Methods render :: Textual t => WrapperTLB -> t Source # | |
Strict ByteString wrapper type
Since: 1.5.0.0
Constructors
| WrapperBS | |
Fields | |
newtype WrapperBSL Source #
Lazy ByteString wrapper type
Since: 1.5.0.0
Constructors
| WrapperBSL | |
Fields | |
Instances
| Parse WrapperBSL Source # | |
Defined in Data.TTC.Wrapper | |
| Render WrapperBSL Source # | |
Defined in Data.TTC.Wrapper Methods render :: Textual t => WrapperBSL -> t Source # | |
newtype WrapperBSB Source #
ByteString Builder wrapper type
Since: 1.5.0.0
Constructors
| WrapperBSB | |
Fields | |
Instances
| Parse WrapperBSB Source # | |
Defined in Data.TTC.Wrapper | |
| Render WrapperBSB Source # | |
Defined in Data.TTC.Wrapper Methods render :: Textual t => WrapperBSB -> t Source # | |
newtype WrapperSBS Source #
ShortByteString wrapper type
Since: 1.5.0.0
Constructors
| WrapperSBS | |
Fields | |
Instances
| Parse WrapperSBS Source # | |
Defined in Data.TTC.Wrapper | |
| Render WrapperSBS Source # | |
Defined in Data.TTC.Wrapper Methods render :: Textual t => WrapperSBS -> t Source # | |