As I’ve already explained I’ve invented and implemented an experimental functional language – PYFL (PYthon based Functional Language) – to try out some ideas.

For example, PYFL has a full set of Variable Binding Operators (VBOs) that use a linear ASCII form to represent the constructs like sigma notation of conventional mathematics. For example the following adds up the first 20 squares

`sumfor i in range(1,20) all i*i end`

and the following tests if N is prime

`forall d in range(2,sqrt(N)): N mod d != 0 end`

In the previous post I described the PYFL approach to input, which is (arguably) purely functional, drastically simpler, and trivial to implement, as compared to Haskell’s cumbersome IO monad. (Btw I have nothing against monads or Haskell in general, I’m just not impressed by the Haskell IO monad).

This time I’ll talk about PYFL’s output scheme. It ticks two of the three boxes just mentioned – it’s simple and easily implemented. Here’s some output (yep, Pascal’s triangle). I’ll show the program at the end of this post.

Continue reading →