[Haskell-beginners] Lens and imperative programming
dedgrant at gmail.com
Fri May 24 21:57:12 CEST 2013
+= carries expectation of specific behavioural properties in popular
circles, making it a devious moniker. In an attempt to bridge programming
paradigms with Haskell this problem is common. There be dragons here:
Always question your assumptions about familiar names and symbols.
On 2013-05-24 11:15 AM, "Brent Yorgey" <byorgey at seas.upenn.edu> wrote:
> 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
> > I've some difficult to grasp the type. I can calculate it (or ask ghci
> > , but it looks complex to grasp.
> > May be I'm just too new to Haskell tools... but... I fear that in the
> > 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 can also be used in many contexts which do not involve the
> State monad.
> Beginners mailing list
> Beginners at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners