-2
Wie folgende Problem zu lösen:ByteStrings und Streicher
import Data.ByteString.Lazy as BS (readFile, ByteString, unpack, fromStrict)
import Data.ByteString.Char8 as C8 (pack)
import Data.ByteString.UTF8 (toString)
import Data.Char (chr)
stringToBS :: String -> BS.ByteString
stringToBS str = BS.fromStrict $ C8.pack str
recode :: String -> String
recode str = toString $ urlDecode True (stringToBS str)
HINWEIS Ich brauche sie die Typen habe ich bereits festgelegt.
Fehler bei Compilierung:
Couldn't match expected type ‘Data.ByteString.Internal.ByteString’
with actual type ‘ByteString’
NB: ‘Data.ByteString.Internal.ByteString’
is defined in ‘Data.ByteString.Internal’
‘ByteString’ is defined in ‘Data.ByteString.Lazy.Internal’
In the second argument of ‘urlDecode’, namely ‘(stringToBS str)’
In the second argument of ‘($)’, namely
‘urlDecode True (stringToBS str)’
Wie kann ich diesen Fehler beheben?
Verwenden Sie nicht die faule Variante von 'ByteString' für' urlDecode'. – MicroVirus
Was ist 'urlDecode' (Typ!)? – leftaroundabout
Woher bekommen Sie 'urlDecode'? – Kwarrtz