-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.hs
More file actions
86 lines (67 loc) · 1.32 KB
/
Main.hs
File metadata and controls
86 lines (67 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{-
Information
===========
Tools
-----
GHC - compiler
GHCi - interpreter (REPL)
Source
------
.hs - text files
Indentation
-----------
a tab (\t) character == 8 spaces
Language version
----------------
Haskell 2010 is the latest version
Haskell
-------
is a general-purpose, statically typed, purely functional programming language
with type inference and lazy evaluation
It is named after logician Haskell Curry
Documentation
-------------
https://www.haskell.org
https://www.haskell.org/hoogle/
-}
{-
GHCi
====
Prelude
-------
is imported by default into all Haskell modules unless either there is
an explicit import statement for it, or the NoImplicitPrelude extension
is enabled
Set prompt
----------
:set prompt "GHCi> "
-}
-- >>> 33 + 3 * 3
-- 42
-- >>> pi
-- 3.141592653589793
-- >>> "ABC" ++ "DE"
-- "ABCDE"
{-
TASK
====
Какое приглашение на самом деле выдает командная строка интерпретатора
(в предыдущем примере интерпретатор выдал приглашение GHCi> )?
SOLUTION
========
*Main>
-}
{-
Import in GHCi
--------------
> :load Test -- or :l Test
> sayHello
Hello from module Test!
Reload changed modules
----------------------
:reload [Module]
:r [Module]
> :r Test
> sayHello
Hello World from module Test!
-}