DEV Community

Discussion on: Daily Challenge #16 - Number of People on the Bus

Collapse
 
craigmc08 profile image
Craig McIlwrath

Haskell:

type BusStop = (Int, Int)

getChange :: BusStop -> Int
getChange stop = fst stop - snd stop

peopleOnBus :: [BusStop] -> Int
peopleOnBus = sum . map getChange