Skip to content

Commit

Permalink
Merge pull request #40 from expipiplus1/squash
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 authored Dec 13, 2021
2 parents f201e3e + 8031e14 commit c4308ef
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
os: [ubuntu-latest]
cabal: [latest]
ghc: ['8.6', '8.8', '8.10', '9.0']
ghc: ['8.8', '8.10', '9.0', '9.2']
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 Joe Hermaszewski
Copyright (c) 2015 Ellie Hermaszewska

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## WIP

## [0.12.5.1] - 2021-12-13
- Correct author name
- Squash warnings for newer GHCs

## [0.12.5] - 2021-05-29
- Tweak test suite to fix #35

Expand Down
12 changes: 4 additions & 8 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{ nixpkgsSrc ? builtins.fetchTarball {
url =
"https://github.com/NixOS/nixpkgs/archive/540dccb2aeaffa9dc69bfdc41c55abd7ccc6baa3.tar.gz"; # nixos-unstable
sha256 = "1j58m811w7xxjncf36hqcjqsfj979hkfcwx9wcrm3g3zbayavapg";
}, pkgs ? import nixpkgsSrc { }, compiler ? null, extraOverrides ? _: _: { }
, modifier ? x: x }:
"https://github.com/NixOS/nixpkgs/archive/e675946ecde5606c505540de2024e2732bae4185.tar.gz"; # nixos-unstable
sha256 = "1xnqhz0wxkgkwpwkal93k5rj72j39pvck542i9jyxh9bm25rc4j5";
}, pkgs ? import nixpkgsSrc { }, compiler ? null }:

let
haskellPackages = if compiler == null then
Expand All @@ -14,8 +13,5 @@ let
in haskellPackages.developPackage {
name = "";
root = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
overrides = with pkgs.haskell.lib;
pkgs.lib.composeExtensions (_self: _super: { }) extraOverrides;
inherit modifier;
overrides = _self: _super: { };
}

10 changes: 5 additions & 5 deletions exact-real.cabal
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
cabal-version: 1.24

-- This file has been generated from package.yaml by hpack version 0.34.4.
-- This file has been generated from package.yaml by hpack version 0.34.5.
--
-- see: https://github.com/sol/hpack

name: exact-real
version: 0.12.5
version: 0.12.5.1
synopsis: Exact real arithmetic
description: A type to represent exact real numbers using fast binary Cauchy sequences.
category: Math
homepage: https://github.com/expipiplus1/exact-real#readme
bug-reports: https://github.com/expipiplus1/exact-real/issues
author: Joe Hermaszewski
maintainer: Joe Hermaszewski <[email protected]>
copyright: 2020 Joe Hermaszewski
author: Ellie Hermaszewska
maintainer: Ellie Hermaszewska <[email protected]>
copyright: 2020 Ellie Hermaszewska
license: MIT
license-file: LICENSE
build-type: Custom
Expand Down
8 changes: 4 additions & 4 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: exact-real
version: "0.12.5"
version: "0.12.5.1"
synopsis: Exact real arithmetic
description: A type to represent exact real numbers using fast binary Cauchy sequences.
category: Math
author: Joe Hermaszewski
maintainer: Joe Hermaszewski <[email protected]>
copyright: 2020 Joe Hermaszewski
author: Ellie Hermaszewska
maintainer: Ellie Hermaszewska <[email protected]>
copyright: 2020 Ellie Hermaszewska
github: expipiplus1/exact-real
extra-source-files:
- readme.md
Expand Down
16 changes: 12 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ examples in this readme.
0 :+ 0
```

Or:

```haskell
λ> let f :: a. Fractional a => (a, a); f = iterate (\(x0, x1) -> let x2 = 111 - (1130-3000/x0) / x1 in (x1, x2)) (11/2, 61/11) !! 100
λ> f @Double
(100.0,100.0)
λ> f @(CReal 10)
(6.0000,6.0000)
λ> f @(CReal 50)
(5.9999999879253263,5.9999999899377725)
```

Implementation
--------------

Expand Down Expand Up @@ -73,8 +85,4 @@ Contributing

Contributions and bug reports are welcome!

Please feel free to contact me on GitHub or as "jophish" on freenode.

-Joe

[goldberg]: http://www.validlab.com/goldberg/paper.pdf "What Every Computer Scientist Should Know About Floating-Point Arithmetic"
2 changes: 1 addition & 1 deletion src/Data/CReal/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ powerSeries q termsAtPrecision x = crMemoize
p' = p + d
p'' = p' + d
m = atPrecision x p''
xs = (%1) <$> iterate (\e -> m * e /^ p'') (bit p')
xs = (% 1) <$> iterate (\e -> m * e /^ p'') (bit p')
r = sum . take (t + 1) . fmap (round . (* fromInteger (bit d))) $ zipWith (*) q xs
in r /^ (2 * d))

7 changes: 0 additions & 7 deletions stack-7.10.2.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions stack-7.10.2.yaml.lock

This file was deleted.

6 changes: 0 additions & 6 deletions stack-7.10.3.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions stack-7.10.3.yaml.lock

This file was deleted.

5 changes: 0 additions & 5 deletions stack-8.2.2.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions stack-8.2.2.yaml.lock

This file was deleted.

5 changes: 0 additions & 5 deletions stack-8.4.4.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions stack-8.4.4.yaml.lock

This file was deleted.

5 changes: 0 additions & 5 deletions stack-8.6.5.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions stack-8.6.5.yaml.lock

This file was deleted.

1 change: 0 additions & 1 deletion test/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Data.List (inits)
import Data.Maybe (fromJust)
import Data.Proxy
import Data.Ratio ((%))
import Data.Semigroup
import GHC.TypeNats
import Numeric.Natural
import Test.Tasty (TestTree, defaultMain, testGroup)
Expand Down
2 changes: 1 addition & 1 deletion test/Test/QuickCheck/Classes/Extra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Test.QuickCheck.Classes.Extra
) where

import Data.Group (invert, Group, Abelian)
import Data.Monoid ((<>), Sum(..), Product)
import Data.Monoid (Sum(..), Product)
import Test.QuickCheck.Extra (Arbitrary, (<=>), (==>))
import Test.QuickCheck.Modifiers (NonZero)
import Test.QuickCheck.Checkers (commutes, transitive, EqProp, (=-=), BinRel)
Expand Down
1 change: 0 additions & 1 deletion test/Test/QuickCheck/Extra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module Test.QuickCheck.Extra

import Test.QuickCheck
import Test.QuickCheck.Checkers (EqProp)
import Test.QuickCheck.Modifiers (NonZero(..), Positive(..))
import System.Random (Random)

deriving instance Num a => Num (NonZero a)
Expand Down

0 comments on commit c4308ef

Please sign in to comment.