4 ms·
What does a functional Python look like? To me, a functional language without tail recursion seems pointless. Is it possible to abstract away whether you are r
by haet 6y ago
What does a functional Python look like?
To me, a functional language without tail recursion seems pointless. Is it possible to abstract away whether you are recursive or iterative, like an iterative recursion scheme?
One thing that I think would be great is if there was a Python approach to effects systems like Polysemy (free monads); what might an in between be for this?
- m_mueller 6y agoI don't think Python's type system is capable enough (yet) for something like this. However tail recursion optimization to me is a non issue - for something expensive and deeply nested I use an iterative approach, and for everything else python's recursion is good enough. There are not that many usecases like this per code base anyways, in my experience. In my current one there is one central facility to do object loading based on yaml definitions, that's the one place I need it there for example.
- lmm 6y ago> To me, a functional language without tail recursion seems pointless. Tail recursion is a low-level detail IMO. Scala does fine without it.
- Qem 6y agoPharo too. See https://stackoverflow.com/questions/37089768/does-pharo-provide-tail-call-optimisation https://stackoverflow.com/questions/37089768/does-pharo-prov...