[Haskell-beginners] list range

Brent Yorgey byorgey at seas.upenn.edu
Wed Dec 28 20:32:01 CET 2011


On Wed, Dec 28, 2011 at 07:51:35PM +0100, Stanisław Findeisen wrote:
> Hi
> 
> Is list range (for example: [1..10]) a language construct or a function?
> What type does it have?

[a .. b] is syntactic sugar which is translated into a call to the
function 'enumFromTo':

  Prelude> [1 .. 10]
  [1,2,3,4,5,6,7,8,9,10]
  Prelude> enumFromTo 1 10
  [1,2,3,4,5,6,7,8,9,10]

-Brent



More information about the Beginners mailing list