Learning Haskell

The main problem of learning Haskell is the very beginning, the first step: to write a working program, which
* as small as possible, and
* more than just print "Hello, World!"

Finally, I found it in the tutorial: "How to write a Haskell program".


--
-- Copyright (c) 2006 Don Stewart - http://www.cse.unsw.edu.au/~dons
-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)
--
import System.Environment

-- | 'main' runs the main program
main :: IO ()
main = getArgs >>= print . haqify . head

haqify s = "Haq! " ++ s

Vibe code with your voice

Stop fighting speech recognition.
Just talk → fix mistakes later

"... _brings_ hello world"   ❌
          ↓
"... _prints_ hello world"   ✅

Get handsfree.vc on Google Play

Categories:

Updated: