Хочу заюзать ф-цию encode из модуля Data.Binary:
----------------------------------------
import Data.Binary
main = do s1 <- encode (2 :: Integer)
print s1
----------------------------------------
encode :: Binary a => a -> ByteString
Экземпляр Binary Integer есть.
$ ghc --make Test.hs -o test
[1 of 1] Compiling Main ( Test.hs, Test.o )
Test.hs:3:16:
Couldn't match expected type `t t1'
against inferred type `Data.ByteString.Lazy.Internal.ByteString'
In a 'do' expression: s1 <- encode 'a'
In the expression:
do s1 <- encode 'a'
print s1
In the definition of `main':
main = do s1 <- encode 'a'
print s1
Подрубаю модуль
import Data.ByteString.Lazy.Internal (ByteString)
Ошибка:
Test.hs:3:16:
Couldn't match expected type `t t1'
against inferred type `ByteString'
....... далее тож самое
Почему не хочет работать ?