packages feed

numhask 0.8.0.0 → 0.8.1.0

raw patch · 16 files changed

+195/−173 lines, 16 filesdep −QuickCheckdep −doctest

Dependencies removed: QuickCheck, doctest

Files

numhask.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: numhask-version: 0.8.0.0+version: 0.8.1.0 synopsis:   A numeric class hierarchy. description:@@ -37,15 +37,13 @@   Simple tested-with:   GHC ==8.8.4-   || ==8.10.2    || ==8.10.4    || ==9.0.1-+   || ==9.2.0.20210821 extra-doc-files:   other/*.svg  extra-source-files:-  readme.md   ChangeLog.md  source-repository head@@ -85,20 +83,3 @@     NumHask.Prelude   other-modules:   default-language: Haskell2010--test-suite test-  type: exitcode-stdio-1.0-  main-is: test.hs-  hs-source-dirs:-    test-  build-depends:-    QuickCheck >= 2.13 && < 2.15,-    base >=4.7 && <5,-    doctest >= 0.18 && < 0.19-  default-language: Haskell2010-  ghc-options:-    -Wall-    -Wcompat-    -Wincomplete-record-updates-    -Wincomplete-uni-patterns-    -Wredundant-constraints
other/nh.svg view
@@ -1,1 +1,1 @@-<svg xmlns="http://www.w3.org/2000/svg" height="300.0" viewBox="-1.1992055357331681 -0.5225 2.3984110714663363 1.045" width="688.5390635788526" xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2848,-0.413 C -0.2536,-0.373 -0.2075,-0.313 -0.1763,-0.273"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.3520,-0.413 C -0.3826,-0.373 -0.4276,-0.313 -0.4581,-0.273"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1311,-0.185 C -0.1207,-0.144 -0.1053,-0.084 -0.0949,-0.044"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -1.0140,-0.414 C -1.0692,-0.383 -1.1338,-0.336 -1.1655,-0.272"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -1.1655,-0.272 C -1.2066,-0.190 -1.1257,-0.097 -1.0667,-0.044"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.8372,-0.414 C -0.7612,-0.373 -0.6483,-0.313 -0.5723,-0.272"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.9185,-0.413 C -0.9185,-0.373 -0.9185,-0.313 -0.9185,-0.273"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.9015,0.028 C -0.7154,0.074 -0.3445,0.166 -0.1770,0.207"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.4127,-0.185 C -0.3400,-0.144 -0.2327,-0.084 -0.1606,-0.043"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.5072,-0.185 C -0.5217,-0.144 -0.5432,-0.084 -0.5578,-0.044"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0851,0.044 C -0.0865,0.085 -0.0886,0.144 -0.0900,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0067,0.004 C 0.2507,0.017 1.0704,0.066 1.1472,0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 1.1472,0.154 C 1.1911,0.204 1.1817,0.247 1.1472,0.304"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 1.1472,0.304 C 1.1151,0.356 1.0585,0.392 1.0032,0.415"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0071,0.005 C 0.1543,0.016 0.5396,0.052 0.8454,0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.8454,0.154 C 0.8696,0.162 0.8947,0.173 0.9171,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0066,0.010 C 0.1197,0.029 0.3773,0.074 0.5828,0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.5828,0.154 C 0.6045,0.162 0.6271,0.174 0.6473,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0061,0.021 C 0.0842,0.046 0.2366,0.093 0.3593,0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.3593,0.154 C 0.3771,0.163 0.3955,0.174 0.4121,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0277,0.044 C 0.0237,0.085 0.0994,0.144 0.1507,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0227,0.272 C -0.0024,0.283 0.0201,0.295 0.0418,0.304"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0418,0.304 C 0.1804,0.358 0.2275,0.331 0.3672,0.382"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.3672,0.382 C 0.3905,0.391 0.4150,0.402 0.4372,0.413"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0259,0.272 C -0.0051,0.284 0.0187,0.296 0.0418,0.304"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0418,0.304 C 0.3054,0.391 0.3924,0.313 0.6612,0.382"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.6612,0.382 C 0.6918,0.390 0.7241,0.402 0.7532,0.414"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0915,0.273 C -0.0915,0.313 -0.0915,0.373 -0.0915,0.413"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1758,0.272 C -0.2546,0.313 -0.3716,0.373 -0.4504,0.414"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1763,0.242 C -0.3047,0.263 -0.5547,0.310 -0.7578,0.382"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.7578,0.382 C -0.7818,0.391 -0.8069,0.402 -0.8297,0.413"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0257,0.273 C 0.0347,0.313 0.1237,0.373 0.1840,0.413"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.8520,-0.185 C -0.7910,-0.144 -0.7009,-0.084 -0.6399,-0.044"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.22000193566955695" x="-0.428805203927738" y="-0.5"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045618e-2" width="0.27107209623570483" x="-0.27794550797302786" y="-0.2713366555226141"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.322147913978321" x="-1.0796204322905858" y="-0.5"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045629e-2" width="0.22000193566955706" x="-1.1226246571296887" y="-4.26733110452282e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045618e-2" width="0.28679056105243594" x="-0.6346744089405665" y="-0.2713366555226141"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045629e-2" width="0.15321613887491203" x="-0.16021927054670337" y="-4.26733110452282e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.16892894651517532" x="-0.17591544219962563" y="0.18599003343215792"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.22000193566955728" x="0.4061300702644397" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.3064209633968875" x="0.6961106892943665" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.3732039316032981" x="-0.278052934743687" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.37320393160329823" x="-0.7209998172963448" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.2357147433098199" x="-1.0285640791235449" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045618e-2" width="0.42428823511061653" x="-1.1306905928567335" y="-0.2713366555226141"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045629e-2" width="0.18857349180079652" x="-0.6678834365590459" y="-4.26733110452282e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.22000193566955728" x="0.8804360241482592" y="0.18599003343215792"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.16892894651517443" x="0.16511445852675743" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.18857349180079686" x="0.6217583719349751" y="0.18599003343215792"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.1532161388749118" x="0.39640424558141496" y="0.18599003343215792"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.23571474330982012" x="8.860283704908722e-2" y="0.18599003343215792"/></g><g fill-opacity="1.0" font-size="4.0e-2" stroke="none" stroke-width="0.0" fill="#333333" text-anchor="middle"><text x="-0.3188042360929595" y="-0.4494417460417588">Additive</text><text x="-0.1424094598551755" y="-0.22077840156437267">Subtractive</text><text x="-0.9185464753014252" y="-0.4494417460417588">Multiplicative</text><text x="-1.0126236892949103" y="7.884942913013337e-3">Divisive</text><text x="-0.4912791284143482" y="-0.22077840156437267">Distributive</text><text x="-8.361120110924736e-2" y="7.884942913013337e-3">Ring</text><text x="-9.145096894203797e-2" y="0.2365482873903993">Field</text><text x="0.5161310380992183" y="0.4652116318677853">ExpField</text><text x="0.8493211709928097" y="0.4652116318677853">QuotientField</text><text x="-9.145096894203797e-2" y="0.4652116318677853">UpperBoundedField</text><text x="-0.5343978514946957" y="0.4652116318677853">LowerBoundedField</text><text x="-0.9107067074686348" y="0.4652116318677853">TrigField</text><text x="-0.9185464753014252" y="-0.22077840156437267">MultiplicativeAction</text><text x="-0.5735966906586477" y="7.884942913013337e-3">Module</text><text x="0.9904369919830376" y="0.2365482873903993">Integral</text><text x="0.24957893178434443" y="0.4652116318677853">Ratio</text><text x="0.7160451178353733" y="0.2365482873903993">Signed</text><text x="0.4730123150188712" y="0.2365482873903993">Norm</text><text x="0.2064602087039975" y="0.2365482873903993">Direction</text></g></svg>+<svg xmlns="http://www.w3.org/2000/svg" height="300.0" viewBox="-1.1992055357331681 -0.5225 2.3984110714663363 1.045" width="688.5390635788526" xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2848,-0.413 C -0.2536,-0.373 -0.2075,-0.313 -0.1763,-0.273"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.3520,-0.413 C -0.3826,-0.373 -0.4276,-0.313 -0.4581,-0.273"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1311,-0.185 C -0.1207,-0.144 -0.1053,-0.084 -0.0949,-0.044"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -1.0140,-0.414 C -1.0692,-0.383 -1.1338,-0.336 -1.1655,-0.272"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -1.1655,-0.272 C -1.2066,-0.190 -1.1257,-0.097 -1.0667,-0.044"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.8372,-0.414 C -0.7612,-0.373 -0.6483,-0.313 -0.5723,-0.272"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.9185,-0.413 C -0.9185,-0.373 -0.9185,-0.313 -0.9185,-0.273"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.9015,0.028 C -0.7154,0.074 -0.3445,0.166 -0.1770,0.207"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.4127,-0.185 C -0.3400,-0.144 -0.2327,-0.084 -0.1606,-0.043"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.5072,-0.185 C -0.5217,-0.144 -0.5432,-0.084 -0.5578,-0.044"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0851,0.044 C -0.0865,0.085 -0.0886,0.144 -0.0900,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0067,0.004 C 0.2507,0.017 1.0704,0.066 1.1472,0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 1.1472,0.154 C 1.1911,0.204 1.1817,0.247 1.1472,0.304"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 1.1472,0.304 C 1.1151,0.356 1.0585,0.392 1.0032,0.415"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0071,0.005 C 0.1543,0.016 0.5396,0.052 0.8454,0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.8454,0.154 C 0.8696,0.162 0.8947,0.173 0.9171,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0066,0.010 C 0.1197,0.029 0.3773,0.074 0.5828,0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.5828,0.154 C 0.6045,0.162 0.6271,0.174 0.6473,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0061,0.021 C 0.0842,0.046 0.2366,0.093 0.3593,0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.3593,0.154 C 0.3771,0.163 0.3955,0.174 0.4121,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0277,0.044 C 0.0237,0.085 0.0994,0.144 0.1507,0.185"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0227,0.272 C -0.0024,0.283 0.0201,0.295 0.0418,0.304"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0418,0.304 C 0.1804,0.358 0.2275,0.331 0.3672,0.382"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.3672,0.382 C 0.3905,0.391 0.4150,0.402 0.4372,0.413"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0259,0.272 C -0.0051,0.284 0.0187,0.296 0.0418,0.304"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0418,0.304 C 0.3054,0.391 0.3924,0.313 0.6612,0.382"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.6612,0.382 C 0.6918,0.390 0.7241,0.402 0.7532,0.414"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0915,0.273 C -0.0915,0.313 -0.0915,0.373 -0.0915,0.413"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1758,0.272 C -0.2546,0.313 -0.3716,0.373 -0.4504,0.414"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1763,0.242 C -0.3047,0.263 -0.5547,0.310 -0.7578,0.382"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.7578,0.382 C -0.7818,0.391 -0.8069,0.402 -0.8297,0.413"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0257,0.273 C 0.0347,0.313 0.1237,0.373 0.1840,0.413"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.8520,-0.185 C -0.7910,-0.144 -0.7009,-0.084 -0.6399,-0.044"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.22000193566955695" x="-0.428805203927738" y="-0.5"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045618e-2" width="0.27107209623570483" x="-0.27794550797302786" y="-0.2713366555226141"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.322147913978321" x="-1.0796204322905858" y="-0.5"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045629e-2" width="0.22000193566955706" x="-1.1226246571296887" y="-4.26733110452282e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045618e-2" width="0.28679056105243594" x="-0.6346744089405665" y="-0.2713366555226141"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045629e-2" width="0.15321613887491203" x="-0.16021927054670337" y="-4.26733110452282e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.16892894651517532" x="-0.17591544219962563" y="0.18599003343215792"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.22000193566955728" x="0.4061300702644397" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.3064209633968875" x="0.6961106892943665" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.3732039316032981" x="-0.278052934743687" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.37320393160329823" x="-0.7209998172963448" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.2357147433098199" x="-1.0285640791235449" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045618e-2" width="0.42428823511061653" x="-1.1306905928567335" y="-0.2713366555226141"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045629e-2" width="0.18857349180079652" x="-0.6678834365590459" y="-4.26733110452282e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.22000193566955728" x="0.8804360241482592" y="0.18599003343215792"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.16892894651517443" x="0.16511445852675743" y="0.41465337790954393"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.18857349180079686" x="0.6217583719349751" y="0.18599003343215792"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.1532161388749118" x="0.39640424558141496" y="0.18599003343215792"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="8.534662209045607e-2" width="0.23571474330982012" x="8.860283704908722e-2" y="0.18599003343215792"/></g><g fill-opacity="1.0" font-size="4.0e-2" stroke="none" stroke-width="0.0" fill="#1f78b4" text-anchor="middle"><text x="-0.3188042360929595" y="-0.4494417460417588">Additive</text><text x="-0.1424094598551755" y="-0.22077840156437267">Subtractive</text><text x="-0.9185464753014252" y="-0.4494417460417588">Multiplicative</text><text x="-1.0126236892949103" y="7.884942913013337e-3">Divisive</text><text x="-0.4912791284143482" y="-0.22077840156437267">Distributive</text><text x="-8.361120110924736e-2" y="7.884942913013337e-3">Ring</text><text x="-9.145096894203797e-2" y="0.2365482873903993">Field</text><text x="0.5161310380992183" y="0.4652116318677853">ExpField</text><text x="0.8493211709928097" y="0.4652116318677853">QuotientField</text><text x="-9.145096894203797e-2" y="0.4652116318677853">UpperBoundedField</text><text x="-0.5343978514946957" y="0.4652116318677853">LowerBoundedField</text><text x="-0.9107067074686348" y="0.4652116318677853">TrigField</text><text x="-0.9185464753014252" y="-0.22077840156437267">MultiplicativeAction</text><text x="-0.5735966906586477" y="7.884942913013337e-3">Module</text><text x="0.9904369919830376" y="0.2365482873903993">Integral</text><text x="0.24957893178434443" y="0.4652116318677853">Ratio</text><text x="0.7160451178353733" y="0.2365482873903993">Signed</text><text x="0.4730123150188712" y="0.2365482873903993">Norm</text><text x="0.2064602087039975" y="0.2365482873903993">Direction</text></g></svg>
other/nhmagma.svg view
@@ -1,2 +1,2 @@-<svg xmlns="http://www.w3.org/2000/svg" height="300.0" viewBox="-0.6392534367128863 -0.5225 1.2785068734257725 1.045" width="367.03546605524576" xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0604,-0.429 C -0.1040,-0.396 -0.1684,-0.348 -0.2120,-0.315"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0128,-0.429 C -0.0128,-0.396 -0.0128,-0.348 -0.0128,-0.315"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0824,-0.439 C -0.1687,-0.406 -0.3161,-0.351 -0.4123,-0.315"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0570,-0.441 C 0.1482,-0.408 0.3087,-0.351 0.4127,-0.314"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0384,-0.429 C 0.0855,-0.396 0.1549,-0.348 0.2019,-0.315"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2057,-0.243 C -0.1563,-0.210 -0.0836,-0.162 -0.0343,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2594,-0.243 C -0.2594,-0.210 -0.2594,-0.162 -0.2594,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0066,-0.243 C -0.0010,-0.210 0.0074,-0.162 0.0131,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0604,-0.243 C -0.1040,-0.210 -0.1684,-0.162 -0.2120,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.4309,-0.244 C -0.4099,-0.235 -0.3868,-0.225 -0.3651,-0.218"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.3651,-0.218 C -0.2498,-0.180 -0.2132,-0.196 -0.0993,-0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0993,-0.154 C -0.0806,-0.147 -0.0611,-0.138 -0.0435,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.4585,-0.243 C -0.4148,-0.210 -0.3504,-0.162 -0.3068,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.4753,-0.244 C 0.4281,-0.199 0.3441,-0.121 0.2690,-0.058"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.2690,-0.058 C 0.2211,-0.017 0.1644,0.027 0.1250,0.057"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.4907,-0.243 C 0.4453,-0.169 0.3347,0.003 0.2178,0.128"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.2178,0.128 C 0.1783,0.171 0.1289,0.214 0.0941,0.244"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.2426,-0.243 C 0.2270,-0.195 0.1934,-0.110 0.1377,-0.058"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.1377,-0.058 C 0.0735,0.002 -0.0182,0.041 -0.0911,0.064"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0303,-0.057 C 0.0406,-0.024 0.0556,0.024 0.0658,0.057"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0246,-0.057 C -0.0649,-0.024 -0.1242,0.024 -0.1645,0.057"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0312,0.129 C -0.0108,0.162 -0.0727,0.210 -0.1146,0.243"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2960,-0.056 C -0.3371,-0.010 -0.3931,0.069 -0.3523,0.128"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.3523,0.128 C -0.3336,0.155 -0.1519,0.216 -0.0388,0.252"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2495,-0.057 C -0.2405,-0.024 -0.2271,0.024 -0.2180,0.057"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0309,0.315 C 0.0121,0.348 -0.0154,0.397 -0.0341,0.429"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1989,0.129 C -0.1904,0.162 -0.1779,0.210 -0.1694,0.243"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1398,0.315 C -0.1210,0.348 -0.0934,0.397 -0.0747,0.429"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.13802057661037992" x="-8.181419517777266e-2" y="-0.5"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.15407082450159398" x="-0.33644535092046735" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.22147493249225647" x="-0.12354137311871094" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.22147493249225653" x="-0.6167534367128863" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.20863704523009718" x="0.4081163914827891" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.1925867973388833" x="0.1567247806808103" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.17974891007672433" x="-7.065160453469976e-2" y="-0.12778519355169937"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.94629838792486e-2" width="0.22147493249225658" x="-3.386645246522468e-2" y="5.832220967245083e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.26320557700941327" x="-0.39101272717437696" y="-0.12778519355169937"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.17974891007672422" x="-3.862484715845449e-2" y="0.24442961289660126"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.94629838792486e-2" width="0.23431744185604025" x="-0.32532584779569823" y="5.832220967245083e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.1251826893482209" x="-0.22271833547742087" y="0.24442961289660126"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.13802057661037997" x="-0.12344897976689145" y="0.43053701612075157"/></g><g fill-opacity="1.0" font-size="4.0e-2" stroke="none" stroke-width="0.0" fill="#333333" text-anchor="middle"><text x="-1.2803906872582704e-2" y="-0.4588510113974741">Magma</text><text x="-0.2594099386696704" y="-0.27274360817332377">Unital</text><text x="-1.2803906872582704e-2" y="-0.27274360817332377">Associative</text><text x="-0.5060159704667582" y="-0.27274360817332377">Commutative</text><text x="0.5124349140978378" y="-0.27274360817332377">Invertible</text><text x="0.25301817935025206" y="-0.27274360817332377">Absorbing</text><text x="1.9222850503662348e-2" y="-8.663620494917346e-2">Additive</text><text x="7.687101378090355e-2" y="9.947119827497686e-2">Subtractive</text><text x="-0.2594099386696704" y="-8.663620494917346e-2">Multiplicative</text><text x="5.124960787990751e-2" y="0.2855786014991273">Divisive</text><text x="-0.2081671268676782" y="9.947119827497686e-2">Distributive</text><text x="-0.16012699080331044" y="0.2855786014991273">Ring</text><text x="-5.443869146170133e-2" y="0.47168600472327754">Field</text></g><g stroke-opacity="1.0" stroke="#e63305" stroke-width="5.0e-3" fill="none" stroke-linecap="round" stroke-dasharray="3.0e-2 1.0e-2"><polyline points="-0.5092186462043825,-0.18610740322415043+<svg xmlns="http://www.w3.org/2000/svg" height="300.0" viewBox="-0.6392534367128863 -0.5225 1.2785068734257725 1.045" width="367.03546605524576" xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0604,-0.429 C -0.1040,-0.396 -0.1684,-0.348 -0.2120,-0.315"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0128,-0.429 C -0.0128,-0.396 -0.0128,-0.348 -0.0128,-0.315"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0824,-0.439 C -0.1687,-0.406 -0.3161,-0.351 -0.4123,-0.315"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0570,-0.441 C 0.1482,-0.408 0.3087,-0.351 0.4127,-0.314"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0384,-0.429 C 0.0855,-0.396 0.1549,-0.348 0.2019,-0.315"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2057,-0.243 C -0.1563,-0.210 -0.0836,-0.162 -0.0343,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2594,-0.243 C -0.2594,-0.210 -0.2594,-0.162 -0.2594,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0066,-0.243 C -0.0010,-0.210 0.0074,-0.162 0.0131,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0604,-0.243 C -0.1040,-0.210 -0.1684,-0.162 -0.2120,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.4309,-0.244 C -0.4099,-0.235 -0.3868,-0.225 -0.3651,-0.218"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.3651,-0.218 C -0.2498,-0.180 -0.2132,-0.196 -0.0993,-0.154"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0993,-0.154 C -0.0806,-0.147 -0.0611,-0.138 -0.0435,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.4585,-0.243 C -0.4148,-0.210 -0.3504,-0.162 -0.3068,-0.129"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.4753,-0.244 C 0.4281,-0.199 0.3441,-0.121 0.2690,-0.058"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.2690,-0.058 C 0.2211,-0.017 0.1644,0.027 0.1250,0.057"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.4907,-0.243 C 0.4453,-0.169 0.3347,0.003 0.2178,0.128"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.2178,0.128 C 0.1783,0.171 0.1289,0.214 0.0941,0.244"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.2426,-0.243 C 0.2270,-0.195 0.1934,-0.110 0.1377,-0.058"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.1377,-0.058 C 0.0735,0.002 -0.0182,0.041 -0.0911,0.064"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0303,-0.057 C 0.0406,-0.024 0.0556,0.024 0.0658,0.057"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.0246,-0.057 C -0.0649,-0.024 -0.1242,0.024 -0.1645,0.057"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0312,0.129 C -0.0108,0.162 -0.0727,0.210 -0.1146,0.243"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2960,-0.056 C -0.3371,-0.010 -0.3931,0.069 -0.3523,0.128"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.3523,0.128 C -0.3336,0.155 -0.1519,0.216 -0.0388,0.252"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.2495,-0.057 C -0.2405,-0.024 -0.2271,0.024 -0.2180,0.057"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M 0.0309,0.315 C 0.0121,0.348 -0.0154,0.397 -0.0341,0.429"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1989,0.129 C -0.1904,0.162 -0.1779,0.210 -0.1694,0.243"/></g><g stroke-opacity="1.0" fill-opacity="0.0" stroke="#1f78b4" stroke-width="5.0e-3" fill="#000000"><path d="M -0.1398,0.315 C -0.1210,0.348 -0.0934,0.397 -0.0747,0.429"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.13802057661037992" x="-8.181419517777266e-2" y="-0.5"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.15407082450159398" x="-0.33644535092046735" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.22147493249225647" x="-0.12354137311871094" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.22147493249225653" x="-0.6167534367128863" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.20863704523009718" x="0.4081163914827891" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924854e-2" width="0.1925867973388833" x="0.1567247806808103" y="-0.3138925967758498"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.17974891007672433" x="-7.065160453469976e-2" y="-0.12778519355169937"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.94629838792486e-2" width="0.22147493249225658" x="-3.386645246522468e-2" y="5.832220967245083e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.26320557700941327" x="-0.39101272717437696" y="-0.12778519355169937"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.17974891007672422" x="-3.862484715845449e-2" y="0.24442961289660126"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.94629838792486e-2" width="0.23431744185604025" x="-0.32532584779569823" y="5.832220967245083e-2"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.1251826893482209" x="-0.22271833547742087" y="0.24442961289660126"/></g><g stroke-opacity="0.8" fill-opacity="0.1" stroke="#1f78b4" stroke-width="5.0e-3" fill="#a6cee3"><rect height="6.946298387924843e-2" width="0.13802057661037997" x="-0.12344897976689145" y="0.43053701612075157"/></g><g fill-opacity="1.0" font-size="4.0e-2" stroke="none" stroke-width="0.0" fill="#1f78b4" text-anchor="middle"><text x="-1.2803906872582704e-2" y="-0.4588510113974741">Magma</text><text x="-0.2594099386696704" y="-0.27274360817332377">Unital</text><text x="-1.2803906872582704e-2" y="-0.27274360817332377">Associative</text><text x="-0.5060159704667582" y="-0.27274360817332377">Commutative</text><text x="0.5124349140978378" y="-0.27274360817332377">Invertible</text><text x="0.25301817935025206" y="-0.27274360817332377">Absorbing</text><text x="1.9222850503662348e-2" y="-8.663620494917346e-2">Additive</text><text x="7.687101378090355e-2" y="9.947119827497686e-2">Subtractive</text><text x="-0.2594099386696704" y="-8.663620494917346e-2">Multiplicative</text><text x="5.124960787990751e-2" y="0.2855786014991273">Divisive</text><text x="-0.2081671268676782" y="9.947119827497686e-2">Distributive</text><text x="-0.16012699080331044" y="0.2855786014991273">Ring</text><text x="-5.443869146170133e-2" y="0.47168600472327754">Field</text></g><g stroke-opacity="1.0" stroke="#e63305" stroke-width="5.0e-3" fill="none" stroke-linecap="round" stroke-dasharray="3.0e-2 1.0e-2"><polyline points="-0.5092186462043825,-0.18610740322415043 0.515637589835462,-0.18610740322415043"/></g></svg>
− readme.md
@@ -1,27 +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)--This package provides numeric classes alternate to the prelude specified in haskell98.--The numeric class constellation looks somewhat like:--![nh](other/nh.svg)--Usage-===--``` haskell-{-# LANGUAGE NegativeLiterals #-}-{-# LANGUAGE RebindableSyntax #-}-import NumHask.Prelude-```-See the documentation in the Numhask module for a detailed overview.--Develop-===--```-stack build --test --haddock --file-watch-```
src/NumHask.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE RebindableSyntax #-} {-# OPTIONS_GHC -Wall #-} {-# OPTIONS_HADDOCK prune #-}@@ -14,20 +13,19 @@      -- * Prelude Mappings     -- $mapping-    -- $backend      -- * Extensions     -- $extensions      -- * Exports     module NumHask.Algebra.Additive,+    module NumHask.Algebra.Multiplicative,+    module NumHask.Algebra.Ring,     module NumHask.Algebra.Field,-    module NumHask.Algebra.Group,     module NumHask.Algebra.Lattice,     module NumHask.Algebra.Module,-    module NumHask.Algebra.Multiplicative,-    module NumHask.Algebra.Ring,     module NumHask.Algebra.Metric,+    module NumHask.Algebra.Group,     module NumHask.Data.Complex,     module NumHask.Data.Integral,     module NumHask.Data.Rational,@@ -36,17 +34,90 @@ where  import NumHask.Algebra.Additive+  ( Additive (..),+    Subtractive (..),+    sum,+  ) import NumHask.Algebra.Field+  ( ExpField (..),+    Field,+    LowerBoundedField (..),+    QuotientField (..),+    TrigField (..),+    UpperBoundedField (..),+    half,+  ) import NumHask.Algebra.Group+  ( AbelianGroup,+    Absorbing (..),+    Associative,+    Commutative,+    Group,+    Idempotent,+    Invertible (..),+    Magma (..),+    Unital (..),+  ) import NumHask.Algebra.Lattice+  ( BoundedJoinSemiLattice (..),+    BoundedMeetSemiLattice (..),+    JoinSemiLattice (..),+    MeetSemiLattice (..),+    joinLeq,+    meetLeq,+  )+import NumHask.Algebra.Metric+  ( Direction (..),+    Epsilon (..),+    Norm (..),+    Polar (..),+    Signed (..),+    coord,+    distance,+    polar,+    (~=),+  ) import NumHask.Algebra.Module+  ( AdditiveAction (..),+    DivisiveAction (..),+    Module,+    MultiplicativeAction (..),+    SubtractiveAction (..),+  ) import NumHask.Algebra.Multiplicative+  ( Divisive (..),+    Multiplicative (..),+    product,+  ) import NumHask.Algebra.Ring-import NumHask.Algebra.Metric-import NumHask.Data.Complex+  ( Distributive,+    InvolutiveRing (..),+    KleeneAlgebra,+    Ring,+    StarSemiring (..),+    two,+  )+import NumHask.Data.Complex (Complex (..), imagPart, realPart) import NumHask.Data.Integral+  ( FromInteger (..),+    FromIntegral (..),+    Integral (..),+    ToIntegral (..),+    even,+    odd,+    (^),+    (^^),+  ) import NumHask.Data.Rational-import NumHask.Exception+  ( FromRatio (..),+    FromRational (..),+    Ratio (..),+    Rational,+    ToRatio (..),+    gcd,+    reduce,+  )+import NumHask.Exception (NumHaskException (..), throw)  -- $setup --@@ -57,9 +128,13 @@  -- $extensions ----- [RebindableSyntax](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/rebindable_syntax.html) and [NegativeLiterals](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/negative_literals.html) are both recommended for use with numhask. [LexicalNegation](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/lexical_negation.html) also looks sweet when it arrives.+-- [RebindableSyntax](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/rebindable_syntax.html)+-- is recommended for use with numhask. ----- As a replacement for the numerical classes, numhask clashes significantly with an unqualified import of the @Prelude@. Either numhask modules should be qualified, or prelude turned off with the NoImplicitPrelude extension, or with RebindableSyntax, which implies NoImplicitPrelude.+-- As a replacement for the numerical classes, numhask clashes significantly with an+-- unqualified import of the @Prelude@. Either numhask modules should be qualified,+-- or prelude turned off with the NoImplicitPrelude extension, or with RebindableSyntax,+-- which implies NoImplicitPrelude. -- -- == defaulting --@@ -67,10 +142,10 @@ -- -- >>> :set -XNoRebindableSyntax -- >>> :t 1--- 1 :: Num p => p+-- 1 :: Num a => a -- -- >>> :t 1.0--- 1.0 :: Fractional p => p+-- 1.0 :: Fractional a => a -- -- With RebindableSyntax (which also switches NoImplicitPrelude on) literal numbers change to the numhask types, 'FromInteger' and 'FromRational': --@@ -87,40 +162,55 @@ -- >>> 1.0 -- 1.0 ----- It is recommended to switch on RebindableSyntax to avoid Num constraints being introduced due to literal defaulting. The extension is a tradeoff, however, and usage comes attached with other non-numeric changes that "NumHask.Prelude" attempts to counteract.------ See See [haskell2010 Section 4.3.4](https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-750004.3) for the nuts and bolts to defaulting.+-- RebindableSyntax is a tradeoff, however, and usage comes attached with other non-numeric changes+-- that "NumHask.Prelude" attempts to counteract. ----- The effect of [ExtendedDefaultRules](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/ghci.html#extension-ExtendedDefaultRules) in ghci or switched on as an extension also need to be understood. It can lead to unusual interactions with numerics and strange error messages at times because it adds @()@ and @[]@ to the start of the type defaulting list.+-- See [haskell2010 Section 4.3.4](https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-750004.3) for the nuts and bolts to defaulting. --+-- The effect of [ExtendedDefaultRules](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/ghci.html#extension-ExtendedDefaultRules)+-- in ghci or switched on as an extension also need to be understood.+-- It can lead to unusual interactions with numerics and strange error messages at times because+-- it adds @()@ and @[]@ to the start of the type defaulting list.  -- $overview--- numhask is largely a set of classes that can replace the 'GHC.Num.Num' class and it's descendents. Principles that have guided design include:+-- numhask is largely a set of classes that can replace the 'GHC.Num.Num' class and it's descendents.+-- Principles that have guided design include: ----- - __/balanced class density/__. The numeric heirarchy begins with addition and multiplication, choosing not to build from a 'Magma' base. Whilst not being as principled as other approaches, this circumvents the instance explosion problems of Haskell whilst maintaining clarity of class purpose.+-- - __/balanced class density/__. The numeric heirarchy begins with addition and multiplication,+--   choosing not to build from a 'Magma' base. Whilst not being as principled as other approaches, this circumvents the instance explosion problems of Haskell whilst maintaining clarity of class purpose. ----- - __/operator-first/__. In most cases, a class exists to define useful operators. The exceptions are 'Distributive', 'Ring' and 'Field', which are collections of operators representing major teleological fault lines.+-- - __/operator-first/__. In most cases, a class exists to define useful operators.+--   The exceptions are 'Distributive', 'Ring' and 'Field', which are collections of operators+--   representing major teleological fault lines. ----- - __/lawful/__. Most classes have laws associated with them that serve to relate class operators together in a meaningful way.+-- - __/lawful/__. Most classes have laws associated with them that serve to relate class operators+--   together in a meaningful way. ----- - __/low-impact/__. The library attempts to fit in with the rest of the Haskell ecosystem. It provides instances for common numbers: 'GHC.Num.Int', 'GHC.Num.Integer', 'GHC.Float.Double', 'GHC.Float.Float' and the Word classes. It avoids name (or idea) clashes with other popular libraries and adopts conventions in the <https://hackage.haskell.org/package/base/docs/Prelude.html current prelude> where they make sense.+-- - __/low-impact/__. The library attempts to fit in with the rest of the Haskell ecosystem.+--   It provides instances for common numbers: 'GHC.Num.Int', 'GHC.Num.Integer', 'GHC.Float.Double',+--   'GHC.Float.Float' and the Word classes. It avoids name (or idea) clashes with other popular libraries+--   and adopts conventions in the <https://hackage.haskell.org/package/base/docs/Prelude.html current prelude>+--   where they make sense. ----- - __/proof-of-concept/__. The library may be below industrial-strength depending on a definition of this term. At the same time, correspondence around improving the library is most welcome.+-- - __/proof-of-concept/__. The library may be below industrial-strength depending on a definition+--   of this term. At the same time, correspondence around improving the library is most welcome.  -- $pictures -- -- The class heirarchy looks somewhat like this: -- ![classes](other/nh.svg) ----- If the base started with magma, and the library tolerated clashing with 'Data.Semigroup' and 'Data.Monoid' in base, it would look like:+-- If the base started with magma, and the library tolerated clashing with 'Data.Semigroup'+-- and 'Data.Monoid' in base, it would look like: -- -- ![magma classes](other/nhmagma.svg) ----- These first two levels, contained in 'NumHask.Algebra.Group' can be considered "morally" super-classes.+-- These first two levels, contained in 'NumHask.Algebra.Group' are moral super-classes.  -- $mapping ----- 'GHC.Num' is a very old part of haskell, and is virtually unchanged since it's specification in [haskell98](https://www.haskell.org/onlinereport/standard-prelude.html).+-- 'GHC.Num' is a very old part of haskell, and is virtually unchanged since it's specification in+-- [haskell98](https://www.haskell.org/onlinereport/standard-prelude.html). -- -- A deconstruction of 'GHC.Num.Num' and mapping to numhask. --@@ -151,9 +241,13 @@ -- >    -- or @1@ (positive). -- >    signum              :: a -> a ----- 'abs' is a function in the 'NumHask.Algebra.Metric.Signed' class. The concept of an absolute value can also include situations where the domain and codomain are different, and 'norm' as a function in the 'NumHask.Algebra.Metric.Norm' class is supplied for these cases.+-- 'abs' is a function in the 'NumHask.Algebra.Metric.Signed' class.+-- The concept of an absolute value can also include situations where the domain and codomain+-- are different, and 'norm' as a function in the 'NumHask.Algebra.Metric.Norm' class is supplied+-- for these cases. -----  'NumHask.Algebra.Metric.sign' replaces 'GHC.Num.signum', because signum is simply a naming crime. 'NumHask.Algebra.Metric.basis' can also be seen as a generalisation of sign.+-- 'NumHask.Algebra.Metric.sign' replaces 'GHC.Num.signum', because signum is simply a naming crime.+-- 'NumHask.Algebra.Metric.basis' can also be seen as a generalisation of sign. -- -- >    -- | Conversion from an 'Integer'. -- >    -- An integer literal represents the application of the function
src/NumHask/Algebra/Additive.hs view
@@ -17,19 +17,17 @@ -- $setup -- -- >>> :set -XRebindableSyntax--- >>> :set -XNegativeLiterals -- >>> :set -XFlexibleContexts -- >>> import NumHask.Prelude--- >>> import Test.QuickCheck  -- | or [Addition](https://en.wikipedia.org/wiki/Addition) -- -- For practical reasons, we begin the class tree with 'NumHask.Algebra.Additive.Additive'.  Starting with  'NumHask.Algebra.Group.Associative' and 'NumHask.Algebra.Group.Unital', or using 'Data.Semigroup.Semigroup' and 'Data.Monoid.Monoid' from base tends to confuse the interface once you start having to disinguish between (say) monoidal addition and monoidal multiplication. ----- prop> \a -> zero + a == a--- prop> \a -> a + zero == a--- prop> \a b c -> (a + b) + c == a + (b + c)--- prop> \a b -> a + b == b + a+-- > \a -> zero + a == a+-- > \a -> a + zero == a+-- > \a b c -> (a + b) + c == a + (b + c)+-- > \a b -> a + b == b + a -- -- By convention, (+) is regarded as commutative, but this is not universal, and the introduction of another symbol which means non-commutative addition seems a bit dogmatic. --@@ -50,10 +48,10 @@  -- | or [Subtraction](https://en.wikipedia.org/wiki/Subtraction) ----- prop> \a -> a - a == zero--- prop> \a -> negate a == zero - a--- prop> \a -> negate a + a == zero--- prop> \a -> a + negate a == zero+-- > \a -> a - a == zero+-- > \a -> negate a == zero - a+-- > \a -> negate a + a == zero+-- > \a -> a + negate a == zero -- -- -- >>> negate 1
src/NumHask/Algebra/Field.hs view
@@ -19,21 +19,22 @@ where  import Data.Bool (bool)-import NumHask.Algebra.Additive+import NumHask.Algebra.Additive (Additive (..), Subtractive (..)) import NumHask.Algebra.Multiplicative-import NumHask.Algebra.Ring-import NumHask.Data.Integral+  ( Divisive ((/)),+    Multiplicative (..),+  )+import NumHask.Algebra.Ring (Distributive, two)+import NumHask.Data.Integral (Integral, even) import Prelude ((.)) import qualified Prelude as P  -- $setup -- -- >>> :set -XRebindableSyntax--- >>> :set -XNegativeLiterals -- >>> :set -XFlexibleContexts -- >>> :set -XScopedTypeVariables -- >>> import NumHask.Prelude--- >>> import Test.QuickCheck  -- | A <https://en.wikipedia.org/wiki/Field_(mathematics) Field> is a set --   on which addition, subtraction, multiplication, and division are defined. It is also assumed that multiplication is distributive over addition.@@ -104,7 +105,7 @@   f ** f' = \a -> f a ** f' a   sqrt f = sqrt . f --- | Conversion from a 'Field' to a 'Ring'+-- | Conversion from a 'Field' to a 'NumHask.Algebra.Ring' -- -- See [Field of fractions](https://en.wikipedia.org/wiki/Field_of_fractions) --
src/NumHask/Algebra/Lattice.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE UndecidableInstances #-}@@ -14,8 +15,8 @@   ) where -import Data.Bool-import Data.Eq+import Data.Bool (Bool (..), (&&), (||))+import Data.Eq (Eq ((==))) import Data.Function (const) import Data.Int (Int16, Int32, Int64, Int8) import Data.Ord (Ord (..))@@ -28,6 +29,9 @@ import GHC.Word (Word) import NumHask.Algebra.Additive (zero) import NumHask.Algebra.Field+  ( LowerBoundedField (negInfinity),+    UpperBoundedField (infinity),+  )  -- | A algebraic structure with element joins: See [Semilattice](http://en.wikipedia.org/wiki/Semilattice) --
src/NumHask/Algebra/Metric.hs view
@@ -23,10 +23,10 @@ import Data.Word (Word16, Word32, Word64, Word8) import GHC.Generics (Generic) import GHC.Natural (Natural (..))-import NumHask.Algebra.Additive-import NumHask.Algebra.Lattice-import NumHask.Algebra.Module-import NumHask.Algebra.Multiplicative+import NumHask.Algebra.Additive (Additive (zero), Subtractive (..))+import NumHask.Algebra.Lattice (MeetSemiLattice, meetLeq)+import NumHask.Algebra.Module (MultiplicativeAction ((.*)))+import NumHask.Algebra.Multiplicative (Multiplicative (one)) import Prelude hiding   ( Bounded (..),     Integral (..),@@ -151,6 +151,7 @@ class (Additive a, Multiplicative b, Additive b) => Norm a b | a -> b where   -- | or length, or ||v||   norm :: a -> b+   -- | or direction, or v-hat   basis :: a -> a 
src/NumHask/Algebra/Module.hs view
@@ -12,20 +12,18 @@   ) where -import NumHask.Algebra.Additive-import NumHask.Algebra.Multiplicative-import NumHask.Algebra.Ring+import NumHask.Algebra.Additive (Additive, Subtractive)+import NumHask.Algebra.Multiplicative (Divisive, Multiplicative)+import NumHask.Algebra.Ring (Distributive)  -- $setup -- -- >>> :set -XRebindableSyntax--- >>> :set -XNegativeLiterals -- >>> :set -XFlexibleContexts -- >>> :set -XFlexibleInstances -- >>> :set -XScopedTypeVariables -- >>> :set -XMultiParamTypeClasses -- >>> import NumHask.Prelude--- >>> import Test.QuickCheck -- >>> import Prelude (Int, fmap)  -- | Additive Action
src/NumHask/Algebra/Multiplicative.hs view
@@ -17,20 +17,18 @@ -- $setup -- -- >>> :set -XRebindableSyntax--- >>> :set -XNegativeLiterals -- >>> :set -XFlexibleContexts -- >>> :set -XScopedTypeVariables -- >>> import NumHask.Prelude--- >>> import Test.QuickCheck  -- | or [Multiplication](https://en.wikipedia.org/wiki/Multiplication) -- -- For practical reasons, we begin the class tree with 'NumHask.Algebra.Additive.Additive' and 'Multiplicative'.  Starting with  'NumHask.Algebra.Group.Associative' and 'NumHask.Algebra.Group.Unital', or using 'Data.Semigroup.Semigroup' and 'Data.Monoid.Monoid' from base tends to confuse the interface once you start having to disinguish between (say) monoidal addition and monoidal multiplication. -- ----- prop> \a -> one * a == a--- prop> \a -> a * one == a--- prop> \a b c -> (a * b) * c == a * (b * c)+-- > \a -> one * a == a+-- > \a -> a * one == a+-- > \a b c -> (a * b) * c == a * (b * c) -- -- By convention, (*) is regarded as not necessarily commutative, but this is not universal, and the introduction of another symbol which means commutative multiplication seems a bit dogmatic. --@@ -53,10 +51,10 @@ -- -- Though unusual, the term Divisive usefully fits in with the grammer of other classes and avoids name clashes that occur with some popular libraries. ----- prop> \(a :: Double) -> a / a ~= one || a == zero--- prop> \(a :: Double) -> recip a ~= one / a || a == zero--- prop> \(a :: Double) -> recip a * a ~= one || a == zero--- prop> \(a :: Double) -> a * recip a ~= one || a == zero+-- > \(a :: Double) -> a / a ~= one || a == zero+-- > \(a :: Double) -> recip a ~= one / a || a == zero+-- > \(a :: Double) -> recip a * a ~= one || a == zero+-- > \(a :: Double) -> a * recip a ~= one || a == zero -- -- >>> recip 2.0 -- 0.5
src/NumHask/Algebra/Ring.hs view
@@ -16,26 +16,24 @@ import Data.Int (Int16, Int32, Int64, Int8) import Data.Word (Word, Word16, Word32, Word64, Word8) import GHC.Natural (Natural (..))-import NumHask.Algebra.Additive-import NumHask.Algebra.Group-import NumHask.Algebra.Multiplicative+import NumHask.Algebra.Additive (Additive ((+)), Subtractive)+import NumHask.Algebra.Group (Idempotent)+import NumHask.Algebra.Multiplicative (Multiplicative (..)) import qualified Prelude as P  -- $setup -- -- >>> :set -XRebindableSyntax--- >>> :set -XNegativeLiterals -- >>> :set -XFlexibleContexts -- >>> :set -XScopedTypeVariables -- >>> import NumHask.Prelude--- >>> import Test.QuickCheck  -- | <https://en.wikipedia.org/wiki/Distributive_property Distributive> ----- prop> \a b c -> a * (b + c) == a * b + a * c--- prop> \a b c -> (a + b) * c == a * c + b * c--- prop> \a -> zero * a == zero--- prop> \a -> a * zero == zero+-- > \a b c -> a * (b + c) == a * b + a * c+-- > \a b c -> (a + b) * c == a * c + b * c+-- > \a -> zero * a == zero+-- > \a -> a * zero == zero -- -- The sneaking in of the <https://en.wikipedia.org/wiki/Absorbing_element Absorption> laws here glosses over the possibility that the multiplicative zero element does not have to correspond with the additive unital zero. class@@ -74,23 +72,23 @@  instance Distributive b => Distributive (a -> b) --- | A <https://en.wikipedia.org/wiki/Ring_(mathematics) Ring> is an abelian group under addition ('Unital', 'Associative', 'Commutative', 'Invertible') and monoidal under multiplication ('Unital', 'Associative'), and where multiplication distributes over addition.+-- | A <https://en.wikipedia.org/wiki/Ring_(mathematics) Ring> is an abelian group under addition ('NumHask.Algebra.Unital', 'NumHask.Algebra.Associative', 'NumHask.Algebra.Commutative', 'NumHask.Algebra.Invertible') and monoidal under multiplication ('NumHask.Algebra.Unital', 'NumHask.Algebra.Associative'), and where multiplication distributes over addition. ----- prop> \a -> zero + a == a--- prop> \a -> a + zero == a--- prop> \a b c -> (a + b) + c == a + (b + c)--- prop> \a b -> a + b == b + a--- prop> \a -> a - a == zero--- prop> \a -> negate a == zero - a--- prop> \a -> negate a + a == zero--- prop> \a -> a + negate a == zero--- prop> \a -> one * a == a--- prop> \a -> a * one == a--- prop> \a b c -> (a * b) * c == a * (b * c)--- prop> \a b c -> a * (b + c) == a * b + a * c--- prop> \a b c -> (a + b) * c == a * c + b * c--- prop> \a -> zero * a == zero--- prop> \a -> a * zero == zero+-- > \a -> zero + a == a+-- > \a -> a + zero == a+-- > \a b c -> (a + b) + c == a + (b + c)+-- > \a b -> a + b == b + a+-- > \a -> a - a == zero+-- > \a -> negate a == zero - a+-- > \a -> negate a + a == zero+-- > \a -> a + negate a == zero+-- > \a -> one * a == a+-- > \a -> a * one == a+-- > \a b c -> (a * b) * c == a * (b * c)+-- > \a b c -> a * (b + c) == a * b + a * c+-- > \a b c -> (a + b) * c == a * c + b * c+-- > \a -> zero * a == zero+-- > \a -> a * zero == zero class   (Distributive a, Subtractive a) =>   Ring a
src/NumHask/Data/Complex.hs view
@@ -19,9 +19,9 @@ import NumHask.Algebra.Additive import NumHask.Algebra.Field import NumHask.Algebra.Lattice+import NumHask.Algebra.Metric import NumHask.Algebra.Multiplicative import NumHask.Algebra.Ring-import NumHask.Algebra.Metric import NumHask.Data.Integral import Prelude hiding   ( Num (..),
src/NumHask/Data/Rational.hs view
@@ -29,9 +29,9 @@ import NumHask.Algebra.Additive import NumHask.Algebra.Field import NumHask.Algebra.Lattice+import NumHask.Algebra.Metric import NumHask.Algebra.Multiplicative import NumHask.Algebra.Ring-import NumHask.Algebra.Metric import NumHask.Data.Integral import Prelude (Int, Integer, Ord (..), Ordering (..), Rational, (.)) import qualified Prelude as P@@ -39,7 +39,6 @@ -- $setup -- -- >>> :set -XRebindableSyntax--- >>> :set -XNegativeLiterals -- >>> import NumHask.Prelude  -- | A rational number
src/NumHask/Prelude.hs view
@@ -24,7 +24,6 @@     ifThenElse,     fromList,     fromListN,-     Natural (..),      -- * Modules you can't live without@@ -36,33 +35,31 @@     module Data.Traversable,     module Data.Semigroup,     module Data.Maybe,-   ) where +import Data.Bool+import Data.Foldable hiding (product, sum)+import Data.Kind+import Data.Maybe+import Data.Semigroup+import Data.Traversable import GHC.Exts+import GHC.Generics import GHC.Natural (Natural (..)) import NumHask.Algebra.Additive import NumHask.Algebra.Field import NumHask.Algebra.Group import NumHask.Algebra.Lattice+import NumHask.Algebra.Metric import NumHask.Algebra.Module import NumHask.Algebra.Multiplicative import NumHask.Algebra.Ring-import NumHask.Algebra.Metric import NumHask.Data.Complex import NumHask.Data.Integral import NumHask.Data.Rational import NumHask.Exception-import Prelude hiding ((*), (**), (+), (-), (/), Integral (..), (^), (^^), abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceiling, cos, cosh, even, exp, floor, fromInteger, fromIntegral, fromRational, gcd, log, logBase, negate, odd, pi, product, properFraction, recip, round, sin, sinh, sqrt, subtract, sum, tan, tanh, toInteger, toRational, truncate)--import Data.Bool-import Data.Kind-import GHC.Generics-import Data.Foldable hiding (sum, product)-import Data.Traversable-import Data.Semigroup-import Data.Maybe+import Prelude hiding (Integral (..), abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceiling, cos, cosh, even, exp, floor, fromInteger, fromIntegral, fromRational, gcd, log, logBase, negate, odd, pi, product, properFraction, recip, round, sin, sinh, sqrt, subtract, sum, tan, tanh, toInteger, toRational, truncate, (*), (**), (+), (-), (/), (^), (^^))  -- $usage --
− test/test.hs
@@ -1,20 +0,0 @@-{-# OPTIONS_GHC -Wall #-}--module Main where--import Prelude-import Test.DocTest--main :: IO ()-main =-  doctest-  [ "src/NumHask.hs",-    "src/NumHask/Prelude.hs",-    "src/NumHask/Algebra/Additive.hs",-    "src/NumHask/Algebra/Multiplicative.hs",-    "src/NumHask/Algebra/Ring.hs",-    "src/NumHask/Algebra/Field.hs",-    "src/NumHask/Algebra/Module.hs"-    -- FIXME: When doctest hits this module, it can't resolve even the simplest instances ...-    -- "src/NumHask/Data/Rational.hs"-  ]