Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main where
- (.?.) :: Bool -> (a, a) -> a
- (.?.) True = fst
- (.?.) False = snd
- infixl 3 .?.
- (>:<) :: a -> b -> (a, b)
- (>:<) = (,)
- main :: IO ()
- main = do
- print $ 3 == 5 .?. "yes" >:< "no" -- "no"
- print $ 5 > 3 .?. "yes" >:< "no" -- "yes"
- print $ 3 - 3 == 0 .?. "yes" >:< "no" -- "yes"
- print $ null [] .?. "yes" >:< "no" -- "yes"
- print $ null [1] .?. "yes" >:< "no" -- "no"
Add Comment
Please, Sign In to add comment