An implementation of the #RosettaCode #ContinuedFractions arithmetic draft task, in #Mercury, based very loosely on the #StandardML (that is based on the #Scheme and the #Python:
Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code https://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_ng,_continued_fraction_n1,_continued_fraction_n2)#Mercury
The implementation uses #LazyLists to represent continued fractions.
#rosettacode #continuedfractions #mercury #standardml #scheme #python #lazylists