Skip to content

Instantly share code, notes, and snippets.

@timjstewart
timjstewart / cabal-init
Last active August 29, 2015 14:10
Quickly create a scratch cabal sandbox and project complete with hspec/QuickCheck tests.
#! /bin/bash
package_name=$(basename `pwd`)
log_file=./cabal-init.log
function fatal() {
echo "$1. Examine ${log_file} for more information." 2>&1
exit 1
}
@ian-ross
ian-ross / RingOscillator.hs
Created November 13, 2012 14:31
Ring oscillator toy with Fay
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE NoImplicitPrelude #-}
module RingOscillator (main) where
import Language.Fay.FFI
import Language.Fay.Prelude
-- System parameters.
@ian-ross
ian-ross / Lorenz.hs
Created November 7, 2012 09:50
Haskell Lyapunov exponent calculations using method of Rangarajan et al. (1998)
module Lorenz where
import Data.Default
data LzParam t = LzParam { sigma :: t, r :: t, b :: t } deriving (Eq, Show)
instance Floating t => Default (LzParam t) where
def = LzParam 10 28 (8/3)
lorenz :: Floating t => t -> [t] -> [t]