Skip to content

Instantly share code, notes, and snippets.

Olivier Breuleux breuleux

Block or report user

Report or block breuleux

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
breuleux /
Last active Dec 20, 2015
Operator precedence parsing
class Operator:
def __init__(self, name, leftp, rightp, merge, fixity, label = None): = name
self.leftp = leftp
self.rightp = rightp
self.merge = merge
self.fixity = fixity
self.label = label or name
breuleux /
Created Jan 14, 2012
Exception factory
# This code is public domain. Copy away!
exception_classes = dict(
type = TypeError,
value = ValueError,
key = KeyError,
index = IndexError #, ...
def Exc(kind):
quicksort{match} =
{} -> {}
{p, *xs} ->
{*quicksort{l1}, p, *quicksort{l2}} where
{l1, l2} = partition{xs} with {x} -> x < p
You can’t perform that action at this time.