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
/// Playground - noun: a place where people can play | |
/// I am the very model of a modern Judgement General | |
//: # Algorithm W | |
//: In this playground we develop a complete implementation of the classic | |
//: algorithm W for Hindley-Milner polymorphic type inference in Swift. | |
//: ## Introduction |
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
import Cocoa | |
// Note: use of enumeration var in generic is instadeath | |
// Note: use of static var in generic is not yet supported | |
public protocol EnumConvertible: Hashable { | |
init?(hashValue hash: Int) | |
static func countMembers() -> Int | |
static func members() -> [Self] | |
} |
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
myPattern = { | |
name = 'meta.spec.triples'; | |
begin = '(?x) | |
(?<subject> \g<iri> | \g<BlankNode> | \g<collection> ){0} | |
(?<iri> \g<IRIREF> | \g<PrefixedName> ){0} | |
(?<IRIREF> \< (?:[^\x00-\x20\<\>\\\"\{\}\|\^`] | (?:\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8}))* \> ){0} | |
(?<PrefixedName> \g<PNAME_LN> | \g<PNAME_NS> ){0} | |
(?<PNAME_LN> (\g<PNAME_NS>) ( (?: [\p{L}\p{M}_] | [:0-9] | %[0-9A-Fa-f]{2} | [\\_~.\-!$&''\(\)*+,;=/?#@%] ) (?:(?:[\p{L}\p{M}_\-0-9\u00B7\u0300-\u036F\u203F-\u2040] | [:.] | %[0-9A-Fa-f]{2} | [\\_~.\-!$&''\(\)*+,;=/?#@%])* (?:[\p{L}\p{M}_\-0-9\u00B7\u0300-\u036F\u203F-\u2040] | : | %[0-9A-Fa-f]{2} | [\\_~.\-!$&''\(\)*+,;=/?#@%])) )? ){0} | |
(?<PNAME_NS> (?: [\p{L}\p{M}] (?:(?:[\p{L}\p{M}_.\-0-9\u00B7\u0300-\u036F\u203F-\u2040])* [\p{L}\p{M}_\-0-9\u00B7\u0300-\u036F\u203F-\u2040] )? )? \: ){0} | |
(?<BlankNode> \g<BLANK_NODE_LABEL> | \g<ANON> ){0} |
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
git config --get remote.origin.url | sed 's#^[^:]*.\([^.]*\)\.git#http://github.com/\1#' | xargs open |