Created
          February 17, 2019 17:22 
        
      - 
      
 - 
        
Save korolr/6c88be4cd205426e79c6ef079b85e4b9 to your computer and use it in GitHub Desktop.  
    BurlywoodPlasticApi created by korolr - https://repl.it/@korolr/BurlywoodPlasticApi
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | sum2 :: Integer -> (Integer, Integer) | |
| sum2 0 = (0,1) | |
| sum2 x = let | |
| a = if x < 0 then x * (-1) else x | |
| b = (+) (div a 10) (a `mod` 10) | |
| c = if a < 10 then a else 2 | |
| in (b, c) | |
| main :: IO () | |
| main = print $ sum2 (-39) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment