Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Haskell <- list comprehension

Name: Anonymous 2009-04-04 5:42

So, is the <- in Haskell list comprehension an arrow (as in, ``take the x from''), or does it imitate the character from the mathematical set notation?
e.g. {x2 : x ∈ ℕ} and [x | x <- [0,1..]]).

Name: Anonymous 2009-04-05 7:11

>>18
You failed to miss the most important point, which is that arrays are random-access and lists have to be traversed¹. It is quite possible to have heterogenous arrays, see Scheme's vector² type for an example.

References/Footnotes
¹ Haskell's lists can be accessed by index with the !! function, but that is implemented by list traversal³.
² Sussman, G.J.; Steele Jr., G.L.; Abelson, H. “Revised5 Report on the Algorithmic Language Scheme”, http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.3.6 -- 1998-02-20, retrieved 1993-09-5695.
³ http://haskell.org/ghc/docs/latest/html/libraries/base/src/GHC-List.html#!!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List