Skip to content

Instantly share code, notes, and snippets.

View lotz84's full-sized avatar

Tatsuya Hirose lotz84

View GitHub Profile
@lotz84
lotz84 / stateio.hs
Created September 20, 2015 15:55
StateIO s a ≡ StateT s IO a
{-# LANGUAGE GADTs #-}
import Control.Monad.Operational
data IStateIO s a where
Get :: IStateIO s s
Put :: s -> IStateIO s ()
LiftIO :: IO a -> IStateIO s a
get' = singleton Get
import Data.Functor.Identity
import Control.Monad.State
import Data.List
import System.Random
type Info = String
data Term = Var Info Int Int
| Abs Info String Term
| App Info Term Term
import Data.Monoid
main = do
let adde :: Monoid m => m -> m
adde = mappend mempty
print $ adde "aaa"
print $ adde (Sum 1)
[alias]
graph = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[user]
name = Tatsuya Hirose
email = [email protected]
execute pathogen#infect()
syntax on
filetype plugin indent on
set ruler
set number
set tabstop=4
set autoindent
set expandtab
alias ll='ls -l'
alias rm='rmtrash'
alias ga='git add'
alias gb='git branch'
alias gc='git commit'
alias gch='git checkout'
alias gd='git diff'
alias gf='git fetch'
alias gg='git graph'
@lotz84
lotz84 / gist:26ce3f3d29342876ceda
Created July 21, 2015 03:27
web page 内のリンク先URLを列挙する
{-# LANGUAGE OverloadedStrings #-}
import Control.Lens
import Data.Foldable
import Network.Wreq
import Text.Taggy.Lens
import Data.Text.Lazy.Encoding
import Data.Maybe
main = do