Serie: haskell
haskell
20 righe
· Aggiornato 2026-02-03
hello.hs
haskell/hello.hs
-- hello.hs
-- A simple Haskell program
-- A function to square a number
square :: Int -> Int
square x = x * x
addTwo :: Int -> Int -> Int
addTwo x y = x + y
main :: IO ()
main = do
putStrLn "Hello, Haskell!"
putStrLn ("Square of 5 is " ++ show (square 5))
putStrLn ("Sum of 5 and 3 is " ++ show (addTwo 5 3))
-- Integer
-- Float
-- Double
-- Char
Articoli correlati
haskell
haskell
Aggiornato 2026-02-03
Adding.hs
Adding.hs — haskell source code from the haskell learning materials (haskell/Adding.hs).
Leggi l'articolo →
haskell
haskell
Aggiornato 2026-02-03
Area.hs
Area.hs — haskell source code from the haskell learning materials (haskell/Area.hs).
Leggi l'articolo →
haskell
haskell
Aggiornato 2026-02-03
Chess.hs
Chess.hs — haskell source code from the haskell learning materials (haskell/Chess.hs).
Leggi l'articolo →
haskell
haskell
Aggiornato 2026-02-03
ChessGraphics.hs
ChessGraphics.hs — haskell source code from the haskell learning materials (haskell/ChessGraphics.hs).
Leggi l'articolo →
haskell
haskell
Aggiornato 2026-02-03
Examples.hs
Examples.hs — haskell source code from the haskell learning materials (haskell/Examples.hs).
Leggi l'articolo →
haskell
haskell
Aggiornato 2026-02-03
Fibonacci.hs
Fibonacci.hs — haskell source code from the haskell learning materials (haskell/Fibonacci.hs).
Leggi l'articolo →