Lexical Error Haskell
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
Lexical Error In String/character Literal At Character ' N'
policies of this site About Us Learn more about Stack Overflow the haskell lexical error at character '\8217' company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags haskell multiline string Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Lexical error in Haskell when concatenating strings up vote 1 down vote favorite I am trying to insert a character ('A') into a string in Haskell my code is as follows: split :: Int -> String -> String split n s |s == [] = s |otherwise = let (a,b) = splitAt n s in “A” ++ split n b However, it keeps throwing up " lexical error at character '\8220' " on the otherwise line. Im new to Haskell and any help would be much appreciated. string haskell concatenation lexical share|improve this question asked Dec 2 '14 at 16:43 BenJacob 305316 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted Change “ to". It's a different Unicode character. You have “ which is left double quation mark while the standard lexical element is the simple quotation mark (") Also, since you're adding a single letter, you can also use 'A' : split n b share|improve this answer answered Dec 2 '14 at 16:54 Mihai Maruseac 13.8k63498 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Br
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Haskell Error lexical error in string/character literal at character ' \r' up vote 1 down vote favorite Hello I'm trying to write a http://stackoverflow.com/questions/27254555/lexical-error-in-haskell-when-concatenating-strings program that converts markdown to HTML, I understand there is Pandoc but my project is writing it out manually. I have it completed or at least I think i Do but I'm getting the following error Haskell Error lexical error in string/character literal at character ' \r' I have no Idea as to what is referring to, any help in pointing it out would be great. Thanks So update: I changed a few things http://stackoverflow.com/questions/27329771/haskell-error-lexical-error-in-string-character-literal-at-character-r with misc symbols and the error I get now is hs.38:17: Not in scope 'str' and as I was working through the thing it has repeatedly kept pointing at line 38 in which I cannot figure out what the issue is as it ignores the same exact thing in the previous function module Main ( convertToHTML, convertSpecialChar, main ) where import System.Environment (getArgs) import System.IO import Data.Char import Data.List import Data.List.Split eof = "