Skip to content

Instantly share code, notes, and snippets.

@masakielastic
Created January 17, 2012 03:24
Show Gist options
  • Save masakielastic/1624397 to your computer and use it in GitHub Desktop.
Save masakielastic/1624397 to your computer and use it in GitHub Desktop.
自然数のリスト
Prelude> [1..10]
[1,2,3,4,5,6,7,8,9,10]
Prelude> take 10 $ iterate (+1) 1
[1,2,3,4,5,6,7,8,9,10]
Prelude> take 10 $ enumFrom 1
[1,2,3,4,5,6,7,8,9,10]
Prelude> enumFromThenTo 1 2 10
[1,2,3,4,5,6,7,8,9,10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment