Translate REPL

This commit is contained in:
Remigiusz Suwalski 2017-01-11 10:21:38 +01:00
parent 6fa14954a5
commit b80c70b4a3

View File

@ -395,27 +395,27 @@ main'' = do
---------------------------------------------------- ----------------------------------------------------
-- 9. The Haskell REPL -- 9. Interaktywne środowisko programowania
---------------------------------------------------- ----------------------------------------------------
-- Start the repl by typing `ghci`. -- Aby uruchomić repl (read-eval-print loop, interaktywne środowisko), należy
-- Now you can type in Haskell code. Any new values -- wpisać `ghci`. Można już programować. Do definiowania nowych wartości służy
-- need to be created with `let`: -- słowo kluczowe `let`:
let foo = 5 let foo = 5
-- You can see the type of any value or expression with `:t`: -- Do sprawdzania typów dowolnej wartości (wyrażenia) wykorzystuje się `:t`:
> :t foo > :t foo
foo :: Integer foo :: Integer
-- Operators, such as `+`, `:` and `$`, are functions. -- Działania takie jak `+`, `:` czy `$`, są funkcjami.
-- Their type can be inspected by putting the operator in parentheses: -- Przed sprawdzeniem ich typu należy otoczyć je nawiasami:
> :t (:) > :t (:)
(:) :: a -> [a] -> [a] (:) :: a -> [a] -> [a]
-- You can get additional information on any `name` using `:i`: -- Dodatkowych informacji dostarcza `:i`:
> :i (+) > :i (+)
class Num a where class Num a where
@ -424,7 +424,7 @@ class Num a where
-- Defined in GHC.Num -- Defined in GHC.Num
infixl 6 + infixl 6 +
-- You can also run any action of type `IO ()` -- Można nawet wykonywać akcje typu `IO ()`!
> sayHello > sayHello
What is your name? What is your name?
@ -433,9 +433,9 @@ Hello, Friend!
``` ```
There's a lot more to Haskell, including typeclasses and monads. These are the Pominęliśmy wiele aspektów Haskella, wliczając w to monady. To właśnie one
big ideas that make Haskell such fun to code in. I'll leave you with one final sprawiają, że programowanie w Haskellu sprawia tyle frajdy. Na zakończenie
Haskell example: an implementation of a quicksort variant in Haskell: pokażę Tobie implementację algorytmu quicksort w Haskellu:
```haskell ```haskell
qsort [] = [] qsort [] = []
@ -444,8 +444,10 @@ qsort (p:xs) = qsort lesser ++ [p] ++ qsort greater
greater = filter (>= p) xs greater = filter (>= p) xs
``` ```
There are two popular ways to install Haskell: The traditional [Cabal-based installation](http://www.haskell.org/platform/), and the newer [Stack-based process](https://www.stackage.org/install). Haskell może zostać zainstalowany na co najmniej dwa sposoby:
- tradycyjnie [przy użyciu Cabala](http://www.haskell.org/platform/),
- nowocześnie [z pomocą Stack](https://www.stackage.org/install).
You can find a much gentler introduction from the excellent Godnymi poleceniami wprowadzeniami wspaniałe
[Learn you a Haskell](http://learnyouahaskell.com/) or [Learn you a Haskell](http://learnyouahaskell.com/) albo
[Real World Haskell](http://book.realworldhaskell.org/). [Real World Haskell](http://book.realworldhaskell.org/).