Skip to content

Commit 9d33773

Browse files
authored
Merge pull request mouredev#4558 from edalmava/haskell
#00 - Haskell
2 parents 370b23b + 23c8543 commit 9d33773

File tree

1 file changed

+46
-0
lines changed
  • Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/haskell

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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!"

0 commit comments

Comments
 (0)