[Haskell-beginners] Maximum length of a GHCi command?

Daniel Fischer daniel.is.fischer at web.de
Sun Feb 28 17:00:09 EST 2010


Am Sonntag 28 Februar 2010 08:54:38 schrieb Kwanghoon Choi:
> Dear Haskeller,
>
> I have a little issue in using GHCi as follows:
>
> ===
> Prelude> length
> "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
>aaaaaaaaaaaaaaaaaaaaaaaaaaaa" <interactive>:1:254:
>     lexical error in string/character literal at character '\EOT'
> ===

Hm,

Prelude> length 
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
99
Prelude> length 
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
549

And it shouldn't get an \EOT anyway, also column 254 is way past the 
String.

>
> It seems to me that GHCi doesn't allow me to type more than some
> specified length of a command.

There's some limit (memory, terminal buffer), but in practice, you 
shouldn't ever come near it.

> Is this interpretation correct? How can I make it longer?
>
> This issue is quite important at least to me. My tool is just a simple
> Haskell program. I don't like to add any extra interactive environment,
> but I like to just use GHCi as an interactive environment for my tool. I
> strongly believe that this ides is pervasive among many haskellers.

So, ghci got the command from your tool and not from you typing at the 
prompt?
Then it seems your tool outputs unwanted \EOT characters, it might be worth 
to check.

>
> Thanks in advance for your help/feedback in advance.
>
> Kwanghoon



More information about the Beginners mailing list