[hs-base] - a Debian 7 (Wheezy) base environment
[debian:7] + build dev-docker/hs-base/Dockerfile --> [hs-base]
[ghc-boot]
- an environment with a bootstrap GHC
#!/bin/sh | |
inPreprocessorMode () { | |
hasE=0 | |
hasU=0 | |
hasT=0 | |
for arg in "$@" | |
do | |
if [ 'x-E' = "x$arg" ]; then hasE=1; fi | |
if [ 'x-undef' = "x$arg" ]; then hasU=1; fi |
module SequsHorribilis | |
where | |
import Test.HUnit | |
type Sequs = [Horribilis] | |
data Horribilis = Atom Int | List Sequs | |
deriving (Eq, Show) | |
upThru :: Int -> Sequs -> Sequs |
{- | |
Copyright 2012-2013 Google Inc. All Rights Reserved. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
module SetPrime where | |
-- import qualified Data. as List | |
-- no need to import List, as the function all is in the Prelude | |
import Control.Applicative ((<$>), (<*>)) | |
-- prefer explicit imports most of the time | |
data Shape = Oval | Squiggle | Diamond deriving (Show, Eq, Bounded, Enum, Ord) | |
data Color = Red | Purple | Green deriving (Show, Eq, Bounded, Enum, Ord) |
module Triangle where | |
-- top-down version | |
minTriangleFlow :: (Num a, Ord a) => [[a]] -> a | |
minTriangleFlow = minimum . foldl sift [] | |
where sift as bs = zipWith (+) bs $ pres as | |
pres [] = [0] | |
pres as@(ah:at) = ah : zipWith min as at ++ [last as] | |
-- bottom-up version (not safe if triangle input is misformed) |
module Ant | |
where | |
import Prelude hiding (log) | |
import Control.Monad ((>=>)) | |
import Data.List ((\\)) | |
-- | A Simple logging Monad that logs items of type e |
#!/usr/bin/env runghc | |
module Main where | |
{- | |
Uninstall.hs - a Haskell uninstaller for Mac OS X | |
This program is really far too big to be in a single file. However, I | |
wanted it to be easily distributable and runnable, and so have kept it all | |
together. |