úÎ,¥+Ú (C) 2015 Merijn Verstraaten BSD-style (see the file LICENSE)+Merijn Verstraaten <merijn@inconsistent.nl> experimentalportableNone17AClass for validated, compile-time, partial conversions from type a to b. Converts a values into validated b values(WARNING: Don't use! For implementors of  instances only!ŽProduces the actual Typed Template Haskell splice for the validated value to splice into the source text. Since you may want to implement a % instance for types that cannot have  $ instances, this function receives both the original a value and the resulting b as input.This allows it to either: Splice the resulting bD into the source using it's Lift instance, or a custom splice.Splice the initial a| into the source using it's Lift instance, and perform the conversion again at runtime, and coercing via, e.g.,  . Since 7 is pure (right?!) this should be perfectly safe.UClearly, splicing the result directly is much safer (it avoids any shenanigans with unsafePerformIOr) and more efficient (no conversion at runtime). However, this is just not always possible, since, for example,  ByteString does not have a  ? instance and we may still want to have validated newtypes of  ByteString.Default implementation:< The default implementation (using DefaultSignatures) uses b's  H instance to do the efficient thing of directly splicing the resulting b into the source.Default implementation for  , uses the   instance for a and  L to redo the conversion at runtime and (unsafely) coerce from 'Maybe b' to b . . Since 2 is pure (right?!) this should be perfectly safe.(C) 2015 Merijn Verstraaten BSD-style (see the file LICENSE)+Merijn Verstraaten <merijn@inconsistent.nl> experimentalportableNone4£The 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: P{-# LANGUAGE TemplateHaskell #-} import ValidLiterals x :: ASCII x = $$(valid c) yInteger 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.Same as  , but for   values.Since   literals use -fromRational :: Fractional a => Rational -> a. this function cannot cost you any precision.Same as , but for when enabling OverloadedStrings makes  literals polymorphic.Same as , but for when enabling OverloadedLists" makes list literals polymorphic.   validated-literals-0.2.0ValidLiterals.Class ValidLiteralsValidate fromLiteral spliceValidhackySpliceValidvalid validInteger validRational validString validListtemplate-haskellLanguage.Haskell.TH.SyntaxLiftbase Data.MaybefromJust integer-gmpGHC.Integer.TypeIntegerGHC.RealIntegral FractionalGHC.BaseString