Roy - Pretty Printing
This week I created an initial version of a pretty printer for Roy code. The REPL will now take a :s
command pointing at a bound name, like so:
roy> let x= \a-> a+ 100
roy> :s x
\a -> a + 100
Notice that it pads out the operators. It also works on things like arrays and objects:
roy> let y = [1,2,3]
roy> :s y
[1, 2, 3]
roy> let z = {a: 1 , b:true, c: "three"}
roy> :s z
{a: 1, b: true, c: "three"}
I have futures plans to expand this into a standalone formatter so that Roy source will have something like gofmt.
In other Roy news:
- We have some better monad examples
- I fixed a bug in recursive functions using data constructors
- The Roy version that the site is based off has been added to the footer of http://roy.brianmckenna.org/
Please enable JavaScript to view the comments powered by Disqus.