Skip to content

Instantly share code, notes, and snippets.

@thsutton
thsutton / demo.hs
Last active August 29, 2015 14:07 — forked from anonymous/demo.hs
module Main where
import Control.Applicative
import Data.Char
import Data.List
import Options.Applicative
import Options.Applicative.Types
-- * Options parsers
@thsutton
thsutton / demo.hs
Last active August 29, 2015 14:07 — forked from anonymous/demo.hs
module Main where
import Control.Applicative
import Data.Char
import Data.List
import Options.Applicative
import Options.Applicative.Types
-- * Options parsers
<?php
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernel;
@thsutton
thsutton / branch.hs
Created December 29, 2011 12:01 — forked from snoyberg/branch.hs
branch in conduits
{-# LANGUAGE NoMonomorphismRestriction #-}
import Data.Conduit
import qualified Data.Conduit.List as CL
branch :: Resource m
=> Sink lIn m lOut
-> Sink rIn m rOut
-> Sink (Either lIn rIn) m (lOut, rOut)
branch (Sink mlsink) (Sink mrsink) = Sink $ do
lsink <- mlsink