eliminators 0.9.3 → 0.9.4
raw patch · 3 files changed
+31/−12 lines, 3 filesdep ~basedep ~singletons-basedep ~template-haskell
Dependency ranges changed: base, singletons-base, template-haskell, th-abstraction, th-desugar
Files
- CHANGELOG.md +3/−0
- eliminators.cabal +10/−10
- src/Data/Eliminator/TH.hs +18/−2
CHANGELOG.md view
@@ -1,3 +1,6 @@+### 0.9.4 [2023.10.13]+* Require `singletons-base-3.3` and GHC 9.8.+ ### 0.9.3 [2023.03.12] * Require `singletons-base-3.2` and GHC 9.6.
eliminators.cabal view
@@ -1,5 +1,5 @@ name: eliminators-version: 0.9.3+version: 0.9.4 synopsis: Dependently typed elimination functions using singletons description: This library provides eliminators for inductive data types, leveraging the power of the @singletons@ library to allow@@ -16,7 +16,7 @@ build-type: Simple extra-source-files: CHANGELOG.md, README.md cabal-version: >=1.10-tested-with: GHC == 9.6.1+tested-with: GHC == 9.8.1 source-repository head type: git@@ -30,14 +30,14 @@ Data.Eliminator.TH Data.Eliminator.TypeLits Data.Eliminator.TypeNats- build-depends: base >= 4.18 && < 4.19+ build-depends: base >= 4.19 && < 4.20 , extra >= 1.4.2 && < 1.8- , singletons-base >= 3.2 && < 3.3+ , singletons-base >= 3.3 && < 3.4 , singleton-nats >= 0.4.2 && < 0.5- , template-haskell >= 2.20 && < 2.21- , text >= 2.0.1 && < 2.1- , th-abstraction >= 0.4 && < 0.6- , th-desugar >= 1.15 && < 1.16+ , template-haskell >= 2.21 && < 2.22+ , text >= 2.0.1 && < 2.2+ , th-abstraction >= 0.4 && < 0.7+ , th-desugar >= 1.16 && < 1.17 hs-source-dirs: src default-language: GHC2021 ghc-options: -Wall -Wcompat -Wno-unticked-promoted-constructors -fenable-th-splice-warnings@@ -58,10 +58,10 @@ PolyRecTypes VecTypes VecSpec- build-depends: base >= 4.18 && < 4.19+ build-depends: base >= 4.19 && < 4.20 , eliminators , hspec >= 2 && < 3- , singletons-base >= 3.2 && < 3.3+ , singletons-base >= 3.3 && < 3.4 , singleton-nats >= 0.4.2 && < 0.5 build-tool-depends: hspec-discover:hspec-discover hs-source-dirs: tests
src/Data/Eliminator/TH.hs view
@@ -726,13 +726,29 @@ upcase :: String -> String upcase str | isHsLetter first- = toUpper first : tail str+ = toUpper first : tailNameStr str | otherwise = str where- first = head str+ first = headNameStr str -- is it a letter or underscore? isHsLetter :: Char -> Bool isHsLetter c = isLetter c || c == '_'++-- Return the first character in a Name's string (i.e., nameBase).+-- Precondition: the string is non-empty.+headNameStr :: String -> Char+headNameStr str =+ case str of+ (c:_) -> c+ [] -> error "headNameStr: Expected non-empty string"++-- Drop the first character in a Name's string (i.e., nameBase).+-- Precondition: the string is non-empty.+tailNameStr :: String -> String+tailNameStr str =+ case str of+ (_:cs) -> cs+ [] -> error "tailNameStr: Expected non-empty string"