emailAddrFromString :: String -> Either String EmailAddress
emailAddrFromString str = case BP.parse parseEmailAddress (BC.snoc bs '\0') of
    BP.ParseFail err -> Left $ "failed to parse: " ++ show bs ++ " " ++ err
    BP.ParseMore _   -> Left $ "failed to parse: " ++ show bs ++ " not enough bytes"
    BP.ParseOK _ v   -> Right v
  where
    bs :: ByteString
    bs = BC.pack str
emailAddrFromString :: String -> Either String EmailAddress
emailAddrFromString str = case BP.parse parseEmailAddress (BC.snoc bs '\0') of
    BP.ParseFail err -> Left $ "failed to parse: " ++ show bs ++ " " ++ err
    BP.ParseMore _   -> Left $ "failed to parse: " ++ show bs ++ " not enough bytes"
    BP.ParseOK _ v   -> Right v
  where
    bs :: ByteString
    bs = BC.pack str
emailAddrFromString str = case BP.parse parseEmailAddress (BC.snoc bs '\0') of
    BP.ParseFail err -> Left $ "failed to parse: " ++ show bs ++ " " ++ err
    BP.ParseMore _   -> Left $ "failed to parse: " ++ show bs ++ " not enough bytes"
    BP.ParseOK _ v   -> Right v
  where
    bs :: ByteString
    bs = BC.pack str