Color theme
0 day streak0 XPP1
HaskellLearn mode
MISSION 1 OF 1

Measure the wildlife labels

0 XP earned
Haskell track: MasterMission: IntermediateList mappingFunction applicationImmutability
Before you start this master track

Functions and immutable lists. Read type signatures, pattern matching, and guards.

Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.

x
0 / 2 challenges
LEARN THE CONCEPT

Understand it, then try it.

Haskell functions transform values without changing the original input. map applies a function to every item of a list, preserving its order. Here length measures each animal name, producing a new list of label widths. The indentation under do groups the small steps that prepare and print the result.

Main.hs
main :: IO ()main = do  let names = ["ox", "heron", "lynx"]  let widths = map length names  print widths

Each mission is a separate Haskell 2010 program using the standard Prelude. Save one as Main.hs and run with runghc Main.hs. String output uses putStrLn; numeric lists use print.

Track the values line by line. Predict the result before running this example in your own editor.