Guest User

Untitled

a guest
Jan 22nd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. isPos n
  2. | n<0 = False
  3. | otherwise = True
  4.  
  5. isPos n
  6. | n<0 = False AND print ("negative")
  7. | otherwise = True AND print ("positive")
  8.  
  9. debug = flip trace
  10.  
  11. isPos n
  12. | n < 0 = False `debug` "negative"
  13. | otherwise = True `debug` "positive"
  14.  
  15. isPos n
  16. | n < 0 = False -- `debug` "negative"
  17. | otherwise = True -- `debug` "positive"
  18.  
  19. import Debug.Trace
  20.  
  21. isPos n
  22. | n < 0 = trace "negative" False
  23. | otherwise = trace "positive" True
Add Comment
Please, Sign In to add comment