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
{-# LANGUAGE NoImplicitPrelude, MultiParamTypeClasses, Rank2Types, TypeOperators #-} | |
newtype Id a = | |
Id a | |
data a :\/ b = | |
Left a | |
| Right b | |
data a :/\ b = |
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
# Extremely simple autoloading implementation | |
class Module | |
alias const_missing_without_autoloading const_missing | |
def const_missing(const) | |
path = "#{name.gsub('::', '/')}/#{const}" | |
path.gsub!(/([a-z\d])([A-Z])/,'\1_\2') | |
require path.downcase | |
const_defined?(const) ? const_get(const) : super | |
rescue LoadError => error | |
warn(error.message) |