I use encode
(Haskell type via JSON to a string):
import GHC.Generics
import Data.Aeson
The string is (according to an error message from the compiler): Data.ByteString.Lazy.Internal.ByteString
.
How do I putStrLn it?
put theoretically
What I'm in search for is a an ad-hoc polymorphic putStrLn
, i.e., I'm looking for the proper instance of putStrLn
semantics for a specific string-like type.
compiler messages
The compiler message if someone is interested:
valencies.lhs:182:22:
Couldn't match type `Data.ByteString.Lazy.Internal.ByteString'
with `[Char]'
Expected type: String
Actual type: Data.ByteString.Lazy.Internal.ByteString
In the return type of a call of `encode'
In the first argument of `putStrLn', namely `(encode CALL)'
In the expression: putStrLn (encode CALL)
see also
Similar question, but with a bit different type: How do I putStrLn a Data.ByteString.Internal.ByteString?.