Hi Angus,

Angus Comber wrote:
Also xs is of what type? list of values? So does this mean x is an
element and xs must be of type list? Confused...

Here is how you can use ghci to investigate such questions:

ghci
GHCi, version 7.4.2: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.

Prelude> let all@(x:xs) = "hello world"

Prelude> x
'h'

Prelude> xs
"ello world"

Prelude> all
"hello world"

Prelude> :t x
x :: Char

Prelude> :t xs
xs :: [Char]

Prelude> :t all
all :: [Char]

Prelude> x
'h'

Prelude> [x]
"h"

Prelude> :t x
x :: Char

Prelude> :t [x]
[x] :: [Char]

Prelude> :q
Leaving GHCi.

  Tillmann

PS. The haskell@haskell.org list is mostly for announcements, so questions like this are better suited for beginn...@haskell.org or haskell-c...@haskell.org.

_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to