News for hackers. Stuff that matters.
Re:Letter to a Young Haskell Enthusiast by dllthomas on Friday August 01, 2014 @06:03PM (#8123083)
"divide two integers so that the result has integer type when the numbers divide evenly, otherwise rational type."

    kazinatorDiv x y = case x `divMod` y of
        (q, 0) -> Left q
        _ -> Right (x % y)

There are no comments on this comment yet.