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:  process with mutable state in haskell (Chadda? Fouch?)
   2. Re:  Cartesian Product in Standard Haskell        Libraries
      (Chadda? Fouch?)


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

Message: 1
Date: Mon, 24 Dec 2012 09:31:53 +0100
From: Chadda? Fouch? <[email protected]>
Subject: Re: [Haskell-beginners] process with mutable state in haskell
To: Alexander _ <[email protected]>
Cc: beginners <[email protected]>
Message-ID:
        <CANfjZRa70v-a3XROBGk9fu7gvz0t+cN2UM=ssdh_rrrveqh...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

There is also Cloud Haskell : http://www.haskell.org/haskellwiki/Cloud_Haskell
Cloud Haskell is closer to an Erlang-like on Haskell, though it's
still cutting edge and so not so very stable, it at least is backed by
some very serious name in the Haskell universe so we can hope for good
things.

--
Jeda?

On Sun, Dec 23, 2012 at 5:52 PM, Alexander _
<[email protected]> wrote:
> Hello,
>
> Can i run process with some mutable state and communicate with it in
> haskell? Something like gen_server in erlang.
>
> Thank you.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>



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

Message: 2
Date: Mon, 24 Dec 2012 10:42:16 +0100
From: Chadda? Fouch? <[email protected]>
Subject: Re: [Haskell-beginners] Cartesian Product in Standard Haskell
        Libraries
To: Jay Sulzberger <[email protected]>
Cc: beginners <[email protected]>
Message-ID:
        <CANfjZRZzCm=Zwas7OQUwDeY+LWtf0srmSv0550d2Y3b=bpo...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Mon, Dec 24, 2012 at 8:01 AM, Jay Sulzberger <[email protected]> wrote:
>
>   > sequence []
>   []
>   it :: [()]
>
> This looks to me to be a violation of the rule that the Cartesian
> product of an empty list of lists is a list with one element in
> it.  It looks to be a violation because "[]" looks like a name
> for an empty list.  But we also have
>
>   > length (sequence [])
>   1
>   it :: Int
>
> which almost reassures me.
>

Well the type of the first response is a dead give-away : the result
is of type [()] but for a cartesian n-product, you would like [[a]]
(with a maybe instantiated to a concrete type) ...
What's happening here is that sequence is not "the cartesian
n-product" in general, it is only that in the list monad but in
"sequence []" there's nothing to indicate that we're in the list
monad, so GHC default to the IO monad and unit () so sequence has the
type "[IO ()] -> IO [()]" and there's no IO action in the list
parameter, so there's nothing in the result list.

Try :
> sequence [] :: [[Int]]
and you should be reassured.

--
Jeda?



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

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


End of Beginners Digest, Vol 54, Issue 38
*****************************************

Reply via email to