yaya-unsafe 0.1.1.0 → 0.1.1.2
raw patch · 5 files changed
+15/−85 lines, 5 filesdep −hedgehogdep −yaya-hedgehogdep −yaya-unsafedep ~basePVP ok
version bump matches the API change (PVP)
Dependencies removed: hedgehog, yaya-hedgehog, yaya-unsafe
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−0
- src/Yaya/Unsafe/Zoo.hs +6/−6
- test/Test/Fold.hs +0/−50
- test/test.hs +0/−15
- yaya-unsafe.cabal +1/−14
CHANGELOG.md view
@@ -4,6 +4,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). +## 0.1.1.2 – 2019–11–08+### Changed+- improved documentation++## 0.1.1.1 – 2019–11–08+### Added+- tests for `law_cataCompose` (which bumps the yaya-hedgehog dependency for tests)+ ## 0.1.1.0 – 2019–01–08 ### Added - lower bounds on internal yaya dependencies
src/Yaya/Unsafe/Zoo.hs view
@@ -29,13 +29,13 @@ dyna :: Functor f => GAlgebra (Cofree f) f b -> Coalgebra f a -> a -> b dyna φ ψ = Unsafe.ghylo (distCofreeT id) seqIdentity φ (fmap Identity . ψ) --- | Unlike most 'hylo's, 'elgot' composes an algebra and coalgebra in a way--- that allows information to move between them. The coalgebra can return,+-- | Unlike most `Unsafe.hylo`s, `elgot` composes an algebra and coalgebra in a+-- way that allows information to move between them. The coalgebra can return, -- effectively, a pre-folded branch, short-circuiting parts of the process. elgot :: Functor f => Algebra f b -> ElgotCoalgebra (Either b) f a -> a -> b elgot φ ψ = Unsafe.hylo ((id ||| φ) . getCompose) (Compose . ψ) --- | The dual of 'elgot', 'coelgot' allows the _algebra_ to short-circuit in+-- | The dual of `elgot`, `coelgot` allows the /algebra/ to short-circuit in -- some cases – operating directly on a part of the seed. coelgot :: Functor f => ElgotAlgebra ((,) a) f b -> Coalgebra f a -> a -> b coelgot φ ψ = Unsafe.hylo (φ . getCompose) (Compose . (id &&& ψ))@@ -67,8 +67,8 @@ stream :: Coalgebra (XNor c) b -> (b -> a -> b) -> b -> [a] -> [c] stream f g = fstream f g (const Neither) --- | Basically the definition from Gibbons’ paper, except the flusher (`h`) is a--- 'Coalgebra' instead of an 'unfold'.+-- | Basically the definition from Gibbons’ paper, except the flusher (@h@) is a+-- `Coalgebra` instead of an `unfold`. fstream :: Coalgebra (XNor c) b -> (b -> a -> b)@@ -92,7 +92,7 @@ -- x :: [Int] -- x = stream project snoc [] [1, 2, 3, 4, 5] --- TODO: Weaken 'Monad' constraint to 'Applicative'.+-- TODO: Weaken `Monad` constraint to `Applicative`. cotraverse :: ( Steppable t (f a) , Steppable u (f b)
− test/Test/Fold.hs
@@ -1,50 +0,0 @@-{-# LANGUAGE TemplateHaskell #-}--module Test.Fold where--import Hedgehog-import qualified Hedgehog.Gen as Gen--import Yaya.Fold.Common-import Yaya.Hedgehog.Expr-import Yaya.Hedgehog.Fold-import qualified Yaya.Unsafe.Fold.Instances ()---- | NB: Only in yaya-unsafe instead of yaya because the `Eq (Fix f)` instance--- is needed.-prop_fixAnaRefl :: Property-prop_fixAnaRefl =- property $ law_anaRefl =<< forAll (Gen.sized genFixExpr)--prop_fixCataCancel :: Property-prop_fixCataCancel =- property $ law_cataCancel size =<< forAll (genExpr (Gen.sized genFixExpr))--prop_fixCataRefl :: Property-prop_fixCataRefl =- property $ law_cataRefl =<< forAll (Gen.sized genFixExpr)---- prop_fixCataCompose :: Property--- prop_fixCataCompose =--- property $ law_cataCompose size id =<< forAll (Gen.sized genFixExpr)---- | NB: Only in yaya-unsafe instead of yaya because the `Eq (Nu f)` instance is--- needed.-prop_nuAnaRefl :: Property-prop_nuAnaRefl =- property $ law_anaRefl =<< forAll (Gen.sized genNuExpr)--prop_nuCataCancel :: Property-prop_nuCataCancel =- property $ law_cataCancel size =<< forAll (genExpr (Gen.sized genNuExpr))--prop_nuCataRefl :: Property-prop_nuCataRefl =- property $ law_cataRefl =<< forAll (Gen.sized genNuExpr)---- prop_nuCataCompose :: Property--- prop_nuCataCompose =--- property $ law_cataCompose size id =<< forAll (Gen.sized genNuExpr)--tests :: IO Bool-tests = checkParallel $$(discover)
− test/test.hs
@@ -1,15 +0,0 @@-import Control.Monad-import System.Exit (exitFailure)-import System.IO (BufferMode(..), hSetBuffering, stdout, stderr)--import qualified Test.Fold as Fold--main :: IO ()-main = do- hSetBuffering stdout LineBuffering- hSetBuffering stderr LineBuffering-- results <- sequence [ Fold.tests- ]-- unless (and results) exitFailure
yaya-unsafe.cabal view
@@ -1,5 +1,5 @@ name: yaya-unsafe-version: 0.1.1.0+version: 0.1.1.2 synopsis: Non-total extensions to the Yaya recursion scheme library. description: Yaya is designed as a _total_ library. However, it is often expedient to use partial operations in some cases, and this@@ -44,19 +44,6 @@ , RankNTypes , ScopedTypeVariables , TupleSections- default-language: Haskell2010--test-suite yaya-unsafe-test- type: exitcode-stdio-1.0- hs-source-dirs: test- main-is: test.hs- other-modules: Test.Fold- build-depends: base- , hedgehog- , yaya >= 0.1.0- , yaya-hedgehog >= 0.1.1- , yaya-unsafe >= 0.1.0- ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall default-language: Haskell2010 source-repository head