mealy 0.5.0.1 → 0.5.1.0
raw patch · 4 files changed
+40/−88 lines, 4 filesdep −clockdep −deepseqdep −doctest-paralleldep ~base
Dependencies removed: clock, deepseq, doctest-parallel, formatn, mtl, optics-core, time
Dependency ranges changed: base
Files
- mealy.cabal +6/−47
- readme.md +34/−0
- readme.org +0/−33
- test/doctests.hs +0/−8
mealy.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: mealy-version: 0.5.0.1+version: 0.5.1.0 license: BSD-3-Clause license-file: LICENSE copyright: Tony Day (c) 2013@@ -23,14 +23,13 @@ build-type: Simple tested-with:- ghc ==9.6.7- ghc ==9.8.4- ghc ==9.10.2+ ghc ==9.10.3 ghc ==9.12.2+ ghc ==9.14.1 extra-doc-files: ChangeLog.md- readme.org+ readme.md source-repository head type: git@@ -46,29 +45,9 @@ -Wpartial-fields -Wredundant-constraints -common ghc2024-additions- default-extensions:- DataKinds- DerivingStrategies- DisambiguateRecordFields- ExplicitNamespaces- GADTs- LambdaCase- MonoLocalBinds- RoleAnnotations--common ghc2024-stanza- if impl(ghc >=9.10)- default-language:- GHC2024- else- import: ghc2024-additions- default-language:- GHC2021- library import: ghc-options-stanza- import: ghc2024-stanza+ default-language: GHC2024 hs-source-dirs: src build-depends: adjunctions >=4.0 && <4.5,@@ -90,18 +69,6 @@ Data.Mealy.Quantiles Data.Mealy.Simulate -test-suite doctests- import: ghc2024-stanza- main-is: doctests.hs- hs-source-dirs: test- build-depends:- base >=4.14 && <5,- doctest-parallel >=0.3 && <0.5,- mealy,-- ghc-options: -threaded- type: exitcode-stdio-1.0- common ghc-options-exe-stanza ghc-options: -fforce-recomp@@ -113,24 +80,16 @@ executable mealy-perf import: ghc-options-exe-stanza import: ghc-options-stanza- import: ghc2024-stanza+ default-language: GHC2024 main-is: mealy-perf.hs hs-source-dirs: test build-depends: base >=4.7 && <5,- clock >=0.8 && <0.9, containers >=0.6 && <0.9,- deepseq >=1.4.4 && <1.6,- formatn >=0.2.1 && <0.4,- harpie >=0.1 && <0.2,- harpie-numhask >=0.1 && <0.2, mealy,- mtl >=2.2.2 && <2.4,- optics-core >=0.4 && <0.5, optparse-applicative >=0.17 && <0.20, perf >=0.14 && <0.15, tdigest >=0.2.1 && <0.4, text >=1.2 && <2.2,- time >=1.10 && <1.15, ghc-options: -O2
+ readme.md view
@@ -0,0 +1,34 @@+# mealy++[](https://hackage.haskell.org/package/mealy) [](https://github.com/tonyday567/mealy/actions/workflows/haskell-ci.yml)++A 'Mealy' is a triple of functions++- (a -> b) **inject**: Convert (initial) input into the (initial) state type.+- (b -> a -> b) **step**: Update state given prior state and (new) input.+- (c -> b) **extract**: Convert state to the output type.++A sum, for example, looks like `M id (+) id` where the first id is the initial injection and the second id is the covariant extraction.++This library provides support for computing statistics (such as an average or a standard deviation) as current state within a mealy context.++## Usage++Usage is to supply a decay function representing the relative weights of recent values versus older ones, in the manner of exponentially-weighted averages. The library attempts to be polymorphic in the statistic which can be combined in applicative style.++```haskell+import Prelude+import Data.Mealy+```++```haskell+fold ((,) <$> ma 0.9 <*> std 0.9) [1..100::Double]+```++```+(91.00265621044142,9.472822805289121)+```++## Reference++[Finite State Transducers](https://stackoverflow.com/questions/27997155/finite-state-transducers-in-haskell)
− readme.org
@@ -1,33 +0,0 @@-#+TITLE: mealy--[[https://hackage.haskell.org/package/mealy][file:https://img.shields.io/hackage/v/mealy.svg]] [[https://github.com/tonyday567/mealy/actions/workflows/haskell-ci.yml][file:https://github.com/tonyday567/mealy/actions/workflows/haskell-ci.yml/badge.svg]]--A 'Mealy' is a triple of functions--- (a -> b) *inject*: Convert (initial) input into the (initial) state type.-- (b -> a -> b) *step*: Update state given prior state and (new) input.-- (c -> b) *extract*: Convert state to the output type.--A sum, for example, looks like ~M id (+) id~ where the first id is the initial injection and the second id is the covariant extraction.--This library provides support for computing statistics (such as an average or a standard deviation) as current state within a mealy context.--* Usage--Usage is to supply a decay function representing the relative weights of recent values versus older ones, in the manner of exponentially-weighted averages. The library attempts to be polymorphic in the statistic which can be combined in applicative style.--#+begin_src haskell :results output-import Prelude-import Data.Mealy-#+end_src--#+begin_src haskell :results output-fold ((,) <$> ma 0.9 <*> std 0.9) [1..100::Double]-#+end_src--#+RESULTS:-: (91.00265621044142,9.472822805289121)--* Reference--[[https://stackoverflow.com/questions/27997155/finite-state-transducers-in-haskell][Finite State Transducers]]
− test/doctests.hs
@@ -1,8 +0,0 @@-module Main where--import System.Environment (getArgs)-import Test.DocTest (mainFromCabal)-import Prelude (IO, (=<<))--main :: IO ()-main = mainFromCabal "mealy" =<< getArgs