Add flake/HIE/README.

main
Joshua Potter 2022-03-31 22:34:23 -04:00
parent 7920fa7a96
commit f584509b44
8 changed files with 116 additions and 4 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

12
.gitignore vendored
View File

@ -1,3 +1,15 @@
# direnv
*.sw?
.direnv
.gopath
/direnv
/direnv.test
/dist
/test/config
/test/data
/test/scenarios/inherited/.envrc
# fused-effects
.stack-work .stack-work
dist-newstyle dist-newstyle
dist dist

View File

@ -1,8 +1,6 @@
# fused-effects-exceptions # 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) [![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. 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: 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:

43
flake.lock Normal file
View File

@ -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
}

55
flake.nix Normal file
View File

@ -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
];
};
}));
}

View File

@ -47,7 +47,7 @@ test-suite test
base base
, fused-effects-exceptions , fused-effects-exceptions
, fused-effects , fused-effects
, tasty ^>= 1.2 , tasty ^>= 1.4
, tasty-hunit ^>= 0.10 , tasty-hunit ^>= 0.10
, transformers , transformers

2
hie.yaml Normal file
View File

@ -0,0 +1,2 @@
cradle:
cabal:

1
result Symbolic link
View File

@ -0,0 +1 @@
/nix/store/k0gb2rky5g5p3n9fgy637swkwd5szxdk-fused-effects-exceptions-1.1.0.2