for your convinience this instuction is available as:
gist
git repo
# settings
{- | |
Uses the She (Stathclyde Haskell Enhancement), which you | |
can get from http://bit.ly/gaVM8X. | |
-} | |
{-# OPTIONS_GHC -Wall -F -pgmF she #-} | |
{-# LANGUAGE GADTs, KindSignatures #-} | |
{-# LANGUAGE TypeFamilies, TypeOperators #-} | |
{-# LANGUAGE RankNTypes, FlexibleContexts #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} |
#!/bin/env python | |
""" | |
os.walk is an awesome generator. | |
However, I needed the same functionality, | |
only I wanted to walk 'up' the | |
directory tree. | |
This allows seaching for files | |
in directories directly above |
import System.Directory | |
import System.Environment | |
import System.FilePath | |
import Control.Applicative ((<$>)) | |
import Control.Arrow (first, second) | |
import Control.Monad (void) | |
import Data.Either (rights) | |
import Data.List (isSuffixOf) | |
import Data.Set (Set, (\\), empty, fromList, insert, singleton, toList, union) | |
import Text.Parsec |
var SPREADSHEET_ID='Google Sheets ID'; | |
var SHEET_NAME = 'Google Sheets Table Name'; | |
function doGet(request) { | |
var callback = request.parameters.jsonp; | |
var range = SpreadsheetApp.openById(SPREADSHEET_ID).getSheetByName(SHEET_NAME).getDataRange(); | |
var json = callback+'('+Utilities.jsonStringify(range.getValues())+')'; | |
return ContentService.createTextOutput(json).setMimeType(ContentService.MimeType.JAVASCRIPT); | |
} |
From Geoff Anders, of Leverage Research (http://www.leverageresearch.org/) | |
For people doing goal factoring - or for people making any sort of box-and-arrow diagram - I recommended the program yEd. It is available here: http://www.yworks.com/en/products_yed_about.html | |
After you install it, I highly recommend setting up the defaults in the following way: | |
1. Open yEd. | |
2. Create a new document. | |
3. Click the white background; a small yellow square should appear on the canvas. | |
4. Click the small yellow square so as to select it. |
{-# LANGUAGE MagicHash, TupleSections, TemplateHaskell #-} | |
module Data.Vector.Storable.Bake(bake, unsafeFromAddrLen) where | |
import Data.Typeable | |
import qualified Data.Vector.Storable as VS | |
import Foreign | |
import GHC.Prim | |
import GHC.Ptr | |
import Language.Haskell.TH |
{-# LANGUAGE ForeignFunctionInterface #-} | |
module Adder where | |
import Foreign.C | |
adder :: CInt -> CInt -> IO CInt | |
adder x y = return $ x + y | |
foreign export ccall adder :: CInt -> CInt -> IO CInt |
löb is a well-known function in Haskell for implementing spreadsheet-like behaviors and tying the knot. It is defined as:
loeb :: Functor f => f (f a -> a) -> f a
loeb fs = xs
where xs = fmap ($ xs) fs
{-# LANGUAGE Rank2Types #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
module Mtl where | |
import Control.Monad.State | |
import Control.Monad.Except | |
runMtl | |
:: Bool |