Skip to content

Instantly share code, notes, and snippets.

View rcaught's full-sized avatar

Ryan Caught rcaught

  • The Internet
View GitHub Profile
class Address
def initialize address, display_name, domain
@address = address
@display_name = display_name
@domain = domain
end
attr_reader :address, :display_name, :domain
def self.from_header h # returns an Array of Addresses
@singpolyma
singpolyma / Cache.hs
Created July 18, 2013 14:34
Simple in-process key/value cache for Haskell
-- | Simple in-process key/value cache
--
-- Of course, for really simple stuff you could probably use unsafeInterleaveIO
module Cache (Cache, newCache, fromCache) where
import Control.Monad (void)
-- Could also use STM instead
import Control.Concurrent (forkIO, Chan, newChan, readChan, writeChan, MVar, newEmptyMVar, putMVar, takeMVar)