Created
October 25, 2017 21:57
Revisions
-
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import Data.Ratio loop x a = do print a let (l,r) = sb a let (_,(d,e)) = l case compare (fromRational (d%e)) x of EQ -> return $ d%e GT -> loop x l LT -> loop x r sb((x,y),(z,w))=(a,b) where a = ((x,y),c) b= (c,(z,w)) c= (z+x,y+w) main = do let a = (0,1) let b = (1,0) let r = (a,b) loop pi r >>= print