I am new to Haskell, so this may be a trivial problem. I am seeing an error message that says
Couldn't match expected type 'Data.Text.Lazy.Internal.Text'
with actual type 'Data.Text.Internal.Text'
and I think the problem is that the actual type is Data.Text.Text
and it expects lazy text. How can I convert one to the other?
EDIT:
here is a simplified code that gives this error.
basically I have a yesod form with a textarea input element and I want to e-mail the contents of the textarea.
{-# LANGUAGE OverloadedStrings #-}
import Data.Text.Lazy.Encoding
import Network.Mail.Mime
import Yesod
data FormData = FormData { dataField :: Textarea } deriving Show
part d = Part {
partType = "text/plain; charset=utf-8"
, partEncoding = None
, partFilename = Nothing
, partContent = encodeUtf8 $ unTextarea $ dataField d
, partHeaders = []
}
main = return ()