<div dir="ltr"><div>Given a string representing a decimal point literal (ex. "0.25"), the number it represents is guaranteed to be rational. It seems appropriate for Ratio to parse such strings.</div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-weight:normal;font-size:16px;line-height:22px;white-space:pre"><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(220,220,170)">readDecimalRatio</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(86,156,214)">::</span><span style="color:rgb(212,212,212)"> (</span><span style="color:rgb(86,156,214)">Integral</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(156,220,254)">a</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">Read</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(156,220,254)">a</span><span style="color:rgb(212,212,212)">) </span><span style="color:rgb(86,156,214)">=></span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(86,156,214)">ReadPrec</span><span style="color:rgb(212,212,212)"> (</span><span style="color:rgb(86,156,214)">Ratio</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(156,220,254)">a</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">    readDecimalRatio = parens $ </span><span style="color:rgb(197,134,192)">do</span></div><div><span style="color:rgb(212,212,212)">        Number x <- lexP</span></div><div><span style="color:rgb(212,212,212)">        return (numberToRational x)</span></div></div></div><div><br></div><div>Combine this by (+++) with the original `readPrec` from the instance Read Ratio.<br></div></div>