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. Re:  Type for lists with one or more elements (Brent Yorgey)
   2. Re:  Haskell GTK (Stephen Tetley)


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

Message: 1
Date: Mon, 10 Jun 2013 11:01:20 -0400
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] Type for lists with one or more
        elements
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

On Thu, Jun 06, 2013 at 08:41:47PM -0700, Frerich Raabe wrote:
> 
> On Jun 6, 2013, at 5:56 PM, Brent Yorgey <[email protected]> wrote:
> 
> > On Thu, Jun 06, 2013 at 05:27:11PM -0700, Frerich Raabe wrote:
> >> I could do something like
> >> 
> >>  data List a = Singleton a | Cons a (List a)
> >> 
> >> but before I go ahead I wonder: is there an existing Haskell package
> >> for this? Maybe even with prettier names than what I wrote above, and
> >> convenient functions for transforming from/to plain [] lists? It
> >> would probably be straightforward to write it myself, but because of
> >> that, I suspect that somebody else already did it. :-)
> > 
> > Yes, this exists in the semigroups package:
> > 
> >  
> > http://hackage.haskell.org/packages/archive/semigroups/0.9.2/doc/html/Data-List-NonEmpty.html
> 
> Awesome, thanks a lot for pointing this out! semigroups? I don't even
> know what that would be, pretty sure I wouldn't have found this by
> myself. :-}

A semigroup is simply a set with an associative binary operation. So
all monoids are semigroups, but other things are semigroups as well;
for example, 'max' is an associative binary operation on the real
numbers, so this is a semigroup; but max has no identity element
(there is no smallest real number) so it is not a monoid.  Non-empty
lists come up a lot when working with semigroups (technically this is
because non-empty lists with (++) are the "free semigroup", i.e. the
Mother Of All Semigroups) which is why they are in this package.

If you want to learn more about monoids and semigroups and some ways
they can be applied, you might be interested in my paper from last
year's Haskell Symposium, "Monoids: Theme and Variations", which you
can find at

  http://www.cis.upenn.edu/~byorgey/publications.html

along with a link to a video and slides.

-Brent



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

Message: 2
Date: Mon, 10 Jun 2013 17:27:26 +0100
From: Stephen Tetley <[email protected]>
Subject: Re: [Haskell-beginners] Haskell GTK
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CAB2TPRA6gKm7kiAwU=fjkm1pbmspfmo0tynu1jt9uakj+ak...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

There have been some higher level systems that abstract over lower level
bindings (e.g. Fruit / WxFruit, the port of Clean's ObjectIO...), but they
seem to lose traction and suffer from bit-rot.

At the moment I wouldn't know what the best option is.


On 10 June 2013 14:50, Giacomo Tesio <[email protected]> wrote:
...

>
> This is not that complex to achieve in OOP, but I can't see HOW to build
> an even basic framework that give me this.
> Actually, that's probably my fault.
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130610/92b427ef/attachment-0001.htm>

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

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


End of Beginners Digest, Vol 60, Issue 19
*****************************************

Reply via email to