h$ Q      (C) 2015-2021 Merijn Verstraaten BSD-style (see the file LICENSE)+Merijn Verstraaten  experimentalportableNone9? 1 validated-literalsClass for validated, compile-time, partial conversions from type a to b.validated-literals Converts a values into validated b values, / values are reported in the compilation error.validated-literals Converts a values into validated b values, . values produce a generic error message. Use  for custom error messages.validated-literals,Creates a Typed TH splice for the resulting b2 values, useful for avoiding the need for orphan  instances and allowing complex splices for types that can't be directly lifted. See the  ByteString example module for an example.validated-literals type for failed conversions. Useful for testing and more gracefully handling compile time failures. validated-literalsThe core function of ValidLiterals, use this together with Typed Template Haskell splices to insert validated literals into your code. For example, if we assume newtype ASCII = ASCII Char where ASCII7 should only contain ASCII characters, we would write:7Polymorphic literals, such as numbers (or strings when OverloadedStrings is enabled) can result in ambiguous type errors with this function. Enabing the ExtendedDefaultRules extension will allow inputs to   to be defaulted to  or  allowing code to compile. A more robust solution is to use the various explicitly defaulted functions in this module, such as  . {-# LANGUAGE TemplateHaskell #-} import ValidLiterals x :: ASCII x = $$(valid 'c') validated-literalsInteger literals lead to obnoxious defaulting complaints by GHC, by using this function you can force the defaulting to , silencing these warnings.Since  literals use $fromInteger :: Num a => Integer -> a. this function cannot cost you any precision. validated-literalsSame as   , but for  values.Since  literals use -fromRational :: Fractional a => Rational -> a. this function cannot cost you any precision. validated-literalsSame as  , but for when enabling OverloadedStrings makes  literals polymorphic. validated-literalsSame as  , but for when enabling OverloadedLists" makes list literals polymorphic.         ! "#$% validated-literals-0.3.1-inplace ValidLiteralstemplate-haskellLanguage.Haskell.TH.Syntaxlift liftTypedLiftValidatefromLiteralWithError fromLiteral liftResultValidationFailurevalid validInteger validRational validString validList$fExceptionValidationFailure$fShowValidationFailurebase Data.EitherLeft GHC.MaybeNothingGHC.Exception.Type Exceptioninteger-wired-inGHC.Integer.TypeIntegerghc-prim GHC.TypesDoubleGHC.RealIntegral FractionalGHC.BaseString