OverloadedStrings for characters

Hacker documentation for ByteString contains this example :

split :: Word8 -> ByteString -> [ByteString] split '\n' "a\nb\nd\ne" == ["a","b","d","e"] 

It is as if '\n' converted to Word8 , but LANGUAGE OverloadedStrings seems to work only with strings, not with characters. What extension do I need to enable to use the sample code?

+5
source share
1 answer

bytestring supports a cheap and cheerful look at Latin1 bytes. You can import Data.ByteString.Char8 to get this view.

+3
source

Source: https://habr.com/ru/post/1209686/


All Articles