atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

Improperly insert type of already defined function #115

Closed ChristopherKing42 closed 8 years ago

ChristopherKing42 commented 8 years ago

If you have

main :: IO()
a = 3
main = putStrLn "Hello World"

and ask atom to insert the type signature of main, you get

main :: IO()
a = 3
main :: IO ()
main = putStrLn "Hello World"

The correct result should be

a = 3
main :: IO ()
main = putStrLn "Hello World"

or

main :: IO()
a = 3
main = putStrLn "Hello World"

Likewise, if you ask atom to insert the type of putStrLn, you get

main :: IO()
a = 3
putStrLn :: String -> IO ()
main = putStrLn "Hello World"

the correct behavior would be to do nothing

lierdakil commented 8 years ago

Due to sheer complexity of finding out if there's already a definition or not, I'm inclined to leave this as-is. It's not breaking anything, and check will let you know that you have duplicate signatures.