Skip to content

414owen/neononempty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeoNonEmpty

GHC version badge CI status badge Hackage version badge license

Like NonEmpty, but with a few changes:

  • Show and Read instance similar to that of normal lists
  • 100% safe API
  • A few added/removed/changed functions (see Data.List.NeoNonEmpty's module docs)
  • API isn't tied to version of GHC/base

The show instance is the original raison d'être. When scanning textual data, the brain can interpret uniformity more quickly. Which do you think is easier to scan?

> x :| [y, z]
> [x, y, z]

Now imagine this in various fields of a large compound structure, and you have two of them, and you're trying to find the difference.

>>> :set -XOverloadedLists
>>> aNonEmpty [1, 2, 3]
[1,2,3]
>>> read "[1, 2, 3]" :: NonEmpty Int
[1,2,3]

About

NonEmpty Haskell list type reborn out-of-tree

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published