This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quicksort{match} = | |
{} -> {} | |
{p, *xs} -> | |
{*quicksort{l1}, p, *quicksort{l2}} where | |
{l1, l2} = partition{xs} with {x} -> x < p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code is public domain. Copy away! | |
exception_classes = dict( | |
type = TypeError, | |
value = ValueError, | |
key = KeyError, | |
index = IndexError #, ... | |
) | |
def Exc(kind): |