Hoogle Search
Within LTS Haskell 24.66 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mkUntypedValid :: String -> Name -> DecsQttc Data.TTC Make a valid function using untypedValidOf for the given type Create a valid function for a type in order to avoid having to write a Proxy when defining constants. See the mkuvalid example program in the ttc-examples directory of the source repository. The following is example usage from the mkuvalid example:
$(TTC.mkUntypedValid "valid" ''Username)
The created valid function can then be used as follows:sample :: Username sample = $(Username.valid "tcard")
mkUntypedValidQQ :: String -> Name -> DecsQttc Data.TTC Make a valid quasi-quoter using untypedValidOf for the given type See the mkuvalidqq example program in the ttc-examples directory of the source repository. The following is example usage from the mkuvalidqq example:
$(TTC.mkUntypedValidQQ "valid" ''Username)
The created valid function can then be used as follows:sample :: Username sample = [Username.valid|tcard|]
mkValid :: String -> Name -> DecsQttc Data.TTC Make a valid function using validOf for the given type Create a valid function for a type in order to avoid having to write a Proxy 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 mkUntypedValid 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 valid function in previous versions of GHC is as follows:$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 ttc-examples directory of the source repository. The following is example usage from the mkvalid example:$(TTC.mkValid "valid" ''Username)
The created valid function can then be used as follows:sample :: Username sample = $$(Username.valid "tcard")
untypedValidOf :: Parse a => Proxy a -> String -> ExpQttc Data.TTC Validate a constant at compile-time using a Parse instance This function requires a Proxy of the result type. Use mkUntypedValid to avoid having to pass a Proxy during constant definition. This function parses the String at compile-time and fails compilation on error. When valid, the String is compiled in, to be parsed again at run-time. Since the result is not compiled in, no Lift instance is required. See the uvalidof example program in the ttc-examples directory of the source repository. The following is example usage from the uvalidof example:
sample :: Username sample = $(TTC.untypedValidOf (Proxy :: Proxy Username) "tcard")
-
ttc Data.TTC Validate a constant at compile-time using a Parse instance This function parses the String at compile-time and fails compilation on error. When valid, the result is compiled in, so the result type must have a Lift instance. When this is inconvenient, use one of the alternative functions in this library. 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 one of the alternative functions in this library. 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:
valid :: (MonadFail m, THS.Quote m, Parse a, THS.Lift a) => 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 and invalid example programs in the ttc-examples directory of the source repository. The following is example usage from the valid example:sample :: Username sample = $$(TTC.valid "tcard")
-
ttc Data.TTC Validate a constant at compile-time using a Parse instance This function requires a Proxy of the result type. Use mkValid to avoid having to pass a Proxy during constant definition. This function parses the String at compile-time and fails compilation on error. When valid, the String is compiled in, to be parsed again at run-time. Since the result is not compiled in, no Lift 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 untypedValidOf 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 ttc-examples directory of the source repository. The following is example usage from the validof example:sample :: Username sample = $$(TTC.validOf (Proxy :: Proxy Username) "tcard")
-
unicode-data Unicode.Char.General.Blocks U+1740..U+175F: Buhid.
CJKCompatibilityIdeographs :: Blockunicode-data Unicode.Char.General.Blocks U+F900..U+FAFF: CJK Compatibility Ideographs.
CJKCompatibilityIdeographsSupplement :: Blockunicode-data Unicode.Char.General.Blocks U+2F800..U+2FA1F: CJK Compatibility Ideographs Supplement.
-
unicode-data Unicode.Char.General.Blocks U+4E00..U+9FFF: CJK Unified Ideographs.