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.
module Data.List.DropConsec | |
( dropConsec | |
) where | |
import Data.List (dropWhile) | |
dropConsec :: Eq a => [a] -> [a] | |
dropConsec [] = [] | |
dropConsec (x:xs) = x : dropConsec (dropWhile (== x) xs) |
#include <stdio.h> | |
#include <unistd.h> | |
int main(void) { | |
if (pathconf("/", _PC_CASE_SENSITIVE)) { | |
printf("The file system is case sensitive\n"); | |
} else { | |
printf("The file system is case insensitive\n"); | |
} | |
#!/usr/bin/env ruby | |
file = ARGV.shift | |
contents = File.read(file, {:encoding => "ISO-8859-15", :mode => "rb"}) | |
contents.encode!("UTF-8") | |
File.open(file, 'w') do |f| | |
f.write(contents) |
{-# LANGUAGE OverloadedStrings #-} | |
module Main (main) where | |
{- | |
To use this script you need to extract your local Hackage index file. If | |
your setup is anything like mine, you should be able to find a .tar file | |
containing the listing somewhere like this: | |
~/.cabal/packages/hackage.haskell.org/00-index.tar.gz | |
diff -rN old-HDBC-mysql/Database/HDBC/MySQL/Connection.hsc new-HDBC-mysql/Database/HDBC/MySQL/Connection.hsc | |
2c2 | |
< {-# OPTIONS -fglasgow-exts #-} | |
--- | |
> {-# LANGUAGE ForeignFunctionInterface, ScopedTypeVariables, EmptyDataDecls #-} | |
125c125 | |
< mysql_autocommit mysql_ 0 | |
--- | |
> _ <- mysql_autocommit mysql_ 0 | |
674c674 |
routeArticle :: Routes | |
routeArticle = customRoute (flip replaceExtension ".html" . dropDate) | |
dropDate :: Identifier -> FilePath | |
dropDate ident = let file = toFilePath ident | |
in replaceFileName file (drop 11 $ takeFileName file) |
<?php | |
function my_theme_init() { | |
if (!is_admin()) { | |
wp_enqueue_style('tarski_stylesheet', get_template_directory_uri() . '/style.css'); | |
} | |
} | |
add_action('init', 'my_theme_init'); |
-- Render RSS feed | |
route "rss.xml" $ idRoute | |
create "rss.xml" $ | |
requireAll_ "posts/*" | |
>>> mapCompiler (arr $ copyField "body" "description") | |
>>> renderRss feedConfiguration |
~/projects/hakyll/examples/brochure (examples) $ ll | |
total 32 | |
-rw-r--r-- 1 ionfish staff 724B 27 Sep 18:57 about.rst | |
-rw-r--r-- 1 ionfish staff 794B 27 Sep 18:57 code.lhs | |
drwxr-xr-x 4 ionfish staff 136B 15 Nov 15:25 css | |
-rw-r--r--@ 1 ionfish staff 504B 26 Mar 18:32 hakyll.hs | |
-rw-r--r--@ 1 ionfish staff 1.1K 27 Sep 18:57 index.markdown | |
drwxr-xr-x 3 ionfish staff 102B 19 Mar 12:13 templates | |
~/projects/hakyll/examples/brochure (examples) $ ghc --make hakyll.hs |