h&NvJp      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~textual type classes'Copyright (c) 2019-2023 Travis CardwellMIT Safe-Inferred "<I|ttcThe " type class provides some default  instances.The * instance parses single-character strings.+Numeric type instances all parse using the  instance.3Textual type instances all convert from the source  data type.ttcThe 8 type class parses a data type from a textual data type.'There are no default instances for the  type class, so that all instances can be customized per project when desired. Instances for some basic data types are defined for the , type class, however, and you can load the  instance as follows: instance TTC.Parse Int Since a type may have at most one instance of a given type class, special care must be taken when defining type class instances in a shared library. In particular, orphan instances should generally not be used in shared libraries since they prevent users of the libraries from writing their own instances.See the uname and prompt example programs in the examples directory..For more details, see the following article: https://www.extrema.is/articles/ttc-textual-type-classes/render-and-parsettcThe " type class provides some default  instances.The , instance renders a single-character string.,Numeric type instances all render using the  instance.1Textual type instances all convert to the target  data type.ttcThe 7 type class renders a data type as a textual data type.'There are no default instances for the  type class, so that all instances can be customized per project when desired. Instances for some basic data types are defined for the , type class, however, and you can load the  instance as follows: instance TTC.Render Int Since a type may have at most one instance of a given type class, special care must be taken when defining type class instances in a shared library. In particular, orphan instances should generally not be used in shared libraries since they prevent users of the libraries from writing their own instances.See the uname and prompt example programs in the examples directory..For more details, see the following article: https://www.extrema.is/articles/ttc-textual-type-classes/render-and-parsettcThe  type class is used to convert between the following textual data types:  (S)Strict  (T)Lazy  (TL)Text  (TLB) (ST)Strict  (BS)Lazy  (BSL) ByteString  (BSB ) (Note: Data.Binary.Builder2 re-exports this type, so TTC can be used with binary as well.) (SBS) ByteString values are assumed to be UTF-8 encoded text. Invalid bytes are replaced with the Unicode replacement character U+FFFD;. In cases where different behavior is required, process  ByteString values before using this class.%This type class has two key features:Type conversion is not$ done through a fixed type (such as  or ).It has a single type variable, making it easy to write functions that accept arguments and/or return values that may be any of the supported textual data types.Note that support for additional data types cannot be implemented by writing instances. Adding support for additional data types would require changing the class definition itself..For more details, see the following article: https://www.extrema.is/articles/ttc-textual-type-classes/textual-type-class ttc Convert to a  ttcConvert to strict  ttcConvert to lazy  ttc Convert to a Text  ttc Convert to ttcConvert to a strict ttcConvert to a lazy ttc Convert to a  ByteString ttc Convert to a ttc0Convert between any supported textual data typesttcConvert from a ttcConvert from strict ttcConvert from lazy ttcConvert from a Text ttcConvert from a ttcConvert from a strict ttcConvert from a lazy ttcConvert from a  ByteString ttcConvert from a ttcConvert an argument to a ttcConvert an argument to strict ttcConvert an argument to lazy ttcConvert an argument to a Text  ttcConvert an argument to a !ttc Convert an argument to a strict "ttcConvert an argument to a lazy #ttcConvert an argument to a  ByteString $ttcConvert an argument to a %ttc Render to a &ttcRender to strict 'ttcRender to lazy (ttc Render to a Text )ttc Render to a *ttcRender to a strict +ttcRender to a lazy ,ttc Render to a  ByteString -ttc Render to a .ttc0Render a value to a textual data type using the  instance/ttc Parse from a 0ttcParse from strict 1ttcParse from lazy 2ttc Parse from a Text 3ttc Parse from a 4ttcParse from a strict 5ttcParse from a lazy 6ttc Parse from a  ByteString 7ttc Parse from a 8ttc Parse to a  type9ttc Parse from a  to a  type:ttcParse from strict  to a  type;ttcParse from lazy  to a  type<ttc Parse from a Text  to a  type=ttc Parse from a  to a  type>ttcParse from a strict  to a  type?ttcParse from a lazy  to a  type@ttc Parse from a  ByteString  to a  typeAttc Parse from a  to a  typeBttcParse or fail using Cttc Parse from a  or fail using DttcParse from strict  or fail using EttcParse from lazy  or fail using Fttc Parse from a Text  or fail using Gttc Parse from a  or fail using HttcParse from a strict  or fail using IttcParse from a lazy  or fail using Jttc Parse from a  ByteString  or fail using Kttc Parse from a  or fail using LttcUnsafely parseMttcUnsafely parse from a NttcUnsafely parse from strict OttcUnsafely parse from lazy PttcUnsafely parse from a Text QttcUnsafely parse from a RttcUnsafely parse from a strict SttcUnsafely parse from a lazy TttcUnsafely parse from a  ByteString UttcUnsafely parse from a Vttc Create a  result from a  error message and a  valueWttc Create a  result from a  error message and a  valueXttc Create a  result from a  error message and a  valueYttc Create a  result from a  error message and a  valueZttc Create a  result from a  error message and a  value[ttc Create a  result from a  error message and a  value\ttc Create a  result from a  error message and a  value]ttc Create a  result from a  error message and a  value^ttc Create a  result from a  error message and a  value_ttc Create a  result from a  error message and a  value`ttcAdd a prefix to  error messages of a  resultattcAdd a prefix to  error messages of a  resultbttcAdd a prefix to  error messages of a  resultcttcAdd a prefix to  error messages of a  resultdttcAdd a prefix to  error messages of a  resultettcAdd a prefix to  error messages of a  resultfttcAdd a prefix to  error messages of a  resultgttcAdd a prefix to  error messages of a  resulthttcAdd a prefix to  error messages of a  resultittcAdd a prefix to  error messages of a  resultjttcParse a value in an enumerationThis function is intended to be used with types that have few choices, as the implementation uses a linear algorithm.See the enum example program in the examples directory.kttc&Parse a value in an enumeration, with  error messages2The following English error messages are returned:*"invalid {name}" when there are no matches4"ambiguous {name}" when there is more than one matchlttcParse a value using the  instancemttcParse a value using the  instance, with  error messages0The following English error message is returned:%"invalid {name}" when the parse failsnttcParse a value to a  type using the  instanceottc Implement  using j String -> THS.Code m a The type of this function in previous versions of GHC is as follows: valid :: (Parse a, THS.Lift a) => String -> TH.Q (TH.TExp a) This function is used the same way in all GHC versions. See the valid, invalid, and lift example programs in the examples6 directory. The following is example usage from the valid example: 2sample :: Username sample = $$(TTC.valid "tcard") rttc,Validate a constant at compile-time using a  instanceThis function requires a  of the result type. Use s to avoid having to pass a  during constant definition.This function parses the  at compile-time and fails compilation on error. When valid, the  is compiled in, to be parsed again at run-time. Since the result is not compiled in, no  instance is required.This function uses a Template Haskell typed expression. Typed expressions were not supported in haskell-src-exts <1.22.0., which causes problems with old versions of hlint". If the issue affects you, use hlint -i "Parse error" to ignore parse errors or use t instead.Note that the typed Template Haskell API changed in GHC 9. The type displayed in this documentation is determined by the version of GHC used to build the documentation.:The type of this function in GHC 9 or later is as follows: validOf :: (MonadFail m, THS.Quote m, Parse a) => Proxy a -> String -> THS.Code m a The type of this function in previous versions of GHC is as follows: validOf :: Parse a => Proxy a -> String -> TH.Q (TH.TExp a) This function is used the same way in all GHC versions. See the validof example program in the examples6 directory. The following is example usage from the validof example: sample :: Username sample = $$(TTC.validOf (Proxy :: Proxy Username) "tcard") sttcMake a valid function using r for the given type Create a valid: function for a type in order to avoid having to write a  when defining constants.This function uses a Template Haskell typed expression. Typed expressions were not supported in haskell-src-exts <1.22.0., which causes problems with old versions of hlint". If the issue affects you, use hlint -i "Parse error" to ignore parse errors or use u instead.Note that the typed Template Haskell API changed in GHC 9. The type displayed in this documentation is determined by the version of GHC used to build the documentation.The type of the created valid* function in GHC 9 or later is as follows: $funName :: forall m. (MonadFail m, THS.Quote m) => String -> THS.Code m $resultType The type of the created valid5 function in previous versions of GHC is as follows: 5$funName :: String -> TH.Q (TH.TExp $resultType) This function is used the same way in all GHC versions. See the mkvalid example program in the examples6 directory. The following is example usage from the mkvalid example: "$(TTC.mkValid "valid" ''Username)  The created valid& function can then be used as follows: 7sample :: Username sample = $$(Username.valid "tcard") tttc,Validate a constant at compile-time using a  instanceThis function requires a  of the result type. Use u to avoid having to pass a  during constant definition.This function parses the  at compile-time and fails compilation on error. When valid, the  is compiled in, to be parsed again at run-time. Since the result is not compiled in, no  instance is required.See the uvalidof example program in the examples6 directory. The following is example usage from the uvalidof example: sample :: Username sample = $(TTC.untypedValidOf (Proxy :: Proxy Username) "tcard") uttcMake a valid function using t for the given type Create a valid: function for a type in order to avoid having to write a  when defining constants.See the mkuvalid example program in the examples6 directory. The following is example usage from the mkuvalid example: )$(TTC.mkUntypedValid "valid" ''Username)  The created valid& function can then be used as follows: 6sample :: Username sample = $(Username.valid "tcard") vttcMake a valid quasi-quoter using t for the given typeSee the uvalidqq example program in the examples6 directory. The following is example usage from the uvalidqq example: +$(TTC.mkUntypedValidQQ "valid" ''Username)  The created valid& function can then be used as follows: 4sample :: Username sample = [Username.valid|tcard|] ttcThis instance enables use of q without having to type valid. The  https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/overloaded_strings.htmlOverloadedStrings extension must be enabled in the module where this functionality is used. Note that this reduces the number of characters in the code, but it can also make the code more difficult to understand by somebody who is not already familiar with it. Typing valid gives people a way to investigate and understand what is going on.Note that the typed Template Haskell API changed in GHC 9. The type displayed in this documentation is determined by the version of GHC used to build the documentation.:The type of this instance in GHC 9 or later is as follows: (MonadFail m, THS.Quote m, Parse a, THS.Lift a) => IsString (THS.Code m a) The type of this instance in previous versions of GHC is as follows: 5(Parse a, THS.Lift a) => IsString (TH.Q (TH.TExp a)) This functionality can be used as follows in all supported versions of GHC. The following is example usage from the valid example: *sample2 :: Username sample2 = $$("alice") The parenthesis are not required from GHC 9. The following is example usage from the valid example: (sample2 :: Username sample2 = $$"alice" jttccase-insensitive when ttcaccept unique prefixes when ttcinvalid input errorttcambiguous input errorttctextual input to parsettcerror or parsed valuekttc!name to include in error messagesttccase-insensitive when ttcaccept unique prefixes when ttctextual input to parsettcerror or parsed valuelttcinvalid input errorttctextual input to parsettcerror or parsed valuemttc!name to include in error messagesttctextual input to parsettcerror or parsed valuenttctextual input to parsettcparsed value or  if invalidottccase-insensitive when ttcaccept unique prefixes when    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"ttc-1.4.0.0-1nSzXUSZkKiKqcZUaC48lvData.TTC ParseDefault parseDefaultParseparse RenderDefault renderDefaultRenderrenderTextualtoStoTtoTLtoTLBtoSTtoBStoBSLtoBSBtoSBSconvertfromSfromTfromTLfromTLBfromSTfromBSfromBSLfromBSBfromSBSasSasTasTLasTLBasSTasBSasBSLasBSBasSBSrenderSrenderTrenderTL renderTLBrenderSTrenderBS renderBSL renderBSB renderSBSrenderWithShowparseSparseTparseTLparseTLBparseSTparseBSparseBSLparseBSBparseSBS parseMaybe parseMaybeS parseMaybeT parseMaybeTL parseMaybeTLB parseMaybeST parseMaybeBS parseMaybeBSL parseMaybeBSB parseMaybeSBS parseOrFail parseOrFailS parseOrFailT parseOrFailTLparseOrFailTLB parseOrFailST parseOrFailBSparseOrFailBSLparseOrFailBSBparseOrFailSBS parseUnsafe parseUnsafeS parseUnsafeT parseUnsafeTLparseUnsafeTLB parseUnsafeST parseUnsafeBSparseUnsafeBSLparseUnsafeBSBparseUnsafeSBS withError withErrorS withErrorT withErrorTL withErrorTLB withErrorST withErrorBS withErrorBSL withErrorBSB withErrorSBS prefixError prefixErrorS prefixErrorT prefixErrorTLprefixErrorTLB prefixErrorST prefixErrorBSprefixErrorBSLprefixErrorBSBprefixErrorSBS parseEnum parseEnum' parseWithReadparseWithRead'maybeParseWithRead readsEnumreadsWithParsevalidvalidOfmkValiduntypedValidOfmkUntypedValidmkUntypedValidQQ$fTextualShortByteString$fTextualBuilder$fTextualByteString$fTextualByteString0$fTextualShortText$fTextualBuilder0 $fTextualText$fTextualText0 $fTextual[]$fRenderDefaultText$fRenderDefaultText0$fRenderDefaultByteString$fRenderDefaultByteString0$fRenderDefault[]$fRenderDefaultWord64$fRenderDefaultWord32$fRenderDefaultWord16$fRenderDefaultWord8$fRenderDefaultWord$fRenderDefaultInteger$fRenderDefaultInt64$fRenderDefaultInt32$fRenderDefaultInt16$fRenderDefaultInt8$fRenderDefaultInt$fRenderDefaultFloat$fRenderDefaultDouble$fRenderDefaultChar$fParseDefaultText$fParseDefaultText0$fParseDefaultByteString$fParseDefaultByteString0$fParseDefault[]$fParseDefaultWord64$fParseDefaultWord32$fParseDefaultWord16$fParseDefaultWord8$fParseDefaultWord$fParseDefaultInteger$fParseDefaultInt64$fParseDefaultInt32$fParseDefaultInt16$fParseDefaultInt8$fParseDefaultInt$fParseDefaultFloat$fParseDefaultDouble$fParseDefaultChar$fIsStringCodeghc-prim GHC.TypesCharbaseGHC.ReadReadGHC.ShowShowGHC.BaseString text-1.2.5.0Data.Text.InternalTextData.Text.Internal.LazyData.Text.Internal.BuilderBuilder'text-short-0.1.5-CNu7AaXLcbMHT8myXd8hVMData.Text.Short.Internal ShortTextbytestring-0.11.3.1Data.ByteString.Internal ByteStringData.ByteString.Lazy.Internal Data.ByteString.Builder.InternalData.ByteString.Short.InternalShortByteString GHC.MaybeMaybeControl.Monad.Fail MonadFailText.ParserCombinators.ReadPReadStemplate-haskellLanguage.Haskell.TH.SyntaxLift Data.ProxyProxyTrueNothing