codesnippets:firsthaskellprogram
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| codesnippets:firsthaskellprogram [2021/04/10 13:50] – [default package is prelude] f2b216 | codesnippets:firsthaskellprogram [2025/10/08 00:48] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| * main function with output, as a complete code example | * main function with output, as a complete code example | ||
| - | * which compiles | + | * compiles, error and warning free, with compiler: GHC 8.10.4, using compiler option |
| - | * warning free with | + | |
| - | * compiler: GHC 8.10.4 using -Wall | + | |
| * <code Haskell> | * <code Haskell> | ||
| main :: IO () | main :: IO () | ||
| Line 25: | Line 23: | ||
| * whereas '' | * whereas '' | ||
| * and ' | * and ' | ||
| - | * default package is '' | + | * default package is '' |
| * in the second line '' | * in the second line '' | ||
| * '' | * '' | ||
| Line 47: | Line 45: | ||
| * '' | * '' | ||
| - | * see the following | + | * see the following |
| * <code Haskell> | * <code Haskell> | ||
| main :: IO () | main :: IO () | ||
| Line 67: | Line 65: | ||
| * result type: '' | * result type: '' | ||
| * '' | * '' | ||
| - | * result type: '' | + | * result type: '' |
| * '' | * '' | ||
| * result type: '' | * result type: '' | ||
| * '' | * '' | ||
| - | * result type: '' | + | * result type: '' |
| * NOTE: | * NOTE: | ||
| * Types start always with upper case letters. | * Types start always with upper case letters. | ||
| Line 83: | Line 81: | ||
| ==== second line declares that function '' | ==== second line declares that function '' | ||
| - | * expression '' | + | * expression '' |
| * it binds '' | * it binds '' | ||
| * when function '' | * when function '' | ||
| - | * expression '' | + | * expression '' |
| * it binds '' | * it binds '' | ||
| * when function '' | * when function '' | ||
| Line 92: | Line 90: | ||
| ==== default package is Prelude ==== | ==== default package is Prelude ==== | ||
| - | * '' | + | * '' |
| - | * package '' | + | * package '' |
| * enables basic elements like functions, types, type classes, and instances | * enables basic elements like functions, types, type classes, and instances | ||
| * the import of such elements can be controlled in different ways | * the import of such elements can be controlled in different ways | ||
| - | * see also [[codesnippets: | + | * see also [[codesnippets: |
| + | |||
| + | ===== ✎ ===== | ||
| + | ~~DISCUSSION~~ | ||
codesnippets/firsthaskellprogram.1618055417.txt.gz · Last modified: (external edit)
