The liblawless package

[Tags:gpl, library, test]

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


[Skip to Readme]

Properties

Versions 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
Change log ChangeLog
Dependencies aeson (>=0.11.2 && <0.12), base (==4.9.*), 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), concurrent-machines (>=0.2.3.3 && <0.3), containers (>=0.5.7 && <0.6), containers-unicode-symbols (>=0.3.1 && <0.4), contravariant (==1.4.*), data-textual (>=0.3.0 && <0.4), dns (>=2.0.8 && <2.1), exceptions (>=0.8.3 && <0.9), hjsonschema (>=1.2.0 && <1.3), lens (>=4.14 && <4.16), 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.*), parsers (>=0.12.4 && <0.13), pathtype (==0.8.*), protolude (>=0.1.10 && <0.2), QuickCheck (>=2.8.2 && <2.9), random (==1.1.*), semigroups (>=0.18.2 && <0.19), stm (>=2.4.4 && <2.5), stm-containers (>=0.2.15 && <0.3), temporary (>=1.2.0 && <1.3), text (>=1.2.2 && <1.3), text-icu (>=0.7.0 && <0.8), text-icu-normalized (>=0.3.0 && <0.4), text-printer (==0.4.*), time (>=1.6.0 && <1.7), transformers (>=0.5.2 && <0.6), zippers (>=0.2.2 && <0.3) [details]
License GPL-3
Copyright © 2016 Evan Cofsky
Author Evan Cofsky
Maintainer evan@theunixman.com
Category Prelude
Source repository head: git clone git@gitlab.com:misandrist/liblawless.git
this: git clone git@gitlab.com:misandrist/liblawless.git(tag v0.20.2)
Uploaded Wed Apr 26 04:02:58 UTC 2017 by misandrist
Distributions NixOS:0.20.1
Downloads 548 total (229 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for liblawless

Readme for liblawless-0.20.2

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]

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.