liblawless: Prelude based on protolude for GHC 8 and beyond.

[ gpl, library, prelude ] [ Propose Tags ] [ Report a vulnerability ]

A Prelude relpacement for GHC 8 with a focus on building applications with Lenses, Machines, and Applicatives.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.13.0, 0.13.1, 0.13.2, 0.13.3, 0.14.0.1, 0.14.0.2, 0.14.0.3, 0.14.0.4, 0.16.0, 0.16.1, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.18.0, 0.18.2, 0.18.3, 0.19.0, 0.19.1, 0.19.2, 0.19.3, 0.19.4, 0.19.5, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 0.21.2, 0.21.3, 0.23.0, 0.23.1, 0.24.0, 0.25.0, 0.25.1, 0.25.2, 0.26.0 (info)
Change log ChangeLog
Dependencies aeson (>=0.11.2 && <0.12), base (>=4.9 && <5), base-unicode-symbols (>=0.2.2 && <0.3), binary (>=0.8.3 && <0.9), boomerang (>=1.4.5.2 && <1.5), bytestring (>=0.10.8 && <0.11), containers (>=0.5.7 && <0.6), containers-unicode-symbols (>=0.3.1 && <0.4), contravariant (>=1.4 && <1.5), data-textual (>=0.3.0 && <0.4), dns (>=2.0.8 && <2.1), exceptions (>=0.8.3 && <0.9), hjsonschema (>=1.6.2 && <1.9), lawless-concurrent-machines (>=0.2.3.3 && <0.5), lens (>=4.14 && <4.16), lifted-async (>=0.9.1.1 && <0.10), lifted-base (>=0.2.3 && <0.3), machines (>=0.6.1 && <0.7), managed (>=1.0.5 && <1.1), monad-control (>=1.0.1.0 && <1.1), mtl (>=2.2.1 && <2.3), network (>=2.6.3.1 && <2.7), network-ip (>=0.3 && <0.4), parsers (>=0.12.4 && <0.13), pathtype (>=0.8 && <0.9), protolude (>=0.1.10 && <0.4), QuickCheck (>=2.8 && <2.10), random (>=1.1 && <1.2), semigroups (>=0.18.2 && <0.19), stm (>=2.4.4 && <2.5), stm-chans (>=3.0.0.4 && <3.1), stm-containers (>=0.2.15 && <0.3), temporary (>=1.2.0 && <1.3), text (>=1.2.2 && <1.3), text-printer (>=0.4 && <0.5), time (>=1.6.0 && <1.9), transformers (>=0.5.2 && <0.6), transformers-base (>=0.4.4 && <0.5), zippers (>=0.2.2 && <0.3) [details]
License GPL-3.0-only
Copyright © 2017 Evan Cofsky
Author Evan Cofsky
Maintainer evan@theunixman.com
Category Prelude
Home page https://gitlab.com/theunixman/liblawless
Source repo head: git clone https://gitlab.com/theunixman/liblawless.git
this: git clone https://gitlab.com/theunixman/liblawless.git(tag v0.26.0)
Uploaded by misandrist at 2017-10-02T04:31:10Z
Distributions
Reverse Dependencies 1 direct, 1 indirect [details]
Downloads 21545 total (38 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for liblawless-0.26.0

[back to package description]

liblawless: An Effectful Foundation

Overview

liblawless is a replacement for the standard Prelude. It targets GHC 8.0 and newer. It's core is building a fine-grained but readily accessible Effect model to move more type checking of code that changes its environment out of plain IO.

Pure vs Effectful Functions

Pure functions don't affect the anything outside of the function. A Pure function will run a calculation on the given values, and return a result. If you pass in the same parameters, you'll always get the same result no matter how many times you call the function.

Effectful functions are functions that do affect the program outside the function, and often the environment outside the computer running them. Even with the same parameters, Effectful Functions can return different results. In many cases they can even return signals that completing their task wasn't possible. In many languages these are called "Side Effects", and aren't modeled in the type system at all. Haskell comes with a simple Effect model in its type system, the [io][IO monad].

Kinds of Effects

The [io][IO monad] models Effects a function has on the world outside the program. There are other, more limited Effects as well, and there are libraries for managing these as well. The two most common are:

  • [transformers][Transformers]
  • [mtl][The MTL]

[transformers]: http://hackage.haskell.org/package/transformers Transformers [mtl]: http://hackage.haskell.org/package/mtl

These model Effects that only apply to the current program, while the IO monad models ''all other effects'' on the world. That's a really broad brush. Most bugs in Haskell code are in the IO monad.

This project is implementing several extra types of Effects that affect the world. Instead of treating them all the same, though, it breaks them up into much smaller kinds of Effects. For example, for accessing files, it's possible to:

  • read bytes from a file
  • write bytes to a file
  • read lines of text from a file
  • write lines of text from a file
  • read arbitrary data from a file, operate on these data items, and write them to a network stream
  • many other simple and complex operations

We are building them on top of the machines library. This library offers a composable model for connecting strongly-typed streams together. It also implements provisions for arbitrary effects, and connecting Effectful functions with Pure functions into streams of computations. When combined with the async library, these streams, and even individual nodes in these streams, can be run concurrently and safely, making full use of multicore systems.