Skip to content

Commit

Permalink
Add license and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklimmm committed Apr 23, 2024
1 parent 321312c commit 0bc1dbb
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Nicky Lim

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
[![Package Version](https://img.shields.io/hexpm/v/priorityq)](https://hex.pm/packages/priorityq)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/priorityq/)

A priority queue implementation based on max pairing heaps. Written in pure Gleam.

## Installation

Add `priorityq` to your Gleam project

```sh
gleam add priorityq
```

## Usage

```gleam
import gleam/int
import priorityq
pub fn main() {
// TODO: An example of the project in use
new(int.compare) |> priorityq.is_empty() // -> True
let pq = priorityq.from_list([1, 5], int.compare)
pq |> priorityq.push(10) |> priorityq.peek() // -> 10
pq |> priorityq.pop() |> priorityq.size() // -> 1
}
```

Expand All @@ -19,7 +33,5 @@ Further documentation can be found at <https://hexdocs.pm/priorityq>.
## Development

```sh
gleam run # Run the project
gleam test # Run the tests
gleam shell # Run an Erlang shell
```
8 changes: 4 additions & 4 deletions gleam.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name = "priorityq"
version = "1.0.0"
version = "0.1.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "username", repo = "project" }
description = "A priority queue implementation based on max pairing heaps. Written in pure Gleam."
licences = ["MIT"]
repository = { type = "github", user = "nicklimmm", repo = "priorityq" }
# links = [{ title = "Website", href = "https://gleam.run" }]
#
# For a full reference of all the available options, you can have a look at
Expand Down

0 comments on commit 0bc1dbb

Please sign in to comment.