Hacker News new | ask | show | jobs
by zumatic 3979 days ago
This is also found in the Ruby hardware description language (not the same as the scripting language). A commonly-occurring pattern is:

R^~1 ; S ; R

where R and S are functions, ';' is composition ('.' in Haskell) and '^~1' is inverse. Usually this is for wiring (change order or grouping of wires to suit block S).

The wrinkle in Ruby is that R and S can be relations, not just functions, so data can flow both ways, just like actual hardware (can only flow from right to left in Haskell). Ruby won't try to guess the obverse function, unlike J.

1 comments

...and I should have said that you can replace the above by:

S \ R