homepage: https://github.com/b123400/sortee#readme
changelog-type: markdown
hash: bc0dfae5faf838e4c71e5406a93a27c79699688b66cfab75f25be39a6ad7fe04
test-bench-deps:
  sortee: -any
  base: ! '>=4.7 && <5'
  hspec: ! '>=2.0.0'
  HUnit: -any
  QuickCheck: ! '>=2.10.1 && <3.0'
maintainer: i@b123400.net
synopsis: Generate string for sort key
changelog: |
  # Changelog for sortee

  ## Unreleased changes
basic-deps:
  base: ! '>=4.7 && <5'
all-versions:
- 0.1.0.0
author: b123400
latest: 0.1.0.0
description-type: markdown
description: |
  # Sortee

  A library for creating sort key, inspired by Jira's Lexorank.

  [![Build Status](https://travis-ci.org/b123400/Sortee.svg?branch=master)](https://travis-ci.org/b123400/Sortee)

  ## Motivation

  To represent an ordered list in database, the simplest way is to assign an integer to each row. The problem though is, reordering requires updating multiple rows. Sorting by string can overcome this problem, Sortee provides a function that generates strings for sorting.

  ## Usage

  Let's say you have 3 rows, with "a" "c" "t" as sort key. To move "t" to the middle of the list, you can get the new sort key by:

  ```haskell
  between "a" "c" -- "b"
  ```

  If you do not have a lower / upper reference, pass `Nothing`:

  ```haskell
  between Nothing "9" -- "4"
  between "q" Nothing -- "v"
  ```

  When there is no "space" between keys, Sortee increases the length of the string.

  ```haskell
  between "h" "i" == Sortee "hU"
  between Nothing "1" == Sortee "0U"
  ```

  ### Limitations

  Not every possible input is valid.

  ```haskell
  between Nothing "0" -- Nothing
  between "b" "b" -- Nothing
  between "b" "b0" -- Nothing
  ```
license-name: GPL-3.0-only

Update from Hackage at 2019-07-09T08:06:37Z
Update from Hackage at 2019-07-09T08:06:37Z
