Advertisement
Guest User

InlineStatements suggestion

a guest
Feb 28th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {-# LANGUAGE InlineStatements #-}
  2. module Main where
  3.  
  4. f :: Bool -> Int -> Int -> IO () -> IO ()
  5. f _ _ _ = id
  6.  
  7. main :: IO ()
  8. main = f
  9.     True
  10.     if True then 1 else 0 -- Would be invalid without InlineStatements
  11.     case True of
  12.         True -> 1
  13.         False -> 0
  14.     do
  15.         print "A"
  16.         print "B"
  17. -- or:
  18. {-
  19. main = f True (if True then 1 else 0) case True of { True -> 1; False -> 0; } do { print "A"; print "B"; }
  20. -}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement