about · lately · live · notes · talks · writing · contact · thanks · support ·


Haskell

Handling Failure

Maintainability of Haskell Code

structured logging

Event Sourcing

Input Validation

Configuration Management

Infrastructure and DevOps Tooling

Website Application Architecture

Software Transactional Memory

Concurrent Programming

GHC Internals

Recommended Reading

Isomorphic Haskell

Domain Driven Design

HTTP Clients

Existential Types

applications.md

Full Websites

Webserver and API

Setting up haskell-vim-now on a Cloud9 workspace:

  1. Start with a Blank workspace.
  2. Increase resources (use at least 7GB for disk and 2GB for ram, but more is better).
  3. Edit styles.css to use a powerline font: css @import url(https://cdn.rawgit.com/wernight/powerline-web-fonts/f3821a36beeba53e6e937319d4ee636ef30a352c/PowerlineFonts.css);
  4. Update apt: sh sudo apt-get update
  5. Install the Haskell stack: sh curl -sSL https://get.haskellstack.org/ | sh
  6. Install haskell-vim-now: sh curl -L https://git.io/haskell-vim-now > /tmp/haskell-vim-now.sh bash /tmp/haskell-vim-now.sh
  7. Enjoy!

Optional

Switch to a newer version of node with nvm:

nvm install 6.9.2
nvm alias default 6.9.2

Uninstall any older versions:

nvm ls
nvm uninstall 4.6.1

data61.md

Execute nix-shell to bootstrap the environment

Create hello.hs

x :: Integer
x = 3
ghci -ignore-dot-ghci 

:load hello.hs #loads from filesystem
:r # reload loaded modules (inc hello.hs)
:t x # obtain type signature of x

Lists

cons :: https://en.wikipedia.org/wiki/Cons

cons - head and tail

>> :t (:.)
(:.) :: t -> List t -> List t
>> 1 :. 2 :. 3 :. 4 :. Nil
[1,2,3,4]

The word “cons” and expressions like “to cons onto” are also part of a more general functional programming jargon. Sometimes operators that have a similar purpose, especially in the context of list processing, are pronounced “cons”. (A good example is the :: operator in ML, Scala, F# and Elm or the : operator in Haskell, which adds an element to the beginning of a list.)

Rosetta

generics :: type variables cons :: https://en.wikipedia.org/wiki/Cons

cons - head and tail

>> :t (:.)
(:.) :: t -> List t -> List t

Pattern Matching

Can enable warnings when not all patterns are matched set fwarn-incomplete-patterns see https://stackoverflow.com/questions/31866379/haskell-non-exhaustive-pattern-matching-in-haskell

Resources

Lists

const

https://en.wikipedia.org/wiki/Unary_function https://hackage.haskell.org/package/base-4.10.1.0/docs/Prelude.html#v:const

Point Free


# Workflow
Look at the signature and write down what you have (tm) and write down what you need to get to (tm)                                                                       

```hs
data Optional a =
  Full a
  | Empty
  deriving (Eq, Show)
What I have                                                                                    
----
x :: a
f :: a -> Optional b
----
What do I need to get to?
? :: Optional b

People

Day 1

Determining file location of a type

>> :i Full
data Optional a = Full a | ...
        -- Defined at src/Course/Optional.hs:15:3

education.md

Videos

GC

https://tech-blog.capital-match.com/posts/2-cpu-credits.html

https://github.com/ezyang/compact/blob/master/README.md

Patterns

https://www.fpcomplete.com/blog/2017/06/readert-design-pattern

date time

https://hackage.haskell.org/package/auto-update-0.1.4/docs/Control-AutoUpdate.html

hot paths

https://www.yesodweb.com/blog/2014/08/announcing-auto-update

compilation

https://rybczak.net/2016/03/26/how-to-reduce-compilation-times-of-haskell-projects/

packages.md

Caching

https://github.com/SumAll/haskell-cached-io README.md http://blog.wuzzeb.org/full-stack-web-haskell/ tooling.md

IDE

Misc

https://begriffs.com/posts/2015-07-27-haskell-source-navigation.html vim.md. https://github.com/begriffs/haskell-vim-now

https://gist.github.com/gatlin/7754289

GHC Internals