singletons-th 3.1 → 3.1.1
raw patch · 24 files changed
+53/−62 lines, 24 filesdep ~basedep ~mtldep ~singletons
Dependency ranges changed: base, mtl, singletons, template-haskell, th-desugar
Files
- CHANGES.md +6/−0
- README.md +3/−3
- singletons-th.cabal +11/−11
- src/Data/Singletons/TH/CustomStar.hs +1/−1
- src/Data/Singletons/TH/Deriving/Foldable.hs +0/−2
- src/Data/Singletons/TH/Deriving/Functor.hs +0/−2
- src/Data/Singletons/TH/Deriving/Infer.hs +0/−2
- src/Data/Singletons/TH/Deriving/Show.hs +1/−1
- src/Data/Singletons/TH/Deriving/Traversable.hs +0/−2
- src/Data/Singletons/TH/Deriving/Util.hs +0/−1
- src/Data/Singletons/TH/Names.hs +2/−2
- src/Data/Singletons/TH/Options.hs +0/−2
- src/Data/Singletons/TH/Partition.hs +0/−3
- src/Data/Singletons/TH/Promote.hs +0/−2
- src/Data/Singletons/TH/Promote/Defun.hs +2/−2
- src/Data/Singletons/TH/Promote/Monad.hs +0/−3
- src/Data/Singletons/TH/Promote/Type.hs +16/−6
- src/Data/Singletons/TH/Single.hs +2/−1
- src/Data/Singletons/TH/Single/Data.hs +0/−2
- src/Data/Singletons/TH/Single/Fixity.hs +0/−1
- src/Data/Singletons/TH/Single/Monad.hs +2/−2
- src/Data/Singletons/TH/SuppressUnusedWarnings.hs +2/−2
- src/Data/Singletons/TH/Syntax.hs +3/−3
- src/Data/Singletons/TH/Util.hs +2/−6
CHANGES.md view
@@ -1,6 +1,12 @@ Changelog for the `singletons-th` project ========================================= +3.1.1 [2022.08.23]+------------------+* Require building with GHC 9.4.+* Improve error messages when attempting to promote a partial application of+ a function arrow `(->)`, which is not currently supported.+ 3.1 [2021.10.30] ---------------- * Require building with GHC 9.2.
README.md view
@@ -7,14 +7,14 @@ _promotion_ of term-level functions to type-level equivalents and _singling_ functions to dependently typed equivalents. This library was originally presented in-[_Dependently Typed Programming with Singletons_](https://cs.brynmawr.edu/~rae/papers/2012/singletons/paper.pdf),+[_Dependently Typed Programming with Singletons_](https://richarde.dev/papers/2012/singletons/paper.pdf), published at the Haskell Symposium, 2012. See also-[the paper published at Haskell Symposium, 2014](https://cs.brynmawr.edu/~rae/papers/2014/promotion/promotion.pdf),+[the paper published at Haskell Symposium, 2014](https://richarde.dev/papers/2014/promotion/promotion.pdf), which describes how promotion works in greater detail. `singletons-th` generates code that relies on bleeding-edge GHC language extensions. As such, `singletons-th` only supports the latest major version-of GHC (currently GHC 9.2). For more information,+of GHC (currently GHC 9.4). For more information, consult the `singletons` [`README`](https://github.com/goldfirere/singletons/blob/master/README.md).
singletons-th.cabal view
@@ -1,5 +1,5 @@ name: singletons-th-version: 3.1+version: 3.1.1 cabal-version: 1.24 synopsis: A framework for generating singleton types homepage: http://www.github.com/goldfirere/singletons@@ -8,7 +8,7 @@ maintainer: Ryan Scott <ryan.gl.scott@gmail.com> bug-reports: https://github.com/goldfirere/singletons/issues stability: experimental-tested-with: GHC == 9.2.1+tested-with: GHC == 9.4.1 extra-source-files: README.md, CHANGES.md license: BSD3 license-file: LICENSE@@ -19,14 +19,14 @@ /singling/ functions to dependently typed equivalents. This library was originally presented in /Dependently Typed Programming with Singletons/, published at the Haskell Symposium, 2012.- (<https://cs.brynmawr.edu/~rae/papers/2012/singletons/paper.pdf>)+ (<https://richarde.dev/papers/2012/singletons/paper.pdf>) See also the paper published at Haskell Symposium, 2014, which describes how promotion works in greater detail:- <https://cs.brynmawr.edu/~rae/papers/2014/promotion/promotion.pdf>.+ <https://richarde.dev/papers/2014/promotion/promotion.pdf>. . @singletons-th@ generates code that relies on bleeding-edge GHC language extensions. As such, @singletons-th@ only supports the latest major version- of GHC (currently GHC 9.2). For more information,+ of GHC (currently GHC 9.4). For more information, consult the @singletons@ @<https://github.com/goldfirere/singletons/blob/master/README.md README>@. .@@ -42,7 +42,7 @@ type: git location: https://github.com/goldfirere/singletons.git subdir: singletons-th- tag: v3.1+ tag: v3.1.1 source-repository head type: git@@ -52,17 +52,17 @@ library hs-source-dirs: src- build-depends: base >= 4.16 && < 4.17,+ build-depends: base >= 4.17 && < 4.18, containers >= 0.5, mtl >= 2.2.1, ghc-boot-th,- singletons == 3.0.1,+ singletons == 3.0.*, syb >= 0.4,- template-haskell >= 2.18 && < 2.19,- th-desugar >= 1.13 && < 1.14,+ template-haskell >= 2.19 && < 2.20,+ th-desugar >= 1.14 && < 1.15, th-orphans >= 0.13.11 && < 0.14, transformers >= 0.5.2- default-language: Haskell2010+ default-language: GHC2021 other-extensions: TemplateHaskellQuotes exposed-modules: Data.Singletons.TH Data.Singletons.TH.CustomStar
src/Data/Singletons/TH/CustomStar.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE DataKinds, TypeFamilies, KindSignatures, TemplateHaskell #-}+{-# LANGUAGE TemplateHaskellQuotes #-} ----------------------------------------------------------------------------- -- |
src/Data/Singletons/TH/Deriving/Foldable.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE ScopedTypeVariables #-}- ----------------------------------------------------------------------------- -- | -- Module : Data.Singletons.TH.Deriving.Foldable
src/Data/Singletons/TH/Deriving/Functor.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE ScopedTypeVariables #-}- ----------------------------------------------------------------------------- -- | -- Module : Data.Singletons.TH.Deriving.Functor
src/Data/Singletons/TH/Deriving/Infer.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE ScopedTypeVariables #-}- ----------------------------------------------------------------------------- -- | -- Module : Data.Singletons.TH.Deriving.Infer
src/Data/Singletons/TH/Deriving/Show.hs view
@@ -10,7 +10,7 @@ -- Implements deriving of Show instances -- -----------------------------------------------------------------------------{-# LANGUAGE ScopedTypeVariables #-}+ module Data.Singletons.TH.Deriving.Show ( mkShowInstance , mkShowSingContext
src/Data/Singletons/TH/Deriving/Traversable.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE ScopedTypeVariables #-}- ----------------------------------------------------------------------------- -- | -- Module : Data.Singletons.TH.Deriving.Traversable
src/Data/Singletons/TH/Deriving/Util.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE MultiWayIf #-}-{-# LANGUAGE ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- |
src/Data/Singletons/TH/Names.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE TemplateHaskellQuotes #-}+ {- Data/Singletons/TH/Names.hs (c) Richard Eisenberg 2014@@ -5,8 +7,6 @@ Defining names and manipulations on names for use in promotion and singling. -}--{-# LANGUAGE TemplateHaskellQuotes #-} module Data.Singletons.TH.Names where
src/Data/Singletons/TH/Options.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE GeneralizedNewtypeDeriving #-}- ----------------------------------------------------------------------------- -- | -- Module : Data.Singletons.TH.Options
src/Data/Singletons/TH/Partition.hs view
@@ -11,9 +11,6 @@ -- ---------------------------------------------------------------------------- -{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TupleSections #-}- module Data.Singletons.TH.Partition where import Prelude hiding ( exp )
src/Data/Singletons/TH/Promote.hs view
@@ -7,8 +7,6 @@ type level. It is an internal module to the singletons-th package. -} -{-# LANGUAGE MultiWayIf, LambdaCase, TupleSections, ScopedTypeVariables #-}- module Data.Singletons.TH.Promote where import Language.Haskell.TH hiding ( Q, cxt )
src/Data/Singletons/TH/Promote/Defun.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE TemplateHaskellQuotes #-}+ {- Data/Singletons/TH/Promote/Defun.hs (c) Richard Eisenberg, Jan Stolarek 2014@@ -5,8 +7,6 @@ This file creates defunctionalization symbols for types during promotion. -}--{-# LANGUAGE TemplateHaskellQuotes #-} module Data.Singletons.TH.Promote.Defun where
src/Data/Singletons/TH/Promote/Monad.hs view
@@ -9,9 +9,6 @@ of DDec, and is wrapped around a Q. -} -{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleContexts,- TypeFamilies, KindSignatures #-}- module Data.Singletons.TH.Promote.Monad ( PrM, promoteM, promoteM_, promoteMDecs, VarPromotions, allLocals, emitDecs, emitDecsM,
src/Data/Singletons/TH/Promote/Type.hs view
@@ -6,8 +6,6 @@ This file implements promotion of types into kinds. -} -{-# LANGUAGE ScopedTypeVariables #-}- module Data.Singletons.TH.Promote.Type ( promoteType, promoteType_NC, promoteType_options , PromoteTypeOptions(..), defaultPromoteTypeOptions@@ -96,9 +94,12 @@ go args (DConT name) = do opts <- getOptions return $ applyDType (DConT (promotedDataTypeOrConName opts name)) args- go [DTANormal k1, DTANormal k2] DArrowT- = return $ DConT tyFunArrowName `DAppT` k1 `DAppT` k2- go args ty@DArrowT = illegal args ty+ go args ty@DArrowT =+ case filterDTANormals args of+ [] -> noPartialArrows+ [_] -> noPartialArrows+ [k1, k2] -> return $ DConT tyFunArrowName `DAppT` k1 `DAppT` k2+ (_:_:_:_) -> illegal args ty go [] ty@DLitT{} = pure ty go args ty@DLitT{} = illegal args ty go args ty@DWildCardT{}@@ -108,8 +109,17 @@ = fail $ unlines [ "`singletons-th` does not support wildcard types" , "\tunless they appear in visible type patterns of data constructors"- , "\tIn the type: " ++ pprint (sweeten typ)+ , "\t" ++ herald ]++ noPartialArrows :: m a+ noPartialArrows = fail $ unlines+ [ "`singletons-th` does not support partial applications of (->)"+ , "\t" ++ herald+ ]++ herald :: String+ herald = "In the type: " ++ pprint (sweeten typ) illegal :: [DTypeArg] -> DType -> m a illegal args hd = fail $ unlines
src/Data/Singletons/TH/Single.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE TemplateHaskellQuotes #-}+ {- Data/Singletons/TH/Single.hs (c) Richard Eisenberg 2013@@ -6,7 +8,6 @@ This file contains functions to refine constructs to work with singleton types. It is an internal module to the singletons-th package. -}-{-# LANGUAGE TemplateHaskellQuotes, TupleSections, ParallelListComp #-} module Data.Singletons.TH.Single where
src/Data/Singletons/TH/Single/Data.hs view
@@ -6,8 +6,6 @@ Singletonizes constructors. -} -{-# LANGUAGE ParallelListComp, TupleSections, LambdaCase #-}- module Data.Singletons.TH.Single.Data where import Language.Haskell.TH.Desugar
src/Data/Singletons/TH/Single/Fixity.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE ScopedTypeVariables #-} module Data.Singletons.TH.Single.Fixity where import Prelude hiding ( exp )
src/Data/Singletons/TH/Single/Monad.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE TemplateHaskellQuotes #-}+ {- Data/Singletons/TH/Single/Monad.hs (c) Richard Eisenberg 2014@@ -7,8 +9,6 @@ The SgM monad allows reading from a SgEnv environment and is wrapped around a Q. -}--{-# LANGUAGE GeneralizedNewtypeDeriving, ParallelListComp, TemplateHaskellQuotes #-} module Data.Singletons.TH.Single.Monad ( SgM, bindLets, bindContext, askContext, lookupVarE, lookupConE,
src/Data/Singletons/TH/SuppressUnusedWarnings.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE AllowAmbiguousTypes #-}+ -- Data/Singletons/TH/SuppressUnusedWarnings.hs -- -- (c) Richard Eisenberg 2014@@ -6,8 +8,6 @@ -- This declares user-oriented exports that are actually meant to be hidden -- from the user. Why would anyone ever want this? Because what is below -- is dirty, and no one wants to see it.--{-# LANGUAGE AllowAmbiguousTypes, PolyKinds, StandaloneKindSignatures #-} module Data.Singletons.TH.SuppressUnusedWarnings where
src/Data/Singletons/TH/Syntax.hs view
@@ -1,3 +1,6 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE TypeFamilies #-}+ {- Data/Singletons/TH/Syntax.hs (c) Richard Eisenberg 2014@@ -6,9 +9,6 @@ Converts a list of DLetDecs into a LetDecEnv for easier processing, and contains various other AST definitions. -}--{-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, DeriveDataTypeable,- FlexibleInstances, ConstraintKinds #-} module Data.Singletons.TH.Syntax where
src/Data/Singletons/TH/Util.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE LambdaCase #-}+ {- Data/Singletons/TH/Util.hs (c) Richard Eisenberg 2013@@ -6,12 +8,6 @@ This file contains helper functions internal to the singletons-th package. Users of the package should not need to consult this file. -}--{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, RankNTypes,- GeneralizedNewtypeDeriving, MultiParamTypeClasses,- UndecidableInstances, MagicHash, LambdaCase,- NoMonomorphismRestriction, ScopedTypeVariables,- FlexibleContexts, TypeApplications #-} module Data.Singletons.TH.Util where