rio: A standard library for Haskell

[ control, library, mit ] [ Propose Tags ]

Work in progress library, see README at https://github.com/commercialhaskell/stack/tree/rio/subs/rio#readme


[Skip to Readme]
Versions [faq] 0.0.0.0, 0.0.1.0, 0.0.2.0, 0.0.3.0, 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.4.0, 0.1.5.0, 0.1.6.0, 0.1.7.0, 0.1.8.0, 0.1.9.0, 0.1.9.1, 0.1.9.2, 0.1.10.0, 0.1.11.0, 0.1.12.0, 0.1.13.0, 0.1.14.0 (info)
Change log ChangeLog.md
Dependencies base (<10), bytestring, containers, deepseq, directory, exceptions, filepath, hashable, microlens, mtl, text, time, typed-process (>=0.2.1.0), unix, unliftio (>=0.2.4.0), unordered-containers, vector, Win32 [details]
License MIT
Author Michael Snoyman
Maintainer michael@snoyman.com
Category Control
Uploaded by MichaelSnoyman at Sun Jan 7 20:16:22 UTC 2018
Distributions Arch:0.1.14.0, Debian:0.1.5.0, Fedora:0.1.4.0, LTSHaskell:0.1.8.0, NixOS:0.1.13.0, Stackage:0.1.9.2, openSUSE:0.1.12.0
Downloads 9217 total (1109 in the last 30 days)
Rating 1.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-01-07 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for rio-0.0.0.0

[back to package description]

The rio library

A standard library for Haskell

Rio

NOTE This code is currently in prerelease status, and has been released as a tech preview. A number of us are actively working on improving the project and getting it to a useful first release. For more information, see the description of goals and the issue tracker for discussions. If you're reading this file anywhere but Github, you should probably read the Github version instead, which will be more up to date.

The goal of the rio library is to help you jump start your Haskell coding. It is intended as a cross between:

  • Collection of well designed, trusted libraries
  • Useful Prelude replacement
  • A set of best practices for writing production quality Haskell code

You're free to use any subset of functionality desired in your project. This README will guide you through using rio to its fullest extent.

Standard library

While GHC ships with a base library, as well as another of other common packages like directory and transformers, there are large gaps in functionality provided by these libraries. This choice for a more minimalistic base is by design, but it leads to some unfortunate consequences:

  • For a given task, it's often unclear which is the right library to use
  • When writing libraries, there is often concern about adding dependencies to any libraries outside of base, due to creating a heavier dependency footprint
  • By avoiding adding dependencies, many libraries end up reimplementing the same functionality, often with incompatible types and type classes, leading to difficulty using libraries together

This library attempts to define a standard library for Haskell. One immediate response may be XKCD #927:

XKCD Standards

To counter that effect, this library takes a specific approach: it reuses existing, commonly used libraries. Instead of defining an incompatible Map type, for instance, we standardize on the commonly used one from the containers library and reexport it from this library.

This library attempts to define a set of libraries as "standard," meaning they are recommended for use, and should be encouraged as dependencies for other libraries. It does this by depending on these libraries itself, and reexporting their types and functions for easy use.

Beyond the ecosystem effects we hope to achieve, this will hopefully make the user story much easier. For a new user or team trying to get started, there is an easy library to depend upon for a large percentage of common functionality.

See the dependencies of this package to see the list of packages considered standard. The primary interfaces of each of these packages is exposed from this library via a RIO.-prefixed module reexporting its interface.

Prelude replacement

The RIO module works as a prelude replacement, providing more functionality and types out of the box than the standard prelude (such as common data types like ByteString and Text), as well as removing common "gotchas", like partial functions and lazy I/O. The guiding principle here is:

  • If something is safe to use in general and has no expected naming conflicts, expose it from RIO
  • If something should not always be used, or has naming conflicts, expose it from another module in the RIO. hierarchy.

Best practices

NOTE There is no need to follow any best practices listed here when using rio. However, in some cases, rio will make design decisions towards optimizing for these use cases. And for Haskellers looking for a set of best practices to follow: you've come to the right place!

For now, this is just a collection of links to existing best practices documents. We'll expand in the future.