Skip to content

Instantly share code, notes, and snippets.

sudo apt-get update
sudo apt-get install zlib1g-dev
sudo apt-get -t experimental install ghc ghc-prof cabal-install alex happy
cabal update
echo "require-sandbox: True" >> ~/.cabal/config
  1. General Background and Overview

The Indexed State Monad in Haskell, Scala, and C#

Have you ever had to write code that made a complex series of succesive modifications to a single piece of mutable state? (Almost certainly yes.)

Did you ever wish you could make the compiler tell you if a particular operation on the state was illegal at a given point in the modifications? (If you're a fan of static typing, probably yes.)

If that's the case, the indexed state monad can help!

Motivation

{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
-- Overloaded strings is just for "api.twitter.com"
-- DerieDataTypeable should be removed after clearing
-- the aeson warning to switch to GHC Generics or Template Haskell
import Data.Data
import System.Environment
import Web.Authenticate.OAuth

How to install latest GHC 7.10.1 + cabal 1.22.3.0 from source on Debian Testing

ghc 7.10.1 installation

Debian prerequisites

    $ sudo apt-get install build-essential ca-certificates xz-utils -y
    $ sudo apt-get install libgmp10 libgmp-dev libffi-dev zlib1g-dev -y  
    $ sudo -K
@valyakuttan
valyakuttan / linux-commnads.md
Last active July 30, 2017 06:00
Infrequently used usefull linux (debian) commands
$ systemd-analyze # Analyze system boot-up performance

$ dmesg # display contents of kernel ring buffer

$ sudo dpkg -i /path/to/deb/file; sudo apt-get install -f
# install a .deb file with it's dependencies

$ dpkg -l | grep '^.i' # list installed packages
@valyakuttan
valyakuttan / android.md
Last active January 16, 2020 09:21
some android commands(Moto E)

Android Cheat Sheet for Linux

1. Fastboot command - fastboot

To list attached devices

$ sudo fastboot devices

To flash twrp to recovery