Skip to content

Instantly share code, notes, and snippets.

View chiller's full-sized avatar

Endre Galaczi chiller

View GitHub Profile
@DarinM223
DarinM223 / Installing.md
Created January 27, 2018 13:29
Installing GHC Mod

Installing GHC Mod

  1. Go to ~/.stack/global-project/stack.yaml and change the resolver: section to lts-10.3.

  2. Add:

- https://hackage.haskell.org/package/ghc-mod-5.9.0.0/candidate/ghc-mod-5.9.0.0.tar.gz
- cabal-helper-0.8.0.0
@jhrr
jhrr / monads.txt
Created January 13, 2015 16:39
"Programming with Effects" by Graham Hutton -- http://www.cs.nott.ac.uk/~gmh/monads
PROGRAMMING WITH EFFECTS
Graham Hutton, January 2015
Shall we be pure or impure?
The functional programming community divides into two camps:
o "Pure" languages, such as Haskell, are based directly
upon the mathematical notion of a function as a
mapping from arguments to results.
@Fristi
Fristi / Aggregate.hs
Last active November 6, 2022 20:50
DDD/Event Sourcing in Haskell. Implemented an aggregate as a type class and type families to couple event, command and error types specific to the aggregate. Errors are returned by using Either (Error e) (Event e). Applying Applicative Functors fits here well to sequentially check if the command suffice.
{-# LANGUAGE TypeFamilies #-}
import Data.Function (on)
import Control.Applicative
data EventData e = EventData {
eventId :: Int,
body :: Event e
}