This file contains 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
Prog [DDef {tyName = TypeDict, | |
kVars = [(a, Star)], | |
cVars = [], | |
sVars = [], | |
cases = [KCons {conName = ArrowTyDict, | |
fields = [ConTy TypeDict [VarTy a],ConTy TypeDict [VarTy b]], | |
outputs = [ConTy ArrowTyDict [VarTy a,VarTy b]]}, | |
KCons {conName = IntDict, | |
fields = [], |
This file contains 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 ScopedTypeVariables #-} | |
{-# OPTIONS_GHC -fdefer-type-errors #-} | |
module Ghostbuster where | |
import Prelude hiding (Int, Maybe(..), Bool(..)) | |
data TypeDict a where | |
data TyEquality a b where | |
Refl :: TyEquality a a |
This file contains 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 TypeFamilies #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Main where | |
import Data.Proxy | |
class SpecList a where | |
type List a :: * |
This file contains 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 TypeFamilies #-} | |
{-# LANGUAGE MagicHash #-} | |
-- | | |
module Data.LVar.Future where | |
import Control.DeepSeq | |
import Control.Exception (throw) |
This file contains 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
main = print "hello world" |
This file contains 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
$ cabal --version | |
cabal-install version 1.20.1.0 | |
$ cabal install turtle | |
Resolving dependencies... | |
Configuring ansi-wl-pprint-0.6.7.3... | |
Downloading clock-0.5.1... | |
Configuring hostname-1.0... | |
Configuring managed-1.0.0... | |
Configuring optional-args-1.0.0... | |
Building ansi-wl-pprint-0.6.7.3... |
This file contains 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
This is the average latency as measured by a single trial run of 100K ping/pongs with several different transports. | |
PingTCP: 7.34s >80%CPU | |
PingTCPTransport: 19s ~60%CPU | |
PingPipes: 6.36s >=100%CPU | |
The machine is a 3.1 ghz Intel Westmere (Dell workstation) running RHEL 6.2. | |
The PingTCP is a baseline that uses the raw Network.Socket interface rather than the Network.Transport abstraction. |
This file contains 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 RankNTypes, GeneralizedNewtypeDeriving, CPP #-} | |
import Data.Vector.Mutable as MV | |
import qualified Data.Vector as V -- ((!), freeze) | |
import Control.Monad.ST | |
import Control.Monad.Primitive | |
import Prelude hiding (read) | |
type Splitter a = a -> (a,a) |
This file contains 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 Main where | |
How to write hybrid CPU/GPU programs with Haskell | |
------------------------------------------------- | |
What's better than programming a GPU with a high-level, | |
Haskell-embedded DSL (domain-specific-language)? Well, perhaps | |
writing portable CPU/GPU programs that utilize both pieces of |
This file contains 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 Data.Complex | |
-- This should be the biggest representable double: | |
big :: Double | |
big = 1.7976931348623157e308 | |
-- This uses OCaml's approach at overflow-avoidance: | |
mag :: Complex Double -> Double | |
mag (x:+y) = |