typeclasses / haskell-phrasebook

The Haskell Phrasebook: a quick intro to Haskell via small annotated example programs
https://typeclasses.com/phrasebook
210 stars 22 forks source link

Enum ranges #7

Closed chris-martin closed 4 years ago

chris-martin commented 4 years ago

A few ideas:

import Data.Time.Calendar

main =
  do
    putStrLn (show [3 .. 8])
    putStrLn (show ['a' .. 'z'])
    putStrLn (show [Tuesday .. Friday])
$ runhaskell range.hs
[3,4,5,6,7,8]
"abcdefghijklmnopqrstuvwxyz"
[Tuesday,Wednesday,Thursday,Friday]

Might be nice to also show:

chris-martin commented 4 years ago

PR: #17

argumatronic commented 4 years ago

Closed due to merging of PR #17.