Alex Fedorov

Results 152 comments of Alex Fedorov

Heh. Ended up doing some black magic: ``` ruby Contract { A } >-> { B } ``` EDIT: btw, valid ruby: `x >-> ...` = `x.>(-> ...)`

Allows to be more haskelly: ``` ruby Contract { A } >-> { B } >-> { C } >-> ... ```

If you haven't yet, look at this stuff: https://github.com/txus/kleisli

I know, I am not going to, it is just that the one who wants to find a way, will always find it. Still, what about this one? ``` ruby...

No, not 100% at least. But that would mean writing proper lexer and parser to get what we want. It would mean parsing free-form ruby + stuff we want to...

Or we might just do eval-ing to ruby: `Contract Contracts::LateBinding[MyContracts, "A, B => C"]` will evaluate the string once, but in different context.

This might create difficulties for tracing errors, when you have typo in that string..

Other thing, that is dangling in my mind is to allow very verbose syntax like that: ``` ruby Contract do inside(MyContracts) do argument A argument B keyword_argument D, default: D.default_value...

By default, you mean this: `include Contracts` will add only `Contract` method and nothing else. Everything else is up to user. ?

Can you provide small example? I can't understand what do you mean by "all contracts are evaluated in their own namespace".