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:  Mutable grid (Magnus Therning)
   2.  ANNOUNCE: Haskell Communities and Activities Report (31st
      ed., November 2016) (Mihai Maruseac)


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

Message: 1
Date: Sat, 24 Dec 2016 15:37:40 +0100
From: Magnus Therning <mag...@therning.org>
To: beginners <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Mutable grid
Message-ID:
        <caaexw5uhgnrd-2giblbpghiybclgnvvn+g6lihhbasdx+pg...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

How did it go?

When I solved that AoC problem I ended up using the matrix package:
http://hackage.haskell.org/package/matrix

/M


On 19 Dec 2016 7:31 pm, "mike h" <mike_k_hough...@yahoo.co.uk> wrote:

> Thanks for the pointers - I’ll take a look.
>
> The background to this is one of the puzzles on Advent Of Code 2016 Q.8.
> https://adventofcode.com/2016/day/8
>
> There are (several hundred) sequential  operations on a grid 50 x 6
>  - initially all zeroes
> e.g.
> rotate row y=0 by 4
> rect 2x1 — sets sub grid from (0,0) to (2,1) to all 1s
> rotate column x=35 by 1
>
> I’m fine about parsing the input to a data structure and executing
> them i.e.
>
> evalExpr :: Expr -> Screen -> Screen     — screen is essentially [[Int]]
> evalExpr e s =
>     case e of
>         (Rect   r c ) ->     evalRect   r c s
>         (RotRow r by) -> evalRotRow r by s
>         (RotCol c by) -> evalRotCol c by s
>         (NOP        ) -> id s
>
> rotating a row was simple enough, code to  rotate column a bit untidy and
> not very nice. The
> evalRect  - which sets values to one in the rectangle of size r x c
> starting at (0,0) top left - triggered the original question.
>
>
> At this point  my knowledge of Haskell is being pushed (which is good) but
> I have a feeling that
> my approach is not ‘correct’ once it gets beyond the parsing. Should each
> of the evalRect, evalRotRow and evalRotCol be called with a Screen (i.e.
> the grid at the root of this question)?
> Is the state monad a fit for this problem?
> Should I change my approach or is using vector the way forward?
>
> Many thanks
>
> Mike
>
>
>
>
>
> On 19 Dec 2016, at 15:27, Michael Orlitzky <mich...@orlitzky.com> wrote:
>
> On 12/19/2016 08:10 AM, mike h wrote:
>
> Hi,
>
> I’m looking a problem where I have an NxN grid of ints. I need a
> function like setValue x y newVal
>
> I have tried using [[Int]] but it does become messy when splitting ,
> dropping and then ++ back together.
>
> What other options are available to represent a mutable grid?
>
>
> Mutable vectors (from the vector[1] package) are an obvious choice. When
> I had to do something similar, I wound up going all the way to repa[2],
> which magically turns all of your grid operations into parallel ones.
>
>
> [1] https://hackage.haskell.org/package/vector
> [2] https://hackage.haskell.org/package/repa
>
> _______________________________________________
> 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/20161224/1675bbd2/attachment-0001.html>

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

Message: 2
Date: Sat, 24 Dec 2016 11:18:53 -0800
From: Mihai Maruseac <mihai.marus...@gmail.com>
To: Haskell <hask...@haskell.org>, haskell <haskell-c...@haskell.org>,
        Haskell Beginners <beginners@haskell.org>
Subject: [Haskell-beginners] ANNOUNCE: Haskell Communities and
        Activities Report (31st ed., November 2016)
Message-ID:
        <CAOMsUMKjbTCxd1UA0jrL=wj5_rdj0wmmhlnbvokt8etfxaj...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On behalf of all the contributors, we are pleased to announce that the

           Haskell Communities and Activities Report
                (31st edition, November 2016)

is now available, in PDF and HTML formats:

  http://haskell.org/communities/11-2016/report.pdf
  http://haskell.org/communities/11-2016/html/report.html

All previous editions of HCAR can be accessed on the wiki at
https://wiki.haskell.org/Haskell_Communities_and_Activities_Report

Many thanks go to all the people that contributed to this report,
both directly, by sending in descriptions, and indirectly, by doing
all the interesting things that are reported. We hope you will find
it as interesting a read as we did.

If you have not encountered the Haskell Communities and Activities
Reports before, you may like to know that the first of these reports
was published in November 2001. Their goal is to improve the
communication between the increasingly diverse groups, projects, and
individuals working on, with, or inspired by Haskell. The idea behind
these reports is simple:

  Every six months, a call goes out to all of you enjoying Haskell to
  contribute brief summaries of your own area of work. Many of you
  respond (eagerly, unprompted, and sometimes in time for the actual
  deadline) to the call. The editors collect all the contributions
  into a single report and feed that back to the community.

When we try for the next update, six months from now, you might want
to report on your own work, project, research area or group as well.
So, please put the following into your diaries now:

========================================
                     End of February 2016:
           target deadline for contributions to the
        May 2017 edition of the HCAR Report
========================================

Unfortunately, many Haskellers working on interesting projects are so
busy with their work that they seem to have lost the time to follow
the Haskell related mailing lists and newsgroups, and have trouble even
finding time to report on their work. If you are a member, user or
friend of a project so burdened, please find someone willing to make
time to report and ask them to "register" with the editors for a simple
e-mail reminder in November (you could point us to them as well, and we
can then politely ask if they want to contribute, but it might work
better if you do the initial asking). Of course, they will still have to
find the ten to fifteen minutes to draw up their report, but maybe we
can increase our coverage of all that is going on in the community.

Feel free to circulate this announcement further in order to
reach people who might otherwise not see it. Enjoy!

-- 
Mihai Maruseac (MM)
"If you can't solve a problem, then there's an easier problem you can
solve: find it." -- George Polya


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

Subject: Digest Footer

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


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

End of Beginners Digest, Vol 102, Issue 15
******************************************

Reply via email to