packages feed

fcf-containers 0.7.0 → 0.7.1

raw patch · 11 files changed

+31/−33 lines, 11 filesdep −GlobPVP ok

version bump matches the API change (PVP)

Dependencies removed: Glob

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,4 +1,11 @@ +# 0.7.1++20220601++ - Clean up several modules (remove extra spaces and paranthesis)+ - Update doctest function and remove Glob dependency+ - Update ci pipeline to do tests with 9.0 and 9.2  # 0.7.0 
examples/Crabcombat.hs view
@@ -101,7 +101,7 @@     (     Foldr (N.+) 0     =<< Uncurry (ZipWith (N.*))-    =<< Bimap ((MToN 1) <=< Length) Reverse+    =<< Bimap (MToN 1 <=< Length) Reverse     =<< AsPair     =<< Fst     =<< PlayGame '[] input@@ -114,6 +114,7 @@ -- Does not compile on my machine (not even with the -freduction-depth=0 at cabal), -- not enough memory -- Ghci also gets 'Killed'.+{- type Input =     '( '[21, 50,  9, 45, 16, 47, 27, 38, 29, 48, 10, 42, 32, 31, 41, 11,  8, 33, 25, 30, 12, 40,  7, 23, 46]      , '[22, 20, 44,  2, 26, 17, 34, 37, 43,  5, 15, 18, 36, 19, 24, 35,  3, 13, 14,  1,  6, 39, 49,  4, 28]@@ -136,7 +137,7 @@     '( '[21, 50,  9, 45, 16, 47, 27, 38, 29, 48, 10,   40,  7, 23, 46]      , '[22, 20, 44,  2, 26, 17, 34, 37, 43,  5, 15,   39, 49,  4, 28]      ) -- :: ([Nat], [Nat])-+-}   
fcf-containers.cabal view
@@ -7,7 +7,7 @@     contents of containers-package and show how these can be used. Everything is     based on the ideas given in the first-class-families -package. Homepage:            https://github.com/gspia/fcf-containers-Version:             0.7.0+Version:             0.7.1 Build-type:          Simple Author:              gspia Maintainer:          iahogsp@gmail.com@@ -16,7 +16,7 @@ Category:            Other Copyright:           gspia (c) 2020- Extra-source-files:  README.md, TODO.md, CHANGELOG.md, default.nix, shell.nix-Tested-With:         GHC ==9.2.2 || ==9.0.2 || ==8.10.7 || ==8.8.4+Tested-With:         GHC ==9.2.2 || ==9.0.2 || ==8.10.7   library@@ -100,7 +100,6 @@       , first-class-families       , fcf-containers       , ghc-prim-      , Glob   else     buildable: False 
src/Fcf/Alg/Morphism.hs view
@@ -64,7 +64,7 @@ -- Check Fcf.Alg.List to see example algebras in use. There we have e.g. -- ListToFix-function. data Cata :: Algebra f a -> Fix f -> Exp a-type instance Eval (Cata alg ('Fix b)) = alg @@ (Eval (Map (Cata alg) b))+type instance Eval (Cata alg ('Fix b)) = alg @@ Eval (Map (Cata alg) b)  -- | Ana can also be used to build a 'Fix' structure. --@@ -117,7 +117,7 @@ -- Check Fcf.Alg.List to see example algebras in use. There we have e.g. -- ListToParaFix-function. data Para :: RAlgebra f a -> Fix f -> Exp a-type instance Eval (Para ralg ('Fix  a)) =  ralg @@ (Eval (Map (Fanout ralg) a))+type instance Eval (Para ralg ('Fix  a)) =  ralg @@ Eval (Map (Fanout ralg) a)  -------------------------------------------------------------------------------- 
src/Fcf/Alg/Other.hs view
@@ -1,8 +1,5 @@-{-# LANGUAGE DataKinds              #-}-{-# LANGUAGE PolyKinds              #-} {-# LANGUAGE TypeFamilies           #-} {-# LANGUAGE TypeInType             #-}-{-# LANGUAGE TypeOperators          #-} {-# LANGUAGE UndecidableInstances   #-} {-# OPTIONS_GHC -Wall                       #-} {-# OPTIONS_GHC -Werror=incomplete-patterns #-}@@ -25,7 +22,7 @@  module Fcf.Alg.Other where -import           Fcf as Fcf+import           Fcf  -------------------------------------------------------------------------------- 
src/Fcf/Alg/Sort.hs view
@@ -100,7 +100,7 @@ -- helper data Inord :: Algebra (BTreeF a) [a] type instance Eval (Inord 'BEmptyF) = '[]-type instance Eval (Inord ('BNodeF v l r)) = Eval (l ++ (Eval ('[v] ++ r)))+type instance Eval (Inord ('BNodeF v l r)) = Eval (l ++ Eval ('[v] ++ r))   -- | Qsort - give the comparison function @a -> a -> Exp Bool@ comparing your @@ -124,5 +124,4 @@ -- Nat-list. Sorting would work without PartCmp. data PartCmp :: (a -> a -> Exp Bool) -> CoAlgebra (BTreeF a) [a]  type instance Eval (PartCmp cmp coalg) = Eval (PartHlp (Flip cmp) coalg)- 
src/Fcf/Alg/Symbol.hs view
@@ -163,7 +163,7 @@ -- = 'True data IsSpaceDelim :: Symbol -> Exp Bool type instance Eval (IsSpaceDelim s) =-    Eval (Eval (IsSpace s) || (Eval (Eval (IsNewLine s) || Eval (IsTab s))))+    Eval (Eval (IsSpace s) || Eval (Eval (IsNewLine s) || Eval (IsTab s)))   -- | IsDigit
src/Fcf/Alg/Tree.hs view
@@ -46,7 +46,7 @@  -- | A function to transform a Tree into fixed structure that can be used -- by Cata and Ana.--- +-- -- See the implementation of 'Size' for an example. data TreeToFix :: Tree a -> Exp (Fix (TreeF a)) type instance Eval (TreeToFix ('Node a '[])) = 'Fix ('NodeF a '[])@@ -55,15 +55,15 @@  -------------------------------------------------------------------------------- --- | Sum the nodes of TreeF containing Nats. --- +-- | Sum the nodes of TreeF containing Nats.+-- -- See the implementation of 'Fib' for an example. data SumNodesAlg :: Algebra (TreeF Nat) Nat type instance Eval (SumNodesAlg ('NodeF x '[]))       = x type instance Eval (SumNodesAlg ('NodeF x (b ': bs))) = x TL.+ (Eval (Sum (b ': bs)))  -- | Count the nodes of TreeF. --- +-- -- See the 'Size' for an example. data CountNodesAlg :: Algebra (TreeF a) Nat type instance Eval (CountNodesAlg ('NodeF x '[]))       = 1@@ -71,11 +71,11 @@   -- | Size of the Tree is the number of nodes in it.--- +-- -- __Example__ -- -- Size is defined as @ Cata CountNodesAlg =<< TreeToFix tr @--- and can be used with the following. +-- and can be used with the following. -- -- >>> data BuildNode :: Nat -> Exp (Nat,[Nat]) -- >>> :{@@ -113,7 +113,7 @@   -- | Fibonaccis with Hylo, not efficient--- +-- -- __Example__ -- -- >>> :kind! Eval (FibHylo 10)@@ -169,7 +169,7 @@ --                             'Fix ('AnnF '( 'NodeF 7 '[], 1))], --                        3))], --           7))-type instance Eval (Sizes fx) = Eval (Synthesize ( ( (+) 1) <=< FSum) fx)+type instance Eval (Sizes fx) = Eval (Synthesize ( (+) 1 <=< FSum) fx) data Sizes :: Fix f -> Exp (Ann f Nat)  --------------------------------------------------------------------------------
src/Fcf/Data/Set.hs view
@@ -307,10 +307,10 @@ -- helper for PowerSet data ExtendBitList :: [[Bool]] -> Exp [[Bool]] type instance Eval (ExtendBitList lst) =-    Eval ((Eval (AddFalses lst)) ++ (Eval (AddTrues =<< Map Reverse lst)))+    Eval (Eval (AddFalses lst) ++ Eval (AddTrues =<< Map Reverse lst))  -- helper for PowerSet--- :kind! Eval (Cata BuildGrayBitListsAlg=<< ListToFix =<< Replicate 3 '[])+-- :kind! Eval (Cata BuildGrayBitListsAlg =<< ListToFix =<< Replicate 3 '[]) data BuildGrayBitListsAlg :: Algebra (ListF [[Bool]]) [[Bool]] type instance Eval (BuildGrayBitListsAlg 'NilF) = '[ '[] ] type instance Eval (BuildGrayBitListsAlg ('ConsF _ lst)) = Eval (ExtendBitList lst)@@ -381,5 +381,4 @@ -- = '[ '[], '[1], '[1, 2], '[1, 2, 3], '[1, 3], '[2], '[2, 3], '[3]] data ToList :: Set v -> Exp [v] type instance Eval (ToList ('Set lst)) = lst- 
src/Fcf/Data/Tree.hs view
@@ -80,11 +80,11 @@ type instance Eval (M.Return a) = 'Node a '[]  -- M.<*> instance (applicative)-type instance Eval (('Node f tfs) M.<*> ('Node x txs)) =+type instance Eval ('Node f tfs M.<*> 'Node x txs) =     'Node (Eval (f x))-        (Eval ( (Eval (Map (Map f) txs))+        (Eval ( Eval (Map (Map f) txs)         ++-          (Eval (Map (StarTx ('Node x txs)) tfs))+          Eval (Map (StarTx ('Node x txs)) tfs)           -- (Eval (Map ( M.<*> ('Node x txs)) tfs))         )) @@ -177,5 +177,4 @@ -- = '[ '[1], '[2, 5], '[3, 6], '[4]] data Levels :: Tree a -> Exp [[a]] type instance Eval (Levels tr) = Eval (Unfoldr SubFLevels '[tr])- 
test/doctest.hs view
@@ -1,4 +1,3 @@-import System.FilePath.Glob (glob) import Test.DocTest  exts :: [String]@@ -11,6 +10,4 @@   ]  main :: IO ()-main = do-  xs <- glob "src/**/*.hs"-  doctest (exts ++ xs)+main = doctest $ exts ++ ["-isrc"]