commentaire haskell
Commenting in Haskell
In Haskell, you can add comments to your code using the --
syntax. Anything after --
on a line is considered a comment and is ignored by the compiler. Here's an example:
-- This is a comment in Haskell
main :: IO ()
main = do
putStrLn "Hello, world!" -- This is another comment
Comments are useful for providing explanations, documenting code, and making it more readable. They are ignored by the compiler and have no impact on the execution of the program.