typed-encoding-0.4.2.0: Type safe string transformations

Safe HaskellSafe
LanguageHaskell2010

Data.TypedEncoding.Common.Types.UncheckedEnc

Contents

Description

Internal definition of types

Synopsis

Documentation

>>> :set -XOverloadedStrings -XMultiParamTypeClasses -XDataKinds -XAllowAmbiguousTypes
>>> import qualified Data.Text as T

UncheckedEnc for validation, similar to CheckedEnc but not verified

data UncheckedEnc c str Source #

Represents some encoded string where encoding was not validated.

Similar to CheckedEnc but unlike CheckedEnc it can contain payloads that have invalid encoding.

See check

Since: 0.2.0.0

Constructors

MkUncheckedEnc [EncAnn] c str 
Instances
(Eq c, Eq str) => Eq (UncheckedEnc c str) Source # 
Instance details

Defined in Data.TypedEncoding.Common.Types.UncheckedEnc

Methods

(==) :: UncheckedEnc c str -> UncheckedEnc c str -> Bool #

(/=) :: UncheckedEnc c str -> UncheckedEnc c str -> Bool #

(Show c, Show str) => Show (UncheckedEnc c str) Source # 
Instance details

Defined in Data.TypedEncoding.Common.Types.UncheckedEnc

Methods

showsPrec :: Int -> UncheckedEnc c str -> ShowS #

show :: UncheckedEnc c str -> String #

showList :: [UncheckedEnc c str] -> ShowS #

(Show c, Displ str) => Displ (UncheckedEnc c str) Source #
>>> displ $ MkUncheckedEnc ["TEST"] () ("hello" :: T.Text)
"MkUncheckedEnc [TEST] () (Text hello)"
Instance details

Defined in Data.TypedEncoding.Common.Types.UncheckedEnc

Methods

displ :: UncheckedEnc c str -> String Source #

toUncheckedEnc :: [EncAnn] -> c -> str -> UncheckedEnc c str Source #

Since: 0.2.0.0

getUncheckedEncAnn :: UncheckedEnc c str -> [EncAnn] Source #

Since: 0.2.0.0

getUncheckedPayload :: forall c str. UncheckedEnc c str -> str Source #

verifyAnn :: forall xs c str. SymbolList xs => UncheckedEnc c str -> Either String (UncheckedEnc c str) Source #

Since: 0.2.0.0