File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/haskell Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ -- Comentario de una línea
2
+ -- Sitio oficial: https://www.haskell.org/
3
+
4
+ {-
5
+ Comentario de varias líneas
6
+
7
+ Documentación oficial: https://www.haskell.org/documentation/
8
+ -}
9
+
10
+ -- Las variables en Haskell son inmutables
11
+
12
+ i :: Integer -- Enteros
13
+ i = 1
14
+
15
+ d :: Double -- Real de Punto Flotante de doble precision
16
+ d = 1.0
17
+
18
+ fl :: Float -- Real Punto Flotante de simple precisión
19
+ fl = 1.0
20
+
21
+ c :: Char -- Caracter
22
+ c = ' a'
23
+
24
+ s :: String -- Cadena
25
+ s = " Haskell"
26
+
27
+ t :: Bool -- Booleanos
28
+ t = True -- Verdadero
29
+
30
+ f :: Bool
31
+ f = False -- Falso
32
+
33
+ o :: Integer
34
+ o = 0o10 -- 8 en notación octal
35
+
36
+ h :: Integer
37
+ h = 0x10 -- 16 en hexadecimal
38
+
39
+ b :: Integer
40
+ b = 0b1111 -- 15 en binario
41
+
42
+ u :: () -- Tipo de la expresión (), llamada unit
43
+ u = ()
44
+
45
+ main :: IO () -- Tipo de una expresión que representa una subrutina de IO que retorna ()
46
+ main = putStrLn " ¡Hola, Haskell!"
You can’t perform that action at this time.
0 commit comments