I hereby claim:
- I am zearen on github.
- I am zearen (https://keybase.io/zearen) on keybase.
- I have a public key whose fingerprint is 1623 CE54 3275 5206 C3AB 0E25 4E71 FD0C 338A 7560
To claim this, I am signing this object:
extern crate petgraph; | |
use petgraph::graph::{Graph, NodeIndex}; | |
use std::fmt; | |
use std::ops::Range; | |
use std::slice::Iter; | |
use std::io::Write; | |
#[derive(Eq, PartialEq, Clone, Copy, Debug)] | |
enum Op { Add, Sub, Mul, Div } |
I hereby claim:
To claim this, I am signing this object:
module Control.Concurrent.QSemR | |
( newQSemR | |
, bracketQSemR | |
, whenEmptyQSemR | |
) where | |
import Control.Exception (bracket) | |
import Control.Concurrent.MVar | |
type QSemR = (MVar (), MVar Int) |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE DeriveDataTypeable #-} | |
import qualified Data.Map as Map | |
import Data.Maybe | |
import Text.Parsec | |
import System.Console.CmdArgs | |
type Map = Map.Map |
{-# LANGUAGE TemplateHaskell #-} | |
module SepiidapusBreeding where | |
import Data.List | |
import Data.Lens.Common | |
import Data.Lens.Template | |
data Karyo | |
= I |
from subprocess import Popen, PIPE | |
class ParseUtil(): | |
def __init__(self, resp): | |
self.resp = resp | |
self.pos = 0 | |
def at(self): | |
return self.resp[self.pos] | |
So I was watching an MIT lecture on algorithms, and they were talking about | |
the quicksort, so I decided I should revisit it in haskell now that I have | |
a little more experience. The common example you see has issues with repeated | |
work. I attempt to minimize this me avoiding list concatenation and | |
using a partition instead. | |
I used literate Haskell because I plan to add better annotations later. | |
> {-# LANGUAGE PatternGuards #-} | |
> module Quicksort where |
data MorseNode = MorseNode | |
{ mnVal :: Char | |
, mnDit :: Maybe MorseNode | |
, mnDah :: Maybe MorseNode | |
} | |
deriving (Eq) | |
instance Show MorseNode where | |
showsPrec _ (MorseNode val dit dah) = ('\'':) . (val:) . ("<."++) | |
. (maybe (' ':) shows $ dit) . ('-':) . (maybe (' ':) shows $ dah) |
{- | |
Zachary Weaver <[email protected]> | |
JSONParser.hs | |
Version 0.1.1 | |
A simple example of parsing JSON with Parsec in haskell. Note that | |
since the primary point of this excersize is demonstration, | |
Text.Parsec.Token was avoided to expose more of the grammar. Also, | |
complicated optimizations and shorcuts were avoided (mostly). |