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
module Main where | |
import System.Directory (getDirectoryContents) | |
import Control.Monad (forM_) | |
import Data.Functor ((<$>)) | |
import System.Posix.Files (getSymbolicLinkStatus, isDirectory) | |
withIsLast :: [a] -> [(a, Bool)] | |
withIsLast [] = [] | |
withIsLast [x] = [(x, True)] |
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
#include <rfftw.h> | |
#include <math.h> | |
#include <stdio.h> | |
/* the out format is: */ | |
/* r0, r1, r2, ..., rn/2, i(n+1)/2-1, ..., i2, i1 */ | |
void fft(int n, fftw_real in[n], fftw_real power_spectrum[n/2+1]) | |
{ | |
fftw_real out[n]; | |
rfftw_plan p; |
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
;;(load "/local-home/user18/repos/thirdparty/emacs-haskell-config/init.el") | |
(add-to-list 'load-path "~/repos/thirdparty/emacs-haskell-config/packages/haskell-mode/") | |
(require 'haskell-mode-autoloads) | |
(add-to-list 'Info-default-directory-list "~/repos/thirdparty/emacs-haskell-config/packages/haskell-mode/") | |
(require 'cl) | |
(add-to-list 'load-path "~/.emacs.d/lisp") | |
(require 'cask "~/.cask/cask.el") |
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
{-# OPTIONS -Wall #-} | |
{-# LANGUAGE TypeFamilies, FlexibleInstances #-} | |
import Data.Map | |
class Indexable a where | |
type Index a | |
type Result a | |
index :: a -> Index a -> Result a |
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 FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
class Indexable a where | |
instance Indexable (String, Int, Char) where | |
instance Indexable ([(String, a)], String, a) where | |
test1 :: Indexable (a,b,c) => a -> b -> c |
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
-- see http://mlton.org/OptionalArguments | |
module OptionalArg where | |
data Product a b = a :& b deriving Show | |
end (a, f) = f a | |
fold (a, f) g = g (a, f) | |
step0 h (a, f) = fold (h a, f) | |
step1 h (a, f) b = fold (h (b, a), f) | |
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
var ordArray = function (__dict_Ord_9) { | |
return { | |
"__superclasses": { | |
"Prelude.Eq_0": function (_) { | |
return eqArray(__dict_Ord_9["__superclasses"]["Prelude.Eq_0"]({})); | |
} | |
}, | |
compare: function (_20) { | |
return function (_21) { | |
if (_20.length === 0) { |
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
# Next-generation IDE for functional programming | |
# Run it, and press any key to start writing code. | |
# It will automatically exit when you're done writing your function. | |
# Work in progress, currently supports factorial | |
import sys | |
factorial = 'fac n = if n > 1 then n * (fac (n - 1)) else 1'.split() |
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 MagicHash #-} | |
module Main where | |
import Control.Monad | |
import Data.Word (Word64) | |
import qualified Data.ByteString.Char8 as BS8 | |
import Control.DeepSeq | |
import qualified Data.Text.Array as A | |
import GHC.Prim | |
import GHC.Base (Int(..)) |
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
-- | | |
module Bidirectional where | |