Series: Angelia
haskell
20 lines
· Updated 2026-02-03
hello.hs
Angelia/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
Related articles
Angelia
haskell
Updated 2026-02-03
Adding.hs
Adding.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Adding.hs).
Read article →
Angelia
haskell
Updated 2026-02-03
Area.hs
Area.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Area.hs).
Read article →
Angelia
haskell
Updated 2026-02-03
Chess.hs
Chess.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Chess.hs).
Read article →
Angelia
haskell
Updated 2026-02-03
ChessGraphics.hs
ChessGraphics.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/ChessGraphics.hs).
Read article →
Angelia
haskell
Updated 2026-02-03
Examples.hs
Examples.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Examples.hs).
Read article →
Angelia
haskell
Updated 2026-02-03
Fibonacci.hs
Fibonacci.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Fibonacci.hs).
Read article →