numhask 0.12.0.0 → 0.12.0.1
raw patch · 5 files changed
+84/−32 lines, 5 filesdep +QuickCheck
Dependencies added: QuickCheck
Files
- numhask.cabal +7/−2
- other/nh.svg +0/−25
- other/nh11.svg +25/−0
- other/nh12.svg +32/−0
- src/NumHask/Data/Positive.hs +20/−5
numhask.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: numhask-version: 0.12.0.0+version: 0.12.0.1 license: BSD-3-Clause license-file: LICENSE copyright: Tony Day (c) 2016@@ -15,7 +15,7 @@ The numeric class constellation looks somewhat like: - +  == Usage @@ -49,9 +49,14 @@ common ghc2021-stanza default-language: GHC2021 +common docspec+ x-docspec-extra-packages: QuickCheck+ build-depends: QuickCheck >= 2.14 && < 2.15+ library import: ghc-options-stanza import: ghc2021-stanza+ import: docspec hs-source-dirs: src build-depends: , base >=4.7 && <5
− other/nh.svg
@@ -1,25 +0,0 @@-<svg height="500" width="500" viewBox="-50 -350 500 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>svg {- color-scheme: light dark;-}-{- .canvas g, .title g, .axisbar g, .ticktext g, .tickglyph g, .ticklines g, .legendContent g text {- fill: rgb(5%, 5%, 5%);- }- .ticklines g, .tickglyph g, .legendBorder g {- stroke: rgb(5%, 5%, 5%);- }- .legendBorder g {- fill: rgb(94%, 94%, 94%);- }-}-@media (prefers-color-scheme:dark) {- .canvas g, .title g, .axisbar g, .ticktext g, .tickglyph g, .ticklines g, .legendContent g text {- fill: rgb(94%, 94%, 94%);- }- .ticklines g, .tickglyph g, .legendBorder g {- stroke: rgb(94%, 94%, 94%);- }- .legendBorder g {- fill: rgb(5%, 5%, 5%);- }-}</style><g class="chart"><g class="edges"><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 226.67,-180.3000 C 218.42,-189.6300 208.1400,-201.23 199.34,-211.1700 L 195.15,-215.9000"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 170.21,-180.3000 C 171.85,-189.1200 173.87,-199.97 175.64,-209.5300 L 176.82,-215.9000"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 110.74,-180.3000 C 123.2400,-189.81 138.84,-201.6800 152.07,-211.7500 L 157.2,-215.65"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 192.3600,-252.3000 C 198.9,-261.46 207.0,-272.81 214.02,-282.62 L 217.78,-287.9"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 162.7,-252.3000 C 153.29,-261.7100 141.56,-273.44 131.56,-283.4400 L 127.1,-287.9"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 76.124,-252.3000 C 82.0090,-261.46 89.304,-272.81 95.6150,-282.62 L 99.004,-287.9"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 181.36,-36.303 C 176.31,-45.3740 170.05,-56.5960 164.62,-66.35 L 161.53,-71.896"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 124.56,-96.119 C 98.982,-102.5 62.272,-116.1700 45.0,-144.0 C 32.513,-164.12 41.437,-191.1 51.02,-210.0600 L 53.992,-215.6700"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 179.35,-101.76 C 205.58,-112.2 246.22,-128.66 281.0,-144.0 C 281.87,-144.38 282.75,-144.78 283.64,-145.17 L 289.5500,-147.86"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 338.83,-108.3 C 335.11,-117.29 330.51,-128.39 326.5,-138.08 L 324.09,-143.9"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 254.03,-36.4830 C 232.89,-47.366 205.83,-61.292 184.89,-72.069 L 179.16,-75.02"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 291.56,-36.4120 C 296.76,-61.887 306.46,-109.37 312.26,-137.79 L 313.51,-143.89"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 122.6400,-36.303 C 127.6900,-45.3740 133.95,-56.5960 139.38,-66.35 L 142.47,-71.896"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 289.61,-177.0 C 269.5900,-187.22 242.1500,-201.2400 219.7400,-212.7 L 214.1500,-215.55"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 313.79,-180.3000 C 312.15,-189.1200 310.13,-199.97 308.36,-209.5300 L 307.18,-215.9000"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 285.71,-252.3000 C 275.84,-261.6400 263.55,-273.26 253.03,-283.21 L 248.34,-287.65"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 63.4720,-36.4830 C 80.423,-46.539 101.75,-59.193 119.2300,-69.561 L 124.5200,-72.699"/></g></g><g class="shapes"><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="58.9997" x="212.5002" y="-180.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="64.0001" x="198.0000" y="-324.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="54.0" x="140.0" y="-180.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="67.9997" x="54.0002" y="-180.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="81.0" x="139.5" y="-252.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="61.9999" x="34.0000" y="-252.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="66.0002" x="157.9999" y="-36.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="54.0" x="125.0" y="-108.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="58.9997" x="316.5002" y="-108.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="94.0032" x="62.9984" y="-324.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="92.0016" x="241.9992" y="-36.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="54.0" x="86.0" y="-36.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="54.0" x="290.0" y="-180.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="77.9976" x="265.0012" y="-252.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="67.9997" x="0.0002" y="-36.0"/></g></g><g class="labels"><g fill="rgb(33%, -22%, 26%)" fill-opacity="1.0" font-size="14.0" stroke="none" stroke-width="0.0" text-anchor="middle"><text x="242.0" y="-158.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Action.html#t:AdditiveAction">Actions</a></text><text x="230.0" y="-302.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Additive.html#t:Additive">Additive</a></text><text x="167.0" y="-158.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Metric.html#t:Basis">Basis</a></text><text x="88.0" y="-158.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Metric.html#t:Direction">Direction</a></text><text x="180.0" y="-230.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Distributive.html#t:Distributive">Distributive</a></text><text x="65.0" y="-230.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Multiplicative.html#t:Divisive">Divisive</a></text><text x="191.0" y="-14.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:ExpField">ExpField</a></text><text x="152.0" y="-86.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:Field">Field</a></text><text x="346.0" y="-86.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Data-Integral.html#t:Integral">Integral</a></text><text x="110.0" y="-302.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Multiplicative.html#t:Multiplicative">Multiplicative</a></text><text x="288.0" y="-14.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:QuotientField">QuotientField</a></text><text x="113.0" y="-14.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Data-Rational.html#t:Ratio">Ratio</a></text><text x="317.0" y="-158.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Ring.html#t:Ring">Ring</a></text><text x="304.0" y="-230.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Additive.html#t:Subtractive">Subtractive</a></text><text x="34.0" y="-14.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:TrigField">TrigField</a></text></g></g></g><g class="hud"/></svg>
+ other/nh11.svg view
@@ -0,0 +1,25 @@+<svg height="500" width="500" viewBox="-50 -350 500 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>svg {+ color-scheme: light dark;+}+{+ .canvas g, .title g, .axisbar g, .ticktext g, .tickglyph g, .ticklines g, .legendContent g text {+ fill: rgb(5%, 5%, 5%);+ }+ .ticklines g, .tickglyph g, .legendBorder g {+ stroke: rgb(5%, 5%, 5%);+ }+ .legendBorder g {+ fill: rgb(94%, 94%, 94%);+ }+}+@media (prefers-color-scheme:dark) {+ .canvas g, .title g, .axisbar g, .ticktext g, .tickglyph g, .ticklines g, .legendContent g text {+ fill: rgb(94%, 94%, 94%);+ }+ .ticklines g, .tickglyph g, .legendBorder g {+ stroke: rgb(94%, 94%, 94%);+ }+ .legendBorder g {+ fill: rgb(5%, 5%, 5%);+ }+}</style><g class="chart"><g class="edges"><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 226.67,-180.3000 C 218.42,-189.6300 208.1400,-201.23 199.34,-211.1700 L 195.15,-215.9000"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 170.21,-180.3000 C 171.85,-189.1200 173.87,-199.97 175.64,-209.5300 L 176.82,-215.9000"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 110.74,-180.3000 C 123.2400,-189.81 138.84,-201.6800 152.07,-211.7500 L 157.2,-215.65"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 192.3600,-252.3000 C 198.9,-261.46 207.0,-272.81 214.02,-282.62 L 217.78,-287.9"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 162.7,-252.3000 C 153.29,-261.7100 141.56,-273.44 131.56,-283.4400 L 127.1,-287.9"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 76.124,-252.3000 C 82.0090,-261.46 89.304,-272.81 95.6150,-282.62 L 99.004,-287.9"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 181.36,-36.303 C 176.31,-45.3740 170.05,-56.5960 164.62,-66.35 L 161.53,-71.896"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 124.56,-96.119 C 98.982,-102.5 62.272,-116.1700 45.0,-144.0 C 32.513,-164.12 41.437,-191.1 51.02,-210.0600 L 53.992,-215.6700"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 179.35,-101.76 C 205.58,-112.2 246.22,-128.66 281.0,-144.0 C 281.87,-144.38 282.75,-144.78 283.64,-145.17 L 289.5500,-147.86"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 338.83,-108.3 C 335.11,-117.29 330.51,-128.39 326.5,-138.08 L 324.09,-143.9"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 254.03,-36.4830 C 232.89,-47.366 205.83,-61.292 184.89,-72.069 L 179.16,-75.02"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 291.56,-36.4120 C 296.76,-61.887 306.46,-109.37 312.26,-137.79 L 313.51,-143.89"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 122.6400,-36.303 C 127.6900,-45.3740 133.95,-56.5960 139.38,-66.35 L 142.47,-71.896"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 289.61,-177.0 C 269.5900,-187.22 242.1500,-201.2400 219.7400,-212.7 L 214.1500,-215.55"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 313.79,-180.3000 C 312.15,-189.1200 310.13,-199.97 308.36,-209.5300 L 307.18,-215.9000"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 285.71,-252.3000 C 275.84,-261.6400 263.55,-273.26 253.03,-283.21 L 248.34,-287.65"/></g><g fill="rgb(0%, 0%, 0%)" fill-opacity="0" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><path d="M 63.4720,-36.4830 C 80.423,-46.539 101.75,-59.193 119.2300,-69.561 L 124.5200,-72.699"/></g></g><g class="shapes"><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="58.9997" x="212.5002" y="-180.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="64.0001" x="198.0000" y="-324.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="54.0" x="140.0" y="-180.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="67.9997" x="54.0002" y="-180.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="81.0" x="139.5" y="-252.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="61.9999" x="34.0000" y="-252.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="66.0002" x="157.9999" y="-36.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="54.0" x="125.0" y="-108.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="58.9997" x="316.5002" y="-108.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="94.0032" x="62.9984" y="-324.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="92.0016" x="241.9992" y="-36.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="54.0" x="86.0" y="-36.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="54.0" x="290.0" y="-180.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="77.9976" x="265.0012" y="-252.0"/></g><g fill="rgb(2%, 29%, 48%)" fill-opacity="0.1" stroke="rgb(33%, -22%, 26%)" stroke-opacity="1.0" stroke-width="1.0"><rect height="36.0" width="67.9997" x="0.0002" y="-36.0"/></g></g><g class="labels"><g fill="rgb(33%, -22%, 26%)" fill-opacity="1.0" font-size="14.0" stroke="none" stroke-width="0.0" text-anchor="middle"><text x="242.0" y="-158.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Action.html#t:AdditiveAction">Actions</a></text><text x="230.0" y="-302.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Additive.html#t:Additive">Additive</a></text><text x="167.0" y="-158.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Metric.html#t:Basis">Basis</a></text><text x="88.0" y="-158.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Metric.html#t:Direction">Direction</a></text><text x="180.0" y="-230.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Distributive.html#t:Distributive">Distributive</a></text><text x="65.0" y="-230.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Multiplicative.html#t:Divisive">Divisive</a></text><text x="191.0" y="-14.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:ExpField">ExpField</a></text><text x="152.0" y="-86.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:Field">Field</a></text><text x="346.0" y="-86.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Data-Integral.html#t:Integral">Integral</a></text><text x="110.0" y="-302.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Multiplicative.html#t:Multiplicative">Multiplicative</a></text><text x="288.0" y="-14.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:QuotientField">QuotientField</a></text><text x="113.0" y="-14.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Data-Rational.html#t:Ratio">Ratio</a></text><text x="317.0" y="-158.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Ring.html#t:Ring">Ring</a></text><text x="304.0" y="-230.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Additive.html#t:Subtractive">Subtractive</a></text><text x="34.0" y="-14.3"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:TrigField">TrigField</a></text></g></g></g><g class="hud"/></svg>
+ other/nh12.svg view
@@ -0,0 +1,32 @@+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1931" height="500" viewBox="-1.9314 -0.5000 3.8628 1.0"><style>svg {+ color-scheme: light dark;+}+{+ .canvas g, .title g, .axisbar g, .ticktext g, .tickglyph g, .ticklines g, .legendContent g text {+ fill: rgb(5%, 5%, 5%);+ }+ .ticklines g, .tickglyph g, .legendBorder g {+ stroke: rgb(5%, 5%, 5%);+ }+ .legendBorder g {+ fill: rgb(94%, 94%, 94%);+ }+}+@media (prefers-color-scheme:dark) {+ .canvas g, .title g, .axisbar g, .ticktext g, .tickglyph g, .ticklines g, .legendContent g text {+ fill: rgb(94%, 94%, 94%);+ }+ .ticklines g, .tickglyph g, .legendBorder g {+ stroke: rgb(94%, 94%, 94%);+ }+ .legendBorder g {+ fill: rgb(5%, 5%, 5%);+ }+}+svg { font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";+}++ticktext { font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;+}++</style><g class="chart"><g class="edges"><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M 0.4258,-0.0563 C 0.3930,-0.0853 0.3522,-0.1214 0.3175,-0.1522 L 0.3030,-0.1651"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M 0.2428,-0.0563 C 0.2428,-0.0834 0.2428,-0.1168 0.2428,-0.1462 L 0.2428,-0.1658"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M 0.2793,-0.2778 C 0.2986,-0.3060 0.3225,-0.3410 0.3433,-0.3711 L 0.3544,-0.3874"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M 0.1804,-0.2778 C 0.1464,-0.3069 0.1041,-0.3430 0.0680,-0.3738 L 0.0530,-0.3866"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M -0.1995,-0.2778 C -0.1655,-0.3069 -0.1232,-0.3430 -0.0871,-0.3738 L -0.0721,-0.3866"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M -0.2781,0.3868 C -0.3104,0.3578 -0.3507,0.3216 -0.3850,0.2908 L -0.3993,0.2780"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M -0.4552,0.1655 C -0.4496,0.1084 -0.4355,0.0162 -0.4003,-0.0554 C -0.3828,-0.0909 -0.3559,-0.1251 -0.3305,-0.1529 L -0.3181,-0.1661"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M -0.3752,0.1756 C -0.3662,0.1720 -0.3570,0.1687 -0.3480,0.1662 C 0.0584,0.0498 0.1902,0.1718 0.5966,0.0554 C 0.5994,0.0546 0.6022,0.0537 0.6051,0.0528 L 0.6238,0.0460"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M 0.0551,-0.0563 C 0.0887,-0.0853 0.1305,-0.1214 0.1662,-0.1522 L 0.1810,-0.1651"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M -0.1993,0.1652 C -0.2100,0.1376 -0.2231,0.1034 -0.2346,0.0736 L -0.2415,0.0557"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M -0.4588,0.3868 C -0.4588,0.3596 -0.4588,0.3263 -0.4588,0.2968 L -0.4588,0.2772"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M 0.6240,-0.0426 C 0.6147,-0.0469 0.6055,-0.0513 0.5966,-0.0554 C 0.5246,-0.0890 0.4442,-0.1261 0.3782,-0.1564 L 0.3600,-0.1647"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M 0.6869,-0.0563 C 0.6762,-0.0840 0.6630,-0.1181 0.6515,-0.1479 L 0.6446,-0.1658"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M -0.1498,-0.0509 C -0.0762,-0.0823 0.0210,-0.1238 0.1002,-0.1576 L 0.1178,-0.1651"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M -0.2618,-0.0563 C -0.2618,-0.0834 -0.2618,-0.1168 -0.2618,-0.1462 L -0.2618,-0.1658"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M 0.5665,-0.2778 C 0.5350,-0.3069 0.4958,-0.3430 0.4623,-0.3738 L 0.4484,-0.3866"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(0%, 0%, 0%)" fill-opacity="0"><path d="M -0.6418,0.3868 C -0.6090,0.3578 -0.5682,0.3216 -0.5335,0.2908 L -0.5190,0.2780"/></g></g><g class="shapes"><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.1946" height="0.1108" x="0.2932" y="-0.4985"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.1662" height="0.1108" x="0.4028" y="-0.0554"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.2062" height="0.1108" x="0.1397" y="-0.0554"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.2477" height="0.1108" x="0.1189" y="-0.2769"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.1900" height="0.1108" x="-0.3568" y="-0.2769"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.2015" height="0.1108" x="-0.3195" y="0.3877"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.1662" height="0.1108" x="-0.5418" y="0.1662"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.1785" height="0.1108" x="-0.0957" y="-0.0554"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.2869" height="0.1108" x="-0.1530" y="-0.4985"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.2800" height="0.1108" x="-0.3188" y="0.1662"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.1662" height="0.1108" x="-0.5418" y="0.3877"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.1662" height="0.1108" x="0.6243" y="-0.0554"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.2223" height="0.1108" x="-0.3730" y="-0.0554"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.2385" height="0.1108" x="0.5051" y="-0.2769"/></g><g stroke-width="0.0031" stroke="rgb(40%, 40%, 40%)" stroke-opacity="0.8" fill="rgb(50%, 50%, 50%)" fill-opacity="0.2"><rect width="0.2062" height="0.1108" x="-0.8049" y="0.3877"/></g></g><g class="labels"><g stroke-width="0.0" stroke="none" fill="rgb(40%, 40%, 40%)" fill-opacity="0.8" font-size="0.0369" text-anchor="middle"><text x="0.3905" y="-0.4308"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Additive.html#t:Additive">Additive</a></text><text x="0.4858" y="0.0123"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Metric.html#t:Basis">Basis</a></text><text x="0.2428" y="0.0123"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Metric.html#t:Direction">Direction</a></text><text x="0.2428" y="-0.2092"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Ring.html#t:Distributive">Distributive</a></text><text x="-0.2618" y="-0.2092"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Multiplicative.html#t:Divisive">Divisive</a></text><text x="-0.2188" y="0.4554"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:ExpField">ExpField</a></text><text x="-0.4588" y="0.2338"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:Field">Field</a></text><text x="-0.0065" y="0.0123"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Data-Integral.html#t:Integral">Integral</a></text><text x="-0.0095" y="-0.4308"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Multiplicative.html#t:Multiplicative">Multiplicative</a></text><text x="-0.1788" y="0.2338"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:QuotientField">QuotientField</a></text><text x="-0.4588" y="0.4554"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Data-Rational.html#t:Ratio">Ratio</a></text><text x="0.7074" y="0.0123"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Ring.html#t:Ring">Ring</a></text><text x="-0.2618" y="0.0123"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:SemiField">SemiField</a></text><text x="0.6243" y="-0.2092"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Additive.html#t:Subtractive">Subtractive</a></text><text x="-0.7018" y="0.4554"><a href="https://hackage.haskell.org/package/numhask/docs/NumHask-Algebra-Field.html#t:TrigField">TrigField</a></text></g></g></g><g class="hud"></g></svg>
src/NumHask/Data/Positive.hs view
@@ -3,7 +3,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} --- | Field classes+-- | A positive number type, defined as existing on [zero, +infinity) module NumHask.Data.Positive ( Positive (..), positive,@@ -37,19 +37,33 @@ -- >>> import NumHask.Prelude -- >>> import NumHask.Data.Positive --- | zero is positive+-- | A positive number is a number that is contained in [zero,+infinity). -- -- >>> 1 :: Positive Int -- UnsafePositive {unPositive = 1} --+--+-- >>> -1 :: Positive Int+-- ...+-- • No instance for ‘Subtractive (Positive Int)’+-- arising from a use of syntactic negation+-- ...+--+-- zero is positive+-- -- >>> positive 0 == zero -- True --+-- The main constructors:+-- -- >>> positive (-1) -- UnsafePositive {unPositive = 0} -- -- >>> maybePositive (-1) -- Nothing+--+-- >>> UnsafePositive (-1)+-- UnsafePositive {unPositive = -1} newtype Positive a = UnsafePositive {unPositive :: a} deriving stock (Eq, Ord, Show)@@ -105,21 +119,22 @@ P.EQ -> bool (n + one) n (even n) P.GT -> n + one --- | Constructor which returns zero for a negative input.+-- | Constructor which returns zero for a negative number. -- -- >>> positive (-1) -- UnsafePositive {unPositive = 0} positive :: (Additive a, MeetSemiLattice a) => a -> Positive a positive a = UnsafePositive (a /\ zero) --- | Unsafe constructors.+-- | Unsafe constructor. -- -- >>> positive_ (-one) -- UnsafePositive {unPositive = -1} positive_ :: a -> Positive a positive_ = UnsafePositive --- | Constructor which returns Nothing for a negative number.+-- | Constructor which returns Nothing if a negative number is supplied.+-- -- >>> maybePositive (-one) -- Nothing maybePositive :: (Additive a, MeetSemiLattice a) => a -> Maybe (Positive a)