Skip to content

Instantly share code, notes, and snippets.

@gregorycollins
gregorycollins / HashTables.hs
Created February 12, 2013 16:25
Hashtables benchmark
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Data.Hashable
import qualified Data.HashTable.IO as H
newtype HInt = HInt Int
deriving (Num, Eq, Ord)
instance Hashable HInt where
hashWithSalt _ (HInt k) = k
@gregorycollins
gregorycollins / bench-console.txt
Last active December 14, 2015 16:29
Conduit/io-streams/handle benchmark
streams /usr/local/google/home/gdc/tmp/haskell/conduit/io-streams-conduit [*] $ ./bench -g -o report.html
warming up
estimating clock resolution...
mean is 1.412510 us (640001 iterations)
found 3120 outliers among 639999 samples (0.5%)
2526 (0.4%) high severe
estimating cost of a clock call...
mean is 32.34526 ns (14 iterations)
found 3 outliers among 14 samples (21.4%)
3 (21.4%) low severe
-- | Internal implementation of the @io-streams@ library, intended for library
-- writers
--
-- Library users should use the interface provided by "System.IO.Streams"
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
@gregorycollins
gregorycollins / Main.hs
Created June 10, 2013 12:44
Minimal failing test suite for hashable 1.2.0.7
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad (forM_)
import Data.Bits
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as S
import Data.Hashable (hash)
import Data.List (foldl', intercalate)
import qualified Data.Map as Map
@gregorycollins
gregorycollins / .gitignore
Last active August 29, 2015 13:56
Haskell-cafe thread on Feb 19 2014
dist
*~
\#*

TODO list for Snap 1.0

  • add remaining repositories to buildbot
  • cleanup/refactor command-line config stuff
  • kill warnings
  • release io-streams-haproxy
    • one more cleanup TODO re: passing in SockAddrs
  • cleanup docs
    • io-streams-style tutorial material and usage examples for most of the api
  • clean up the tutorial material on the website (second priority to the api docstrings)
@gregorycollins
gregorycollins / .gitignore
Last active August 29, 2015 14:01
Directory traversal with io-streams
#*#
*~
.cabal-sandbox
TAGS
cabal.sandbox.config
dist/
(defun haskell-style ()
"Sets the current buffer to use Haskell Style. Meant to be
added to `haskell-mode-hook'"
(interactive)
(haskell-indent-mode 1)
(haskell-doc-mode 1)
;; (turn-on-haskell-indentation)
(setq haskell-indent-thenelse 2
haskell-indent-after-keywords '(("where" 2 0)
("of" 2)
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.0-0.rc4.git3.990.surfacepro3.fc24.x86_64 ([email protected]) (gcc version 5.3.1 20151207 (Red Hat 5.3.1-1) (GCC) ) #1 SMP Thu Dec 10 19:24:04 UTC 2015
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.4.0-0.rc4.git3.990.surfacepro3.fc24.x86_64 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/root rd.lvm.lv=fedora/00 rd.luks.uuid=luks-697f4fed-dd84-4ae6-98ef-3781e522cd41 rhgb quiet LANG=en_US.UTF-8 nouveau.modeset=0 rd.driver.blacklist=nouveau video=vesa:off
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: xstate_offset[3]: 960, xstate_sizes[3]: 64
[ 0.000000] x86/fpu: xstate_offset[4]: 1024, xstate_sizes[4]: 64
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x01: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x02: 'SSE re
Bus 002 Device 002: ID 045e:090b Microsoft Corp.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 9 Hub
bDeviceSubClass 0
bDeviceProtocol 3
bMaxPacketSize0 9
idVendor 0x045e Microsoft Corp.