Add flake/HIE/README.
parent
7920fa7a96
commit
f584509b44
|
@ -1,3 +1,15 @@
|
|||
# direnv
|
||||
*.sw?
|
||||
.direnv
|
||||
.gopath
|
||||
/direnv
|
||||
/direnv.test
|
||||
/dist
|
||||
/test/config
|
||||
/test/data
|
||||
/test/scenarios/inherited/.envrc
|
||||
|
||||
# fused-effects
|
||||
.stack-work
|
||||
dist-newstyle
|
||||
dist
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# fused-effects-exceptions
|
||||
|
||||
[![Hackage](https://img.shields.io/hackage/v/fused-effects-exceptions.svg)](https://hackage.haskell.org/package/fused-effects-exceptions)
|
||||
[![BSD3 license](https://img.shields.io/badge/license-BSD3-blue.svg)](LICENSE)
|
||||
[![Build Status](https://action-badges.now.sh/fused-effects/fused-effects-exceptions)](https://github.com/fused-effects/fused-effects-exceptions/actions)
|
||||
|
||||
<!--
|
||||
Setup, hidden from the rendered markdown.
|
||||
|
@ -20,7 +18,7 @@ main = pure ()
|
|||
-->
|
||||
|
||||
|
||||
This package provides `Control.Effect.Exception`, a module that wraps the [`Control.Exception`](http://hackage.haskell.org/package/base/docs/Control-Exception.html) API from `base` with the vocabulary provided by the [`fused-effects`](http://hackage.haskell.org/package/fused-effects) library. These functions interact with GHC's support for dynamic exceptions, including functions like `catch` for exception handling and `bracket` for resource management.
|
||||
This fork provides `Control.Effect.Exception[.UnliftIO]`, a module that wraps the [`Control.Exception`](http://hackage.haskell.org/package/base/docs/Control-Exception.html) and [`UnliftIO.Exception`](https://hackage.haskell.org/package/unliftio-0.2.21.0/docs/UnliftIO-Exception.html) API from `base` with the vocabulary provided by the [`fused-effects`](http://hackage.haskell.org/package/fused-effects) library. These functions interact with GHC's support for dynamic exceptions, including functions like `catch` for exception handling and `bracket` for resource management.
|
||||
|
||||
Please be aware that injudicious use of these functions may provoke surprising interactions with carriers that thread a monadic state as a parameter, à la the `Control.Carrier.State` types provided by `fused-effects`. For example, a function like `finally`, which does not thread any state from its body to its handler block, may discard state writes in cleanup handlers:
|
||||
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1648297722,
|
||||
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1648648646,
|
||||
"narHash": "sha256-pHAq/GvsP7zRHkUTCs+4d31C0IEtTIuC6/TFASIA+zg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "efea022d6fe0da84aa6613d4ddeafb80de713457",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-21.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
description = "Handle exceptions thrown in IO with fused-effects.";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
let
|
||||
name = "fused-effects-exceptions";
|
||||
in
|
||||
{
|
||||
overlay = final: prev: {
|
||||
haskellPackages = prev.haskellPackages.override {
|
||||
overrides = _self: _super: {
|
||||
"${name}" = prev.haskellPackages.callCabal2nix name self { };
|
||||
};
|
||||
};
|
||||
};
|
||||
} // (flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlay ];
|
||||
};
|
||||
|
||||
haskell = {
|
||||
ghc = pkgs.haskellPackages.ghc;
|
||||
hls = pkgs.haskell-language-server.override {
|
||||
supportedGhcVersions = [ "8107" ];
|
||||
};
|
||||
};
|
||||
in
|
||||
with pkgs; {
|
||||
packages = {
|
||||
"${name}" = pkgs.haskellPackages.callCabal2nix name self { };
|
||||
};
|
||||
|
||||
defaultPackage = self.packages.${system}.${name};
|
||||
|
||||
devShell = mkShell {
|
||||
buildInputs = [
|
||||
haskell.ghc
|
||||
haskell.hls
|
||||
gdb
|
||||
haskellPackages.cabal-install
|
||||
haskellPackages.stylish-haskell
|
||||
];
|
||||
};
|
||||
}));
|
||||
}
|
|
@ -47,7 +47,7 @@ test-suite test
|
|||
base
|
||||
, fused-effects-exceptions
|
||||
, fused-effects
|
||||
, tasty ^>= 1.2
|
||||
, tasty ^>= 1.4
|
||||
, tasty-hunit ^>= 0.10
|
||||
, transformers
|
||||
|
||||
|
|
Loading…
Reference in New Issue