Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Haskell-cafe] Error: Improperly terminated character constant

82 views
Skip to first unread message

Ivan Amarquaye

unread,
May 11, 2008, 7:36:22 AM5/11/08
to haskel...@haskell.org

I'm writing a function dRop to accept words ending in 'es' and drop the last two characters i.e. 'es'.eg. mangoes -> mongo but i keep on getting this error: "Improperly terminated character constant" after running this code which i have left below. Can i get any form of help from anyone in here...?


-----------------------------------------

dRop :: String -> String
dRop word = if drop (length word - 2) word == 'es'
then take (length word - 2) word
else word

--------------------------------------------------

regards

Amarquaye.Ivan
_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline

Johannes Laire

unread,
May 11, 2008, 7:46:51 AM5/11/08
to Ivan Amarquaye, haskel...@haskell.org
Single quotes are for characters, double quotes are for strings. So
change 'es' to "es".

--
Johannes Laire

2008/5/11 Ivan Amarquaye <amarqua...@hotmail.com>:


>
>
> I'm writing a function dRop to accept words ending in 'es' and drop the last
> two characters i.e. 'es'.eg. mangoes -> mongo but i keep on getting this
> error: "Improperly terminated character constant" after running this code
> which i have left below. Can i get any form of help from anyone in here...?
>
>
> -----------------------------------------
>
> dRop :: String -> String
> dRop word = if drop (length word - 2) word == 'es'
> then take (length word - 2) word
> else word
>
> --------------------------------------------------
>
> regards
>
>
>
> Amarquaye.Ivan
> ________________________________

> Connect to the next generation of MSN Messenger Get it now!
> _______________________________________________
> Haskell-Cafe mailing list
> Haskel...@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

0 new messages