-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from nao1215/nchika/project-setup
Add project settings
- Loading branch information
Showing
11 changed files
with
174 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: nao1215 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
ghc: ["9.8", "9.6"] | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Haskell | ||
uses: haskell-actions/setup@v2 | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
enable-stack: true | ||
stack-version: 'latest' | ||
|
||
- name: Cache Stack dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.stack | ||
key: ${{ runner.os }}-stack-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('stack.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-stack-${{ matrix.ghc }}- | ||
${{ runner.os }}-stack- | ||
- name: Install dependencies | ||
run: stack build --only-dependencies | ||
|
||
- name: Build and Test | ||
run: stack test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Changelog for `clockwork-base32` | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to the | ||
[Haskell Package Versioning Policy](https://pvp.haskell.org/). | ||
|
||
## Unreleased | ||
|
||
## 0.1.0.0 - YYYY-MM-DD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
# clockwork-base32 | ||
Clockwork-Base32 in Haskell | ||
|
||
Clockwork Base32 is a simple variant of Base32 inspired by Crockford's Base32. See [Clockwork Base32 Specification](https://gist.github.com/szktty/228f85794e4187882a77734c89c384a8). | ||
|
||
## Usage | ||
|
||
```haskell | ||
-- TODO: Write usage examples here | ||
``` | ||
|
||
## Other Implementations | ||
|
||
### Reference Implementations | ||
|
||
- C: [szktty/c-clockwork-base32](https://github.com/szktty/c-clockwork-base32) | ||
- Erlang: [shiguredo/erlang-base32](https://github.com/shiguredo/base32_clockwork) | ||
- Go: [szktty/go-clockwork-base32](https://github.com/szktty/go-clockwork-base32) | ||
- Swift: [szktty/swift-clockwork-base32](https://github.com/szktty/swift-clockwork-base32) | ||
|
||
### Third-party Implementations | ||
|
||
- C++: [wx257osn2/clockwork_base32_cxx](https://github.com/wx257osn2/clockwork_base32_cxx) | ||
- C++: [objectx/cpp-clockwork-base32](https://github.com/mganeko/js_clockwork_base32) | ||
- JavaScript: [mganeko/js_clockwork_base32](https://github.com/mganeko/js_clockwork_base32) | ||
- AssemblyScript: [mganeko/as_clockwork_base32](https://github.com/mganeko/as_clockwork_base32) | ||
- Rust: [woxtu/rust-clockwork-base32](https://github.com/woxtu/rust-clockwork-base32) | ||
- Rust: [hnakamur/rs-clockwork-base32](https://github.com/hnakamur/rs-clockwork-base32) | ||
- Go: [shogo82148/go-clockwork-base32](https://github.com/shogo82148/go-clockwork-base32) | ||
- TypeScript: [niyari/base32-ts](https://github.com/niyari/base32-ts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
cabal-version: 2.2 | ||
|
||
name: clockwork-base32 | ||
version: 0.1.0.0 | ||
-- synopsis: | ||
-- description: | ||
homepage: https://github.com/nao1215/clockwork-base32#readme | ||
license: MIT | ||
license-file: LICENSE | ||
author: Naohiro CHIKAMATSU | ||
maintainer: [email protected] | ||
copyright: 2025 Naohiro CHIKAMATSU | ||
category: Web | ||
build-type: Simple | ||
extra-source-files: README.md | ||
CHANGELOG.md | ||
|
||
library | ||
exposed-modules: ClockworkBase32 | ||
hs-source-dirs: src | ||
build-depends: base >= 4.7 && < 5, | ||
bytestring, | ||
containers | ||
default-language: Haskell2010 | ||
ghc-options: -Wall | ||
-Wcompat | ||
-Widentities | ||
-Wincomplete-record-updates | ||
-Wincomplete-uni-patterns | ||
-Wmissing-export-lists | ||
-Wmissing-home-modules | ||
-Wpartial-fields | ||
-Wredundant-constraints | ||
|
||
test-suite clockwork-base32-test | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: test | ||
main-is: Spec.hs | ||
build-depends: base >= 4.7 && < 5, | ||
hspec, | ||
clockwork-base32, | ||
bytestring | ||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module ClockworkBase32 | ||
( maxInList | ||
) where | ||
|
||
-- returns the maximum element in a list, if it exists | ||
maxInList :: (Ord a) => [a] -> Maybe a | ||
maxInList [] = Nothing | ||
maxInList xs = Just (maximum xs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
snapshot: lts-23.4 | ||
packages: | ||
- . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file was autogenerated by Stack. | ||
# You should not edit this file by hand. | ||
# For more information, please see the documentation at: | ||
# https://docs.haskellstack.org/en/stable/topics/lock_files | ||
|
||
packages: [] | ||
snapshots: | ||
- completed: | ||
sha256: 0d61fd2be255f5c425cd92dbb4a78d1f70af2c138f3ec921e98b97ae182b044c | ||
size: 679291 | ||
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/4.yaml | ||
original: lts-23.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Main (main) where | ||
|
||
import ClockworkBase32 (maxInList) | ||
import Test.Hspec | ||
|
||
|
||
main :: IO () | ||
main = hspec $ do | ||
describe "maxInList" $ do | ||
it "returns Nothing for an empty list" $ do | ||
maxInList ([] :: [Int]) `shouldBe` Nothing | ||
|
||
it "returns the maximum element for a non-empty list" $ do | ||
maxInList ([1, 2, 3] :: [Int]) `shouldBe` Just 3 |