Skip to content

Commit b9b8140

Browse files
Prepare 0.3.11.1 release.
Use new .github workflows. Reformatted. Removed unused imports. Updated package metadata.
1 parent e447c5e commit b9b8140

22 files changed

+1789
-1507
lines changed

.github/CODEOWNERS

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

.github/workflows/build.yaml

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

.github/workflows/haskell-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22
on:
33
push:
44
branches:
5-
- master
5+
- main
66
pull_request:
77
types:
88
- opened

.github/workflows/release.yaml

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

.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

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Revision history for bytesmith
22

3+
## 0.3.11.1 -- 2024-02-13
4+
5+
* Update package metadata.
6+
37
## 0.3.11.0 -- 2024-01-05
48

59
* Add `Data.Bytes.Parser.Latin.hexWord32`.

Setup.hs

-2
This file was deleted.

bench/Main.hs

+14-10
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,28 @@
44
import Data.Char (ord)
55
import Data.Primitive (ByteArray)
66
import Data.Word (Word8)
7-
import Gauge.Main (defaultMain,bench,whnf)
7+
import Gauge.Main (bench, defaultMain, whnf)
88

99
import qualified Data.Bytes.Parser as P
1010
import qualified Data.Bytes.Parser.Latin as Latin
1111
import qualified GHC.Exts as Exts
1212

1313
main :: IO ()
14-
main = defaultMain
15-
[ bench "decPositiveInteger" $ whnf
16-
(\x -> P.parseByteArray (Latin.decUnsignedInteger ()) x)
17-
encodedBigNumber
18-
]
14+
main =
15+
defaultMain
16+
[ bench "decPositiveInteger" $
17+
whnf
18+
(\x -> P.parseByteArray (Latin.decUnsignedInteger ()) x)
19+
encodedBigNumber
20+
]
1921

2022
encodedBigNumber :: ByteArray
21-
encodedBigNumber = stringToByteArray $ show $ id @Integer $
22-
246246357264327645234627753190240202405243024304504230544
23-
*
24-
732345623640035232405249305932503920593209520932095234651
23+
encodedBigNumber =
24+
stringToByteArray $
25+
show $
26+
id @Integer $
27+
246246357264327645234627753190240202405243024304504230544
28+
* 732345623640035232405249305932503920593209520932095234651
2529

2630
stringToByteArray :: String -> ByteArray
2731
stringToByteArray =

bytesmith.cabal

+53-43
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,89 @@
1-
cabal-version: 2.2
2-
name: bytesmith
3-
version: 0.3.11.0
4-
synopsis: Nonresumable byte parser
1+
cabal-version: 2.2
2+
name: bytesmith
3+
version: 0.3.11.1
4+
synopsis: Nonresumable byte parser
55
description:
66
Parse bytes as fast as possible. This is a nonresumable parser
77
that aggresively uses `UnboxedSums` to avoid performing any
88
allocations.
9-
homepage: https://github.com/andrewthad/bytesmith
10-
bug-reports: https://github.com/andrewthad/bytesmith/issues
11-
license: BSD-3-Clause
12-
license-file: LICENSE
13-
author: Andrew Martin
14-
maintainer: andrew.thaddeus@gmail.com
15-
copyright: 2019 Andrew Martin
16-
category: Data
17-
extra-source-files: CHANGELOG.md
18-
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.5 || == 9.4.3
9+
10+
homepage: https://github.com/byteverse/bytesmith
11+
bug-reports: https://github.com/byteverse/bytesmith/issues
12+
license: BSD-3-Clause
13+
license-file: LICENSE
14+
author: Andrew Martin
15+
maintainer: amartin@layer3com.com
16+
copyright: 2019 Andrew Martin
17+
category: Data
18+
extra-doc-files: CHANGELOG.md
19+
tested-with: GHC ==9.4.8 || ==9.6.3 || ==9.8.1
20+
21+
common build-settings
22+
default-language: Haskell2010
23+
ghc-options: -Wall -Wunused-packages
1924

2025
library
26+
import: build-settings
2127
exposed-modules:
2228
Data.Bytes.Parser
23-
Data.Bytes.Parser.BigEndian
24-
Data.Bytes.Parser.LittleEndian
2529
Data.Bytes.Parser.Ascii
2630
Data.Bytes.Parser.Base128
31+
Data.Bytes.Parser.BigEndian
2732
Data.Bytes.Parser.Latin
2833
Data.Bytes.Parser.Leb128
34+
Data.Bytes.Parser.LittleEndian
2935
Data.Bytes.Parser.Rebindable
3036
Data.Bytes.Parser.Unsafe
3137
Data.Bytes.Parser.Utf8
38+
3239
other-modules:
3340
Data.Bytes.Parser.Internal
3441
Data.Bytes.Parser.Types
42+
3543
build-depends:
36-
, base >=4.12 && <5
37-
, byteslice >=0.2.6 && <0.3
38-
, bytestring >=0.10.8 && <0.13
39-
, contiguous >= 0.6 && < 0.7
40-
, natural-arithmetic >=0.1.3
41-
, primitive >=0.7 && <0.10
42-
, run-st >=0.1 && <0.2
43-
, text-short >=0.1.3 && <0.2
44-
, wide-word >=0.1.0.9 && <0.2
45-
hs-source-dirs: src
46-
ghc-options: -O2 -Wall
47-
default-language: Haskell2010
44+
, base >=4.12 && <5
45+
, byteslice >=0.2.6 && <0.3
46+
, bytestring >=0.10.8 && <0.13
47+
, contiguous >=0.6 && <0.7
48+
, natural-arithmetic >=0.1.3
49+
, primitive >=0.7 && <0.10
50+
, run-st >=0.1 && <0.2
51+
, text-short >=0.1.3 && <0.2
52+
, wide-word >=0.1.0.9 && <0.2
53+
54+
hs-source-dirs: src
55+
ghc-options: -O2
4856

4957
test-suite test
50-
default-language: Haskell2010
51-
type: exitcode-stdio-1.0
58+
import: build-settings
59+
type: exitcode-stdio-1.0
5260
hs-source-dirs: test
53-
main-is: Main.hs
54-
ghc-options: -Wall -O2
61+
main-is: Main.hs
5562
build-depends:
56-
, base >=4.12.0.0 && <5
63+
, base >=4.12.0.0 && <5
64+
, byte-order
65+
, byteslice
5766
, bytesmith
5867
, primitive
59-
, byteslice
60-
, tasty-hunit
6168
, tasty
69+
, tasty-hunit
6270
, tasty-quickcheck
63-
, byte-order
6471
, text-short
6572
, wide-word
6673

6774
benchmark bench
68-
type: exitcode-stdio-1.0
75+
import: build-settings
76+
type: exitcode-stdio-1.0
6977
build-depends:
7078
, base
71-
, byteslice
72-
, bytestring
79+
, bytesmith
7380
, gauge
7481
, primitive
75-
, bytesmith
76-
ghc-options: -Wall -O2
77-
default-language: Haskell2010
82+
83+
ghc-options: -O2
7884
hs-source-dirs: bench
79-
main-is: Main.hs
85+
main-is: Main.hs
86+
87+
source-repository head
88+
type: git
89+
location: git://github.com/byteverse/bytesmith.git

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+

src/Data/Bytes/Parser.hs

-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
{-# language BangPatterns #-}
22
{-# language BinaryLiterals #-}
33
{-# language DataKinds #-}
4-
{-# language DeriveFunctor #-}
54
{-# language DerivingStrategies #-}
65
{-# language GADTSyntax #-}
7-
{-# language KindSignatures #-}
86
{-# language LambdaCase #-}
97
{-# language MagicHash #-}
108
{-# language MultiWayIf #-}
119
{-# language PolyKinds #-}
1210
{-# language RankNTypes #-}
1311
{-# language ScopedTypeVariables #-}
14-
{-# language StandaloneDeriving #-}
1512
{-# language TypeApplications #-}
16-
{-# language UnboxedSums #-}
1713
{-# language UnboxedTuples #-}
1814
{-# language CPP #-}
1915

0 commit comments

Comments
 (0)