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 FlexibleContexts #-} | |
{-# OPTIONS_GHC -Wall #-} | |
import Control.Exception | |
import Control.Monad | |
import System.IO | |
import Control.Monad.Except | |
import Pipes.Core ((+>>)) | |
import qualified Data.Iteratee as I | |
import qualified Data.Iteratee.Char as I |
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 GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeOperators #-} | |
module ForallConstraints where | |
import Data.Monoid | |
import Data.Constraint | |
import Data.Constraint.Forall | |
data Box t 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 FlexibleInstances #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE UndecidableInstances #-} -- GHC 7.6 needs this but GHC 7.8 does not | |
module Undecidable where | |
class a ~ a => C a | |
instance a ~ a => C a |
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
diff --git a/src/Control/Retry.hs b/src/Control/Retry.hs | |
index 64bf19f..36daf84 100644 | |
--- a/src/Control/Retry.hs | |
+++ b/src/Control/Retry.hs | |
@@ -4,6 +4,7 @@ | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
+{-# LANGUAGE ViewPatterns #-} | |
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 #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
import Control.Concurrent | |
import Control.Exception | |
import Control.Monad | |
import Data.Function | |
import Data.Monoid | |
import Data.Text | |
import System.Timeout |
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
#!/bin/bash | |
cabal configure && cabal build && cabal haddock --hyperlink-source \ | |
--html-location='http://hackage.haskell.org/package/$pkg/docs' \ | |
--contents-location='http://hackage.haskell.org/package/$pkg' | |
S=$? | |
if [ "${S}" -eq "0" ]; then | |
cd "dist/doc/html" | |
DDIR="${1}-${2}-docs" | |
cp -r "${1}" "${DDIR}" && tar -c -v -z -Hustar -f "${DDIR}.tar.gz" "${DDIR}" | |
CS=$? |
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
-- A simple program to demonstrate Gtk2Hs. | |
module Main (Main.main) where | |
import Graphics.UI.Gtk | |
main :: IO () | |
main = do | |
initGUI | |
-- Create a new window | |
window <- windowNew |
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
[maoe@maoe:~/src/bindings-portaudio/example on master] | |
% brew install portaudio | |
Warning: portaudio-19.20140130 already installed | |
[maoe@maoe:~/src/bindings-portaudio/example on master] | |
% ./.cabal-sandbox/bin/example-portaudio 44100 1024 | |
Initialization: 0 | |
Available APIs: | |
Opening the default stream: -9985 | |
example-portaudio: user error (Failed.) |
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
{-# OPTIONS_GHC -O2 -fobject-code #-} | |
module DynMap where | |
import Control.Applicative | |
import Control.Monad (join) | |
import Control.Seq | |
import Data.Map (Map) | |
import Data.Traversable (Traversable) | |
import qualified Data.Map as Map | |
import qualified Data.Traversable as T |
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
perform | |
:: (a -> IO b) | |
-> Event a | |
-> SignalGen (Event b) | |
perform f event = generatorE $ execute . f <$> event | |
performSync :: Event (IO a) -> SignalGen (Event a) | |
performSync = perform id | |
-- | Perform IO actions asynchronously in separate threads. |