As I’ve already explained I’ve invented and implemented an experimental functional language – PYFL (PYthon based Functional Language

PYFL Output: the magic of simple side effects | Bill Wadge's Blog

submited by
Style Pass
2021-06-07 14:30:04

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

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.

Unfortunately I can’t claim that PYFL output is functional. It shamelessly causes a side effect. I just don’t know how to do better.

Leave a Comment