This is a brief and bare-bones guide to getting GHC 7.2 and the cabal-install
tool (the two basic things you'll need to do Haskell development) up and running
on a new Mac OS X 10.7 install.
The instructions given here worked for me, but YMMV.
| #!/usr/bin/perl | |
| use strict; | |
| #use warnings; | |
| require "getopts.pl"; | |
| use vars qw ($opt_f $opt_s $opt_h $opt_H); | |
| &Getopts('f:s:hH:'); |
| # source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list | |
| # A list of available STUN server. | |
| stun.l.google.com:19302 | |
| stun1.l.google.com:19302 | |
| stun2.l.google.com:19302 | |
| stun3.l.google.com:19302 | |
| stun4.l.google.com:19302 | |
| stun01.sipphone.com | |
| stun.ekiga.net |
| {-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-} | |
| import System.Environment (getArgs, getProgName) | |
| import Control.Monad (forM_, replicateM_) | |
| import Data.Binary (Binary, encode, decode) | |
| import Data.Typeable (Typeable) | |
| import Data.ByteString.Lazy (ByteString) | |
| import Control.Concurrent (threadDelay) | |
| import Data.Rank1Dynamic (toDynamic) | |
| import Control.Distributed.Static | |
| ( Static |
| # ~/.osx — http://mths.be/osx | |
| ############################################################################### | |
| # General UI/UX # | |
| ############################################################################### | |
| # Set computer name (as done via System Preferences → Sharing) | |
| scutil --set ComputerName "MathBook Pro" | |
| scutil --set HostName "MathBook Pro" | |
| scutil --set LocalHostName "MathBook-Pro" |
| (use '[clojure.core.match :only [match]]) | |
| (defn evaluate [env [sym x y]] | |
| (match [sym] | |
| ['Number] x | |
| ['Add] (+ (evaluate env x) (evaluate env y)) | |
| ['Multiply] (* (evaluate env x) (evaluate env y)) | |
| ['Variable] (env x))) | |
| (def environment {"a" 3, "b" 4, "c" 5}) |
| #!/bin/bash | |
| # Script for placing sudoers.d files with syntax-checking | |
| # Making a temporary file to contain the sudoers-changes to be pre-checked | |
| TMP=$(mktemp -t vagrant_sudoers) | |
| cat /etc/sudoers > $TMP | |
| cat >> $TMP <<EOF | |
| # Allow passwordless startup of Vagrant when using NFS. | |
| Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports |
| #!/usr/bin/env runghc | |
| module Main where | |
| {- | |
| Uninstall.hs - a Haskell uninstaller for Mac OS X | |
| This program is really far too big to be in a single file. However, I | |
| wanted it to be easily distributable and runnable, and so have kept it all | |
| together. |
| (*/!\ known bugs and shortcomings: | |
| - lacks integer overflow check, | |
| - lacks sign parsing (can't parse negative ints) | |
| - exceptions are not helpfull | |
| - code is ugly | |
| - should benchmark parse_int against parse_int_ | |
| *) | |
| let int_of_char c = match c with |
| // carpe noctem | |
| // format: 60 card | |
| // https://gist.github.com/967979 | |
| // Lands | |
| 8 Swamp | |
| 4 Peat Bog | |
| 4 Inkmoth Nexus | |
| // Instants |