Haskell

From miki
Jump to navigation Jump to search

References

Examples

Hello World

main = putStrLn "Hello, World!"

Palindrom

Save this as pal.hs:

-- pal.hs
main = do
  putStrLn "Enter just over half of a palindrome:"
  s <- getLine
  putStrLn (s ++ tail (reverse s))

Compile and run:

ghc pal.hs
./pal