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.  Lens and imperative programming (Giacomo Tesio)
   2. Re:  Lens and imperative programming (Kim-Ee Yeoh)
   3. Re:  Lens and imperative programming (Giacomo Tesio)
   4.  Haskell on Debian (Giacomo Tesio)
   5. Re:  Haskell on Debian (Emanuel Koczwara)
   6. Re:  Lens and imperative programming (Brent Yorgey)


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

Message: 1
Date: Fri, 24 May 2013 16:15:54 +0200
From: Giacomo Tesio <[email protected]>
Subject: [Haskell-beginners] Lens and imperative programming
To: "[email protected]" <[email protected]>
Message-ID:
        <CAHL7psFf31m9N+9evFtznO6=flmvzsr9_ouo-cz5lnnzmcj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi, I'm reading about the Lens package, and I'm scared by the imperative
style that it enables.

I know the limits of imperative programming, and despite the fact that lens
are purely functional by themself, I'm scared about limits in readability
of code. I'm afraid of writing "write-only" code.


I guess I'm wrong, but I'd like to know your opinions.


Giacomo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130524/f2349fd2/attachment-0001.htm>

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

Message: 2
Date: Fri, 24 May 2013 22:10:50 +0700
From: Kim-Ee Yeoh <[email protected]>
Subject: Re: [Haskell-beginners] Lens and imperative programming
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CAPY+ZdS-Lkdv99UD2OLprnQxNMEkOmjQP2XzVecuM1YOL7f=u...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On Fri, May 24, 2013 at 9:15 PM, Giacomo Tesio <[email protected]> wrote:

> I know the limits of imperative programming, and despite the fact that
> lens are purely functional by themself, I'm scared about limits in
> readability of code. I'm afraid of writing "write-only" code.
>

Without any example or further details about the exact nature of this fear,
I think it's really difficult for anyone to do this question justice.

As a start, try divvying up the issue into syntax and semantics.
Semantically, lenses remain purely functional, as you say. Syntax-wise, it
appears problematic. One path forward is to flesh out what you mean by the
latter.

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130524/092604ee/attachment-0001.htm>

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

Message: 3
Date: Fri, 24 May 2013 18:41:27 +0200
From: Giacomo Tesio <[email protected]>
Subject: Re: [Haskell-beginners] Lens and imperative programming
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <cahl7pshhrhlzzqmvvttsrl3qefywyyt7amjh0oipdtnfyt6...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

For example I'm scared by += a function compositions.

For example here

units.traversed.health -= 3


(from
http://www.haskellforall.com/2013/05/program-imperatively-using-haskell.html)
I've some difficult to grasp the type. I can calculate it (or ask ghci :-D)
, but it looks complex to grasp.

May be I'm just too new to Haskell tools... but... I fear that in the long
run, this could become unreadable.


Am I wrong?


Giacomo



On Fri, May 24, 2013 at 5:10 PM, Kim-Ee Yeoh <[email protected]> wrote:

>
> On Fri, May 24, 2013 at 9:15 PM, Giacomo Tesio <[email protected]> wrote:
>
>> I know the limits of imperative programming, and despite the fact that
>> lens are purely functional by themself, I'm scared about limits in
>> readability of code. I'm afraid of writing "write-only" code.
>>
>
> Without any example or further details about the exact nature of this
> fear, I think it's really difficult for anyone to do this question justice.
>
> As a start, try divvying up the issue into syntax and semantics.
> Semantically, lenses remain purely functional, as you say. Syntax-wise, it
> appears problematic. One path forward is to flesh out what you mean by the
> latter.
>
> -- Kim-Ee
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130524/77d3a3f0/attachment-0001.htm>

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

Message: 4
Date: Fri, 24 May 2013 18:45:28 +0200
From: Giacomo Tesio <[email protected]>
Subject: [Haskell-beginners] Haskell on Debian
To: "[email protected]" <[email protected]>
Message-ID:
        <cahl7psfidnqy5tcace3mozhu84xgsbnmt7vwsubqzvdl8g3...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Can I use cabal install without being root?

I'd like to use packages from hackage instead of those provided by apt-get
as far as possibile.
Is it possible at all? I guess that libraries depending on FFI won't
works...


Giacomo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130524/341b5893/attachment-0001.htm>

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

Message: 5
Date: Fri, 24 May 2013 19:24:01 +0200
From: Emanuel Koczwara <[email protected]>
Subject: Re: [Haskell-beginners] Haskell on Debian
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID: <1369416241.5240.3.camel@emanuel-laptop>
Content-Type: text/plain; charset="utf-8"

Hi,

Dnia 2013-05-24, pi? o godzinie 18:45 +0200, Giacomo Tesio pisze:
> Can I use cabal install without being root?
> 
> 
> I'd like to use packages from hackage instead of those provided by
> apt-get as far as possibile.
> Is it possible at all? I guess that libraries depending on FFI won't
> works...

  Yes, you can. Just try.

  If you will install something as root with cabal, it will install it
in root home directory, not in global system directories.

Emanuel


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5185 bytes
Desc: not available
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130524/edd89851/attachment-0001.bin>

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

Message: 6
Date: Fri, 24 May 2013 14:13:36 -0400
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] Lens and imperative programming
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

On Fri, May 24, 2013 at 06:41:27PM +0200, Giacomo Tesio wrote:
> For example I'm scared by += a function compositions.
> 
> For example here
> 
> units.traversed.health -= 3
> 
> 
> (from
> http://www.haskellforall.com/2013/05/program-imperatively-using-haskell.html)
> I've some difficult to grasp the type. I can calculate it (or ask ghci :-D)
> , but it looks complex to grasp.
> 
> May be I'm just too new to Haskell tools... but... I fear that in the long
> run, this could become unreadable.

You could already do exactly the same thing without the lens package.
It uses the State monad.  The lens package just makes it much simpler
to write this code.

If you think that overuse of the State monad will lead to bad,
unmaintainable code, you are right.  But that has nothing to do with
lenses.

Lenses can also be used in many contexts which do not involve the
State monad.

-Brent



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

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 59, Issue 30
*****************************************

Reply via email to