[Haskell-beginners] no instance for monad

Daniel Trstenjak daniel.trstenjak at gmail.com
Sun Oct 21 10:24:34 CEST 2012

On Sat, Oct 20, 2012 at 10:34:27PM +0200, Daniel Trstenjak wrote:
> The issue arises, because Text and a type of the Json library you're
> using, both have an instance for the type class IsString, which is
> the base for the OverloadedStrings extension.

Well, now I didn't read the error message properly. You have been
absolutely right with your analysis.

> Instead of giving each element a type you could give the whole list a type:
> ["a", "b"] :: [T.Text]

Or you could add a helper function:

hprintT :: (MonadIO m) => Handle -> TF.Format -> [T.Text] -> m ()
hprintT = TF.hprint


More information about the Beginners mailing list