Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Doubting Haskell
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 33 of 33 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Luke Palmer  
View profile  
 More options Mar 4 2008, 6:45 am
Newsgroups: fa.haskell
From: "Luke Palmer" <lrpal...@gmail.com>
Date: Tue, 04 Mar 2008 11:45:16 UTC
Local: Tues, Mar 4 2008 6:45 am
Subject: Re: [Haskell-cafe] Doubting Haskell

On Tue, Mar 4, 2008 at 4:16 AM, Ketil Malde <ke...@malde.org> wrote:
> Paul Johnson <p...@cogito.org.uk> writes:

>  > I'm surprised you found the significant whitespace difficult.

>  I wonder if this has something to do with the editor one uses?  I use
>  Emacs, and just keep hitting TAB, cycling through possible alignments,
>  until things align sensibly.  I haven't really tried, but I can
>  imagine lining things up manually would be more painful, especially
>  if mixing tabs and spaces.

Especially if mixing tabs and spaces indeed.  Haskell does the Python
thing of assuming that a tab is 8 spaces, which IMO is a mistake.  The
sensible thing to do if you have a whitespace-sensitive language that
accepts both spaces in tabs is to make them incomparable to each
other; i.e.

    main = do
    <sp><sp>putStrLn $ "Hello"
    <sp><sp><tab>++ "World"
    -- compiles fine

    main = do
    <sp><sp>putStrLn $ "Hello"
    <tab>++ "World"
    -- error, can't tell how indented '++ "World"' is...

Luke
_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Moore  
View profile  
 More options Mar 4 2008, 10:19 am
Newsgroups: fa.haskell
From: "Paul Moore" <p.f.mo...@gmail.com>
Date: Tue, 04 Mar 2008 15:19:09 UTC
Local: Tues, Mar 4 2008 10:19 am
Subject: Re: [Haskell-cafe] Doubting Haskell
On 04/03/2008, Alan Carter <alangcar...@gmail.com> wrote:

That was an interesting read. Thanks for posting it. I also liked the
tale of the BBC ULA - it reminded me of a demo I saw once at an Acorn
show, where they had a RISC PC on show, with a (IBM) PC card in it.
They were demonstrating how hot the PC chip runs compared to the ARM
RISC chip by using it to make toast. I dread to think what you could
do with one of today's monsters :-)

Paul.
_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cale Gibbard  
View profile  
 More options Mar 4 2008, 11:21 am
Newsgroups: fa.haskell
From: "Cale Gibbard" <cgibb...@gmail.com>
Date: Tue, 04 Mar 2008 16:21:36 UTC
Local: Tues, Mar 4 2008 11:21 am
Subject: Re: [Haskell-cafe] Doubting Haskell
On 04/03/2008, Luke Palmer <lrpal...@gmail.com> wrote:

<snip>

I honestly think that tab characters occurring anywhere but in a
comment should be considered a lexical error and rejected by the
compiler outright. More problems are caused by trying to continue with
only tabs, or some mixture of tabs and spaces than just getting one's
editor to expand tabs automatically.

 - Cale
_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Evan Laforge  
View profile  
 More options Mar 4 2008, 1:53 pm
Newsgroups: fa.haskell
From: "Evan Laforge" <qdun...@gmail.com>
Date: Tue, 04 Mar 2008 18:53:20 UTC
Local: Tues, Mar 4 2008 1:53 pm
Subject: Re: [Haskell-cafe] Doubting Haskell

> Especially if mixing tabs and spaces indeed.  Haskell does the Python
> thing of assuming that a tab is 8 spaces, which IMO is a mistake.  The

FWIW, most people in python land think the same thing, and the -t flag
makes mixed tabs and spaces a warning or error.  At the least, -Wall
could report mixed usage.  At the most, make it an error.
_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hjgt...@chello.nl  
View profile  
 More options Mar 4 2008, 5:02 pm
Newsgroups: fa.haskell
From: hjgt...@chello.nl
Date: Tue, 04 Mar 2008 22:02:15 UTC
Local: Tues, Mar 4 2008 5:02 pm
Subject: Re: [Haskell-cafe] Doubting Haskell

About the line length needed for Haskell programs, there was a discussion
about this some time ago, that could be regarded as a tutorial for
reducing indentation:
    http://haskell.org/pipermail/haskell-cafe/2007-July/028787.html

As for the idle core you mention: I keep one core fully occupied with a
program that searches for a cure against cancer, see:
    http://www.computeagainstcancer.org/

The example you gave for the use of "map" can be simplified:
    map func (take (10 [0..]))  -- should actually be: map func (take 10
[0..])
->
    map func [0..9]

Regards,
Henk-Jan van Tuyl

--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--

On Tue, 04 Mar 2008 07:29:24 +0100, Alan Carter <alangcar...@gmail.com>
wrote:

> Many thanks for the explanations when I was first experimenting with
> Haskell. I managed to finish translating a C++ wxWidgets program into
> Haskell wxHaskell, and am certainly impressed.

> I've written up some reflections on my newbie experience together with
> both versions, which might be helpful to people interested in
> popularizing Haskell, at:

> http://the-programmers-stone.com/2008/03/04/a-first-haskell-experience/

> Regards,

> Alan

--
--
Met vriendelijke groet,
Henk-Jan van Tuyl

--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--

_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chaddaï Fouché  
View profile  
 More options Mar 4 2008, 5:30 pm
Newsgroups: fa.haskell
From: "Chaddaï Fouché" <chaddai.fou...@gmail.com>
Date: Tue, 04 Mar 2008 22:30:21 UTC
Local: Tues, Mar 4 2008 5:30 pm
Subject: Re: [Haskell-cafe] Doubting Haskell
2008/3/4, Alan Carter <alangcar...@gmail.com>:

>  I've written up some reflections on my newbie experience together with
>  both versions, which might be helpful to people interested in
>  popularizing Haskell, at:

>  http://the-programmers-stone.com/2008/03/04/a-first-haskell-experience/

This is truly interesting, any learning experience is enlightening, we
truly do need to lower this barrier of admittance of which you speak.

On another subject, there are still point in your code that could be
clearer or done with less              cruft :

maxOfHistogram stats = snd (foldl (\(cA, vA) (cB, vB) -> if (vA > vB)
                                                            then (cA, vA)
                                                            else (cB, vB))
                                  (0, 0)
                                  stats)

can become :

maxofHistogram stats = foldl' max 0 (map snd stats)

("foldl' max 0" could be replaced by "maximum" but there wouldn't be a
default 0 anymore)

more importantly, you can replace this kind of code :
  vA <- varCreate []
  vB <- varCreate []
  -- ...
  vL <- varCreate []
  vM <- varCreate []
  vN <- varCreate []
  vO <- varCreate []

by :
  [vA, vB, vC, vD, vE, vF, vG, vH, vI, vJ, vK, vL, vM, vN, vO] <-
    replicateM 15 (varCreate [])

(true also for the "dA <- textEntry statusFrame [text := "0",
alignment := AlignRight]" sequence)

I'm not sure that functions like getdTotal couldn't be improved, I
wonder if a small Map for the elements of d wouldn't make the code
much better and offer other opportunities for abstractions. As it is,
enumeration like :

             [[label "Total Entries",   widget (getdTotal d)]
             ,[label "Valid Entries",   widget (getdValid d)]
             -- ...
             ,[label "MDMA",            widget (getdMdma d)]
             ,[label "Caffeine",        widget (getdCaffeine d)]]

could be slightly reduced by :
let bindLabelAndWidget (lbl,getter) = [label lbl, widget (getter d)]
in map bindLabelAndWidget [("Total Entries", getdTotal), ("Valid
Entries", getdValid)
  ,(...)]

And little thing like :
mapM_ (\f -> do repaint f) knownFrames
becoming :
mapM_ repaint knownFrames

I also do concur that a flag or a warning to signal mixed tabulations
and space would be a _very_ good idea !

--
Jedaï
_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Don Stewart  
View profile  
 More options Mar 4 2008, 5:35 pm
Newsgroups: fa.haskell
From: Don Stewart <d...@galois.com>
Date: Tue, 04 Mar 2008 22:35:30 UTC
Local: Tues, Mar 4 2008 5:35 pm
Subject: Re: [Haskell-cafe] Doubting Haskell
chaddai.fouche:

> 2008/3/4, Alan Carter <alangcar...@gmail.com>:
> >  I've written up some reflections on my newbie experience together with
> >  both versions, which might be helpful to people interested in
> >  popularizing Haskell, at:

> >  http://the-programmers-stone.com/2008/03/04/a-first-haskell-experience/

> I also do concur that a flag or a warning to signal mixed tabulations
> and space would be a _very_ good idea !

Such a flag already exists:

    -fwarn-tabs

As in:

    $ ghc -fwarn-tabs A.hs -no-recomp
    A.hs:3:0: Tab character

-- Don
_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lennart Augustsson  
View profile  
 More options Mar 5 2008, 6:48 pm
Newsgroups: fa.haskell
From: "Lennart Augustsson" <lenn...@augustsson.net>
Date: Wed, 05 Mar 2008 23:48:28 UTC
Local: Wed, Mar 5 2008 6:48 pm
Subject: Re: [Haskell-cafe] Doubting Haskell

Thanks for an interesting write-up.  And not bad for a first Haskell
program. :)
There's still a number of things you could do to limit the boiler plate
code, though.

_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »