úÎ!jdh€     Safe,-.>HUVX_kúNone,-.>HUVX_kg¼  type-errorsDThis type family is always stuck. It must be used in the context of .Like  &, but uses the explicit meta-variable   to mark substitution points.1:kind! $(te[t| SubstVar (Either VAR VAR) Bool |])...= Either Bool Bool4:kind! $(te[t| SubstVar (Either VAR Bool) [Char] |])...= Either [Char] Bool.:kind! $(te[t| SubstVar (VAR Int Bool) (,) |])... = (Int, Bool)  type-errorsDThis type family is always stuck. It must be used in the context of . 2 is a meta-varaible which marks a substitution in  . The result of   expr val is  expr[val/ ]. 3 is polykinded and can be used in several settings.See   for examples.  type-errorsDThis type family is always stuck. It must be used in the context of .  expr a b substitutes all instances of a for b in expr.2:kind! $(te[t| Subst (Either Int Int) Int Bool |])...= Either Bool Bool5:kind! $(te[t| Subst (Either Int Bool) Int [Char] |])...= Either [Char] Bool5:kind! $(te[t| Subst (Either Int Bool) Either (,) |])... = (Int, Bool)  type-errorsDThis type family is always stuck. It must be used in the context of .  expr err% determines if the type described by expr) is phantom in the variables marked via  .. If it's not, it produces the error message err.%For example, consider the definition::{data Qux a b = Qux b:}which is phantom in a:D:eval_error $(te[t| UnlessPhantom (Qux PHANTOM Int) ('Text "Ok") |])() but not in b:F:eval_error $(te[t| UnlessPhantom (Qux Int PHANTOM) ('Text "Bad!") |])...... Bad!...NUnfortunately there is no known way to emit an error message if the variable is a phantom.Often you'll want to guard   against …, to ensure you don't get errors when things are merely ambiguous. You can do this by writing your own fcf whose implementation is  ::{.data NotPhantomErrorFcf :: k -> Exp Constraint+type instance Eval (NotPhantomErrorFcf f) =# $(te[t| UnlessPhantom (f PHANTOM)* ( ShowTypeQuoted fB ':<>: 'Text " is not phantom in its argument!") |]):}:{observe_phantom :: UnlessStuck f (NotPhantomErrorFcf f) => f p -> ()observe_phantom _ = ():}We then notice that using observe_phantom against * doesn't produce any errors, but against   does:observe_phantom Proxy()observe_phantom (Just 5)...+... 'Maybe' is not phantom in its argument!...Finally, we leave observe_phantom unsaturated, and therefore f( isn't yet known. Without guarding the   behind /, this would incorrectly produce the message "f! is not phantom in its argument!"observe_phantom...(... No instance for (Show (f0 p0 -> ()))...  type-errorsDThis type family is always stuck. It must be used in the context of .RA meta-variable for marking which argument should be a phantom when working with  . 3 is polykinded and can be used in several settings.See   for examples. type-errorsLike ), but leaves no residual constraint when expr5 is stuck. This can be used to ensure an expression isn't$ stuck before analyzing it further.See the example under  ! for an example of this use-case. type-errorsLike E, but specialized to the case when you don't want to do anything if expr isn't stuck.:{observe_no_rep :: WhenStuck (Rep t)K (DelayError ('Text "No Rep instance for " ':<>: ShowTypeQuoted t)) => t -> ()observe_no_rep _ = ():}observe_no_rep HasNoRep..."... No Rep instance for 'HasNoRep'...observe_no_rep True() type-errors expr b c leaves b' in the residual constraints whenever expr is stuck, otherwise it uates c.Often you want to leave a  in b# in order to report an error when expr is stuck.The cz parameter is a first-class family, which allows you to perform arbitrarily-complicated type-level computations whenever exprB isn't stuck. For example, you might want to produce a typeclass !- here. Alternatively, you can nest calls to ' in order to do subsequent processing.This is a generalization of  https://kcsongor.github.io/kcsongor's Break machinery described in  1https://kcsongor.github.io/report-stuck-families/detecting the undetectable. type-errorsLike ,, but implemented as a first-class family. . is useful when used as the last argument to  and . type-errorsA helper definition that doesn'tY emit a type error. This is occassionally useful to leave as the residual constraint in 1 when you only want to observe if an expression isn't stuck. type-errorsLike ,, but implemented as a first-class family. - is useful when used as the last argument to  and . type-errorsError messages produced via  are often  too strictF, and will be emitted sooner than you'd like. The solution is to use A, which will switch the error messages to being consumed lazily.:{@foo :: TypeError ('Text "Too eager; prevents compilation") => ()foo = ():}...#... Too eager; prevents compilation...:{6foo :: DelayError ('Text "Lazy; emitted on use") => ()foo = ():}foo...... Lazy; emitted on use... type-errorsLike #, but quotes the type if necessary.:show_error ShowTypeQuoted Int... ... 'Int'...2:show_error ShowTypeQuoted "symbols aren't quoted"...... "symbols aren't quoted"... type-errorsPretty print a list.#:show_error PrettyPrintList '[Bool]... ... 'Bool'...#:show_error PrettyPrintList '[1, 2]...... '1', and '2'...7:show_error PrettyPrintList '["hello", "world", "cool"]... ... "hello", "world", and "cool"... type-errorshThis library provides tools for performing lexical substitutions over types. For example, the function  ) asks you to mark phantom variables via  .ˆUnfortunately, this substitution cannot reliably be performed via type families, since it will too often get stuck. Instead we provide :, which is capable of reasoning about types symbolically.&Any type which comes with the warning #"This type family is always stuck." must be used in the context of  and the magic [t|5 quasiquoter. To illustrate, the following is stuck::{foo :: SubstVar VAR Bool foo = True:}...8... Couldn't match expected type ...SubstVar VAR Bool...... with actual type ...Bool......But running it via  makes everything work::{$foo :: $(te[t| SubstVar VAR Bool |]) foo = True:}-If you don't want to think about when to use ., it's a no-op when used with everyday types::{bar :: $(te[t| Bool |]) bar = True:}  "       !"#$%&'()*+,-./*type-errors-0.2.0.0-GmwyqUkCLee2WD9Tm5u8aH Type.ErrorsPaths_type_errors Data.ProxyProxybase GHC.TypeLits TypeErrorText:<>::$$:ShowType ErrorMessage3first-class-families-0.5.0.0-KzVSrPbLOlGD0jvruQdyZ5Fcf.CombinatorsPureFcf.CoreExpEvalSubstVarVARSubst UnlessPhantomPHANTOM UnlessStuck WhenStuckIfStuck NoErrorFcfNoError DelayErrorFcf DelayErrorShowTypeQuotedPrettyPrintListteversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName GHC.MaybeMaybeghc-prim GHC.Types Constraint