Skip to content

Commit bbcd6f3

Browse files
Prepare 0.1.1.1 release
Reformatted. Added workflows. Updated package metadata.
1 parent 1e57777 commit bbcd6f3

File tree

13 files changed

+365
-234
lines changed

13 files changed

+365
-234
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@byteverse/l3c

.github/workflows/build.yaml

Lines changed: 12 additions & 0 deletions
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

Lines changed: 12 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.vscode/
12
dist
23
dist-*
34
cabal-dev

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Revision history for base64-bytes
22

3+
## 0.1.1.1 -- 2024-02-01
4+
5+
* Update package metadata.
6+
37
## 0.1.1.0 -- 2022-12-07
48

59
* Support GHC 9.2

Main.hs

Lines changed: 0 additions & 4 deletions
This file was deleted.

Setup.hs

Lines changed: 0 additions & 2 deletions
This file was deleted.

base64-bytes.cabal

Lines changed: 47 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,71 @@
1-
cabal-version: 2.2
2-
name: base64-bytes
3-
version: 0.1.1.0
4-
synopsis: Base64 encoding of byte sequences
5-
homepage: https://github.com/andrewthad/base64-bytes
6-
bug-reports: https://github.com/andrewthad/base64-bytes/issues
7-
license: BSD-3-Clause
8-
license-file: LICENSE
9-
author: Andrew Martin
10-
maintainer: [email protected]
11-
copyright: 2019 Andrew Martin
12-
category: Data
13-
build-type: Simple
14-
extra-source-files: CHANGELOG.md
1+
cabal-version: 2.2
2+
name: base64-bytes
3+
version: 0.1.1.1
4+
synopsis: Base64 encoding of byte sequences
5+
description: Base64 encoding of byte sequences.
6+
homepage: https://github.com/byteverse/base64-bytes
7+
bug-reports: https://github.com/byteverse/base64-bytes/issues
8+
license: BSD-3-Clause
9+
license-file: LICENSE
10+
author: Andrew Martin
11+
maintainer: [email protected]
12+
copyright: 2019 Andrew Martin
13+
category: Data
14+
build-type: Simple
15+
extra-doc-files: CHANGELOG.md
1516

1617
library
1718
exposed-modules:
1819
Data.Bytes.Base64
1920
Data.Bytes.Base64.Url
21+
2022
build-depends:
21-
, base >=4.12 && <5
22-
, primitive >=0.7 && <0.10
23-
, byte-order >=0.1.1 && <0.2
24-
, byteslice >=0.1.4 && <0.3
25-
, run-st >=0.1 && <0.2
26-
, bytebuild >=0.3.4 && <0.4
27-
, natural-arithmetic >=0.1.1 && <0.2
28-
, word-compat >=0.0.4
29-
hs-source-dirs: src
23+
, base >=4.12 && <5
24+
, byte-order >=0.1.1 && <0.2
25+
, bytebuild >=0.3.4 && <0.4
26+
, byteslice >=0.1.4 && <0.3
27+
, natural-arithmetic >=0.1.1 && <0.2
28+
, primitive >=0.7 && <0.10
29+
, run-st >=0.1 && <0.2
30+
, word-compat >=0.0.4 && <0.1
31+
32+
hs-source-dirs: src
3033
default-language: Haskell2010
31-
ghc-options: -Wall -O2
34+
ghc-options: -Wall -O2
3235

3336
test-suite test
34-
Default-Language: Haskell2010
35-
hs-source-dirs: test
36-
main-is: Main.hs
37-
type: exitcode-stdio-1.0
37+
default-language: Haskell2010
38+
hs-source-dirs: test
39+
main-is: Main.hs
40+
type: exitcode-stdio-1.0
3841
build-depends:
3942
, base
4043
, base64-bytes
41-
, natural-arithmetic >=0.1.1
4244
, bytebuild
45+
, byteslice >=0.1.4.0
46+
, natural-arithmetic >=0.1.1
4347
, primitive
44-
, byteslice >=0.1.4.0
45-
ghc-options: -O2 -Wall
48+
49+
ghc-options: -O2 -Wall
4650

4751
benchmark bench
48-
type: exitcode-stdio-1.0
52+
type: exitcode-stdio-1.0
4953
build-depends:
5054
, base
55+
, base64 >=0.3
5156
, base64-bytes
57+
, base64-bytestring
5258
, byteslice
5359
, bytestring
5460
, gauge
5561
, primitive
56-
, base64-bytestring
57-
, base64 >=0.3
58-
, random >=1.1
59-
ghc-options: -Wall -O2
62+
, random >=1.1
63+
64+
ghc-options: -Wall -O2
6065
default-language: Haskell2010
61-
hs-source-dirs: bench
62-
main-is: Main.hs
66+
hs-source-dirs: bench
67+
main-is: Main.hs
68+
69+
source-repository head
70+
type: git
71+
location: git://github.com/byteverse/base64-bytes.git

bench/Main.hs

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,67 @@
1-
{-# LANGUAGE BangPatterns #-}
21
{-# LANGUAGE BlockArguments #-}
32
{-# LANGUAGE MagicHash #-}
4-
{-# LANGUAGE TypeApplications #-}
53
{-# LANGUAGE PackageImports #-}
64

75
import Control.Monad.ST (runST)
8-
import System.Random (mkStdGen,randoms)
9-
import Data.Primitive (ByteArray(ByteArray),unsafeFreezeByteArray)
10-
import Data.Primitive (copyByteArray,newPinnedByteArray)
11-
import Gauge.Main (defaultMain,bgroup,bench,whnf)
12-
import Data.ByteString.Internal (ByteString(PS))
6+
import Data.ByteString.Internal (ByteString (PS))
7+
import Data.Primitive (ByteArray (ByteArray), copyByteArray, newPinnedByteArray, unsafeFreezeByteArray)
8+
import Gauge.Main (bench, bgroup, defaultMain, whnf)
9+
import System.Random (mkStdGen, randoms)
1310

1411
import qualified Data.Bytes as Bytes
1512
import qualified Data.Bytes.Base64 as Base64
1613
import qualified Data.List as List
1714
import qualified GHC.Exts as Exts
1815
import qualified GHC.ForeignPtr as Exts
1916

20-
import qualified "base64-bytestring" Data.ByteString.Base64 as BS
2117
import qualified "base64" Data.ByteString.Base64 as B64
18+
import qualified "base64-bytestring" Data.ByteString.Base64 as BS
2219

2320
main :: IO ()
24-
main = defaultMain
25-
[ bgroup "encode"
26-
[ bgroup "base64-bytes"
27-
[ bench "100" $
28-
whnf (\x -> Base64.encode (Bytes.fromByteArray x)) str100
29-
, bench "1000" $
30-
whnf (\x -> Base64.encode (Bytes.fromByteArray x)) str1000
31-
, bench "10000" $
32-
whnf (\x -> Base64.encode (Bytes.fromByteArray x)) str10000
33-
]
34-
, bgroup "base64-bytestring"
35-
[ bench "100" $
36-
whnf (\x -> BS.encode (byteArrayToByteString 100 x)) str100
37-
, bench "1000" $
38-
whnf (\x -> BS.encode (byteArrayToByteString 1000 x)) str1000
39-
, bench "10000" $
40-
whnf (\x -> BS.encode (byteArrayToByteString 10000 x)) str10000
41-
]
42-
, bgroup "base64"
43-
[ bench "100" $
44-
whnf (\x -> B64.encodeBase64' (byteArrayToByteString 100 x)) str100
45-
, bench "1000" $
46-
whnf (\x -> B64.encodeBase64' (byteArrayToByteString 1000 x)) str1000
47-
, bench "10000" $
48-
whnf (\x -> B64.encodeBase64' (byteArrayToByteString 10000 x)) str10000
49-
]
21+
main =
22+
defaultMain
23+
[ bgroup
24+
"encode"
25+
[ bgroup
26+
"base64-bytes"
27+
[ bench "100" $
28+
whnf (\x -> Base64.encode (Bytes.fromByteArray x)) str100
29+
, bench "1000" $
30+
whnf (\x -> Base64.encode (Bytes.fromByteArray x)) str1000
31+
, bench "10000" $
32+
whnf (\x -> Base64.encode (Bytes.fromByteArray x)) str10000
33+
]
34+
, bgroup
35+
"base64-bytestring"
36+
[ bench "100" $
37+
whnf (\x -> BS.encode (byteArrayToByteString 100 x)) str100
38+
, bench "1000" $
39+
whnf (\x -> BS.encode (byteArrayToByteString 1000 x)) str1000
40+
, bench "10000" $
41+
whnf (\x -> BS.encode (byteArrayToByteString 10000 x)) str10000
42+
]
43+
, bgroup
44+
"base64"
45+
[ bench "100" $
46+
whnf (\x -> B64.encodeBase64' (byteArrayToByteString 100 x)) str100
47+
, bench "1000" $
48+
whnf (\x -> B64.encodeBase64' (byteArrayToByteString 1000 x)) str1000
49+
, bench "10000" $
50+
whnf (\x -> B64.encodeBase64' (byteArrayToByteString 10000 x)) str10000
51+
]
52+
]
5053
]
51-
]
5254

5355
byteArrayToByteString :: Int -> ByteArray -> ByteString
54-
{-# inline byteArrayToByteString #-}
55-
byteArrayToByteString len (ByteArray x) = PS
56-
( Exts.ForeignPtr
57-
(Exts.byteArrayContents# x)
58-
(Exts.PlainPtr (Exts.unsafeCoerce# x))
59-
) 0 len
56+
{-# INLINE byteArrayToByteString #-}
57+
byteArrayToByteString len (ByteArray x) =
58+
PS
59+
( Exts.ForeignPtr
60+
(Exts.byteArrayContents# x)
61+
(Exts.PlainPtr (Exts.unsafeCoerce# x))
62+
)
63+
0
64+
len
6065

6166
str100 :: ByteArray
6267
{-# NOINLINE str100 #-}

fourmolu.yaml

Lines changed: 51 additions & 0 deletions
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+

0 commit comments

Comments
 (0)