!"#$%&'()*+,-./01234 5 6789:;<=>?@ABCDEF GHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef g h i j k l m n o p q r s t u v w x y z { | } ~  (C) 2008-2013 Edward KmettBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portable Trustworthy #A logically uninhabited data type. Since   values logically don'$t exist, this witnesses the logical  reasoning tool of "ex falso quodlibet". If   is uninhabited then any  that holds only values of type    is holding no values. If   is uninhabited then any  that holds values of type    is holding no values.  Reading a  , value is always a parse error, considering   as # a data type with no constructors.    (C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portable Safe-InferredA  about a type a0 is either a proof of existence or a proof that a  cannot exist. Proof that no a exists  Witness for a ,Because we can never create a value of type  , a function that type-checks  at  a -> Void shows that objects of type a$ can never exist. Thus, we say that  a is   None((& NoneLPromote every declaration given to the type level, retaining the originals. 4Promote each declaration, discarding the originals. Produce instances for '(:==)', (type-level equality) from the given types Produce an instance for '(:==)'+ (type-level equality) from the given type 11-None DGenerate singleton definitions from a type that is already defined. 1 For example, the singletons package itself uses  4 $(genSingletons [''Bool, ''Maybe, ''Either, ''[]]) *to generate singletons for Prelude types. JMake promoted and singleton versions of all declarations given, retaining  the original declarations.  See  =http://www.cis.upenn.edu/~eir/packages/singletons/README.html for  further explanation. KMake promoted and singleton versions of all declarations given, discarding  the original declarations. Create instances of SEq and type-level '(:==)' for each type in the list Create instance of SEq and type-level '(:==)' for the given type Create instances of SEq (only -- no instance for '(:==)', which SEq generally & relies on) for each type in the list Create instances of SEq (only -- no instance for '(:==)', which SEq generally  relies on) for the given type Create instances of SDecide for each type in the list .Create instance of SDecide for the given type P      !"#$%&'()*P      !"#$%&'()*K      !"#$%&'()*None An existentially-quantified0 singleton. This type is useful when you want a P singleton type, but there is no way of knowing, at compile-time, what the type K index will be. To make use of this type, you will generally have to use a  pattern-match:   foo :: Bool -> ...  foo b = case toSing b of E SomeSing sb -> {- fancy dependently-typed code with sb -} ;An example like the one above may be easier to write using  withSomeSing. !Convenient abbreviation for #:  "type Demote (a :: k) = DemoteRep ('KProxy :: KProxy k) "The " class is essentially a kind class. It classifies all kinds U for which singletons are defined. The class supports converting between a singleton < type and the base (unrefined) type which it is built from. #AGet a base type from a proxy for the promoted kind. For example,   DemoteRep ('KProxy :: KProxy Bool) will be the type Bool. $.Convert a singleton to its unrefined version. %IConvert an unrefined type to an existentially-quantified singleton type. &A &; constraint is essentially an implicitly-passed singleton. K If you need to satisfy this constraint with an explicit singleton, please  see  withSingI. ';Produce the singleton explicitly. You will likely need the ScopedTypeVariables 0 extension to use this method the way you want. ((The singleton kind-indexed data family. )<Convenient synonym to refer to the kind of a type variable:  type KindOf (a :: k) = ('KProxy :: KProxy k) *Members of the * kind- class support decidable equality. Instances P of this class are generated alongside singleton definitions for datatypes that  derive an + instance. +?Compute a proof or disproof of equality, given two singletons. " !"#$%&'()*+,-./0123,456-./012345- !"#$%&'()*+,-./0123,4566789:;<=>?@ABCDEFGHI !"#$%&'()*+,-./0123,456-./012345(C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNone<Conditional over singletons 789:;<=>?@ (6HI789:;<=>?@(6< 987:;=?>@ 789:;<=>?@(C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNoneAThe singleton analogue of +. Unlike the definition for +, it is required " that instances define a body for '(%:==)'!. You may also supply a body for '(%:/=)'. BBoolean equality on singletons C"Boolean disequality on singletons EA re-export of the type-level (==)( that conforms to the singletons naming  convention. ABCDEJKLABCDEABCEDABCDEJKL (C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNoneFJProduce a representation and singleton for the collection of types given.  A datatype Rep; is created, with one constructor per type in the declared E universe. When this type is promoted by the singletons library, the # constructors become full types in *', not just promoted data constructors.  For example,  + $(singletonStar [''Nat, ''Bool, ''Maybe]) generates the following:  = data Rep = Nat | Bool | Maybe Rep deriving (Eq, Show, Read) $and its singleton. However, because Rep is promoted to *, the singleton ! is perhaps slightly unexpected:  # data instance Sing (a :: *) where  SNat :: Sing Nat  SBool :: Sing Bool 3 SMaybe :: SingRep a => Sing a -> Sing (Maybe a) The unexpected part is that Nat, Bool, and Maybe above are the real Nat,  Bool, and Maybe', not just promoted data constructors. "Please note that this function is very% experimental. Use at your own risk. FA list of Template Haskell Name s for types MFFFM(C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNoneNOPQRSTU(V(NOPQRSTU(C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNoneG The function G8 generates a case expression where each right-hand side R is identical. This may be useful if the type-checker requires knowledge of which N constructor is used to satisfy equality or type-class constraints, but where ' each constructor is treated the same. G-The head of the type of the scrutinee. (Like ''Maybe or ''Bool.) +The scrutinee, in a Template Haskell quote &The body, in a Template Haskell quote /  !"#$%&'()*+HI8<ABCEG-G(&'"#$%)!E<8ABC*+  G(C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNone HIJKLMNOPQ(,-./01289:;<=>HIJKLMNOPQ(210/.-,LMKNJOIPHQ HIJKLMNOPQ(C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNone  *+ *+ (C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNone RThe promotion of W SA S wraps up a &! instance for explicit handling. UGet an implicit singleton (a &! instance) from an explicit one. VGConvenience function for creating a context with an implicit singleton  available. W Convert a normal datatype (like X$) to a singleton for that datatype, ! passing it into a continuation. XEA convenience function useful when we need to name a singleton value 4 multiple times. Without this function, each use of ' could potentially K refer to a different singleton, and one has to use type signatures (often  with ScopedTypeVariables$) to ensure that they are the same. YCA convenience function that names a singleton satisfying a certain N property. If the singleton does not satisfy the property, then the function  returns Y7. The property is expressed in terms of the underlying " representation of the singleton. Z8Allows creation of a singleton when a proxy is at hand. [&Allows creation of a singleton when a proxy# is at hand. \FGHC 7.8 sometimes warns about incomplete pattern matches when no such 1 patterns are possible, due to GADT constraints.  See the bug report at  ,https://ghc.haskell.org/trac/ghc/ticket/3927.  In such cases, it'3s useful to have a catch-all pattern that then has  \ as its right-hand side. ]The singleton for W RZ[STUVWThe original datatype Function expecting a singleton XYZ[\] !"#$%&'()RSTUVWXYZ[\](&'"#$%)!ST UVWZ[XY\R] RZ[STUVWXYZ[\](C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNone \^_`abcde] (3?@^_`abcde (3`_cdab^e \^_`abcde] (C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNonefg^hijklmno_pq(4DEfghijklmnopq(4kljminhogpfqfg^hijklmno_pq (C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNonerstuvwxyz{|}~(5FGrstuvwxyz{|}~(5z{y|x}w~vutsrrstuvwxyz{|}~(C) 2013 Richard EisenbergBSD-style (see LICENSE)%Richard Eisenberg (eir@cis.upenn.edu) experimental non-portableNoneV  !"#$%&'(),-./012345689:;<=>?@ABCDEFGHI789:;<ABCDEIJKLMNOPRSTUVWXYZ[\]_`abklz{$(6354210/.-,< 987:;`_abz{klLMKNJOIP` !"#$%&'( ) * + ,-./01234566789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ \]^_`abcdefghiijklmnopqrstuvwxyz { | } ~            !                !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOBCDEFGHPQRSTUVWXYZ[\] ^_`abcdefghijklm_`no p qrsingletons-0.9.3Data.Singletons.THData.Singletons.EqData.SingletonsData.Singletons.BoolData.Singletons.VoidData.Singletons.TypesData.Singletons.TupleData.Singletons.ListData.Singletons.EitherData.Singletons.MaybeData.Singletons.CustomStarData.Singletons.UtilData.Singletons.PromoteData.Singletons.SingletonsData.Singletons.CoreData.Singletons.TypeRepStarData.Singletons.DecideData.Singletons.Preludeghc-primGHC.PrimAnybaseData.Type.EqualityRefl:~:== Data.ProxyProxyKProxyData.Type.BoolIfNotVoidabsurdvacuousvacuousMDecision DisprovedProvedRefutedpromote promoteOnlypromoteEqInstancespromoteEqInstance genSingletons singletonssingletonsOnlysingEqInstancessingEqInstancesingEqInstancesOnlysingEqInstanceOnlysingDecideInstancessingDecideInstanceSomeSingDemoteSingKind DemoteRepfromSingtoSingSingIsingSingKindOfSDecide%~STuple7STuple6STuple5STuple4STuple3STuple2STuple0SListSEitherSMaybeSBool:||:&&sNot%:&&%:||sIfBool_ OtherwisesBool_ sOtherwiseSEq%:==%:/=:/=:== singletonStarcasesSwapUncurryCurrySndFstsFstsSndsCurrysUncurrysSwapError SingInstance singInstance withSingI withSomeSingwithSingsingThat singByProxy singByProxy#bugInGHCsErrorReverseTailHead:++%:++sHeadsTailsReverseIsRightIsLeftPartitionEithersRightsLeftsEither_sEither_sLeftssRightssPartitionEitherssIsLeftsIsRightMapMaybe CatMaybes ListToMaybe MaybeToList FromMaybeFromJust IsNothingIsJustMaybe_sMaybe_sIsJust sIsNothing sFromJust sFromMaybe sMaybeToList sListToMaybe sCatMaybes sMapMaybeGHC.BaseFunctorMonad $fReadVoid$fExceptionVoid$fIxVoid $fShowVoid $fOrdVoid$fEqVoidQWithAuxQWArunQWA mkTyFamInst basicTypes newUniqueNameqReportWarningtupleDegree_maybetupleNameDegree_maybe ctorCases ctor1CaseextractNameArgs reinterpretisUpcaseupcaselocase prefixUCName prefixLCNameextractTvbKindextractTvbNamefoldTypefoldExpisVarK mkTupleExp mkTuplePat orIfEmpty emptyMatches multiCasecomp1comp2evalWithoutAux evalForAux evalForPair addBinding addElement containsName concatMapMlistify$fQuasiQWithAux$fMonadWritermQWithAuxth-desugar-1.2.1 Language.Haskell.TH.Desugar.UtilgetDataDreifyWithWarning QWithDecsTypesQ TopLevelLHSLHS lhsRawNamelhsNamelhsHolePromoteQ PromoteTable TypeTable anyTypeNameboolNameandNametyEqNamerepNameifNameheadNametailName symbolNamefalseTytrueTyboolTyandTyifTyFam headTyFam tailTyFam promoteInfopromoteDataConpromoteValName promoteVal promoteType checkForRepcheckForRepInDecls promoteDecsmkEqTypeInstancetypeSynonymFlag promoteDec promoteDataD promoteDec' promoteClausepromoteTopLevelPat promotePat promoteBody promoteExp promoteLitPatternContext Statement ParameterTopLevel CaseStatement LetBindingExpsQEqualityClassDesc TypeContextTypeFnExpTablesingFamilyName singIName singMethName toSingName fromSingName demoteRepNamesingKindClassName sEqClassName sEqMethNamesIfName undefinedName sconsNamesnilNamekProxyDataNamekProxyTypeNamesomeSingTypeNamesomeSingDataNamenilNameconsNamelistName sListNameeqNamesDecideClassNamesDecideMethName provedName disprovedNamereflName mkTupleName singFamilysingKindConstraintdemotesingDataConName singTyConName singClassName singDataCon singValNamesingVal kindParamsingInfosingCtorsingDecssingDecsingEqualityInstance sEqClassDescsDecideClassDescmkEqualityInstancemkEqMethClausemkDecideMethClause singDataDsingKindsingTypeliftOutForalls singTypeRec singContextsingPred singClausecheckIfBrainWillExplodesingPatsingExpsingLit GHC.ClassesEq SOrdering$fSingKindSymbolKProxy$fSingISymboln$fSingKindNatKProxy $fSingINatn$fSingKindBoolKProxy$fTestEqualitykSing$fSDecideSymbolKProxy$fSDecideNatKProxy$fSDecideBoolKProxySSymSNatSConsSNilSGTSEQSLTSRightSLeftSJustSNothingSTrueSFalse$fSEqSymbolKProxy$fSEqNatKProxy$fSEqBoolKProxymkCustomEqInstancesDIDon'tInstantiatedirty_mk_STypeRep$fTestCoercion*Sing$fSDecide*KProxy $fSEq*KProxy$fSingKind*KProxy $fSingI*aSTypeRepGHC.Errerror GHC.TypesBool Data.MaybeNothing Reverse_aux sReverse_auxPartitionEithers_auxsPartitionEithers_aux