Nathan Lilienthal

Results 241 comments of Nathan Lilienthal

The binary tree example is a pretty simple example, but in essence the goal is to be able to refer to the type you are defining inside of itself. A...

It is _not_ a limitation of ruby, there are plenty of strict languages who implement recursive datatypes. Typed Racket or ML are great examples. Typed Racket solves the problem by...

Exactly. The work done here if done in a smart way will also be able to open up doors for polymorphic types as well.

I don't think people should be expected to "resolve" their own contracts. These matters should be dealt with internally when the contract system goes to check a guard. Calling it...

Totally not calling this well thought out enough to be _done_ but heres something that works. ``` ruby require 'contracts' include Contracts class Ref < CallableClass def initialize(contract) @contract =...

Another option is what the coffeescript guys are doing. ``` o :: a: Num b: Self c: (Num) -> Self inner: { y: Bool, z: Self } o = #......

The coffeescript library for contracts.

I also was playing around with a `Self` however I feel it would be confusing because there is also `self`. I'd opt to calling the same concept `Rec` to draw...

Right, I forgot that this gem provides multi-dispatch for a moment. That throws a wrench in the classical contract system. The problem with using `Rec` for these cases, is that...