Skip to content

Instantly share code, notes, and snippets.

package com.michaelavila;
import java.util.Optional;
import java.util.function.Function;
class Either<A,B> {
private A left = null;
private B right = null;
private Either(A a, B b) {

Put the contents of the files in this gist in $HOME/.grc/ in their respective files.

@michaelavila
michaelavila / README.md
Created January 19, 2016 22:23
Colorize maven output
  1. brew install grc
  2. add alias mvn='grc -c conf.mvn mvn' to your ~/.profile
  3. copy the other file in this gist to ~/.grc/conf.mvn
@michaelavila
michaelavila / .vimrc
Created August 26, 2016 16:54
Toggle light/dark for terminal + vim
let base16colorspace=256
colorscheme base16-default-dark
let shellbg=$SHELLBG
if shellbg == 'dark'
set background=dark
highlight LineNr ctermfg=blue ctermbg=black
else
set background=light
highlight LineNr ctermfg=blue ctermbg=white
endif
//: Playground - noun: a place where people can play
import UIKit
typealias Properties = Dictionary<String,Any?>
struct TypeKey {
let type: Any.Type
}
@michaelavila
michaelavila / Applicative Functor (part 1) notes.md
Last active June 12, 2017 17:11
Applicative Functor (part 1) notes

Applicative functors

Why is Applicative Functor needed?

To understand the need for applicative, try to write an implementation of the following:

fmap2 :: Functor f => (a -> b -> c) -> (f a -> f b -> f c)
@michaelavila
michaelavila / lens.md
Created July 11, 2017 17:15
Control.Lens Notes

Lens

Control.Lens helps you to get, set, and modify the particulars of your data. The ideas behind lens are interesting for a number of reasons, not the least of which is composability. Because of this, Simon Peyton Jones titled his talk on lens "Compositional Data Access and Manipulation", which is a great title. You should watch that talk.

The agenda is: