Skip to content

Instantly share code, notes, and snippets.

@korolr
Created February 17, 2019 17:22
Show Gist options
  • Save korolr/6c88be4cd205426e79c6ef079b85e4b9 to your computer and use it in GitHub Desktop.
Save korolr/6c88be4cd205426e79c6ef079b85e4b9 to your computer and use it in GitHub Desktop.
BurlywoodPlasticApi created by korolr - https://repl.it/@korolr/BurlywoodPlasticApi
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