Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Folders and sub-folders (Sylvain Henry)
   2. Re:  general observation about programming
      (driemer.rie...@gmail.com)
   3. Re:  general observation about programming (Dudley Brooks)
   4. Re:  general observation about programming (MJ Williams)


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

Message: 1
Date: Fri, 26 Feb 2016 14:01:43 +0100
From: Sylvain Henry <hsy...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Folders and sub-folders
Message-ID:
        <CAPmptcUTWPVHXrN4Tpd8NAXT=KD+e9aqKH-Y=8A5GmUOmKeL=g...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Your "isOk" function will filter out hidden directories on Unix (which may
be what you want?).

Otherwise: isOk = (`notElem` [".",".."])

Also "\x -> folders x" = "folders"

2016-02-26 11:42 GMT+01:00 Mike Houghton <mike_k_hough...@yahoo.co.uk>:

> Thanks.
>
>
> I sweated it  bit more and got
>
>
>
> isOk FilePath -> Bool
> isOk  = not . isPrefixOf "."
>
> folders :: FilePath -> IO [FilePath]
> folders fp  = do
>     all <- getDirectoryContents fp
>     z' <- filterM doesDirectoryExist $ map (fp </>) (filter isOk all)
>     x' <- mapM (\x -> folders x) z'
>     return $ z' ++ (concat x') ::
>
> which seems to work.
>
>
> > On 25 Feb 2016, at 19:07, Imants Cekusins <ima...@gmail.com> wrote:
> >
> > Hello Mike,
> >
> > below code find all files recursively from a starting point. It works.
> >
> > You'd need to tweak it to find folders instead.
> >
> >
> > import System.Directory
> > import Data.List
> >
> >
> > findAllFiles::FilePath -> IO [FilePath]
> > findAllFiles base0 = gd1 base0
> >>> = \list1 -> concatMap' recurse3 list1
> >     where gd1 d1 = filter f2 <$> (getDirectoryContents d1)
> >           f2 "." = False
> >           f2 ".." = False
> >           f2 _ = True
> >           recurse3 md3 = doesDirectoryExist md3full
> >>> = \isDir3 ->
> >                        if isDir3 then findAllFiles md3full
> >                        else pure [md3full]
> >                    where md3full = base0 ++ "/" ++ md3
> >
> >
> >
> > concatMap':: (a -> IO [b]) -> [a] -> IO [b]
> > concatMap' m0 list0 = sequence (m0 <$> list0)
> >>> = \list2 -> pure $ concat list2
> > _______________________________________________
> > Beginners mailing list
> > Beginners@haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20160226/6ace6a92/attachment-0001.html>

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

Message: 2
Date: Fri, 26 Feb 2016 07:56:35 -0700
From: driemer.rie...@gmail.com
To: mike.pent...@physics.org, The Haskell-Beginners Mailing List -
        Discussion of primarily beginner-level topics related to Haskell
        <beginners@haskell.org>
Subject: Re: [Haskell-beginners] general observation about programming
Message-ID: <90958f7a-c5b1-4cb1-b3e5-de268c929...@gmail.com>
Content-Type: text/plain;       charset=us-ascii

Sure what is your availability?

Sent from my iPhone
Please disregard errors as this is a smaller device.

> On Feb 26, 2016, at 02:55, Mike Pentney <mike.pent...@physics.org> wrote:
> 
> As a newbie, something I dislike about Haskell is the use of infix operators 
> like <||> which are unpronouncable and therefore (if you don't happen to know 
> the notation the symbol is based on) are more or less meaningless.
> 
> And Haskellers often seem to prefer 1 and 2 character variable names, which 
> again convey little or no information.
> 
> And don't get me started on point-free code...!
> 
> N.B. I am not trying to start a flame war, these are just comments from my 
> experience of trying to get beyond text-book examples and start using Haskell 
> libraries and trying to learn from open source code. In general I find 
> idiomatic Haskell hard to understand, and for me this is a barrier to using 
> Haskell for real projects. Maybe someday I'll have learnt enough to get past 
> this problem, but as the language and libraries seem to evolve quickly, I 
> have my doubts...
> 
> 
>> On 25/02/16 19:19, Jeffrey Brown wrote:
>> Something I like about functional programming is how it interfaces with 
>> natural language.
>> Haskell, somehow to a greater extent than other languages, encourages me to 
>> divide functions
>> into one or two-liners. Each has a type signature that means something in 
>> English. Further, each
>> gives you the opportunity to choose a good name for the function and its 
>> arguments. After doing
>> those things, the function is much easier to write, and much easier to read 
>> -- so much so that
>> often you don't have to read the function body at all, just the type 
>> signature, function name
>> and argument names.
>> 
>> On Thu, Feb 25, 2016 at 8:17 AM, Dudley Brooks <dbro...@runforyourlife.org
>> <mailto:dbro...@runforyourlife.org>> wrote:
>> 
>>    Ages and ages ago I saw this advice about programming:
>> 
>>    Q:  "What's the best language for a programmer to know?"
>> 
>>    A:  "English" (or whatever your native language is)
>> 
>>    -- Dudley
>> 
>> 
>>>    On 2/24/16 4:03 PM, Dennis Raddle wrote:
>>> 
>>>    This is more about programming in general than Haskell, although 
>>> Haskellers probably know
>>>    it well.
>>> 
>>>    I don't claim to have expert knowledge on this, but I'm gradually 
>>> getting better at it.
>>> 
>>>    When I set out to write a program, or refactor a program, or modify a 
>>> program, it helps to
>>>    set out my thinking in a clear way. And how I make it clear is to 
>>> document my thoughts.
>>> 
>>>    An outline is one good way to organize thoughts and is probably my main 
>>> tool. But good
>>>    English prose is also helpful.
>>> 
>>>    The key factor is "editing." In what sense do I mean that? Good writers 
>>> do it, and the
>>>    Haskell documentation does it. I mean (1) brevity and (2) good flow. To 
>>> achieve brevity,
>>>    you must think about the essence of each statement and trim away the 
>>> unnecessary stuff.
>>>    Good flow refers to how the document builds up and modifies your 
>>> concepts as you read it.
>>>    A document can actually mirror an effective learning process, or 
>>> influence and change your
>>>    process.
>>> 
>>>    I work with my documentation, making several editing passes. By the time 
>>> I'm done, I am in
>>>    a great position to write a concise and flexible program.
>>> 
>>>    It's interesting that not only is Haskell a concise language, but the 
>>> Haskell library
>>>    documentation is concise. Contrast that with the Python documentation 
>>> which often wanders
>>>    about into areas that are irrelevant--it could easily be cut into one 
>>> third its present size.
>>> 
>>>    Mike
>>> 
>>> 
>>> 
>>> 
>>>    _______________________________________________
>>>    Beginners mailing list
>>>    Beginners@haskell.org <mailto:Beginners@haskell.org>
>>>    http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>> 
>> 
>>    _______________________________________________
>>    Beginners mailing list
>>    Beginners@haskell.org <mailto:Beginners@haskell.org>
>>    http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>> 
>> 
>> 
>> 
>> --
>> Jeffrey Benjamin Brown
>> 
>> 
>> _______________________________________________
>> Beginners mailing list
>> Beginners@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>> 
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

Message: 3
Date: Fri, 26 Feb 2016 07:29:03 -0800
From: Dudley Brooks <dbro...@runforyourlife.org>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] general observation about programming
Message-ID: <56d06f3f.9090...@runforyourlife.org>
Content-Type: text/plain; charset=windows-1252; format=flowed

One problem is that, while the symbolic operators do seem to have names 
(specified in the standards?) which are often sufficiently explanatory, 
you can find many tutorials which never even mention those names.

On 2/26/16 1:55 AM, Mike Pentney wrote:

> As a newbie, something I dislike about Haskell is the use of infix 
> operators like <||> which are unpronouncable and therefore (if you 
> don't happen to know the notation the symbol is based on) are more or 
> less meaningless.
>
> And Haskellers often seem to prefer 1 and 2 character variable names, 
> which again convey little or no information.
>
> And don't get me started on point-free code...!
>
> N.B. I am not trying to start a flame war, these are just comments 
> from my experience of trying to get beyond text-book examples and 
> start using Haskell libraries and trying to learn from open source 
> code. In general I find idiomatic Haskell hard to understand, and for 
> me this is a barrier to using Haskell for real projects. Maybe someday 
> I'll have learnt enough to get past this problem, but as the language 
> and libraries seem to evolve quickly, I have my doubts...
>
>
> On 25/02/16 19:19, Jeffrey Brown wrote:
>> Something I like about functional programming is how it interfaces 
>> with natural language.
>> Haskell, somehow to a greater extent than other languages, encourages 
>> me to divide functions
>> into one or two-liners. Each has a type signature that means 
>> something in English. Further, each
>> gives you the opportunity to choose a good name for the function and 
>> its arguments. After doing
>> those things, the function is much easier to write, and much easier 
>> to read -- so much so that
>> often you don't have to read the function body at all, just the type 
>> signature, function name
>> and argument names.
>>
>> On Thu, Feb 25, 2016 at 8:17 AM, Dudley Brooks 
>> <dbro...@runforyourlife.org
>> <mailto:dbro...@runforyourlife.org>> wrote:
>>
>>     Ages and ages ago I saw this advice about programming:
>>
>>     Q:  "What's the best language for a programmer to know?"
>>
>>     A:  "English" (or whatever your native language is)
>>
>>     -- Dudley
>>
>>
>>     On 2/24/16 4:03 PM, Dennis Raddle wrote:
>>
>>>     This is more about programming in general than Haskell, although 
>>> Haskellers probably know
>>>     it well.
>>>
>>>     I don't claim to have expert knowledge on this, but I'm 
>>> gradually getting better at it.
>>>
>>>     When I set out to write a program, or refactor a program, or 
>>> modify a program, it helps to
>>>     set out my thinking in a clear way. And how I make it clear is 
>>> to document my thoughts.
>>>
>>>     An outline is one good way to organize thoughts and is probably 
>>> my main tool. But good
>>>     English prose is also helpful.
>>>
>>>     The key factor is "editing." In what sense do I mean that? Good 
>>> writers do it, and the
>>>     Haskell documentation does it. I mean (1) brevity and (2) good 
>>> flow. To achieve brevity,
>>>     you must think about the essence of each statement and trim away 
>>> the unnecessary stuff.
>>>     Good flow refers to how the document builds up and modifies your 
>>> concepts as you read it.
>>>     A document can actually mirror an effective learning process, or 
>>> influence and change your
>>>     process.
>>>
>>>     I work with my documentation, making several editing passes. By 
>>> the time I'm done, I am in
>>>     a great position to write a concise and flexible program.
>>>
>>>     It's interesting that not only is Haskell a concise language, 
>>> but the Haskell library
>>>     documentation is concise. Contrast that with the Python 
>>> documentation which often wanders
>>>     about into areas that are irrelevant--it could easily be cut 
>>> into one third its present size.
>>>
>>>     Mike
>>>
>>>
>>>
>>>
>>>     _______________________________________________
>>>     Beginners mailing list
>>>     Beginners@haskell.org <mailto:Beginners@haskell.org>
>>>     http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>>     _______________________________________________
>>     Beginners mailing list
>>     Beginners@haskell.org <mailto:Beginners@haskell.org>
>>     http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>>
>>
>> -- 
>> Jeffrey Benjamin Brown
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners



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

Message: 4
Date: Fri, 26 Feb 2016 16:19:26 +0000
From: MJ Williams <matthewjwilliams...@gmail.com>
To: dbro...@runforyourlife.org,  The Haskell-Beginners Mailing List -
        Discussion of primarily beginner-level topics related to Haskell
        <beginners@haskell.org>
Subject: Re: [Haskell-beginners] general observation about programming
Message-ID:
        <caakj9fnftztzatf9bslxtqgmcbbyea916_u59c1r1oakdco...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

As I see it, Haskell and pure functional languages aren't
`necessarily' about readability so much as expressing thought in
mathematical terms.  The readability comes with the consistency and
transparency of well-formed mathematical notation.
by the way, that's transparency in laymen's sense and not referential
transparency.
Matthew


On 26/02/2016, Dudley Brooks <dbro...@runforyourlife.org> wrote:
> One problem is that, while the symbolic operators do seem to have names
> (specified in the standards?) which are often sufficiently explanatory,
> you can find many tutorials which never even mention those names.
>
> On 2/26/16 1:55 AM, Mike Pentney wrote:
>
>> As a newbie, something I dislike about Haskell is the use of infix
>> operators like <||> which are unpronouncable and therefore (if you
>> don't happen to know the notation the symbol is based on) are more or
>> less meaningless.
>>
>> And Haskellers often seem to prefer 1 and 2 character variable names,
>> which again convey little or no information.
>>
>> And don't get me started on point-free code...!
>>
>> N.B. I am not trying to start a flame war, these are just comments
>> from my experience of trying to get beyond text-book examples and
>> start using Haskell libraries and trying to learn from open source
>> code. In general I find idiomatic Haskell hard to understand, and for
>> me this is a barrier to using Haskell for real projects. Maybe someday
>> I'll have learnt enough to get past this problem, but as the language
>> and libraries seem to evolve quickly, I have my doubts...
>>
>>
>> On 25/02/16 19:19, Jeffrey Brown wrote:
>>> Something I like about functional programming is how it interfaces
>>> with natural language.
>>> Haskell, somehow to a greater extent than other languages, encourages
>>> me to divide functions
>>> into one or two-liners. Each has a type signature that means
>>> something in English. Further, each
>>> gives you the opportunity to choose a good name for the function and
>>> its arguments. After doing
>>> those things, the function is much easier to write, and much easier
>>> to read -- so much so that
>>> often you don't have to read the function body at all, just the type
>>> signature, function name
>>> and argument names.
>>>
>>> On Thu, Feb 25, 2016 at 8:17 AM, Dudley Brooks
>>> <dbro...@runforyourlife.org
>>> <mailto:dbro...@runforyourlife.org>> wrote:
>>>
>>>     Ages and ages ago I saw this advice about programming:
>>>
>>>     Q:  "What's the best language for a programmer to know?"
>>>
>>>     A:  "English" (or whatever your native language is)
>>>
>>>     -- Dudley
>>>
>>>
>>>     On 2/24/16 4:03 PM, Dennis Raddle wrote:
>>>
>>>>     This is more about programming in general than Haskell, although
>>>> Haskellers probably know
>>>>     it well.
>>>>
>>>>     I don't claim to have expert knowledge on this, but I'm
>>>> gradually getting better at it.
>>>>
>>>>     When I set out to write a program, or refactor a program, or
>>>> modify a program, it helps to
>>>>     set out my thinking in a clear way. And how I make it clear is
>>>> to document my thoughts.
>>>>
>>>>     An outline is one good way to organize thoughts and is probably
>>>> my main tool. But good
>>>>     English prose is also helpful.
>>>>
>>>>     The key factor is "editing." In what sense do I mean that? Good
>>>> writers do it, and the
>>>>     Haskell documentation does it. I mean (1) brevity and (2) good
>>>> flow. To achieve brevity,
>>>>     you must think about the essence of each statement and trim away
>>>> the unnecessary stuff.
>>>>     Good flow refers to how the document builds up and modifies your
>>>> concepts as you read it.
>>>>     A document can actually mirror an effective learning process, or
>>>> influence and change your
>>>>     process.
>>>>
>>>>     I work with my documentation, making several editing passes. By
>>>> the time I'm done, I am in
>>>>     a great position to write a concise and flexible program.
>>>>
>>>>     It's interesting that not only is Haskell a concise language,
>>>> but the Haskell library
>>>>     documentation is concise. Contrast that with the Python
>>>> documentation which often wanders
>>>>     about into areas that are irrelevant--it could easily be cut
>>>> into one third its present size.
>>>>
>>>>     Mike
>>>>
>>>>
>>>>
>>>>
>>>>     _______________________________________________
>>>>     Beginners mailing list
>>>>     Beginners@haskell.org <mailto:Beginners@haskell.org>
>>>>     http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>>
>>>     _______________________________________________
>>>     Beginners mailing list
>>>     Beginners@haskell.org <mailto:Beginners@haskell.org>
>>>     http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>>
>>>
>>>
>>> --
>>> Jeffrey Benjamin Brown
>>>
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> Beginners@haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>


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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 92, Issue 34
*****************************************

Reply via email to