Moved to https://weakish.github.io/StutteringTalkaholic/dive-into/fish/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Part Zero : 10:15 Saturday Night | |
* | |
* (In which we will see how to let the type system help you handle failure)... | |
* | |
* First let's define a domain. (All the following requires scala 2.9.x and scalaz 6.0) | |
*/ | |
import scalaz._ | |
import Scalaz._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
# ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
function ghc-pkg-clean() { | |
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
do | |
echo unregistering $p; ghc-pkg $* unregister $p | |
done | |
} | |
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, UndecidableInstances #-} | |
module Prolog (Petja, Vasja, Serg, Father) where | |
data Petja = Petja | |
data Vasja = Vasja | |
data Serg = Serg | |
class Father a b where | |
isFather :: a -> b -> () | |
isFather x y = () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NOTE: on lion (and snow leopard i suppose), make sure you are using a 64 bit install of ghc. Also, unless you are suggesting an edit to these directions, please go ask people on the relevant mailing list or wiki for help :) | |
NOTE: gtk2hs 0.12.2 won't build with ghc 7.4.1, but the current darcs repo for gtk2hs does build | |
NOTE: on 7.4 there seems to be a problem when in ghci and drawing to a window, but not when rendering to pdf. I don't know why this is, but if you do, let me know. I'll update this as i have more info | |
note that these directions probably can use some cleanup, but i'm choosing these steps so that rebuilding any haskell library doesn't require remembering ANYTHING :-) | |
(tested on ghc 7.2.2, assumes you have standard developer things installed on mac, like x11 and stuff) | |
1) cabal install gtk2hs-buildtools #(this should work with any haskell platform install) | |
2) brew install cairo gtk gettext fontconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.zip.ZipFile | |
import java.io.FileInputStream | |
import java.io.FileOutputStream | |
import scala.collection.JavaConversions._ | |
import java.util.zip.ZipEntry | |
import java.io.InputStream | |
import java.io.OutputStream | |
import java.io.File | |
class ZipArchive { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ "keys": ["escape"], "command": "exit_insert_mode", | |
"context": | |
[ | |
{ "key": "setting.command_mode", "operand": false }, | |
{ "key": "setting.is_widget", "operand": false } | |
] | |
}, | |
{ "keys": ["escape"], "command": "exit_visual_mode", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
// Basic drag select | |
{ | |
"button": "button1", "count": 1, | |
"press_command": "drag_select_callback" | |
}, | |
{ | |
// Select between selection and click location | |
"button": "button1", "modifiers": ["shift"], | |
"press_command": "drag_select_callback", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use xelatex instead of pdflatex | |
$pdflatex = 'xelatex -synctex=1 -interaction=nonstopmode --shell-escape %O %S'; | |
# Always create PDFs | |
$pdf_mode = 1; | |
# Use Skim.app to preview generated PDFs | |
$pdf_previewer = 'open -a Skim.app %S'; | |
# Use continous mode by default |
OlderNewer