--- rough notes ---
Gary introduces an side project that Gary has been working on part-time for an little over an year, including ...
ExUnit.start | |
defmodule MacroExpansionTest do | |
use ExUnit.Case | |
defmacro a_macro(_) do | |
quote do | |
1 + 1 | |
end | |
end |
class Responder a where | |
respond :: a -> Controller () | |
class Injectable a where | |
inject :: Controller (Maybe a) | |
instance (Injectable a, Responder b) => Responder (a -> b) where | |
respond f = do | |
a <- inject | |
case a of |
withResourceSnap :: Pool a -> (a -> Handler b v c) -> Handler b v c | |
withResourceSnap pool act = bracketHandler (takeResource pool) putResource' runAction | |
where runAction (a,b) = act a | |
putResource' (a,b) = putResource b a |
withResource pool (\_ -> do | |
logError "gave a resource" | |
pass | |
logError "took back the resource" | |
) |
highlight ExtraWhitespace ctermbg=red guibg=red | |
au ColorScheme * highlight ExtraWhitespace guibg=red | |
au BufEnter * match ExtraWhitespace /\s\+$/ | |
au InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ | |
au InsertLeave * match ExtraWhiteSpace /\s\+$/ |
set nocompatible | |
filetype off | |
silent! call pathogen#runtime_append_all_bundles() | |
silent! call pathogen#helptags() | |
filetype plugin indent on | |
runtime macros/matchit.vim | |
set hidden | |
set autoread | |
set nobackup |
diff --git a/src/Data/RingBuffer/Vector.hs b/src/Data/RingBuffer/Vector.hs | |
index ed37817..4c6f05d 100644 | |
--- a/src/Data/RingBuffer/Vector.hs | |
+++ b/src/Data/RingBuffer/Vector.hs | |
@@ -51,25 +51,34 @@ newRingBuffer size zero = do | |
consumeFrom :: MVector a -> Int -> Barrier -> Consumer a -> IO () | |
consumeFrom (MVector mvec) modm barr (Consumer fn sq) = do | |
- vec <- V.unsafeFreeze mvec | |
- consumeFrom' vec |
require 'thread' | |
class Actor | |
class ActorDied < RuntimeError; end | |
def self.queue | |
@queue ||= Queue.new | |
end | |
def self.push(x) | |
queue.push(x) |
--- rough notes ---
Gary introduces an side project that Gary has been working on part-time for an little over an year, including ...
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
import Data.Traversable | |
instance (Traversable t) => (Functor t) |