invert 1.0 → 1.0.0.1
raw patch · 3 files changed
+30/−17 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changelog.md +4/−0
- invert.cabal +21/−12
- src/Invert.hs +5/−5
+ changelog.md view
@@ -0,0 +1,4 @@+History of the `invert` package:++ - Version 1.0, February 2021, initial release+ - Version 1.0.0.1, June 2021, extremely minor documentation changes
invert.cabal view
@@ -1,18 +1,19 @@ cabal-version: 2.0 name: invert-version: 1.0-synopsis: Automatically generate a function's inverse+version: 1.0.0.1+synopsis: Automatically generate a function’s inverse+category: Functions description:- This library deals with computing a function's inverse.+ This library deals with computing a function’s inverse. This is, of course, not possible in general, so the applicability of this library comes with some caveats: .- * The function's domain must be enumerable, and+ * The function’s domain must be enumerable, and preferably rather small. We provide a few suggestions and utilities for how to enumerate the domain.- * The function's codomain must belong to the @Eq@ class.+ * The function’s codomain must belong to the @Eq@ class. An @Ord@ or @Hashable@ instance is also nice, to accommodate a data structure for efficient lookups. * The functions for inverting injections, surjections,@@ -25,11 +26,19 @@ well choose only to read and borrow its techniques. build-type: Simple-tested-with: GHC==8.10.3, GHC==8.8.4, GHC==8.6.5+tested-with: GHC == 9.0.1, GHC == 8.10.3, GHC == 8.8.4, GHC == 8.6.5 +author: Chris Martin+maintainer: Chris Martin, Julie Moronuki++homepage: https://github.com/typeclasses/invert+bug-reports: https://github.com/typeclasses/invert/issues+ license: Apache-2.0 license-file: license.txt +extra-source-files: changelog.md+ library default-language: Haskell2010 ghc-options: -Wall@@ -41,10 +50,10 @@ , NamedFieldPuns , ExistentialQuantification build-depends:- base ^>= 4.12 || ^>= 4.13 || ^>= 4.14- , containers ^>=0.6- , hashable ^>= 1.3- , unordered-containers ^>= 0.2+ base ^>= 4.12 || ^>= 4.13 || ^>= 4.14 || ^>= 4.15+ , containers ^>= 0.6+ , hashable ^>= 1.2.7 || ^>= 1.3+ , unordered-containers ^>= 0.2.9 , generic-deriving ^>= 1.14 , vector ^>= 0.12 @@ -55,7 +64,7 @@ main-is: billing-codes.hs hs-source-dirs: examples build-depends:- base ^>= 4.12 || ^>= 4.13 || ^>= 4.14+ base ^>= 4.12 || ^>= 4.13 || ^>= 4.14 || ^>= 4.15 , invert benchmark benchmarks@@ -66,6 +75,6 @@ main-is: bench.hs ghc-options: -O2 -Wall Build-Depends:- base ^>= 4.12 || ^>= 4.13 || ^>= 4.14+ base ^>= 4.12 || ^>= 4.13 || ^>= 4.14 || ^>= 4.15 , criterion ^>= 1.5 , invert
src/Invert.hs view
@@ -49,15 +49,15 @@ {- $overview -There are three considerations when you're inverting a function:+There are three considerations when you’re inverting a function: 1. Is it an injection, a surjection, both (a bijection), or neither? 2. What data structure do you want to use for efficient lookups?- 3. Can you produce a list of all values in the function's domain?+ 3. Can you produce a list of all values in the function’s domain? === 1. What sort of function do you have? -This question determines the type of the function's inverse.+This question determines the type of the function’s inverse. For a function @(a -> b)@, we call @(a)@ its /domain/, and @(b)@ its /codomain/. @@ -285,7 +285,7 @@ -- It uses two stock-derivable classes, 'Enum' and 'Bounded'. -- -- To derive the required typeclass instances, add the--- following deriving clause to the type's definition:+-- following deriving clause to the type’s definition: -- -- > deriving (Enum, Bounded) --@@ -304,7 +304,7 @@ -- -- > {-# language DeriveGeneric, DeriveAnyClass, DerivingStrategies #-} ----- Then add the following deriving clauses to the type's definition:+-- Then add the following deriving clauses to the type’s definition: -- -- > deriving stock Generic -- > deriving anyclass GEnum