Skip to content

Instantly share code, notes, and snippets.

@5outh
Created August 15, 2012 22:21
Show Gist options
  • Save 5outh/3364265 to your computer and use it in GitHub Desktop.
Save 5outh/3364265 to your computer and use it in GitHub Desktop.
FracFrac
instance Fractional Fraction where
(/) f = (*) f . recip
recip (Frac a b) = Frac b a
fromRational r = Frac (numerator r) (denominator r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment