packages feed

numhask 0.1.4.0 → 0.2.0.0

raw patch · 18 files changed

+115/−935 lines, 18 filesdep −QuickCheckdep −doctestdep −numhaskdep ~base

Dependencies removed: QuickCheck, doctest, numhask, protolude, tasty, tasty-quickcheck

Dependency ranges changed: base

Files

numhask.cabal view
@@ -1,11 +1,7 @@--- This file has been generated from package.yaml by hpack version 0.18.1.------ see: https://github.com/sol/hpack- name:           numhask-version:        0.1.4.0-synopsis:       A numeric prelude-description:    A numeric prelude, providing a clean structure for numbers and operations that combine them.+version:        0.2.0.0+synopsis:       numeric classes+description:    A numeric class heirarchy. category:       mathematics homepage:       https://github.com/tonyday567/numhask#readme bug-reports:    https://github.com/tonyday567/numhask/issues@@ -15,12 +11,14 @@ license:        BSD3 license-file:   LICENSE build-type:     Simple-cabal-version:  >= 1.10+cabal-version:  >= 1.18  extra-source-files:-    readme.md-    stack.yaml+  stack.yaml +extra-doc-files:+  other/*.svg+ source-repository head   type: git   location: https://github.com/tonyday567/numhask@@ -28,17 +26,17 @@ library   hs-source-dirs:       src-  default-extensions: NegativeLiterals NoImplicitPrelude OverloadedStrings UnicodeSyntax-  ghc-options: -Wall+  default-extensions: NegativeLiterals OverloadedStrings UnicodeSyntax+  ghc-options:+      -Wall+      -Wcompat+      -Wincomplete-record-updates+      -Wincomplete-uni-patterns+      -Wredundant-constraints+   build-depends:-      QuickCheck >=2.8 && <3-    , protolude >=0.1 && <0.3-    , tasty-    , tasty-quickcheck-    , base >=4.7 && <4.11+      base >=4.7 && <4.12   exposed-modules:-      NumHask.Prelude-      NumHask.Examples       NumHask.Algebra       NumHask.Algebra.Additive       NumHask.Algebra.Basis@@ -51,26 +49,6 @@       NumHask.Algebra.Module       NumHask.Algebra.Multiplicative       NumHask.Algebra.Singleton-      NumHask.Laws   other-modules:       Paths_numhask-  default-language: Haskell2010--test-suite test-  type: exitcode-stdio-1.0-  main-is: test.hs-  hs-source-dirs:-      test-  default-extensions: NegativeLiterals NoImplicitPrelude OverloadedStrings UnicodeSyntax-  build-depends:-      QuickCheck >=2.8 && <3-    , protolude >=0.1 && <0.3-    , tasty-    , tasty-quickcheck-    , base >=4.7 && <5-    , QuickCheck >=2.8 && <3-    , doctest-    , numhask-    , tasty-    , tasty-quickcheck   default-language: Haskell2010
+ other/ring.svg view
@@ -0,0 +1,3 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"+    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" height="600.0000" stroke-opacity="1" viewBox="0 0 600 600" font-size="1" width="600.0000" xmlns:xlink="http://www.w3.org/1999/xlink" stroke="rgb(0,0,0)" version="1.1"><defs></defs><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,236.0194,583.6788)" stroke="none" text-anchor="middle">CRing</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 268.6619,600.0000 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,271.2733,487.6094)" stroke="none" text-anchor="middle">Ring</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 303.9158,503.9306 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,271.2733,392.3625)" stroke="none" text-anchor="middle">Semiring</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 303.9158,408.6838 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,271.2733,298.3522)" stroke="none" text-anchor="middle">Distribution</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 303.9158,314.6734 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,203.3770,204.3419)" stroke="none" text-anchor="middle">Multiplicative</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 236.0194,220.6631 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,394.0116,298.3522)" stroke="none" text-anchor="middle">AdditiveGroup</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 426.6541,314.6734 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,273.8847,204.3419)" stroke="none" text-anchor="middle">Additive</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 306.5272,220.6631 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,399.2344,204.3419)" stroke="none" text-anchor="middle">Invertible</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 431.8769,220.6631 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,271.2733,110.3316)" stroke="none" text-anchor="middle">Commutative</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 303.9158,126.6528 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,200.7656,110.3316)" stroke="none" text-anchor="middle">Associative</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 233.4080,126.6528 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,341.7837,110.3316)" stroke="none" text-anchor="middle">Unital</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 374.4261,126.6528 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" font-size="6.528494703214632px" stroke="rgb(0,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><text dominant-baseline="middle" transform="matrix(1.0000,0.0000,0.0000,1.0000,271.2733,16.3212)" stroke="none" text-anchor="middle">Magma</text></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 303.9158,32.6425 l -0.0000,-32.6425 h -65.2849 l -0.0000,32.6425 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 283.5147,32.6425 l 41.2275,54.9679 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 329.5423,94.0103 l -3.1096,-9.0974 l -1.4396,3.0321 l -3.3139,0.5331 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 324.9932,87.9450 l -0.2510,-0.3346 l 0.6365,-0.4774 l -0.3855,0.8120 l -0.2510,-0.3346 l -0.6365,0.4774 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 259.0324,32.6425 l -41.2259,54.9679 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 213.0065,94.0103 l 7.8629,-5.5323 l -3.3139,-0.5330 l -1.4396,-3.0321 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 217.5555,87.9449 l 0.2510,-0.3346 l 0.6365,0.4774 l -0.8875,-0.1427 l 0.2510,-0.3346 l -0.6365,-0.4774 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,32.6425 l 0.0000,53.3679 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,94.0103 l 2.9709,-9.1436 l -2.9709,1.5619 l -2.9709,-1.5619 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,86.4286 l -0.0000,-0.4183 l 0.7956,-0.0000 l -0.7956,0.4183 l -0.0000,-0.4183 l -0.7956,0.0000 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 282.3811,32.6425 l 101.2446,148.7645 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 388.1267,188.0206 l -2.6884,-9.2307 l -1.5773,2.9628 l -3.3349,0.3803 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 383.8610,181.7528 l -0.2353,-0.3458 l 0.6577,-0.4476 l -0.4224,0.7934 l -0.2353,-0.3458 l -0.6577,0.4476 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(255,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.7267,126.6528 l 1.4825,53.3709 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 273.4313,188.0206 l 2.7159,-9.2226 l -2.9264,1.6438 l -3.0132,-1.4788 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 273.2208,180.4419 l -0.0116,-0.4181 l 0.7953,-0.0221 l -0.7837,0.4402 l -0.0116,-0.4181 l -0.7953,0.0221 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(255,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 329.9957,126.6528 l -39.6389,54.8825 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 285.6727,188.0206 l 7.7621,-5.6730 l -3.3230,-0.4733 l -1.4939,-3.0057 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 290.1119,181.8744 l 0.2449,-0.3391 l 0.6450,0.4658 l -0.8899,-0.1268 l 0.2449,-0.3391 l -0.6450,-0.4658 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(255,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 213.4599,126.6528 l 42.8190,55.0530 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 261.1904,188.0206 l -3.2685,-9.0415 l -1.3862,3.0569 l -3.3041,0.5911 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 256.5357,182.0360 l -0.2568,-0.3302 l 0.6280,-0.4885 l -0.3712,0.8186 l -0.2568,-0.3302 l -0.6280,0.4885 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(255,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 294.7401,220.6631 l 72.1161,56.4375 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 373.1563,282.0310 l -5.3697,-7.9749 l -0.6010,3.3023 l -3.0610,1.3770 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 367.1856,277.3584 l -0.3294,-0.2578 l 0.4903,-0.6266 l -0.1609,0.8843 l -0.3294,-0.2578 l -0.4903,0.6266 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(255,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 398.3277,220.6631 l -2.9656,53.3802 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 394.9184,282.0310 l 3.4736,-8.9648 l -3.0530,1.3947 l -2.8797,-1.7243 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 395.3389,274.4609 l 0.0232,-0.4176 l 0.7944,0.0441 l -0.8176,0.3735 l 0.0232,-0.4176 l -0.7944,-0.0441 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(0,0,255)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 259.4858,126.6528 l -39.6373,54.8824 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 215.1645,188.0206 l 7.7620,-5.6731 l -3.3230,-0.4732 l -1.4940,-3.0057 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 219.6036,181.8743 l 0.2449,-0.3391 l 0.6450,0.4658 l -0.8899,-0.1267 l 0.2449,-0.3391 l -0.6450,-0.4658 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(0,0,255)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 317.7547,126.6528 l -83.7310,56.8728 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 227.4059,188.0206 l 9.2331,-2.6800 l -2.9614,-1.5800 l -0.3772,-3.3352 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 233.6777,183.7607 l 0.3460,-0.2350 l 0.4470,0.6582 l -0.7931,-0.4231 l 0.3460,-0.2350 l -0.4470,-0.6582 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(0,0,255)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 201.2189,126.6528 l 1.4825,53.3709 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 202.9236,188.0206 l 2.7159,-9.2226 l -2.9264,1.6438 l -3.0132,-1.4788 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 202.7131,180.4419 l -0.0116,-0.4181 l 0.7953,-0.0221 l -0.7837,0.4402 l -0.0116,-0.4181 l -0.7953,0.0221 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(255,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 273.4313,220.6631 l -1.4825,53.3709 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.7267,282.0310 l 3.2237,-9.0576 l -3.0132,1.4788 l -2.9264,-1.6438 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.9372,274.4522 l 0.0116,-0.4181 l 0.7953,0.0221 l -0.8069,0.3960 l 0.0116,-0.4181 l -0.7953,-0.0221 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(0,0,255)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,32.6425 l 0.0000,241.3885 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,282.0310 l 2.9709,-9.1436 l -2.9709,1.5619 l -2.9709,-1.5619 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,274.4493 l -0.0000,-0.4183 l 0.7956,-0.0000 l -0.7956,0.4183 l -0.0000,-0.4183 l -0.7956,0.0000 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(0,0,255)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 204.8459,126.6528 l 60.4068,241.6274 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 267.1930,376.0413 l 0.6646,-9.5912 l -2.5034,2.2358 l -3.2611,-0.7947 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 265.3542,368.6859 l -0.1014,-0.4058 l 0.7719,-0.1930 l -0.6704,0.5988 l -0.1014,-0.4058 l -0.7719,0.1930 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(0,0,255)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 337.7032,126.6528 l -60.4091,241.6274 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 275.3538,376.0413 l 5.1000,-8.1500 l -3.2611,0.7947 l -2.5034,-2.2359 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 277.1927,368.6860 l 0.1015,-0.4058 l 0.7719,0.1930 l -0.8733,0.2128 l 0.1015,-0.4058 l -0.7719,-0.1930 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,314.6734 l 0.0000,53.3679 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,376.0413 l 2.9709,-9.1436 l -2.9709,1.5619 l -2.9709,-1.5619 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,368.4596 l -0.0000,-0.4183 l 0.7956,-0.0000 l -0.7956,0.4183 l -0.0000,-0.4183 l -0.7956,0.0000 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(255,0,0)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 383.4269,314.6734 l -97.2158,149.9026 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 281.8581,471.2881 l 7.4679,-6.0550 l -3.3425,-0.3061 l -1.6428,-2.9270 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(255,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 285.9834,464.9270 l 0.2276,-0.3509 l 0.6675,0.4329 l -0.8951,-0.0820 l 0.2276,-0.3509 l -0.6675,-0.4329 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,408.6838 l 0.0000,54.6043 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,471.2881 l 2.9709,-9.1436 l -2.9709,1.5619 l -2.9709,-1.5619 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 271.2733,463.7064 l -0.0000,-0.4183 l 0.7956,-0.0000 l -0.7956,0.4183 l -0.0000,-0.4183 l -0.7956,0.0000 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.5" stroke="rgb(0,0,255)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 204.7814,220.6631 l 29.1477,338.7239 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 234.6150,567.3575 l 2.1761,-9.3647 l -2.8261,1.8109 l -3.0939,-1.3015 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.5" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,255)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 233.9650,559.8037 l -0.0359,-0.4167 l 0.7927,-0.0682 l -0.7568,0.4850 l -0.0359,-0.4167 l -0.7927,0.0682 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="0.0" opacity="0.3" stroke="rgb(84,84,84)" stroke-width="1.5912373974723018" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 265.2840,503.9306 l -20.5193,55.9166 "/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(0,0,0)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 242.0087,567.3575 l 5.9391,-7.5604 l -3.3272,0.4428 l -2.2510,-2.4898 Z"/></g><g stroke-linejoin="miter" stroke-opacity="1.0" fill-opacity="1.0" opacity="0.3" stroke="rgb(0,0,0)" stroke-width="0.0" fill="rgb(84,84,84)" stroke-linecap="butt" stroke-miterlimit="10.0"><path d="M 244.6206,560.2399 l 0.1441,-0.3927 l 0.7469,0.2741 l -0.8910,0.1186 l 0.1441,-0.3927 l -0.7469,-0.2741 Z"/></g></svg>
− readme.md
@@ -1,43 +0,0 @@-numhask-===--[![Build Status](https://travis-ci.org/tonyday567/numhask.svg)](https://travis-ci.org/tonyday567/numhask) [![Hackage](https://img.shields.io/hackage/v/numhask.svg)](https://hackage.haskell.org/package/numhask) [![lts](https://www.stackage.org/package/numhask/badge/lts)](http://stackage.org/lts/package/numhask) [![nightly](https://www.stackage.org/package/numhask/badge/nightly)](http://stackage.org/nightly/package/numhask) --A numeric prelude, providing a clean structure for numbers and operations that combine them.--Field heirarchy------[![Field Hierarchy](https://tonyday567.github.io/other/field.svg)](https://tonyday567.github.io/other/field.svg)--Numbers with structure------[![Hilbert Hierarchy](https://tonyday567.github.io/other/hilbert.svg)](https://tonyday567.github.io/other/hilbert.svg)---This particular shed has been painted:--- by providing separately named magma-derived classes for addition and multiplication, and then being symetrical in the treatment of the two heirarchies.  A short magma structure is provided with the intention of supplying appropriate classes fro operators that are no addition nor multiplication, but this structure is not hooked up to the main classes.-- to be as compatible as practical with the existing haskell ecosystem.  Ints, Integers, Floats, Doubles and Complex are taken from base and given numhask instances, so they are also Num instances.  Monoid and Semigroup are not used in numhask to maintain compatability.-- as a replacement for anything in base that has a Num, Fractional or Real constraint.-- includes QuickCheck tests of the numeric laws implicit in the classes.  This also includes tracking where laws are approximate or fail for non-exact numbers.-- the usual operators (+) and (*) operators are reserved for commutative relationships, with plus and times being used for non-commutative ones.--Alternative color-schemes, stylistic flourishes and opines are welcome.--In summary, the library doesn't do anything fancy. But if having to define `(*)` when you just want a `(+)` offends your sensibilities, it may bring some sanity.---Usage------``` {.sourceCode .literate .haskell}-{-# LANGUAGE NoImplicitPrelude #-}-import Numhask.Prelude-```--'Numhask.Prelude' is designed as a drop-in replacement for Prelude and 'NoImplicitPrelude' is obligatory. Behind the scenes, the module wraps [protolude](https://www.stackage.org/package/protolude).--See [Examples](src/NumHask/Examples.hs) for basic examples, [numhask-array](https://www.stackage.org/package/numhask-array) for numbers with structure, and [numhask-range](https://www.stackage.org/package/numhask-range) for slightly heavier number crunching.-
src/NumHask/Algebra.hs view
@@ -1,8 +1,15 @@ {-# OPTIONS_GHC -Wall #-} --- | Algebraic structure+-- | The basic algebraic class structure of a number.+--+-- > import NumHask.Algebra+-- > import Prelude hiding (Bounded(..), Integral(..), (*), (**), (+), (-), (/), (^), (^^), abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceiling, cos, cosh, exp, floor, fromInteger, fromIntegral, isNaN, log, logBase, negate, pi, product, recip, round, sin, sinh, sqrt, sum, tan, tanh, toInteger)+-- module NumHask.Algebra-  ( module NumHask.Algebra.Additive+  ( -- * Mapping from Num+    --+    -- $numMap+    module NumHask.Algebra.Additive   , module NumHask.Algebra.Basis   , module NumHask.Algebra.Distribution   , module NumHask.Algebra.Field@@ -12,8 +19,10 @@   , module NumHask.Algebra.Module   , module NumHask.Algebra.Multiplicative   , module NumHask.Algebra.Ring+  , Complex(..)   ) where +import Data.Complex (Complex(..)) import NumHask.Algebra.Additive import NumHask.Algebra.Basis import NumHask.Algebra.Distribution@@ -24,3 +33,50 @@ import NumHask.Algebra.Module import NumHask.Algebra.Multiplicative import NumHask.Algebra.Ring++-- $numMap+--+-- `Num` is a very old part of haskell, and a lot of different numeric concepts are tossed in there. The closest analogue in numhask is the `Ring` class, which combines the classical `+`, `-` and `*`, together with the distribution laws.+--+-- ![ring example](other/ring.svg)+--+-- No attempt is made, however, to reconstruct the particular combination of laws and classes that represent the old `Num`.  A rough mapping of `Num` to numhask classes follows:+--+-- > -- | Basic numeric class.+-- > class  Num a  where+-- >    {-# MINIMAL (+), (*), abs, signum, fromInteger, (negate | (-)) #-}+-- >+-- >    (+), (-), (*)       :: a -> a -> a+-- >    -- | Unary negation.+-- >    negate              :: a -> a+-- +-- `+` is a function of the `Additive` class, +-- `-` is a function of the `AdditiveGroup` class, and+-- `*` is a function of the `Multiplicative` class.+-- `negate` is specifically in the `AdditiveInvertible` class.  There are many useful constructions between negate and (-), involving cancellative properties.+--+-- >    -- | Absolute value.+-- >    abs                 :: a -> a+-- >    -- | Sign of a number.+-- >    -- The functions 'abs' and 'signum' should satisfy the law:+-- >    --+-- >    -- > abs x * signum x == x+-- >    --+-- >    -- For real numbers, the 'signum' is either @-1@ (negative), @0@ (zero)+-- >    -- or @1@ (positive).+-- >    signum              :: a -> a+--+-- `abs` is a function in the `Signed` class.  The concept of an absolute value of a number can include situations where the domain and codomain are different, and `size` as a function in the `Normed` class is supplied for these cases.+--+--  `sign` replaces `signum`, because signum is a heinous name.+--+-- >    -- | Conversion from an 'Integer'.+-- >    -- An integer literal represents the application of the function+-- >    -- 'fromInteger' to the appropriate value of type 'Integer',+-- >    -- so such literals have type @('Num' a) => a@.+-- >    fromInteger         :: Integer -> a+--+-- `fromInteger` is given its own class `FromInteger`+--++
src/NumHask/Algebra/Additive.hs view
@@ -16,8 +16,9 @@   ) where  import Data.Complex (Complex(..))-import qualified Protolude as P-import Protolude (Bool(..), Double, Float, Int, Integer)++import qualified Prelude as P+import Prelude (Bool(..), Double, Float, Int, Integer)  -- | 'plus' is used as the operator for the additive magma to distinguish from '+' which, by convention, implies commutativity --
src/NumHask/Algebra/Basis.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# OPTIONS_GHC -Wall #-} --- | Element-by-element operation for 'Representable's+-- | Element-by-element operations module NumHask.Algebra.Basis   ( AdditiveBasis(..)   , AdditiveGroupBasis(..)
src/NumHask/Algebra/Distribution.hs view
@@ -8,7 +8,7 @@ import Data.Complex (Complex(..)) import NumHask.Algebra.Additive import NumHask.Algebra.Multiplicative-import Protolude (Bool(..), Double, Float, Int, Integer)+import Prelude (Bool(..), Double, Float, Int, Integer)  -- | Distribution (and annihilation) laws --
src/NumHask/Algebra/Field.hs view
@@ -16,8 +16,8 @@ import NumHask.Algebra.Additive import NumHask.Algebra.Multiplicative import NumHask.Algebra.Ring-import Protolude (Bool, Double, Float, Integer, (||))-import qualified Protolude as P+import Prelude (Bool, Double, Float, Integer, (||))+import qualified Prelude as P  -- | A Semifield is a Field without Commutative Multiplication. class (MultiplicativeInvertible a, Ring a) =>
src/NumHask/Algebra/Integral.hs view
@@ -9,8 +9,8 @@   ) where  import NumHask.Algebra.Ring-import qualified Protolude as P-import Protolude (Double, Float, Int, Integer, (.), fst, snd)+import qualified Prelude as P+import Prelude (Double, Float, Int, Integer, (.), fst, snd)  -- | Integral laws --
src/NumHask/Algebra/Metric.hs view
@@ -11,13 +11,14 @@   , (≈)   ) where +import qualified Prelude as P+import Prelude+       hiding (Bounded(..), Integral(..), (*), (+), (-), abs, negate, sqrt)+ import Data.Complex (Complex(..)) import NumHask.Algebra.Additive import NumHask.Algebra.Field import NumHask.Algebra.Multiplicative-import qualified Protolude as P-import Protolude-       (Bool(..), Double, Eq(..), Float, Int, Integer, Ord(..), ($), (&&))  -- | 'signum' from base is not an operator replicated in numhask, being such a very silly name, and preferred is the much more obvious 'sign'.  Compare with 'Norm' and 'Banach' where there is a change in codomain --@@ -30,31 +31,31 @@   abs :: a -> a  instance Signed Double where-  sign a =-    if a >= zero-      then one-      else negate one+  sign a+    | a == zero = zero+    | a > zero = one+    | otherwise = negate one   abs = P.abs  instance Signed Float where-  sign a =-    if a >= zero-      then one-      else negate one+  sign a+    | a == zero = zero+    | a > zero = one+    | otherwise = negate one   abs = P.abs  instance Signed Int where-  sign a =-    if a >= zero-      then one-      else negate one+  sign a+    | a == zero = zero+    | a > zero = one+    | otherwise = negate one   abs = P.abs  instance Signed Integer where-  sign a =-    if a >= zero-      then one-      else negate one+  sign a+    | a == zero = zero+    | a > zero = one+    | otherwise = negate one   abs = P.abs  -- | Like Signed, except the codomain can be different to the domain.@@ -73,7 +74,7 @@ instance Normed Integer Integer where   size = P.abs -instance (Multiplicative a, ExpField a, Normed a a) =>+instance (Multiplicative a, ExpField a) =>          Normed (Complex a) a where   size (rx :+ ix) = sqrt (rx * rx + ix * ix) @@ -99,7 +100,7 @@ instance Metric Integer Integer where   distance a b = abs (a - b) -instance (Multiplicative a, ExpField a, Normed a a) =>+instance (Multiplicative a, ExpField a) =>          Metric (Complex a) a where   distance a b = size (a - b) 
src/NumHask/Algebra/Module.hs view
@@ -7,7 +7,7 @@ {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wall #-} --- | Algebra for Representable numbers+-- | Algebra for Modules module NumHask.Algebra.Module   ( AdditiveModule(..)   , AdditiveGroupModule(..)@@ -24,7 +24,7 @@ import NumHask.Algebra.Metric import NumHask.Algebra.Multiplicative import NumHask.Algebra.Ring-import Protolude+import Prelude        (Double, Float, Int, Integer)  -- | Additive Module Laws
src/NumHask/Algebra/Multiplicative.hs view
@@ -16,8 +16,8 @@  import Data.Complex (Complex(..)) import NumHask.Algebra.Additive-import qualified Protolude as P-import Protolude (Bool(..), Double, Float, Int, Integer)+import qualified Prelude as P+import Prelude (Bool(..), Double, Float, Int, Integer)  -- | 'times' is used as the operator for the multiplicative magam to distinguish from '*' which, by convention, implies commutativity --
src/NumHask/Algebra/Ring.hs view
@@ -13,7 +13,7 @@ import NumHask.Algebra.Additive import NumHask.Algebra.Distribution import NumHask.Algebra.Multiplicative-import Protolude (Bool(..), Double, Float, Int, Integer)+import Prelude (Bool(..), Double, Float, Int, Integer)  -- | Semiring class (MultiplicativeAssociative a, MultiplicativeUnital a, Distribution a) =>
− src/NumHask/Examples.hs
@@ -1,112 +0,0 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE OverloadedLists #-}-{-# OPTIONS_GHC -Wall #-}-{-# OPTIONS_GHC -fno-warn-unused-imports #-}---- | NumHask usage examples-module NumHask.Examples-  (-    -- ** Imports and Pragmas-    -- $imports--    -- $setup-    -- ** Basic Arithmetic-    -- $basic--    -- ** Complex numbers-    -- $complex--    -- ** Vectors-    -- $vector--    -- ** Matrices-    -- $matrices-  ) where--import NumHask.Prelude---- $imports--- NumHask.Prelude is a replacement for the standard prelude with the 'NoImplicitPrelude' extension explicitly required.------ $setup--- >>> :set -XNoImplicitPrelude--- >>> import NumHask.Prelude------ $basic--- 'Int', 'Integer', 'Double' and 'Float' are from base.  NumHask takes these classes and redefines the basic arithmetic operators.------ >>> 1 + 1--- 2--- >>> 1 - 1--- 0--- >>> 1 * 1--- 1--- >>> 1 / 1--- 1.0------ Note that the literal numbers in the divide above defaulted to Float rather than Int.------ >>> 1 / (1::Int)--- ...--- ... No instance for (MultiplicativeGroup Int)--- ...------ >>> 1 / fromIntegral (1::Int)--- 1.0------ 'Float' and 'Double' are 'NumHask.Algebra.Fields.Field' instances.------ >>> zero == 0.0--- True--- >>> one == 1.0--- True--- >>> 1.0 + 1.0--- 2.0--- >>> 1.0 - 1.0--- 0.0--- >>> 1.0 * 1.0--- 1.0--- >>> 1.0 / 1.0--- 1.0------ 'QuotientField'------ >>> 1 `div` 2--- 0--- >>> 3 `mod` 2--- 1------ 'BoundedField'------ >>> one/zero--- Infinity--- >>> -one/zero--- -Infinity--- >>> zero/zero+one--- NaN------ 'ExpField'------ >>> logBase 2 4--- 2.0--- >>> 2 ** 2--- 4.0--- >>> sqrt 4--- 2.0--- >>> exp 2--- 7.38905609893065--- >>> log 2--- 0.6931471805599453------ $complex------ >>> let a = 1 :+ 2--- >>> a--- 1 :+ 2--- >>> zero - a--- (-1) :+ (-2)--- >>> (1 :+ (-2)) * ((-2) :+ 4)--- 6 :+ 8--- >>> (1 :+ (-1)) / (2 :+ 2)--- 0.0 :+ (-0.5)
− src/NumHask/Laws.hs
@@ -1,557 +0,0 @@-{-# LANGUAGE FlexibleContexts #-}--module NumHask.Laws-  ( LawArity(..)-  , LawArity2(..)-  , Law-  , Law2-  , testLawOf-  , testLawOf2-  , idempotentLaws-  , additiveLaws-  , additiveLawsFail-  , additiveGroupLaws-  , multiplicativeLaws-  , multiplicativeLawsFail-  , multiplicativeMonoidalLaws-  , multiplicativeGroupLaws-  , distributionLaws-  , distributionLawsFail-  , integralLaws-  , signedLaws-  , metricFloatLaws -  , metricComplexFloatLaws-  , boundedFieldFloatLaws-  , quotientFieldLaws -  , expFieldLaws-  , expFieldComplexLooseLaws  -  , additiveBasisLaws-  , additiveGroupBasisLaws-  , multiplicativeBasisLaws-  , multiplicativeGroupBasisLaws-  , additiveModuleLaws-  , additiveGroupModuleLaws-  , multiplicativeModuleLaws-  , multiplicativeGroupModuleLawsFail-  , expFieldNaperianLaws-  , metricNaperianFloatLaws-  , tensorProductLaws-  , banachLaws-  , hilbertLaws-  , semiringLaws-  , ringLaws-  , starSemiringLaws-  ) where--import NumHask.Prelude-import Test.Tasty.QuickCheck hiding ((><))-import Test.Tasty (TestName, TestTree)--data LawArity a-  = Nonary Bool-  | Unary (a -> Bool)-  | Binary (a -> a -> Bool)-  | Ternary (a -> a -> a -> Bool)-  | Ornary (a -> a -> a -> a -> Bool)-  | Failiary (a -> Property)--data LawArity2 a b-  = Unary2 (a -> Bool)-  | Binary2 (a -> b -> Bool)-  | Ternary2 (a -> a -> b -> Bool)-  | Ternary2' (a -> b -> b -> Bool)-  | Ternary2'' (a -> a -> a -> Bool)-  | Quad31 (a -> a -> a -> b -> Bool)-  | Quad22 (a -> a -> b -> b -> Bool)-  | Failiary2 (a -> Property)--type Law a = (TestName, LawArity a)--type Law2 a b = (TestName, LawArity2 a b)--testLawOf :: (Arbitrary a, Show a) => [a] -> Law a -> TestTree-testLawOf _ (name, Nonary f) = testProperty name f-testLawOf _ (name, Unary f) = testProperty name f-testLawOf _ (name, Binary f) = testProperty name f-testLawOf _ (name, Ternary f) = testProperty name f-testLawOf _ (name, Ornary f) = testProperty name f-testLawOf _ (name, Failiary f) = testProperty name f--testLawOf2 ::-     (Arbitrary a, Show a, Arbitrary b, Show b)-  => [(a, b)]-  -> Law2 a b-  -> TestTree-testLawOf2 _ (name, Unary2 f) = testProperty name f-testLawOf2 _ (name, Binary2 f) = testProperty name f-testLawOf2 _ (name, Ternary2 f) = testProperty name f-testLawOf2 _ (name, Ternary2' f) = testProperty name f-testLawOf2 _ (name, Ternary2'' f) = testProperty name f-testLawOf2 _ (name, Quad22 f) = testProperty name f-testLawOf2 _ (name, Quad31 f) = testProperty name f-testLawOf2 _ (name, Failiary2 f) = testProperty name f---- idempotent-idempotentLaws :: (Eq a, Additive a, Multiplicative a) => [Law a]-idempotentLaws =-  [ ("idempotent: a + a == a", Unary (\a -> a + a == a))-  , ("idempotent: a * a == a", Unary (\a -> a * a == a))-  ]---- additive-additiveLaws :: (Eq a, Additive a) => [Law a]-additiveLaws =-  [ ( "associative: (a + b) + c = a + (b + c)"-    , Ternary (\a b c -> (a + b) + c == a + (b + c)))-  , ("left id: zero + a = a", Unary (\a -> zero + a == a))-  , ("right id: a + zero = a", Unary (\a -> a + zero == a))-  , ("commutative: a + b == b + a", Binary (\a b -> a + b == b + a))-  ]--additiveLawsFail :: (Eq a, Additive a, Show a, Arbitrary a) => [Law a]-additiveLawsFail =-  [ ( "associative: (a + b) + c = a + (b + c)"-    , Failiary $ expectFailure . (\a b c -> (a + b) + c == a + (b + c)))-  , ("left id: zero + a = a", Unary (\a -> zero + a == a))-  , ("right id: a + zero = a", Unary (\a -> a + zero == a))-  , ("commutative: a + b == b + a", Binary (\a b -> a + b == b + a))-  ]--additiveGroupLaws :: (Eq a, AdditiveGroup a) => [Law a]-additiveGroupLaws =-  [ ("minus: a - a = zero", Unary (\a -> (a - a) == zero))-  , ("negate minus: negate a == zero - a", Unary (\a -> negate a == zero - a))-  , ( "negate left cancel: negate a + a == zero"-    , Unary (\a -> negate a + a == zero))-  , ( "negate right cancel: negate a + a == zero"-    , Unary (\a -> a + negate a == zero))-  ]---- multiplicative-multiplicativeLaws :: (Eq a, Multiplicative a) => [Law a]-multiplicativeLaws =-  [ ( "associative: (a * b) * c = a * (b * c)"-    , Ternary (\a b c -> (a * b) * c == a * (b * c)))-  , ("left id: one * a = a", Unary (\a -> one * a == a))-  , ("right id: a * one = a", Unary (\a -> a * one == a))-  , ("commutative: a * b == b * a", Binary (\a b -> a * b == b * a))-  ]--multiplicativeMonoidalLaws ::-     (Eq a, MultiplicativeUnital a, MultiplicativeAssociative a) => [Law a]-multiplicativeMonoidalLaws =-  [ ( "associative: (a * b) * c = a * (b * c)"-    , Ternary (\a b c -> (a `times` b) `times` c == a `times` (b `times` c)))-  , ("left id: one `times` a = a", Unary (\a -> one `times` a == a))-  , ("right id: a `times` one = a", Unary (\a -> a `times` one == a))-  ]--multiplicativeLawsFail ::-     (Eq a, Show a, Arbitrary a, Multiplicative a) => [Law a]-multiplicativeLawsFail =-  [ ( "associative: (a * b) * c = a * (b * c)"-    , Failiary $ expectFailure . (\a b c -> (a * b) * c == a * (b * c)))-  , ("left id: one * a = a", Unary (\a -> one * a == a))-  , ("right id: a * one = a", Unary (\a -> a * one == a))-  , ("commutative: a * b == b * a", Binary (\a b -> a * b == b * a))-  ]--multiplicativeGroupLaws :: (Epsilon a, Eq a, MultiplicativeGroup a) => [Law a]-multiplicativeGroupLaws =-  [ ( "divide: a == zero || a / a ≈ one"-    , Unary (\a -> a == zero || (a / a) ≈ one))-  , ( "recip divide: recip a == one / a"-    , Unary (\a -> a == zero || recip a == one / a))-  , ( "recip left: a == zero || recip a * a ≈ one"-    , Unary (\a -> a == zero || recip a * a ≈ one))-  , ( "recip right: a == zero || a * recip a ≈ one"-    , Unary (\a -> a == zero || a * recip a ≈ one))-  ]---- distribution-distributionLaws :: (Eq a, Distribution a) => [Law a]-distributionLaws =-  [ ( "left annihilation: a * zero == zero"-    , Unary (\a -> a `times` zero == zero))-  , ( "right annihilation: zero * a == zero"-    , Unary (\a -> zero `times` a == zero))-  , ( "left distributivity: a * (b + c) == a * b + a * c"-    , Ternary (\a b c -> a `times` (b + c) == a `times` b + a `times` c))-  , ( "right distributivity: (a + b) * c == a * c + b * c"-    , Ternary (\a b c -> (a + b) `times` c == a `times` c + b `times` c))-  ]--distributionLawsFail ::-     (Show a, Arbitrary a, Epsilon a, Eq a, Distribution a) => [Law a]-distributionLawsFail =-  [ ( "left annihilation: a * zero == zero"-    , Unary (\a -> a `times` zero == zero))-  , ( "right annihilation: a * zero == zero"-    , Unary (\a -> zero `times` a == zero))-  , ( "left distributivity: a * (b + c) = a * b + a * c"-    , Failiary $-      expectFailure . (\a b c -> a `times` (b + c) == a `times` b + a `times` c))-  , ( "right distributivity: (a + b) * c = a * c + b * c"-    , Failiary $-      expectFailure . (\a b c -> (a + b) `times` c == a `times` c + b `times` c))-  ]---- integral-integralLaws :: (Eq a, Integral a, FromInteger a, ToInteger a) => [Law a]-integralLaws =-  [ ( "integral divmod: b == zero || b * (a `div` b) + (a `mod` b) == a"-    , Binary (\a b -> b == zero || b `times` (a `div` b) + (a `mod` b) == a))-  , ("fromIntegral a = a", Unary (\a -> fromIntegral a == a))-  ]---- metric-signedLaws :: (Eq a, Signed a) => [Law a]-signedLaws = [("sign a * abs a == a", Unary (\a -> sign a `times` abs a == a))]--metricFloatLaws :: () => [Law Float]-metricFloatLaws =-  [ ("positive", Binary (\a b -> (distance a b :: Float) >= zero))-  , ("zero if equal", Unary (\a -> (distance a a :: Float) == zero))-  , ( "associative"-    , Binary (\a b -> (distance a b :: Float) ≈ (distance b a :: Float)))-  , ( "triangle rule - sum of distances > distance"-    , Ternary-        (\a b c ->-           (abs a > 10.0) ||-           (abs b > 10.0) ||-           (abs c > 10.0) ||-           not-             (veryNegative-                (distance a c + distance b c - (distance a b :: Float))) &&-           not-             (veryNegative-                (distance a b + distance b c - (distance a c :: Float))) &&-           not-             (veryNegative-                (distance a b + distance a c - (distance b c :: Float)))))-  ]--metricComplexFloatLaws :: () => [Law (Complex Float)]-metricComplexFloatLaws =-  [ ("positive", Binary (\a b -> (distance a b :: Float) >= zero))-  , ("zero if equal", Unary (\a -> (distance a a :: Float) == zero))-  , ( "associative"-    , Binary (\a b -> (distance a b :: Float) ≈ (distance b a :: Float)))-  , ( "triangle rule - sum of distances > distance"-    , Ternary-        (\a b c ->-           (size a > (10.0 :: Float)) ||-           (size b > (10.0 :: Float)) ||-           (size c > (10.0 :: Float)) ||-           not-             (veryNegative-                (distance a c + distance b c - (distance a b :: Float))) &&-           not-             (veryNegative-                (distance a b + distance b c - (distance a c :: Float))) &&-           not-             (veryNegative-                (distance a b + distance a c - (distance b c :: Float)))))-  ]---- field-boundedFieldFloatLaws :: [Law Float]-boundedFieldFloatLaws =-  [ ( "infinity laws"-    , Unary-        (\a ->-           ((one :: Float) / zero + infinity == infinity) &&-           (infinity + a == infinity) &&-           isNaN ((infinity :: Float) - infinity) &&-           isNaN ((infinity :: Float) / infinity) &&-           isNaN (nan + a) && (zero :: Float) / zero /= nan))-  ]--quotientFieldLaws :: (Ord a, Field a, QuotientField a, FromInteger a) => [Law a]-quotientFieldLaws =-  [ ( "a - one < floor a <= a <= ceiling a < a + one"-    , Unary-        (\a ->-           ((a - one) < fromIntegral (floor a)) &&-           (fromIntegral (floor a) <= a) &&-           (a <= fromIntegral (ceiling a)) &&-           (fromIntegral (ceiling a) < a + one)))-  , ( "round a == floor (a + one/(one+one))"-    , Unary (\a -> round a == floor (a + one / (one + one))))-  ]--expFieldLaws ::-     (ExpField a, Signed a, Epsilon a, Fractional a, Ord a) => [Law a]-expFieldLaws =-  [ ( "sqrt . (**(one+one)) ≈ id"-    , Unary-        (\a ->-           not (veryPositive a) ||-           (a > 10.0) ||-           (sqrt . (** (one + one)) $ a) ≈ a &&-           ((** (one + one)) . sqrt $ a) ≈ a))-  , ( "log . exp ≈ id"-    , Unary-        (\a ->-           not (veryPositive a) ||-           (a > 10.0) || (log . exp $ a) ≈ a && (exp . log $ a) ≈ a))-  , ( "for +ive b, a != 0,1: a ** logBase a b ≈ b"-    , Binary-        (\a b ->-           (not (veryPositive b) ||-            not (nearZero (a - zero)) ||-            (a == one) ||-            (a == zero && nearZero (logBase a b)) || (a ** logBase a b ≈ b))))-  ]--expFieldComplexLooseLaws :: Float -> [Law (Complex Float)]-expFieldComplexLooseLaws _ =-  [ ( "sqrt . (**(one+one)) ≈ id test contains a stack overflow"-    , Unary (const True))-  , ("log . exp test contains a stack overflow", Unary (const True))-  , ( "for +ive b, a != 0,1: a ** logBase a b ≈ b"-    , Binary-        (\a b@(rb :+ ib) ->-           (not (rb > zero && ib > zero) ||-            not (nearZero (a - zero)) ||-            (a == one) ||-            (a == zero && nearZero (logBase a b)) || (a ** logBase a b ≈ b))))-  ]--metricNaperianFloatLaws :: (Metric (r Float) Float) => [Law (r Float)]-metricNaperianFloatLaws =-  [ ("positive", Binary (\a b -> distance a b >= (zero :: Float)))-  , ("zero if equal", Unary (\a -> distance a a == (zero :: Float)))-  , ("associative", Binary (\a b -> distance a b ≈ (distance b a :: Float)))-  , ( "triangle rule - sum of distances > distance"-    , Ternary-        (\a b c ->-           not-             (veryNegative-                (distance a c + distance b c - (distance a b :: Float))) &&-           not-             (veryNegative-                (distance a b + distance b c - (distance a c :: Float))) &&-           not-             (veryNegative-                (distance a b + distance a c - (distance b c :: Float)))))-  ]--expFieldNaperianLaws ::-     ( ExpField (r a)-     , Foldable r-     , ExpField a-     , Epsilon a-     , Signed a-     , Epsilon (r a)-     , Fractional a-     , Ord a-     )-  => [Law (r a)]-expFieldNaperianLaws =-  [ ( "sqrt . (**2) ≈ id"-    , Unary-        (\a ->-           not (all veryPositive a) ||-           any (> 10.0) a ||-           (sqrt . (** (one + one)) $ a) ≈ a &&-           ((** (one + one)) . sqrt $ a) ≈ a))-  , ( "log . exp ≈ id"-    , Unary-        (\a ->-           not (all veryPositive a) ||-           any (> 10.0) a || (log . exp $ a) ≈ a && (exp . log $ a) ≈ a))-  , ( "for +ive b, a != 0,1: a ** logBase a b ≈ b"-    , Binary-        (\a b ->-           (not (all veryPositive b) ||-            not (all nearZero a) ||-            all (== one) a ||-            (all (== zero) a && all nearZero (logBase a b)) ||-            (a ** logBase a b ≈ b))))-  ]---- module-additiveModuleLaws ::-     (Eq (r a), Epsilon a, Epsilon (r a), AdditiveModule r a) => [Law2 (r a) a]-additiveModuleLaws =-  [ ( "additive module associative: (a + b) .+ c ≈ a + (b .+ c)"-    , Ternary2 (\a b c -> (a + b) .+ c ≈ a + (b .+ c)))-  , ( "additive module commutative: (a + b) .+ c ≈ (a .+ c) + b"-    , Ternary2 (\a b c -> (a + b) .+ c ≈ (a .+ c) + b))-  , ("additive module unital: a .+ zero == a", Unary2 (\a -> a .+ zero == a))-  , ( "module additive equivalence: a .+ b ≈ b +. a"-    , Binary2 (\a b -> a .+ b ≈ b +. a))-  ]--additiveGroupModuleLaws ::-     (Eq (r a), Epsilon a, Epsilon (r a), AdditiveGroupModule r a)-  => [Law2 (r a) a]-additiveGroupModuleLaws =-  [ ( "additive group module associative: (a + b) .- c ≈ a + (b .- c)"-    , Ternary2 (\a b c -> (a + b) .- c ≈ a + (b .- c)))-  , ( "additive group module commutative: (a + b) .- c ≈ (a .- c) + b"-    , Ternary2 (\a b c -> (a + b) .- c ≈ (a .- c) + b))-  , ( "additive group module unital: a .- zero == a"-    , Unary2 (\a -> a .- zero == a))-  , ( "module additive group equivalence: a .- b ≈ negate b +. a"-    , Binary2 (\a b -> a .- b ≈ negate b +. a))-  ]--multiplicativeModuleLaws ::-     (Eq (r a), Epsilon a, Epsilon (r a), MultiplicativeModule r a)-  => [Law2 (r a) a]-multiplicativeModuleLaws =-  [ ( "multiplicative module unital: a .* one == a"-    , Unary2 (\a -> a .* one == a))-  , ( "module right distribution: (a + b) .* c ≈ (a .* c) + (b .* c)"-    , Ternary2 (\a b c -> (a + b) .* c ≈ (a .* c) + (b .* c)))-  , ( "module left distribution: c *. (a + b) ≈ (c *. a) + (c *. b)"-    , Ternary2 (\a b c -> c *. (a + b) ≈ (c *. a) + (c *. b)))-  , ("annihilation: a .* zero == zero", Unary2 (\a -> a .* zero == zero))-  , ( "module multiplicative equivalence: a .* b ≈ b *. a"-    , Binary2 (\a b -> a .* b ≈ b *. a))-  ]--multiplicativeGroupModuleLawsFail ::-     ( Eq a-     , Show a-     , Arbitrary a-     , Eq (r a)-     , Show (r a)-     , Arbitrary (r a)-     , Epsilon a-     , Epsilon (r a)-     , MultiplicativeGroupModule r a-     )-  => [Law2 (r a) a]-multiplicativeGroupModuleLawsFail =-  [ ( "multiplicative group module unital: a ./ one == a"-    , Unary2 (\a -> nearZero a || a ./ one == a))-  , ( "module multiplicative group equivalence: a ./ b ≈ recip b *. a"-    , Binary2 (\a b -> b == zero || a ./ b ≈ recip b *. a))-  ]--banachLaws ::-     ( Ord a-     , Fractional a-     , Signed a-     , Foldable r-     , Fractional b-     , Eq (r a)-     , Epsilon b-     , Epsilon (r a)-     , Metric (r a) b-     , MultiplicativeGroup b-     , Banach r a-     , Normed (r a) b-     , Singleton r-     )-  => [Law2 (r a) b]-banachLaws =-  [ ( "normalize a .* size a ≈ one"-    , Unary2-        (\a ->-           a == singleton zero ||-           (any ((> 10.0) . abs) a || (normalize a .* size a) ≈ a)))-  ]--hilbertLaws ::-    ( Eq (r a)-    , Eq a-    , Multiplicative a-    , MultiplicativeModule r a-    , Epsilon a-    , Epsilon (r a)-    , Hilbert r a)-  => [Law2 (r a) a]-hilbertLaws =-  [ ("commutative a <.> b ≈ b <.> a", Ternary2 (\a b _ -> a <.> b ≈ b <.> a))-  , ( "distributive over addition a <.> (b + c) == a <.> b + a <.> c"-    , Ternary2'' (\a b c -> a <.> (b + c) ≈ a <.> b + a <.> c))-  , ( "bilinear a <.> (s *. b + c) == s * (a <.> b) + a <.> c"-    , Quad31 (\a b c s -> a <.> (s *. b + c) == s * (a <.> b) + a <.> c))-  , ( "scalar multiplication (s0 *. a) <.> (s1 *. b) == s0 * s1 * (a <.> b)"-    , Quad22 (\a b s0 s1 -> (s0 *. a) <.> (s1 *. b) == s0 * s1 * (a <.> b)))-  ]--tensorProductLaws ::-     ( Eq (r (r a))-     , Additive (r (r a))-     , Eq (r a)-     , Eq a-     , TensorProduct (r a)-     , Epsilon a-     , Epsilon (r a)-     )-  => [Law2 (r a) a]-tensorProductLaws =-  [ ( "left distribution over addition a><b + c><b == (a+c) >< b"-    , Ternary2'' (\a b c -> a >< b + c >< b == (a + c) >< b))-  , ( "right distribution over addition a><b + a><c == a >< (b+c)"-    , Ternary2'' (\a b c -> a >< b + a >< c == a >< (b + c)))-  -- , ( "left module tensor correspondance a *. (b><c) == (a><b) .* c"-  --   , Ternary2'' (\a b c -> a *. (b><c) == (a><b) .* c))-  -- , ( "right module tensor correspondance (a><b) .* c == a *. (b><c)"-  --   , Ternary2'' (\a b c -> (a><b) .* c == a *. (b><c)))-  ]---- basis-additiveBasisLaws :: (Eq (r a), Epsilon (r a), AdditiveBasis r a) => [Law (r a)]-additiveBasisLaws =-  [ ( "associative: (a .+. b) .+. c ≈ a .+. (b .+. c)"-    , Ternary (\a b c -> (a .+. b) .+. c ≈ a .+. (b .+. c)))-  , ("left id: zero .+. a = a", Unary (\a -> zero .+. a == a))-  , ("right id: a .+. zero = a", Unary (\a -> a .+. zero == a))-  , ("commutative: a .+. b == b .+. a", Binary (\a b -> a .+. b == b .+. a))-  ]--additiveGroupBasisLaws :: (Eq (r a), Singleton r, AdditiveGroupBasis r a) => [Law (r a)]-additiveGroupBasisLaws =-  [ ( "minus: a .-. a = singleton zero"-    , Unary (\a -> (a .-. a) == singleton zero))-  ]--multiplicativeBasisLaws :: (Eq (r a), Singleton r, MultiplicativeBasis r a) => [Law (r a)]-multiplicativeBasisLaws =-  [ ( "associative: (a .*. b) .*. c == a .*. (b .*. c)"-    , Ternary (\a b c -> (a .*. b) .*. c == a .*. (b .*. c)))-  , ("left id: singleton one .*. a = a", Unary (\a -> singleton one .*. a == a))-  , ( "right id: a .*. singleton one = a"-    , Unary (\a -> a .*. singleton one == a))-  , ("commutative: a .*. b == b .*. a", Binary (\a b -> a .*. b == b .*. a))-  ]--multiplicativeGroupBasisLaws ::-     ( Eq (r a)-     , Epsilon a-     , Epsilon (r a)-     , Singleton r-     , MultiplicativeGroupBasis r a-     )-  => [Law (r a)]-multiplicativeGroupBasisLaws =-  [ ( "basis divide: a ./. a ≈ singleton one"-    , Unary (\a -> a == singleton zero || (a ./. a) ≈ singleton one))-  ]---- | semiring-semiringLaws :: (Eq a, Semiring a) => [Law a]-semiringLaws = additiveLaws <> distributionLaws <>-    [ ( "associative: (a * b) * c = a * (b * c)"-    , Ternary (\a b c -> (a `times` b) `times` c == a `times` (b `times` c)))-    , ("left id: one * a = a", Unary (\a -> one `times` a == a))-    , ("right id: a * one = a", Unary (\a -> a `times` one == a))-    ]---- | ring-ringLaws :: (Eq a, Ring a) => [Law a]-ringLaws = semiringLaws <> additiveGroupLaws---- | starsemiring-starSemiringLaws :: (Eq a, StarSemiring a) => [Law a]-starSemiringLaws = semiringLaws <>-    [ ( "star law: star a == one + a `times` star a"-    , Unary (\a -> star a == one + a `times` star a))-    ]-
− src/NumHask/Prelude.hs
@@ -1,52 +0,0 @@-{-# OPTIONS_GHC -Wall #-}---- | A prelude for NumHask-module NumHask.Prelude-  ( -- * Backend-    -- $backend-    module Protolude--    -- * Algebraic Heirarchy-    -- $instances-  , module NumHask.Algebra.Additive-  , module NumHask.Algebra.Basis-  , module NumHask.Algebra.Distribution-  , module NumHask.Algebra.Field-  , module NumHask.Algebra.Integral-  , module NumHask.Algebra.Magma-  , module NumHask.Algebra.Metric-  , module NumHask.Algebra.Module-  , module NumHask.Algebra.Multiplicative-  , module NumHask.Algebra.Ring-  , module NumHask.Algebra.Singleton--  ) where--import Protolude-       hiding (Bounded(..), Integral(..), Rep, Semiring(..), (*), (**),-               (+), (-), (/), (^), (^^), abs, acos, acosh, asin, asinh, atan,-               atan2, atanh, ceiling, cos, cosh, exp, floor, fromInteger,-               fromIntegral, infinity, isNaN, log, logBase, negate, pi, product,-               recip, round, sin, sinh, sqrt, sum, tan, tanh, toInteger, trans,-               zero)--import NumHask.Algebra.Additive-import NumHask.Algebra.Basis-import NumHask.Algebra.Distribution-import NumHask.Algebra.Field-import NumHask.Algebra.Integral-import NumHask.Algebra.Magma-import NumHask.Algebra.Metric-import NumHask.Algebra.Module-import NumHask.Algebra.Multiplicative-import NumHask.Algebra.Ring-import NumHask.Algebra.Singleton---- $backend--- NumHask imports Protolude as the prelude and replaces much of the 'Num' heirarchy in base.--- Usage of 'Semigroup' and 'Monoid' has been avoided to retain basic compatability.--- $instances--- Re-defines the numeric tower.------ Instances for 'Int', 'Integer', 'Float', 'Double', 'Bool' and 'Complex' are supplied.---
stack.yaml view
@@ -1,3 +1,3 @@-resolver: nightly-2017-11-07+resolver: nightly-2018-04-04  extra-deps: []
− test/test.hs
@@ -1,95 +0,0 @@-{-# OPTIONS_GHC -Wall #-}---- | testing IEEE numbers is a special kind of hell, and one that I reserve for days when I can hardly think, so please forgive the horrible hackery contained within this file.------ This suite sometimes fails, having been hand-crafty towards balancing reasonably approximate equality versus unbounded failure (given enough trials).-module Main where--import NumHask.Prelude-import NumHask.Laws--import Test.DocTest-import Test.Tasty-       (TestTree, defaultMain, testGroup)--main :: IO ()-main = do-  doctest ["src/NumHask/Examples.hs"]-  defaultMain tests--tests :: TestTree-tests =-  testGroup-    "NumHask"-    [ testsInt-    , testsFloat-    , testsBool-    , testsComplexFloat-    ]--testsInt :: TestTree-testsInt =-  testGroup-    "Int"-    [ testGroup "Additive" $ testLawOf ([] :: [Int]) <$> additiveLaws-    , testGroup "Additive Group" $ testLawOf ([] :: [Int]) <$> additiveGroupLaws-    , testGroup "Multiplicative" $-      testLawOf ([] :: [Int]) <$> multiplicativeLaws-    , testGroup "Distribution" $ testLawOf ([] :: [Int]) <$> distributionLaws-    , testGroup "Integral" $ testLawOf ([] :: [Int]) <$> integralLaws-    , testGroup "Signed" $ testLawOf ([] :: [Int]) <$> signedLaws-    ]--testsFloat :: TestTree-testsFloat =-  testGroup-    "Float"-    [ testGroup "Additive - Associative Fail" $-      testLawOf ([] :: [Float]) <$> additiveLawsFail-    , testGroup "Additive Group" $-      testLawOf ([] :: [Float]) <$> additiveGroupLaws-    , testGroup "Multiplicative - Associative Fail" $-      testLawOf ([] :: [Float]) <$> multiplicativeLawsFail-    , testGroup "MultiplicativeGroup" $-      testLawOf ([] :: [Float]) <$> multiplicativeGroupLaws-    , testGroup "Distribution - Fail" $-      testLawOf ([] :: [Float]) <$> distributionLawsFail-    , testGroup "Signed" $ testLawOf ([] :: [Float]) <$> signedLaws-    , testGroup "Bounded Field" $-      testLawOf ([] :: [Float]) <$> boundedFieldFloatLaws-    , testGroup "Metric" $ testLawOf ([] :: [Float]) <$> metricFloatLaws-    , testGroup "Quotient Field" $-      testLawOf ([] :: [Float]) <$> quotientFieldLaws-    , testGroup "Exponential Field" $ testLawOf ([] :: [Float]) <$> expFieldLaws-    ]--testsBool :: TestTree-testsBool =-  testGroup-    "Bool"-    [ testGroup "Idempotent" $ testLawOf ([] :: [Bool]) <$> idempotentLaws-    , testGroup "Additive" $ testLawOf ([] :: [Bool]) <$> additiveLaws-    , testGroup "Multiplicative" $-      testLawOf ([] :: [Bool]) <$> multiplicativeLaws-    , testGroup "Distribution" $ testLawOf ([] :: [Bool]) <$> distributionLaws-    ]--testsComplexFloat :: TestTree-testsComplexFloat =-  testGroup-    "Complex Float"-    [ testGroup "Additive - Associative Fail" $-      testLawOf ([] :: [Complex Float]) <$> additiveLawsFail-    , testGroup "Additive Group" $-      testLawOf ([] :: [Complex Float]) <$> additiveGroupLaws-    , testGroup "Multiplicative - Associative Fail" $-      testLawOf ([] :: [Complex Float]) <$> multiplicativeLawsFail-    , testGroup "MultiplicativeGroup" $-      testLawOf ([] :: [Complex Float]) <$> multiplicativeGroupLaws-    , testGroup "Distribution - Fail" $-      testLawOf ([] :: [Complex Float]) <$> distributionLawsFail-    , testGroup "Exponential Field" $-      testLawOf ([] :: [Complex Float]) <$> expFieldComplexLooseLaws 10-    , testGroup "Metric" $-      testLawOf ([] :: [Complex Float]) <$> metricComplexFloatLaws-    ]