get first char from string haskell code example
Example 1: get first char from string haskell
Prelude> take 1 "hello"
"h"
Prelude> take 1 ""
""
Prelude> head "hello"
'h'
Prelude> head ""
*** Exception: Prelude.head: empty list
Example 2: get first char from string haskell
Prelude> take 3 "Hello"
"Hel"