
Hi all, I must be doing something wrong with my tabs. Because this keeps telling me parse error. Can some one see if it is indentation. I'm sending a file so as you'll be able to see what going on. If I copy it here it can appear wrong the difference is with the Var expression. John

On Sun, Feb 14, 2010 at 1:54 PM, John Moore
Hi all, I must be doing something wrong with my tabs.
Indeed you are: you're using them. :-) Searching for tab characters in your file reveals that it uses both tab characters and spaces mixed throughout. You should convert your file to use only spaces; this should resolve your indentation problems.

Am Sonntag 14 Februar 2010 20:54:54 schrieb John Moore:
Hi all, I must be doing something wrong with my tabs. Because this keeps telling me parse error. Can some one see if it is indentation. I'm sending a file so as you'll be able to see what going on. If I copy it here it can appear wrong the difference is with the Var expression.
John
First of all, *don't mix tabs and spaces for indentation* (best, don't use tabs at all). It's evalStep d (Var x) = case x of (Val a) ->case x of (Val b) ->(lookup x d) if (isJust m_e)then evalStep(lookup x d) else fail "Error in expression -- no definition for variable!" The "if ... " is aligned with (Val b), so GHC tries to parse it as a pattern. But if-expressions aren't patterns, so you get a parse error. But the code doesn't really make sense (and isn't well typed) anyway. You probably want something like evalStep d (Var x) = case lookup x d of Just e -> e Nothing -> error "Error in expression -- no definition for variable!" for that.

On Sun, Feb 14, 2010 at 3:20 PM, Daniel Fischer
Am Sonntag 14 Februar 2010 20:54:54 schrieb John Moore:
Hi all, I must be doing something wrong with my tabs. Because this keeps telling me parse error. Can some one see if it is indentation. I'm sending a file so as you'll be able to see what going on. If I copy it here it can appear wrong the difference is with the Var expression.
John
First of all, *don't mix tabs and spaces for indentation* (best, don't use tabs at all).
I find the latter a bit too restrictive, especially since I use a text editor that is a glorified version of ed. Hitting the spacebar 19 times is too much to ask of me. And as such, I am occasionally forced to do something when a tab doesn't get me past the word `where' or `let', but isn't that the majority of what Layout specifies? Is there a good answer for caveman programmers who like ed and tabs?
It's
evalStep d (Var x) = case x of (Val a) ->case x of (Val b) ->(lookup x d) if (isJust m_e)then evalStep(lookup x d) else fail "Error in expression -- no definition for variable!"
The "if ... " is aligned with (Val b), so GHC tries to parse it as a pattern. But if-expressions aren't patterns, so you get a parse error.
But the code doesn't really make sense (and isn't well typed) anyway. You probably want something like
evalStep d (Var x) = case lookup x d of Just e -> e Nothing -> error "Error in expression -- no definition for variable!"
for that. _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Jorden, Cave persons such as yourself can use tabs as long as your tab size is 8 characters. This is "hard-coded" into the Haskell 98 specification. Steve Jorden Mauro wrote:
First of all, *don't mix tabs and spaces for indentation* (best, don't use tabs at all).
I find the latter a bit too restrictive, especially since I use a text editor that is a glorified version of ed. Hitting the spacebar 19 times is too much to ask of me.
And as such, I am occasionally forced to do something when a tab doesn't get me past the word `where' or `let', but isn't that the majority of what Layout specifies?
Is there a good answer for caveman programmers who like ed and tabs?

On Sun, Feb 14, 2010 at 4:46 PM, Stephen Blackheath [to
Haskell-Beginners]
Jorden,
Cave persons such as yourself can use tabs as long as your tab size is 8 characters. This is "hard-coded" into the Haskell 98 specification.
My editor, being made of sticks, some rocks, and the jawbone of an ass, just puts in a tab character. The graphical representation of a tab character expands from the insertion point to the nearest multiple of 8 characters, but that has no bearing on the file contents. Also, there are situations when a tab-boundary is not enough. What is the correct course of action here? Currently, I usually try to change the line to spaces, or if I'm lazy, I'll put spaces after tabs, which I don't feel good about. My editor knows enough to indent the next line the same amount.
Steve
Jorden Mauro wrote:
First of all, *don't mix tabs and spaces for indentation* (best, don't use tabs at all).
I find the latter a bit too restrictive, especially since I use a text editor that is a glorified version of ed. Hitting the spacebar 19 times is too much to ask of me.
And as such, I am occasionally forced to do something when a tab doesn't get me past the word `where' or `let', but isn't that the majority of what Layout specifies?
Is there a good answer for caveman programmers who like ed and tabs?

On 14/02/10 22:05, Jorden Mauro wrote:
On Sun, Feb 14, 2010 at 4:46 PM, Stephen Blackheath [to Haskell-Beginners]
wrote: Jorden,
Cave persons such as yourself can use tabs as long as your tab size is 8 characters. This is "hard-coded" into the Haskell 98 specification.
My editor, being made of sticks, some rocks, and the jawbone of an ass, just puts in a tab character. The graphical representation of a tab character expands from the insertion point to the nearest multiple of 8 characters, but that has no bearing on the file contents.
Sure it does, the bearing is that there's a tab character there. ;-)
Also, there are situations when a tab-boundary is not enough. What is the correct course of action here?
Other people have already suggested it: change editor. Please let us know if there is *any* good reason for anyone to be using such a limited editor in the 21st century.
Currently, I usually try to change the line to spaces, or if I'm lazy, I'll put spaces after tabs, which I don't feel good about. My editor knows enough to indent the next line the same amount.
From this it sounds like you aren't using such a stone age editor after all. Are you sure you can't get it to also convert tabs to spaces? /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

On Feb 14, 2010, at 6:00 PM, Magnus Therning
On 14/02/10 22:05, Jorden Mauro wrote:
On Sun, Feb 14, 2010 at 4:46 PM, Stephen Blackheath [to Haskell-Beginners]
wrote: Jorden,
Cave persons such as yourself can use tabs as long as your tab size is 8 characters. This is "hard-coded" into the Haskell 98 specification.
My editor, being made of sticks, some rocks, and the jawbone of an ass, just puts in a tab character. The graphical representation of a tab character expands from the insertion point to the nearest multiple of 8 characters, but that has no bearing on the file contents.
Sure it does, the bearing is that there's a tab character there. ;-)
If I put one.
Also, there are situations when a tab-boundary is not enough. What is the correct course of action here?
Other people have already suggested it: change editor.
Not happening. Sam is sublime.
Please let us know if there is *any* good reason for anyone to be using such a limited editor in the 21st century.
Structural regexes. Size. Remote editing. Simplicity of code, UI, etc. Lack of bugs. Orthogonality. Performance. (Sam handles dozens of megabyte-sized files, even on a remote machine, without batting an eye, even during regex commands)
Currently, I usually try to change the line to spaces, or if I'm lazy, I'll put spaces after tabs, which I don't feel good about. My editor knows enough to indent the next line the same amount.
From this it sounds like you aren't using such a stone age editor after all.
I assure you, I am. It has exactly only 33 commands. Give it a spin, I doubt you'll like it. It's not ed, but does have a GUI -- a verrry simple one.
Are you sure you can't get it to also convert tabs to spaces?
Not without reprogramming it. Of course, I could convert files by hand, but I could just as easily use spaces. I just thought tabs were acceptable. I was a contientious objector in the Tabs or Spaces War. Is just using spaces the Haskell Caveman Solution?
/M
-- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Sun, Feb 14, 2010 at 23:44, Jorden Mauro
On Feb 14, 2010, at 6:00 PM, Magnus Therning
wrote:
Are you sure you can't get it to also convert tabs to spaces?
Not without reprogramming it. Of course, I could convert files by hand, but I could just as easily use spaces. I just thought tabs were acceptable.
I was a contientious objector in the Tabs or Spaces War. Is just using spaces the Haskell Caveman Solution?
I'd argue the solution is to just use one. The issue is with mixing them! /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

Am Sonntag 14 Februar 2010 22:30:27 schrieb Jorden Mauro:
On Sun, Feb 14, 2010 at 3:20 PM, Daniel Fischer
wrote: Am Sonntag 14 Februar 2010 20:54:54 schrieb John Moore:
Hi all, I must be doing something wrong with my tabs. Because this keeps telling me parse error. Can some one see if it is indentation. I'm sending a file so as you'll be able to see what going on. If I copy it here it can appear wrong the difference is with the Var expression.
John
First of all, *don't mix tabs and spaces for indentation* (best, don't use tabs at all).
I find the latter a bit too restrictive, especially since I use a text editor that is a glorified version of ed.
Okay: Whyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy? Isn't there some editor which allows you to configure the tab settings but still is whatever-you-like-about-ed enough for you to use?
Hitting the spacebar 19 times is too much to ask of me.
And as such, I am occasionally forced to do something when a tab doesn't get me past the word `where' or `let', but isn't that the majority of what Layout specifies?
Is there a good answer for caveman programmers who like ed and tabs?
Never change your tab-width.

On Sun, Feb 14, 2010 at 5:04 PM, Daniel Fischer
Am Sonntag 14 Februar 2010 22:30:27 schrieb Jorden Mauro:
On Sun, Feb 14, 2010 at 3:20 PM, Daniel Fischer
wrote: Am Sonntag 14 Februar 2010 20:54:54 schrieb John Moore:
Hi all, I must be doing something wrong with my tabs. Because this keeps telling me parse error. Can some one see if it is indentation. I'm sending a file so as you'll be able to see what going on. If I copy it here it can appear wrong the difference is with the Var expression.
John
First of all, *don't mix tabs and spaces for indentation* (best, don't use tabs at all).
I find the latter a bit too restrictive, especially since I use a text editor that is a glorified version of ed.
Okay: Whyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy?
Structural regular expressions. My editor is almost context-free! (ok, a lame joke) I also believe DaVinci was right when he said `simplicity is the ultimate sophistication'.
Isn't there some editor which allows you to configure the tab settings but still is whatever-you-like-about-ed enough for you to use?
Well... there's nothing quite like Sam.
Hitting the spacebar 19 times is too much to ask of me.
And as such, I am occasionally forced to do something when a tab doesn't get me past the word `where' or `let', but isn't that the majority of what Layout specifies?
Is there a good answer for caveman programmers who like ed and tabs?
Never change your tab-width.
I can't!

On Sun, Feb 14, 2010 at 04:30:27PM -0500, Jorden Mauro wrote:
On Sun, Feb 14, 2010 at 3:20 PM, Daniel Fischer
wrote: Am Sonntag 14 Februar 2010 20:54:54 schrieb John Moore:
Hi all, I must be doing something wrong with my tabs. Because this keeps telling me parse error. Can some one see if it is indentation. I'm sending a file so as you'll be able to see what going on. If I copy it here it can appear wrong the difference is with the Var expression.
John
First of all, *don't mix tabs and spaces for indentation* (best, don't use tabs at all).
I find the latter a bit too restrictive, especially since I use a text editor that is a glorified version of ed. Hitting the spacebar 19 times is too much to ask of me.
And as such, I am occasionally forced to do something when a tab doesn't get me past the word `where' or `let', but isn't that the majority of what Layout specifies?
Is there a good answer for caveman programmers who like ed and tabs?
Another good answer is to use explicit curly braces and semicolons so you don't have to rely on layout. -Brent

On Sun, Feb 14, 2010 at 8:51 PM, Brent Yorgey
On Sun, Feb 14, 2010 at 04:30:27PM -0500, Jorden Mauro wrote:
On Sun, Feb 14, 2010 at 3:20 PM, Daniel Fischer
wrote: Am Sonntag 14 Februar 2010 20:54:54 schrieb John Moore:
Hi all, I must be doing something wrong with my tabs. Because this keeps telling me parse error. Can some one see if it is indentation. I'm sending a file so as you'll be able to see what going on. If I copy it here it can appear wrong the difference is with the Var expression.
John
First of all, *don't mix tabs and spaces for indentation* (best, don't use tabs at all).
I find the latter a bit too restrictive, especially since I use a text editor that is a glorified version of ed. Hitting the spacebar 19 times is too much to ask of me.
And as such, I am occasionally forced to do something when a tab doesn't get me past the word `where' or `let', but isn't that the majority of what Layout specifies?
Is there a good answer for caveman programmers who like ed and tabs?
Another good answer is to use explicit curly braces and semicolons so you don't have to rely on layout.
Yes, I am a recovering C programmer. You caught me! I really do appreciate the features of sam, and its simplicity is why I like layout. Omit needless punctuation, I say.
-Brent _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (7)
-
Brent Yorgey
-
Daniel Fischer
-
John Moore
-
Jorden Mauro
-
Magnus Therning
-
Stephen Blackheath [to Haskell-Beginners]
-
Tom Tobin