Skip to content

Instantly share code, notes, and snippets.

View ndmitchell's full-sized avatar

Neil Mitchell ndmitchell

View GitHub Profile
@ndmitchell
ndmitchell / Shakefile.hs
Created April 7, 2014 08:36
Shake .min.js build system
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
module Temp where
import Development.Shake
import Development.Shake.Classes
import Development.Shake.FilePath
import Data.Char
@ndmitchell
ndmitchell / msys.bat
Created March 17, 2015 09:16
New MSYS launcher
@echo off
rem Copyright (C): 2001, 2002, 2003, 2004, 2005 Earnie Boyd
rem mailto:earnie@users.sf.net
rem This file is part of Minimal SYStem
rem http://www.mingw.org/msys.shtml
rem
rem File: msys.bat
rem Revision: 2.4
rem Revision Date: December 8th, 2005
@ndmitchell
ndmitchell / Bad (full)
Created March 19, 2015 23:56
GHC 7.10 RC3 Shake issues
This file has been truncated, but you can view the full file.
[31 of 55] Compiling Development.Shake.Errors ( src\Development\Shake\Errors.hs, .hpc\core\Development\Shake\Errors.o )
==================== Tidy Core ====================
Result size of Tidy Core
= {terms: 2,070, types: 2,156, coercions: 13}
Development.Shake.Errors.$fExceptionShakeException1 :: [Char]
[GblId,
Str=DmdType,
@ndmitchell
ndmitchell / build1.ninja
Created April 17, 2015 09:20
Ninja phony behaviour
# ninja bar.txt # builds foo.txt and bar.txt
# touch foo.txt
# ninja bar.txt # builds nothing
rule create
command = cmd /c "echo $out > $out"
rule copy
command = cmd /c "copy $from $out"
import GHC
import GHC.Paths ( libdir )
import DynFlags
import Linker
import Module
import Outputable
import Control.Monad.IO.Class
targetFile = "Test.hs"
C:\Neil\hoogle>stack ghci -v
Version 0.1.4.1, Git revision fe3ca799f618ade4073f7275e0a5bf9c6d2af9a4 I386
2015-09-14 20:33:58.8686447: [debug] Checking for project config at: C:\Neil\hoogle\stack.yaml @(stack_43ouVK2BYx36UgHTH0HZP1:Stack.Config src/Stack\Config.hs:466:9)
2015-09-14 20:33:58.8998859: [debug] Loading project config file stack.yaml @(stack_43ouVK2BYx36UgHTH0HZP1:Stack.Config src/Stack\Config.hs:489:13)
2015-09-14 20:33:58.8998859: [debug] Trying to decode C:\Users\ndmit_000\AppData\Roaming\stack\build-plan-cache\i386-windows\nightly-2015-08-07.cache @(stack_43ouVK2BYx36UgHTH0HZP1:Data.Binary.VersionTagged src/Data\Binary\VersionTagged.hs:53:5)
2015-09-14 20:33:58.9311383: [debug] Success decoding C:\Users\ndmit_000\AppData\Roaming\stack\build-plan-cache\i386-windows\nightly-2015-08-07.cache @(stack_43ouVK2BYx36UgHTH0HZP1:Data.Binary.VersionTagged src/Data\Binary\VersionTagged.hs:62:13)
2015-09-14 20:33:58.9311383: [debug] Run process: ghc --info @(stack_43ouVK2BYx36UgHTH0HZP1:System.Process.Read
(Linux)
g++ -dynamic -g -c -arch i386 x86_64 -Wall -fPIC -I/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/include/darwin -I./include/iConnect -I./include/TsiSdk -I./include/TsiSdk++ -I./lib iConnectJavaJCPP.cpp -o iConnectJCPP.o
g++ -dynamiclib -arch i386 x86_64 -Wl,-soname,libiConnectJCPP.so, --no-undefined -L./lib iConnectJCPP.o -o libiConnectJCPP.dylib -lTsiSdk -liConnect -lTsiSdk++
(Mac OS X)
g++ -dynamic -g -c -arch i386 x86_64 -Wall -I/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/include/darwin -I./include/iConnect -I./include/TsiSdk -I./include/TsiSdk++ -I./lib iConnectJavaJCPP.cpp -o iConnectJCPP.o
@ndmitchell
ndmitchell / Nofib.hs
Created February 7, 2013 20:22
Shake build system for the nofib benchmark suite.
{-# LANGUAGE RecordWildCards, DeriveDataTypeable #-}
module Main(main) where
-- Standard libraries
import Control.Concurrent
import Control.Exception
import Control.Monad
import Data.Char
import Data.List
@ndmitchell
ndmitchell / GCHQ.hs
Created December 21, 2015 20:59
GCHQ 2015 Puzzle in Haskell
module Main(main) where
import Data.Maybe
import Data.List
-- Data table copied from https://matthewearl.github.io/2015/12/10/gchq-xmas-card/
width = 25
height = 25
rows = [
stack setup
stack install happy alex
stack exec -- pacman -S gcc binutils git automake-wrapper tar make patch --no-confirm
stack exec -- git clone --recursive git://git.haskell.org/ghc.git
cd ghc
stack exec -- git clone git://github.com/snowleopard/shaking-up-ghc shake-build
stack exec -- perl boot
stack exec -- bash configure --enable-tarballs-autodownload
stack build --stack-yaml=shake-build/stack.yaml --only-dependencies
stack exec --stack-yaml=shake-build/stack.yaml -- shake-build/build.bat -j