GitXplorerGitXplorer
a

haskell-non-empty-text

public
4 stars
0 forks
1 issues

Commits

List of commits on branch master.
Verified
df776c464f0e3f0b881fdf8c530b5fc850358e40

Merge pull request #4 from telser/telser/nfdata-instance

aacatton committed 3 years ago
Unverified
46fec046ec67bb715c720b404366c4dfe45cb94c

Adds cabal file to repo since stack deprecated support for repos without one

ttelser committed 4 years ago
Unverified
704e685596c42c3d86810cd4d7599415e158753d

Add NFData instance for NonEmptyText

ttelser committed 4 years ago
Verified
7fff689c60c59af4518c47c0e970612f988e648d

Merge pull request #2 from malob/patch-1

aacatton committed 4 years ago
Verified
beb40794606f03b73e615d15de36ba64bb3c840b

Merge pull request #3 from malob/patch-2

aacatton committed 4 years ago
Verified
c6f348382d9d3218fdec1a90ed475548a2d464be

Add map function

mmalob committed 5 years ago

README

The README file for this repository.

Non Empty Text

Typesafe thin wrapper around Data.Text to make impossible to be empty (to always hold at least on character)

Roadmap

Done

  • Typesafe wrapper around Text
  • Data.TextData.NonEmptyText back and forth conversion.
  • Basic functions: (un)cons, head, tail, last, length
  • Text equivalent of null -> isSingleton.

To do

  • Item class instance
  • Transformations (most importantly map, intercalate, reverse)
  • Case conversions
  • Justification
  • Folds (especially, total fold1 functions)
  • Scans
  • Substrings

For now all of this can be done by calling toText, however the Text type doesn't ensure that all of this functions return NonEmptyText.

Another solution is to use fromText . <function> . toText, but this forces the programmer to handle the Nothing case, which is for many of these functions unnecessary.

FAQ

Why not text1?

text1 basically does the same thing than this package, and even more. It's also a great package.

However text1 has a lot of dependencies, and use an alternative homebrewed prelude.

non-empty-text is aiming towards a minimal, thin wrapper. The goal is to do the same thing as the text, with only text and base as dependencies, no extension.