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
breuleux / op.py
Last active Dec 20, 2015
Operator precedence parsing
View op.py
class Operator:
def __init__(self, name, leftp, rightp, merge, fixity, label = None):
self.name = name
self.leftp = leftp
self.rightp = rightp
self.merge = merge
self.fixity = fixity
self.label = label or name
@breuleux
breuleux / exc.py
Created Jan 14, 2012
Exception factory
View exc.py
# This code is public domain. Copy away!
exception_classes = dict(
type = TypeError,
value = ValueError,
key = KeyError,
index = IndexError #, ...
)
def Exc(kind):
View quicksort.eg
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.