Consider this simple .hs
file:
module MinHaddockFail where
yo :: String
yo = "yo"
module Ant | |
where | |
import Prelude hiding (log) | |
import Control.Monad ((>=>)) | |
import Data.List ((\\)) | |
-- | A Simple logging Monad that logs items of type e |
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 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) |
{- | |
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 SequsHorribilis | |
where | |
import Test.HUnit | |
type Sequs = [Horribilis] | |
data Horribilis = Atom Int | List Sequs | |
deriving (Eq, Show) | |
upThru :: Int -> Sequs -> Sequs |
#!/bin/sh | |
. /usr/local/pisound/scripts/common/common.sh | |
log "starting pbj" | |
flash_leds 1 | |
killall scsynth | |
killall sclang | |
rm -f /tmp/sclang-*.log 2>/dev/null || true |
#!/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. |
#include <Adafruit_SPIFlash.h> | |
namespace { | |
// === | |
// === Test Data Generation and Checking | |
// === | |
const size_t BLOCKSIZE = 512; |