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 Control.Concurrent.Chan (Chan, newChan) | |
import qualified Data.Map as M | |
import Control.Concurrent.STM | |
import Control.Monad.Trans (MonadIO, liftIO) | |
import GHC.Conc (unsafeIOToSTM) | |
type Id = Integer | |
getOrCreateChannel :: (MonadIO m) => Id -> TVar (M.Map Id (Chan a)) -> m (Chan a) | |
getOrCreateChannel cid t = liftIO . atomically $ do |
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 BangPatterns #-} | |
{-# LANGUAGE DeriveDataTypeable #-} | |
module AlphaHeavy.Exception | |
( setDefaultUncaughtExceptionHandler | |
, lastException | |
, uncaughtExceptionHandler | |
) where | |
import Control.Exception (Exception(..), SomeException(..)) |
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.Array.ST | |
import Control.Monad.ST | |
import Control.Monad.Reader | |
type Env = String | |
type ReaderST s = ReaderT Env (ST s) | |
foo :: ReaderST s [Int] | |
foo = do |
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 BangPatterns #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE OverlappingInstances #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE ScopedTypeVariables #-} |
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
int someCall(int x) | |
{ | |
return x * x; | |
} |
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 OverloadedStrings #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Forall where | |
import Control.Applicative | |
import Data.Aeson | |
import Control.Monad | |
data Bar = Bar Int | |
data Baz = Baz Int Int |
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.Aeson | |
import Data.Attoparsec | |
import qualified Data.Enumerator as E | |
import qualified Data.Enumerator.Binary as Eb | |
import qualified Data.Enumerator.List as El | |
import qualified Data.ByteString as BS | |
byteLines :: Monad m => E.Enumeratee BS.ByteString BS.ByteString m b | |
byteLines = Eb.splitWhen (== 10) -- 10 is LF |
This file has been truncated, but you can view the full file.
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
.file "/tmp/ghc20442_0/ghc20442_0.bc" | |
.file 1 "/home/nhowell/source/ghc-profiling/libraries/unix/dist-install/build/System/Posix/User.hs" | |
.section .debug_info,"",@progbits | |
.Lsection_info: | |
.section .debug_abbrev,"",@progbits | |
.Lsection_abbrev: | |
.section .debug_aranges,"",@progbits | |
.section .debug_macinfo,"",@progbits |
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
#line 1 "ParseInt64.rl" | |
#include <HsFFI.h> | |
#line 7 "ParseInt64.c" | |
static const int ParseInt64_start = 1; | |
static const int ParseInt64_first_final = 3; | |
static const int ParseInt64_error = 0; |
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
{-# OPTIONS_GHC -fno-warn-deprecations #-} | |
{-# OPTIONS_GHC -fno-warn-orphans #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
module Main (main) where | |
import Control.Monad (when) | |
import qualified Data.ByteString.Lazy as BL |