From eca0b9ddc3cfbcaea5bd32f08caec1ee2b058b7c Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Fri, 11 Mar 2022 08:50:42 -0500 Subject: [PATCH] Rough template on repository structure. --- README.md | 39 ++++++++++++++++++- app/Main.hs | 4 -- cabal.project | 2 + .../free-monads.cabal | 13 +++---- 4 files changed, 46 insertions(+), 12 deletions(-) delete mode 100644 app/Main.hs create mode 100644 cabal.project rename hello-world.cabal => free-monads/free-monads.cabal (91%) diff --git a/README.md b/README.md index e924d0c..30a3972 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,41 @@ -# hello-world +# effect-systems + +This repository contains collections of code snippets related to my +[Effect Systems](https://jrpotter.github.io/posts/effect-systems/) blog post. +The post is not yet publically available. + +> As I’ve begun exploring the world of so-called algebraic effect systems, I’ve +become increasingly frustrated in the level of documentation around them. +Learning to use them (and moreso, understanding how they work) requires diving +into the internals, watching various videos, and hoping to grok why certain +effects aren’t being interpreted they way you might have hoped. My goal in this +post is to address this issue, at least to some degree, in a focused, +pedagogical fashion. In particular, I’ll aim to build up an intution of the +fused-effects, library, chosen because it seems to have the most active +development, the smallest dependency footprint, and minimal type machinery. + +## Building + +This repository uses Nix for reproducible builds. First +[install Nix](https://nixos.org/download.html) if you do not currently have it +on your system. Afterward, enable [flakes](https://nixos.wiki/wiki/Flakes) by +adding line + +``` +experimental-features = nix-command flakes +``` + +to `$HOME/.config/nix/nix.conf`. You may then use `nix build` and `nix develop`. +To makes things easier, we recommend using [Home Manager](https://github.com/nix-community/home-manager) +to install [direnv](https://github.com/direnv/direnv) and [nix-direnv](https://github.com/nix-community/nix-direnv). +Once you run + +```bash +$ direnv allow +``` + +from the root directory, `nix develop` will be automatically invoked each time +a change is detected in `flake.nix` or you return to the directory. ## Formatting diff --git a/app/Main.hs b/app/Main.hs deleted file mode 100644 index 98f25e4..0000000 --- a/app/Main.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Main where - -main :: IO () -main = putStrLn "Hello, World!" diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..7e47e83 --- /dev/null +++ b/cabal.project @@ -0,0 +1,2 @@ +packages: + free-monads diff --git a/hello-world.cabal b/free-monads/free-monads.cabal similarity index 91% rename from hello-world.cabal rename to free-monads/free-monads.cabal index 6018d8f..47848f9 100644 --- a/hello-world.cabal +++ b/free-monads/free-monads.cabal @@ -1,8 +1,8 @@ cabal-version: 3.0 - name: hello-world + name: free-monads version: 0.1.0.0 - synopsis: The Corner programming language. + synopsis: Free monads implementation. -- A longer description of the package. -- description: @@ -18,7 +18,7 @@ CHANGELOG.md README.md -common hello-world-common +common free-monads-common default-language: Haskell2010 default-extensions: BangPatterns, BinaryLiterals, @@ -74,7 +74,6 @@ common hello-world-common relude ghc-options: -Wall -executable hello-world - import: hello-world-common - main-is: Main.hs - hs-source-dirs: app +library + import: free-monads-common + hs-source-dirs: src