species 0.4 → 0.4.0.1
raw patch · 3 files changed
+24/−12 lines, 3 filesdep ~basedep ~containersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, containers
API changes (from Hackage documentation)
- Math.Combinatorics.Species: data (:.:) f g a
- Math.Combinatorics.Species.Structures: data (:.:) f g a
+ Math.Combinatorics.Species: data f (:.:) g a
+ Math.Combinatorics.Species.Structures: data f (:.:) g a
- Math.Combinatorics.Species: class Typeable (StructTy f) => Enumerable (f :: * -> *) where type StructTy f :: * -> * where {
+ Math.Combinatorics.Species: class Typeable (StructTy f) => Enumerable (f :: * -> *) where {
- Math.Combinatorics.Species: class (C s) => Species s where linOrd = oneHole cycle subset = set * set ksubset k = (set `ofSizeExactly` k) * set element = singleton * set ofSizeExactly s n = s `ofSize` (== n) nonEmpty = flip ofSize (> 0)
+ Math.Combinatorics.Species: class (C s) => Species s
- Math.Combinatorics.Species.Class: class (C s) => Species s where linOrd = oneHole cycle subset = set * set ksubset k = (set `ofSizeExactly` k) * set element = singleton * set ofSizeExactly s n = s `ofSize` (== n) nonEmpty = flip ofSize (> 0)
+ Math.Combinatorics.Species.Class: class (C s) => Species s
- Math.Combinatorics.Species.Enumerate: class Typeable (StructTy f) => Enumerable (f :: * -> *) where type StructTy f :: * -> * where {
+ Math.Combinatorics.Species.Enumerate: class Typeable (StructTy f) => Enumerable (f :: * -> *) where {
Files
- CHANGES +8/−0
- Math/Combinatorics/Species/Enumerate.hs +14/−10
- species.cabal +2/−2
CHANGES view
@@ -1,3 +1,11 @@+0.4.0.1 10 April 2018++ * bug fix in 'structureType' function (https://github.com/byorgey/species/issues/3)++0.4-r1 12 October 2017++ * Allow base-4.10 (GHC 8.2)+ 0.4 9 August 2016 * Add support for GHC 8.0.1. Unfortunately, the price to pay for this is
Math/Combinatorics/Species/Enumerate.hs view
@@ -203,8 +203,7 @@ where extractType :: forall s. Typeable s => TSpeciesAST s -> TypeRep extractType _ = typeOf1 (undefined :: s ()) --- | Show a 'TypeRep' while stripping off qualifier portions of 'TyCon'--- names. This is essentially copied and pasted from the+-- | Show a 'TypeRep'. This is essentially copied and pasted from the -- "Data.Typeable" source, with a number of cases taken out that we -- don't care about (special cases for @(->)@, tuples, etc.). showStructureType :: TypeRep -> String@@ -212,21 +211,26 @@ where showsPrecST :: Int -> TypeRep -> ShowS showsPrecST p t = case splitTyConApp t of- (tycon, []) -> showString (dropQuals $ tyConName tycon)+ (tycon, []) -> showString (tyConName tycon) (tycon, [x]) | tyConName tycon == "[]" -> showChar '[' . showsPrecST 11 x . showChar ']'- (tycon, args) -> showParen (p > 9)- $ showString (dropQuals $ tyConName tycon)- . showChar ' '- . showArgsST args+ (tycon, args) -> showParen (p > 9) $+ case (tyConName tycon, args) of+ (':':_, [x,y]) -> showsPrecST 10 x . showChar ' '+ . showString (tyConName tycon)+ . showChar ' '+ . showsPrecST 10 y+ (':':_, _) -> showChar '(' . showString (tyConName tycon)+ . showChar ')' . showChar ' '+ . showArgsST args+ _ -> showString (tyConName tycon)+ . showChar ' '+ . showArgsST args showArgsST :: [TypeRep] -> ShowS showArgsST [] = id showArgsST [t] = showsPrecST 10 t showArgsST (t:ts) = showsPrecST 10 t . showChar ' ' . showArgsST ts-- dropQuals :: String -> String- dropQuals = reverse . takeWhile (/= '.') . reverse -- | 'enumerateE' is a variant of 'enumerate'' which takes an -- (existentially quantified) typed AST and returns a list of
species.cabal view
@@ -1,5 +1,5 @@ name: species-version: 0.4+version: 0.4.0.1 license: BSD3 license-file: LICENSE build-type: Simple@@ -20,7 +20,7 @@ location: https://github.com/byorgey/species Library- build-depends: base >= 4.7 && < 4.10,+ build-depends: base >= 4.7 && < 4.11, numeric-prelude >= 0.3 && < 0.5, np-extras >= 0.3 && < 0.4, containers >= 0.2 && < 0.6,