Humpty Dumpty sat on a wall,
Humpty Dumpty had a great fall.
All the king's horses and all the king's men
Couldn't put Humpty together again.
This file contains hidden or 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
#!/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. |
This file contains hidden or 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
import Control.Concurrent | |
import Control.Concurrent.Async | |
import Control.Applicative | |
import Control.Monad | |
import Data.Traversable | |
newtype Concurrently a = Concurrently { runConcurrently :: IO a } | |
instance Functor Concurrently where |
This file contains hidden or 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 ImplicitParams, ParallelListComp,MonadComprehensions #-} | |
import Control.Monad | |
import Control.Monad.Fix | |
import Control.Monad.Zip | |
import Control.Applicative | |
import Control.Concurrent | |
import Control.Concurrent.MVar | |
import Control.Exception | |
import Prelude -- hiding (catch) | |
import Data.IORef |
This file contains hidden or 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 HTML where | |
class Tag a where | |
toHTML :: a -> String | |
data Attribute = Attribute { | |
key :: String, | |
value :: String | |
} deriving Show |
This file contains hidden or 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
countPackets p = | |
let v = AL.parse (CA.many packetValue) p | |
r = fromMaybe [] $ AL.maybeResult v | |
in r |
This file contains hidden or 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 FileIO (FHandle,open,write,flush,close,obtainPrefixLock,releasePrefixLock,PrefixLock) where | |
import System.Win32(HANDLE, | |
createFile, | |
gENERIC_WRITE, | |
fILE_SHARE_NONE, | |
cREATE_ALWAYS, | |
fILE_ATTRIBUTE_NORMAL, | |
win32_WriteFile, | |
flushFileBuffers, | |
closeHandle) |
This file contains hidden or 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 OverloadedStrings#-} | |
import Data.Aeson.Types | |
import Data.Aeson | |
import qualified Data.Vector as V | |
import qualified Data.ByteString.Lazy as L | |
import Data.HashMap.Strict | |
import qualified Data.Text as T | |
-- this is backward maybe -- also doesn't crack open the Values |
This file contains hidden or 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
import Control.Monad | |
import Control.Concurrent | |
import Control.Concurrent.STM | |
import System.Random | |
import Text.Printf | |
-- Forks | |
type Fork = TMVar Int | |
newFork :: Int -> IO Fork |
This file contains hidden or 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 ScopedTypeVariables #-} | |
import System.Environment | |
import Data.Char | |
import System.IO | |
import System.Process | |
import System.Exit | |
import Control.Concurrent (forkIO, newEmptyMVar, putMVar, takeMVar) | |
import qualified Control.Exception as C |