Chris Stryczynski

Software Developer / Consultant

Haskell Brick tutorial - written with GitChapter

This project is written with https://github.com/chrissound/GitChapter, this means you are able to clone down the project from https://github.com/chrissound/Git-Chapter-Tutorial-for-Haskell-Brick, and hack along from each section where you see the following:

Git From Commit: 
4e498f763211e21f2826f04358a8754e0499d789

Git Until Commit: 
e90a5db33f0c69c9513bce966be63f79f80beef1

This time we’ll be looking at brick they also have an exellent guide written here: https://github.com/jtdaugherty/brick/blob/master/docs/guide.rst.

Simple start

Okay so far so good.

Lets get the simplest example we can:

We need to add two packages and the ghci-options threaded (using hpack instead of the usual cabl):

diff --git a/package.yaml b/package.yaml
index d3805a9..c74178e 100644
--- a/package.yaml
+++ b/package.yaml
@@ -6,8 +6,11 @@ build-type: Simple
 maintainer: Chris Stryczynski
 dependencies:
 - base >=4.10 && <4.11
+- brick
+- vty
 name: app
 version: '0.1.0.0'
 extra-source-files: ChangeLog.md
 author: Chris Stryczynski
 license: BSD3
+ghc-options: -threaded

And we start of with:

Now if we build and run the project we see:

The command failed with exit code (1). [?1049h[?1049l[?12l[?25h(B[?12l[?25happ: empty picture