Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patrickt/alchemist
A Haskell library for carefully refactoring critical paths.
https://github.com/patrickt/alchemist
Last synced: 3 days ago
JSON representation
A Haskell library for carefully refactoring critical paths.
- Host: GitHub
- URL: https://github.com/patrickt/alchemist
- Owner: patrickt
- Created: 2020-10-09T22:19:48.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-11T20:01:49.000Z (over 3 years ago)
- Last Synced: 2024-12-24T12:30:15.007Z (5 days ago)
- Language: Haskell
- Size: 47.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# alchemist
[![GitHub CI](https://github.com/patrickt/alchemist/workflows/CI/badge.svg)](https://github.com/patrickt/alchemist/actions)
[![Hackage](https://img.shields.io/hackage/v/alchemist.svg?logo=haskell)](https://hackage.haskell.org/package/alchemist)
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)`alchemist` is library for refactoring critical paths. You build up `Experiment` values with a DSL, starting with a reference behavior, called here the _control_, that represents the existing behavior of your app. From then on, you add one or more `candidate` computations to this `Experiment`, each candidate representing a monadic computation whose result should be equal to that of running the control. Each time an `Experiment` is invoked, it logs the results of running all the candidate computations to some user-defined portal downstream.
`alchemist` is useful when you have Extremely Important Code Paths that Absolutely Should Not Break In Production. Though Haskell's type system catches many errors that other languages do not, types can't catch all errors, particularly the dynamic errors that GHC can throw even in pure code. By slowly factoring out your critical sections into `alchemist`-compatible blocks, you have an additional layer of confidence during the refactoring and testing process.
This is a clone of Ruby's [`scientist`](http://github.com/github/scientist).
Example:
``` haskell
import Alchemist.IO as Alcmain = do
let myOldFunction = someExistingFunction
let myNewFunction = newFunctionToTest
-- Both myOldFunction and myNewFunction are run,
-- their outputs are compared, and information is logged.
result <-
Alc.new "example" myOldFunction
& Alc.try myNewFunction
& Alc.run
```## To-dos
Write `alchemist-mtl`.
## Thanks to
The `scientist` authors, and the legendary producer of the same name.