Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: indentation (Jorden Mauro)
2. Re: indentation (Stephen Blackheath [to Haskell-Beginners])
3. Re: indentation (Jorden Mauro)
4. Re: indentation (Daniel Fischer)
5. Re: indentation (Jorden Mauro)
6. Re: indentation (Magnus Therning)
7. Re: indentation (Jorden Mauro)
8. Re: indentation (Brent Yorgey)
----------------------------------------------------------------------
Message: 1
Date: Sun, 14 Feb 2010 16:30:27 -0500
From: Jorden Mauro <[email protected]>
Subject: Re: [Haskell-beginners] indentation
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On Sun, Feb 14, 2010 at 3:20 PM, Daniel Fischer
<[email protected]> 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?
>
> 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
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
------------------------------
Message: 2
Date: Mon, 15 Feb 2010 10:46:12 +1300
From: "Stephen Blackheath [to Haskell-Beginners]"
<[email protected]>
Subject: Re: [Haskell-beginners] indentation
To: Jorden Mauro <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8
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?
------------------------------
Message: 3
Date: Sun, 14 Feb 2010 17:05:13 -0500
From: Jorden Mauro <[email protected]>
Subject: Re: [Haskell-beginners] indentation
To: "Stephen Blackheath [to Haskell-Beginners]"
<[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On Sun, Feb 14, 2010 at 4:46 PM, Stephen Blackheath [to
Haskell-Beginners] <[email protected]>
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.
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?
>
------------------------------
Message: 4
Date: Sun, 14 Feb 2010 23:04:49 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] indentation
To: Jorden Mauro <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Am Sonntag 14 Februar 2010 22:30:27 schrieb Jorden Mauro:
> On Sun, Feb 14, 2010 at 3:20 PM, Daniel Fischer
>
> <[email protected]> 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.
------------------------------
Message: 5
Date: Sun, 14 Feb 2010 17:09:43 -0500
From: Jorden Mauro <[email protected]>
Subject: Re: [Haskell-beginners] indentation
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On Sun, Feb 14, 2010 at 5:04 PM, Daniel Fischer
<[email protected]> wrote:
> Am Sonntag 14 Februar 2010 22:30:27 schrieb Jorden Mauro:
>> On Sun, Feb 14, 2010 at 3:20 PM, Daniel Fischer
>>
>> <[email protected]> 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!
------------------------------
Message: 6
Date: Sun, 14 Feb 2010 23:00:05 +0000
From: Magnus Therning <[email protected]>
Subject: Re: [Haskell-beginners] indentation
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
On 14/02/10 22:05, Jorden Mauro wrote:
> On Sun, Feb 14, 2010 at 4:46 PM, Stephen Blackheath [to
> Haskell-Beginners] <[email protected]>
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
Url :
http://www.haskell.org/pipermail/beginners/attachments/20100214/71d6b90e/signature-0001.bin
------------------------------
Message: 7
Date: Sun, 14 Feb 2010 18:44:42 -0500
From: Jorden Mauro <[email protected]>
Subject: Re: [Haskell-beginners] indentation
To: Magnus Therning <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
On Feb 14, 2010, at 6:00 PM, Magnus Therning <[email protected]>
wrote:
> On 14/02/10 22:05, Jorden Mauro wrote:
>> On Sun, Feb 14, 2010 at 4:46 PM, Stephen Blackheath [to
>> Haskell-Beginners]
>> <[email protected]>
>> 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
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
------------------------------
Message: 8
Date: Sun, 14 Feb 2010 20:51:19 -0500
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] indentation
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
On Sun, Feb 14, 2010 at 04:30:27PM -0500, Jorden Mauro wrote:
> On Sun, Feb 14, 2010 at 3:20 PM, Daniel Fischer
> <[email protected]> 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
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 20, Issue 25
*****************************************