semiring-simple 0.1.0.0 → 0.2.0.0
raw patch · 3 files changed
+40/−53 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- Data/Semiring.hs +0/−50
- semiring-simple.cabal +3/−3
- src/Data/Semiring.hs +37/−0
− Data/Semiring.hs
@@ -1,50 +0,0 @@--- | --- Module : Data.Semiring--- Copyright : Thomas Wilke, Frank Huch, Sebastian Fischer, Peter Harpending--- License : BSD3--- Maintainer : Peter Harpending <pharpend2@gmail.com>--- --- This library provides a type class for semirings.--- --module Data.Semiring where---- |--- A semiring is an additive commutative monoid with identity 'zero':--- --- > a .+. b == b .+. a--- > zero .+. a == a--- > (a .+. b) .+. c == a .+. (b .+. c)--- --- A semiring is a multiplicative monoid with identity 'one':--- --- > one .*. a == a--- > a .*. one == a--- > (a .*. b) .*. c == a .*. (b .*. c)--- --- Multiplication distributes over addition:--- --- > a .*. (b .+. c) == (a .*. b) .+. (a .*. c)--- > (a .+. b) .*. c == (a .*. c) .+. (b .*. c)--- --- 'zero' annihilates a semiring with respect to multiplication:--- --- > zero .*. a == zero--- > a .*. zero == zero--- --- All laws should hold with respect to the required `Eq` instance.--- --- For example, the Booleans form a semiring.--- --- * @False@ is an identity of disjunction which is commutative and--- associative,--- --- * @True@ is an identity of conjunction which is associative,--- --- * conjunction distributes over disjunction, and--- --- * @False@ annihilates the Booleans with respect to conjunction.--- -class (Eq s) => Semiring s where- zero, one :: s- (.+.), (.*.) :: s -> s -> s
semiring-simple.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.0+version: 0.2.0.0 -- A short (one-line) description of the package. synopsis: A module for dealing with semirings.@@ -57,10 +57,10 @@ -- other-extensions: -- Other library packages from which modules are imported.- build-depends: base >=4.6 && <4.7+ build-depends: base >=4.7 && <4.8 -- Directories containing source files.- -- hs-source-dirs: + hs-source-dirs: src/ -- Base language which the package is written in. default-language: Haskell2010
+ src/Data/Semiring.hs view
@@ -0,0 +1,37 @@+{-| +Module : Data.Semiring+Copyright : Thomas Wilke, Frank Huch, Sebastian Fischer, Peter Harpending+License : BSD3+Maintainer : Peter Harpending <pharpend2@gmail.com>++This library provides a type class for semirings.++-}++module Data.Semiring where++-- |+-- A semiring is an additive commutative monoid with identity 'zero':+-- +-- > a .+. b == b .+. a+-- > zero .+. a == a+-- > (a .+. b) .+. c == a .+. (b .+. c)+-- +-- A semiring is a multiplicative monoid with identity 'one':+-- +-- > one .*. a == a+-- > a .*. one == a+-- > (a .*. b) .*. c == a .*. (b .*. c)+-- +-- Multiplication distributes over addition:+-- +-- > a .*. (b .+. c) == (a .*. b) .+. (a .*. c)+-- > (a .+. b) .*. c == (a .*. c) .+. (b .*. c)+-- +-- 'zero' annihilates a semiring with respect to multiplication:+-- +-- > zero .*. a == zero+-- > a .*. zero == zero+class (Eq s) => Semiring s where+ zero, one :: s+ (.+.), (.*.) :: s -> s -> s