Difference between revisions of "Translations:FP Laboratory 1/7/en"
Jump to navigation
Jump to search
(Importing a new version from external source) |
(Importing a new version from external source) |
||
Line 1: | Line 1: | ||
− | == First program in Haskell == | + | == First program in Haskell == |
In your favorite development environment (VS Code by default): | In your favorite development environment (VS Code by default): | ||
* Crate a file <code>simple.hs</code>. | * Crate a file <code>simple.hs</code>. | ||
* Create a function <code>pythagoras a b</code> that computes <code>c</code> based on <math>c^2 = a^2 + b^2 \,,</math>. Necessary functions can be found: [https://hoogle.haskell.org/ Hoogle] | * Create a function <code>pythagoras a b</code> that computes <code>c</code> based on <math>c^2 = a^2 + b^2 \,,</math>. Necessary functions can be found: [https://hoogle.haskell.org/ Hoogle] | ||
* Open <code>ghci</code> and run the implemented function with <code>3 4</code>. File can be loaded using command <code>:l</code> (<code>:load</code>) and reloaded with <code>:r</code> (<code>:reload</code>). | * Open <code>ghci</code> and run the implemented function with <code>3 4</code>. File can be loaded using command <code>:l</code> (<code>:load</code>) and reloaded with <code>:r</code> (<code>:reload</code>). |
Latest revision as of 11:28, 23 September 2020
First program in Haskell
In your favorite development environment (VS Code by default):
- Crate a file
simple.hs
. - Create a function
pythagoras a b
that computesc
based on . Necessary functions can be found: Hoogle - Open
ghci
and run the implemented function with3 4
. File can be loaded using command:l
(:load
) and reloaded with:r
(:reload
).