Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Homework2 where
- isSmallPrime :: Int -> Bool
- isSmallPrime x = x `elem` [2,3,5,7]
- equivalent :: Bool -> Bool -> Bool
- equivalent True True = True
- equivalent False False = True
- equivalent _ _ = False
- implies :: Bool -> Bool -> Bool
- implies True False = False
- implies _ _ = True
- invertO :: (Int, Int) -> (Int, Int)
- invertO (a, b) = (-a, -b)
- isOnNegId :: (Int, Int) -> Bool
- isOnNegId (a, b) = (b == -a)
- add :: (Int, Int) -> (Int, Int) -> (Int, Int)
- add (a1, b1) (a2, b2) = ((a1*b2)+(a2*b1), (b1*b2))
- multiply :: (Int, Int) -> (Int, Int) -> (Int, Int)
- multiply (a1, b1) (a2, b2) = ((a1*a2), (b1*b2))
- divide :: (Int, Int) -> (Int, Int) -> (Int, Int)
- divide (a1, b1) (a2, b2) = ((a1*b2), (a2*b1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement