Changelog for singletons-base-3.0
Changelog for the singletons-base project
3.0 [2021.03.12]
-
The
singletonslibrary has been split into three libraries:- The new
singletonslibrary is now a minimal library that only providesData.Singletons,Data.Singletons.Decide,Data.Singletons.Sigma, andData.Singletons.ShowSing(if compiled with GHC 8.6 or later).singletonsnow supports building GHCs back to GHC 8.0, as well as GHCJS. - The
singletons-thlibrary defines Template Haskell functionality for promoting and singling term-level definitions, but but nothing else. This library continues to require the latest stable release of GHC. - The
singletons-baselibrary defines promoted and singled versions of definitions from thebaselibrary, including thePrelude. This library continues to require the latest stable release of GHC.
Consult the changelogs for
singletonsandsingletons-thfor changes specific to those libraries. For more information on this split, see the relevant GitHub discussion. - The new
-
Require building with GHC 9.0.
-
The modules in
singletons-basehave been renamed to better reflect the modules frombasefrom which they take inspiration. In particular, the following module renamings have been applied:Data.Singletons.CustomStar->Data.Singletons.Base.CustomStarData.Singletons.Prelude->Prelude.SingletonsData.Singletons.Prelude.Applicative->Control.Applicative.SingletonsData.Singletons.Prelude.Bool->Data.Bool.SingletonsData.Singletons.Prelude.Const->Data.Functor.Const.SingletonsData.Singletons.Prelude.Either->Data.Either.SingletonsData.Singletons.Prelude.Enum->Data.Singletons.Base.EnumData.Singletons.Prelude.Eq->Data.Eq.SingletonsData.Singletons.Prelude.Foldable->Data.Foldable.SingletonsData.Singletons.Prelude.Function->Data.Function.SingletonsData.Singletons.Prelude.Functor->Data.Functor.Const.SingletonsData.Singletons.Prelude.Identity->Data.Functor.Identity.SingletonsData.Singletons.Prelude.IsString->Data.String.SingletonsData.Singletons.Prelude.Ord->Data.Ord.SingletonsData.Singletons.Prelude.List->Data.List.SingletonsData.Singletons.Prelude.List.NonEmpty->Data.List.NonEmpty.SingletonsData.Singletons.Prelude.Maybe->Data.Maybe.SingletonsData.Singletons.Prelude.Monad->Control.Monad.SingletonsData.Singletons.Prelude.Monad.Fail->Control.Monad.Fail.SingletonsData.Singletons.Prelude.Monad.Zip->Control.Monad.Zip.SingletonsData.Singletons.Prelude.Monoid->Data.Monoid.SingletonsData.Singletons.Prelude.Proxy->Data.Proxy.SingletonsData.Singletons.Prelude.Semigroup->Data.Semigroup.SingletonsData.Singletons.Prelude.Show->Data.Show.SingletonsData.Singletons.Prelude.Traversable->Data.Traversable.SingletonsData.Singletons.Prelude.Tuple->Data.Tuple.SingletonsData.Singletons.Prelude.Void->Data.Void.SingletonsData.Singletons.TH->Data.Singletons.Base.THData.Singletons.TypeError->Data.Singletons.Base.TypeErrorData.Singletons.TypeLits->GHC.TypeLits.SingletonsData.Singletons.TypeRepTYPE->Data.Singletons.Base.TypeRepTYPE
Note that modules that do not correspond to any particular module in
basenow have the prefixData.Singletons.Base.*. This includesData.Singletons.Base.Enum, a special module that exists to provide a home for theSuccandPredpromoted type families that is separate fromPrelude.Singletons(which exports everything fromPEnumexceptSuccandPred). This is done in an effort to make importingPrelude.Singletonsless likely to induce name clashes with code that works over unary natural numbers, which often use the names "Succ" and "Pred". -
An effort has been made to make the API of
Prelude.Singletonsmore closely mirror that of thePreludeinbase. As a result,Prelude.Singletonsnow exports some different functions than it used to. In particular, it now exports the following:Until/sUntil/UntilSym{N}type (++@#@$$$)type (.@#@$$$$)FlipSym3type (!!)/(%!!)/type (!!@#@{$})Length/sLength/LengthSym{N}DropWhile/sDropWhileLookupSym{N}Unzip3Sym{N}
Prelude.Singletonsalso used to export some things that were not exported by thePrelude. Accordingly, these exports have been removed fromPrelude.Singletons. They are:(^)/(%^)/type (^@#@{$}). Although thePreludedoes define a function named(^), it is more general than the one defined insingletons-base, which only works onNats. ImportGHC.TypeLits.Singletonsif you wish to use theNat-specific versions.DefaultEq, which has no counterpart in thePrelude. ImportData.Eq.Singletonsif you wish to use this.bool_, which has no counterpart in thePrelude. ImportData.Bool.Singletonsif you wish to use this.
-
Two previously public-facing modules—
Data.Singletons.Prelude.BaseandData.Singletons.Prelude.Num—have been turned into internal modules. The contents of these modules are re-exported fromPrelude.Singletons, so that can be used instead. -
Due to the
singletonspackage split, theEq,Ord, etc. instances forSomeSingare no longer provided in theData.Singletonsmodule in thesingletonslibrary. Instead, they are now provided in a newData.Singletons.Base.SomeSingmodule, which definesEq,Ord, etc. instances forSomeSingas orphans. -
The
PEqclass no longer usesDefaultEqas its default implementation for(==).DefaultEq, despite its name, is actually not a suitable implementation for(==)for a good majority of singleton types (see the discussion in this GitHub issue for more information).(==)'s default is now defined in terms of(/=), just like its term-level counterpart in theEqclass. -
Since
base-4.15.0.0now deprecatesData.Singletons.Option(in anticipation of its removal in a future version ofbase), this library no longer offers a singleton type forOption. Accordingly, theoption_function has also been removed.