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
-- file Hello.hscript | |
"Hello world" | |
let val = id | |
let assert = id | |
let a = 3 | |
val a | |
let square x = x * x |
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
{-| Many actions in base monad transformers cannot be automatically | |
'Control.Monad.Trans.Class.lift'ed. These functions lift these remaining | |
actions so that they work in the 'Proxy' monad transformer. | |
-} | |
{-# LANGUAGE CPP #-} | |
{-# LANGUAGE Rank2Types #-} | |
module Pipes.Lift ( | |
-- * ErrorT |
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 qualified Data.Text.Lazy as TL | |
import qualified Data.Text.Lazy.IO as TL | |
import qualified Data.Text as T | |
import qualified Data.Text.Encoding as T | |
import Pipes | |
import qualified Pipes.Text as PT | |
import qualified Data.ByteString.Lazy.Char8 as BL | |
import qualified Data.ByteString.Char8 as B |
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 LambdaCase#-} | |
import qualified Pipes.ByteString as BP | |
import Pipes | |
import Pipes.Parse | |
import qualified Data.ByteString as B | |
import qualified Data.Text as T | |
import Data.Text (Text(..)) | |
import qualified Data.Text.IO as T | |
import Data.Text.Encoding | |
import Data.Text.Encoding.Error |
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 BangPatterns, CPP, ForeignFunctionInterface, GeneralizedNewtypeDeriving, MagicHash, | |
UnliftedFFITypes #-} | |
-- This module lifts assorted materials from Brian O'Sullivan's text package | |
-- especially Data.Text.Encoding in order to define a pipes-appropriate | |
-- streamDecodeUtf8 | |
module Pipes.Text.Internal | |
( Decoding(..) | |
, streamDecodeUtf8 | |
) where | |
import Control.Monad.ST.Unsafe (unsafeIOToST, unsafeSTToIO) |
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 Test.QuickCheck hiding ((.&.)) | |
import Test.Framework (Test, testGroup, defaultMain) | |
import Test.Framework.Providers.QuickCheck2 (testProperty) | |
import Debug.Trace (trace) | |
import Control.Exception (SomeException, evaluate, try) | |
import System.IO.Unsafe (unsafePerformIO) | |
import Data.Bits ((.&.)) |
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
benchmarking lazy text | |
mean: 3.904823 ms, lb 3.844596 ms, ub 4.018289 ms, ci 0.950 | |
std dev: 410.2641 us, lb 239.7706 us, ub 612.5513 us, ci 0.950 | |
benchmarking new conduit | |
mean: 7.473182 ms, lb 7.354699 ms, ub 7.651235 ms, ci 0.950 | |
std dev: 739.4707 us, lb 538.1933 us, ub 975.3947 us, ci 0.950 |
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 RankNTypes #-} | |
import Data.Conduit | |
import qualified Data.Conduit.Text as CT | |
import Criterion.Main | |
import qualified Data.Text as T | |
import qualified Data.Text.Lazy as TL | |
import qualified Data.Text.Lazy.Encoding as TLE | |
import qualified Data.ByteString as S | |
import qualified Data.ByteString.Lazy as L | |
import qualified Data.Conduit.List as CL |
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 BangPatterns#-} | |
{-# LANGUAGE RankNTypes #-} | |
import Blaze.ByteString.Builder (Builder, fromByteString, toByteString) | |
import Control.Exception (Exception) | |
import Control.Monad.Trans.Class (lift) | |
import Data.ByteString (ByteString) | |
import qualified Data.ByteString as S | |
import qualified Data.ByteString.Lazy as L | |
import Data.Monoid |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="Content-Style-Type" content="text/css" /> | |
<meta name="generator" content="pandoc" /> | |
<title></title> | |
<style type="text/css">code{white-space: pre;}</style> | |
<style type="text/css"> | |
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { |