DEV Community

Alain
Alain

Posted on

Answer: How to make an tail recursive function and test it in ReasonML?

How do you test if this reasonml function is tail recursive. The simple version show you the unannottated function and usingTailCall.re show its annotated in reasonml.

Call in terminal with:

ocamlc -annot -o tailCall -pp "refmt -p ml" -impl tailCall.re
📺 Info Siaran: idkjs/answer how to make an tail recursive function and test it in reasonml fc - Pertandingan Hari Ini 📺 Info Siaran: idkjs/answer how to make an tail recursive function and test it in reasonml fc - Pertandingan Hari Ini

You can check where the tail calls are with:

grep call -A1 tailCall.annot 
📺 Info Siaran: idkjs/answer how to make an tail recursive function and test it in reasonml fc - Pertandingan Hari Ini 📺 Info Siaran: idkjs/answer how to make an tail recursive function and test it in reasonml fc - Pertandingan Hari Ini

Source: https://stackoverflow.com/a/40401233/2336356
Sketch: https://sketch.sh/s/eBl2Z0Wvd21azKu6SFzb9j/

Top comments (0)