Skip to content

Instantly share code, notes, and snippets.

@dimitri-xyz
Last active October 13, 2015 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimitri-xyz/f0819c947ecd386b84d6 to your computer and use it in GitHub Desktop.
Save dimitri-xyz/f0819c947ecd386b84d6 to your computer and use it in GitHub Desktop.
Merging 2 branches - function definition does NOT depend on constant
-- base
-------
c :: Int
c = 5
plusone :: Int -> Int
plusone x = x + 1
main = putStrLn $ "the total is: " ++ show (plusone c)
-- branch A
-----------
c :: Int
c = 6 -- New Value
plusone :: Int -> Int
plusone x = x + 1
main = putStrLn $ "the total is: " ++ show (plusone c)
-- branch B
-----------
c :: Int
c = 5
plusone :: Int -> Int
plusone 6 = -3 -- New Definition
plusone x = x + 1
main = putStrLn $ "the total is: " ++ show (plusone c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment