Skip to content

Commit 0331b67

Browse files
Prepare 0.2.1.0 release.
Reformatted. Added workflows. Updated package metadata.
1 parent 41dee36 commit 0331b67

16 files changed

+946
-656
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@byteverse/l3c

.github/workflows/build.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: build
2+
on:
3+
pull_request:
4+
branches:
5+
- "*"
6+
7+
jobs:
8+
call-workflow:
9+
uses: byteverse/.github/.github/workflows/build.yaml@main
10+
secrets: inherit
11+
with:
12+
release: false

.github/workflows/release.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
7+
jobs:
8+
call-workflow:
9+
uses: byteverse/.github/.github/workflows/build.yaml@main
10+
secrets: inherit
11+
with:
12+
release: true

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.vscode/
12
dist
23
dist-*
34
cabal-dev

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Revision history for natural-arithmetic
22

3-
## 0.2.1.0 -- 2024-??-??
3+
## 0.2.1.0 -- 2024-02-02
44

55
* Add `fromInt` and `fromInt#` to `Arithmetic.Fin`.
6+
* Update package metadata.
67

78
## 0.2.0.0 -- 2024-01-09
89

Setup.hs

-2
This file was deleted.

fourmolu.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Number of spaces per indentation step
2+
indentation: 2
3+
4+
# Max line length for automatic line breaking
5+
column-limit: 200
6+
7+
# Styling of arrows in type signatures (choices: trailing, leading, or leading-args)
8+
function-arrows: trailing
9+
10+
# How to place commas in multi-line lists, records, etc. (choices: leading or trailing)
11+
comma-style: leading
12+
13+
# Styling of import/export lists (choices: leading, trailing, or diff-friendly)
14+
import-export-style: leading
15+
16+
# Whether to full-indent or half-indent 'where' bindings past the preceding body
17+
indent-wheres: false
18+
19+
# Whether to leave a space before an opening record brace
20+
record-brace-space: true
21+
22+
# Number of spaces between top-level declarations
23+
newlines-between-decls: 1
24+
25+
# How to print Haddock comments (choices: single-line, multi-line, or multi-line-compact)
26+
haddock-style: multi-line
27+
28+
# How to print module docstring
29+
haddock-style-module: null
30+
31+
# Styling of let blocks (choices: auto, inline, newline, or mixed)
32+
let-style: auto
33+
34+
# How to align the 'in' keyword with respect to the 'let' keyword (choices: left-align, right-align, or no-space)
35+
in-style: right-align
36+
37+
# Whether to put parentheses around a single constraint (choices: auto, always, or never)
38+
single-constraint-parens: always
39+
40+
# Output Unicode syntax (choices: detect, always, or never)
41+
unicode: never
42+
43+
# Give the programmer more choice on where to insert blank lines
44+
respectful: true
45+
46+
# Fixity information for operators
47+
fixities: []
48+
49+
# Module reexports Fourmolu should know about
50+
reexports: []
51+

natural-arithmetic.cabal

+33-22
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
cabal-version: 2.2
2-
name: natural-arithmetic
3-
version: 0.2.1.0
4-
synopsis: Arithmetic of natural numbers
1+
cabal-version: 2.2
2+
name: natural-arithmetic
3+
version: 0.2.1.0
4+
synopsis: Arithmetic of natural numbers
55
description:
66
A search for terms like `arithmetic` and `natural` on hackage reveals
77
no shortage of libraries for handling the arithmetic of natural
@@ -18,7 +18,7 @@ description:
1818
application code, not in library code. This is because libraries
1919
should not require the presence of typechecker plugins. Technically,
2020
they can (you could document it), but many developers will not
21-
use libraries that have unusual install procedures like this.
21+
use libraries that have unusual install procedures like this.
2222
.
2323
This library, in places, requires users to use the 'TypeApplications`
2424
language extension. This is done when a number is only need at
@@ -28,7 +28,7 @@ description:
2828
in `Arithmetic.Lt` and `Arithmetic.Lte`. This is done in the interest
2929
of making it easy for user to assemble proofs. Recall that proof
3030
assembly is done by hand rather than by an SMT solver, so removing
31-
some tediousness from this is helpful to users.
31+
some tediousness from this is helpful to users.
3232
.
3333
This library provides left and variants variants of several functions.
3434
For example, `Arithmetic.Lte` provides both `substituteL` and
@@ -54,29 +54,40 @@ description:
5454
* Decrement: Decrease an upper bound along with the bounded value
5555
.
5656
* Substitute: Replace a number with an equal number
57-
homepage: https://github.com/andrewthad/natural-arithmetic
58-
bug-reports: https://github.com/andrewthad/natural-arithmetic/issues
59-
license: BSD-3-Clause
60-
license-file: LICENSE
61-
author: Andrew Martin
62-
maintainer: andrew.thaddeus@gmail.com
63-
copyright: 2019 Andrew Martin
64-
category: Math
65-
extra-source-files: CHANGELOG.md
57+
58+
homepage: https://github.com/byteverse/natural-arithmetic
59+
bug-reports: https://github.com/byteverse/natural-arithmetic/issues
60+
license: BSD-3-Clause
61+
license-file: LICENSE
62+
author: Andrew Martin
63+
maintainer: amartin@layer3com.com
64+
copyright: 2019 Andrew Martin
65+
category: Math
66+
extra-doc-files: CHANGELOG.md
67+
68+
common build-settings
69+
default-language: Haskell2010
70+
ghc-options: -Wall -Wunused-packages
6671

6772
library
73+
import: build-settings
6874
exposed-modules:
69-
Arithmetic.Fin
7075
Arithmetic.Equal
76+
Arithmetic.Fin
7177
Arithmetic.Lt
7278
Arithmetic.Lte
7379
Arithmetic.Nat
80+
Arithmetic.Plus
7481
Arithmetic.Types
7582
Arithmetic.Unsafe
76-
Arithmetic.Plus
83+
7784
build-depends:
78-
, base>=4.14 && <5
79-
, unlifted >=0.2.1
80-
hs-source-dirs: src
81-
default-language: Haskell2010
82-
ghc-options: -Wall -O2
85+
, base >=4.14 && <5
86+
, unlifted >=0.2.1
87+
88+
hs-source-dirs: src
89+
ghc-options: -O2
90+
91+
source-repository head
92+
type: git
93+
location: git://github.com/byteverse/natural-arithmetic.git

src/Arithmetic/Equal.hs

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{-# language DataKinds #-}
2-
{-# language ExplicitForAll #-}
3-
{-# language KindSignatures #-}
4-
{-# language MagicHash #-}
5-
{-# language TypeOperators #-}
6-
{-# language UnboxedTuples #-}
1+
{-# LANGUAGE DataKinds #-}
2+
{-# LANGUAGE ExplicitForAll #-}
3+
{-# LANGUAGE KindSignatures #-}
4+
{-# LANGUAGE MagicHash #-}
5+
{-# LANGUAGE TypeOperators #-}
6+
{-# LANGUAGE UnboxedTuples #-}
77

88
module Arithmetic.Equal
99
( symmetric
@@ -14,29 +14,29 @@ module Arithmetic.Equal
1414
, lift
1515
) where
1616

17-
import Arithmetic.Unsafe (type (:=:)(Eq), type (:=:#)(Eq#))
17+
import Arithmetic.Unsafe (type (:=:) (Eq), type (:=:#) (Eq#))
1818
import GHC.TypeNats (type (+))
1919

2020
symmetric :: (m :=: n) -> (n :=: m)
21-
{-# inline symmetric #-}
21+
{-# INLINE symmetric #-}
2222
symmetric Eq = Eq
2323

2424
plusL :: forall c m n. (m :=: n) -> (c + m :=: c + n)
25-
{-# inline plusL #-}
25+
{-# INLINE plusL #-}
2626
plusL Eq = Eq
2727

2828
plusR :: forall c m n. (m :=: n) -> (m + c :=: n + c)
29-
{-# inline plusR #-}
29+
{-# INLINE plusR #-}
3030
plusR Eq = Eq
3131

3232
plusL# :: forall c m n. (m :=:# n) -> (c + m :=:# c + n)
33-
{-# inline plusL# #-}
33+
{-# INLINE plusL# #-}
3434
plusL# _ = Eq# (# #)
3535

3636
plusR# :: forall c m n. (m :=:# n) -> (m + c :=:# n + c)
37-
{-# inline plusR# #-}
37+
{-# INLINE plusR# #-}
3838
plusR# _ = Eq# (# #)
3939

4040
lift :: (m :=:# n) -> (m :=: n)
41-
{-# inline lift #-}
41+
{-# INLINE lift #-}
4242
lift _ = Eq

0 commit comments

Comments
 (0)