user65080
0
Q:

get first char from string haskell

Prelude> take 3 "Hello"
"Hel"
1
Prelude> take 1 "hello"
"h"
Prelude> take 1 ""
""
Prelude> head "hello"
'h'
Prelude> head ""
*** Exception: Prelude.head: empty list
1

New to Communities?

Join the community