Send Beginners mailing list submissions to
        beginners@haskell.org

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
        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:  How to solve this using State Monad? (Miguel Negrao)
   2. Re:  How to solve this using State Monad? (Ertugrul S?ylemez)
   3. Re:  How to solve this using State Monad? (Henry Lockyer)
   4.  GHCi won't allow type declaration as shown in    LYAHFGG (Stan Kulp)
   5. Re:  GHCi won't allow type declaration as shown   in LYAHFGG
      (Homero Cardoso de Almeida)
   6. Re:  GHCi won't allow type declaration as shown   in LYAHFGG
      (Brandon Allbery)


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

Message: 1
Date: Thu, 31 May 2012 16:46:26 +0100
From: Miguel Negrao <miguel.negrao-li...@friendlyvirus.org>
Subject: Re: [Haskell-beginners] How to solve this using State Monad?
To: beginners@haskell.org
Message-ID: <9c2c6f14-1233-49cc-a346-b48140a6d...@friendlyvirus.org>
Content-Type: text/plain; charset=windows-1252


A 31/05/2012, ?s 16:25, Michael Alan Dorman escreveu:

> Ertugrul S?ylemez <e...@ertes.de> writes:
>> I almost feel stupid writing these long explanations, just to see them
>> getting ignored ultimately.  The automaton arrow is one of the most
>> useful and most underappreciated concepts for state in Haskell.
> 
> While I'm not sure I have a need for it right now, I definitely haven't
> ignored this exchange---I've read the individual emails, and a link to
> the archive is filed away for future use.
> 
> So it's been very helpful, even if those being helped aren't
> participating per se.

+1

Because of those posts I spent my morning reading about arrows which seems a 
quite interesting concept, although couldn?t yet see what is best for ( I would 
be curious to learn it in order to try out Yampa).  I have to say that the 
resources I found to learn about arrows on the net were a bit disorganized. 
This page is really well done  
http://en.wikibooks.org/wiki/Haskell/Understanding_arrows but then because I 
don?t know much about parsers I couldn?t really progress through the second 
half.

best,
Miguel Negr?o


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

Message: 2
Date: Thu, 31 May 2012 18:18:07 +0200
From: Ertugrul S?ylemez <e...@ertes.de>
Subject: Re: [Haskell-beginners] How to solve this using State Monad?
To: beginners@haskell.org
Message-ID: <20120531181807.37bed...@tritium.streitmacht.eu>
Content-Type: text/plain; charset="utf-8"

Miguel Negrao <miguel.negrao-li...@friendlyvirus.org> wrote:

> Because of those posts I spent my morning reading about arrows which
> seems a quite interesting concept, although couldn?t yet see what is
> best for ( I would be curious to learn it in order to try out Yampa).
> I have to say that the resources I found to learn about arrows on the
> net were a bit disorganized. This page is really well done
> http://en.wikibooks.org/wiki/Haskell/Understanding_arrows but then
> because I don?t know much about parsers I couldn?t really progress
> through the second half.

I have started an arrow tutorial which many people found easy to follow.
It's not finished yet, but since so many people found it useful I'm
sharing that unfinished tutorial:

    <http://ertes.de/new/tutorials/arrows.html>

It answers the most important questions:  What?  Why?  How?  To some
extent it also answers:  When?  But I have to work on that question.
The basics of the automaton arrow are covered, but when I find time I
will extend the tutorial to cover Auto in full.  Finally I also intend
to cover a powerful generalization of Auto:  the wire arrow, which is
the basis of the Netwire AFRP library.


Greets,
Ertugrul

-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120531/709e5178/attachment-0001.pgp>

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

Message: 3
Date: Thu, 31 May 2012 17:23:08 +0100
From: Henry Lockyer <henry.lock...@ntlworld.com>
Subject: Re: [Haskell-beginners] How to solve this using State Monad?
To: beginners@haskell.org
Message-ID: <41b1172f-bfa0-450e-adf9-b74fe4adf...@ntlworld.com>
Content-Type: text/plain; charset=windows-1252

+ I think I already said it, but, in case it was not clear: Me too.
 Even as a participating person I feel helped!  ;-)
I just haven't taken it onboard yet and need that quiet free morning
to read more about it...

+ I think this is clearly identifying the point where the State monad(s) 
can become confusing at first, in my (limited) experience:
                                          "The problem of the state monad is a
very fundamental one.  As soon as your automaton is parametric it
becomes a function:

   dfaWith :: DfaInput -> State DfaState DfaOutput"

But I need more time to assimilate the following
"Functions in Haskell are opaque.  For every composition of automata you
would have to write an individual loop, because you would have to force
the two individual states to be combined somehow.  This gets more
inconvenient as your automaton library grows."

best/Henry
 
On 31 May 2012, at 16:46, Miguel Negrao wrote:

> 
> A 31/05/2012, ?s 16:25, Michael Alan Dorman escreveu:
> 
>> Ertugrul S?ylemez <e...@ertes.de> writes:
>>> I almost feel stupid writing these long explanations, just to see them
>>> getting ignored ultimately.  The automaton arrow is one of the most
>>> useful and most underappreciated concepts for state in Haskell.
>> 
>> While I'm not sure I have a need for it right now, I definitely haven't
>> ignored this exchange---I've read the individual emails, and a link to
>> the archive is filed away for future use.
>> 
>> So it's been very helpful, even if those being helped aren't
>> participating per se.
> 
> +1
> 
> Because of those posts I spent my morning reading about arrows which seems a 
> quite interesting concept, although couldn?t yet see what is best for ( I 
> would be curious to learn it in order to try out Yampa).  I have to say that 
> the resources I found to learn about arrows on the net were a bit 
> disorganized. This page is really well done  
> http://en.wikibooks.org/wiki/Haskell/Understanding_arrows but then because I 
> don?t know much about parsers I couldn?t really progress through the second 
> half.
> 
> best,
> Miguel Negr?o
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners




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

Message: 4
Date: Thu, 31 May 2012 12:48:02 -0700 (PDT)
From: Stan Kulp <stan_k...@yahoo.com>
Subject: [Haskell-beginners] GHCi won't allow type declaration as
        shown in        LYAHFGG
To: "beginners@haskell.org" <beginners@haskell.org>
Message-ID:
        <1338493682.89984.yahoomail...@web111401.mail.gq1.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

I have been working my way through "Learn You a Haskell for Greater Good" and 
am stumped when I get to the "Syntax in Functions - Pattern Matching" section.

The book shows the following expression...

ghci> lucky?::?(Integral?a)?=>?a?->?String??

...but when I try to execute it in GHCi I get the following error...

<interactive>:1:1: Not in scope: `lucky'

What am I missing? 

?
Stan Kulp
4421 W North Pinebrook Lane
Columbia, MO 65203


Home: 573-234-2065
Work: 573-522-5075
Cell: 573-864-6051
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120531/20d1311e/attachment-0001.htm>

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

Message: 5
Date: Thu, 31 May 2012 16:52:22 -0300
From: Homero Cardoso de Almeida <homero...@gmail.com>
Subject: Re: [Haskell-beginners] GHCi won't allow type declaration as
        shown   in LYAHFGG
To: Stan Kulp <stan_k...@yahoo.com>
Cc: "beginners@haskell.org" <beginners@haskell.org>
Message-ID:
        <capv0zwpdkp0a7kymgnkgc3fdw6u5pugkjc1lfvxst7eqjhu...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I don't think GHCi allows function and type definitions in interactive mode.

You have to write the functions in a source file and then load it. You can
then call the functions as usual.

Homero Cardoso de Almeida


On Thu, May 31, 2012 at 4:48 PM, Stan Kulp <stan_k...@yahoo.com> wrote:

> I have been working my way through "Learn You a Haskell for Greater Good"
> and am stumped when I get to the "Syntax in Functions - Pattern Matching"
> section.
>
> The book shows the following expression...
>
> ghci> lucky :: (Integral a) => a -> **String
>
> ...but when I try to execute it in GHCi I get the following error...
>
> <interactive>:1:1: Not in scope: `lucky'
>
> What am I missing?
>
> Stan Kulp
> 4421 W North Pinebrook Lane
> Columbia, MO 65203
>
> Home: 573-234-2065
> Work: 573-522-5075
> Cell: 573-864-6051
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120531/06a748c2/attachment-0001.htm>

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

Message: 6
Date: Thu, 31 May 2012 16:36:10 -0400
From: Brandon Allbery <allber...@gmail.com>
Subject: Re: [Haskell-beginners] GHCi won't allow type declaration as
        shown   in LYAHFGG
To: Stan Kulp <stan_k...@yahoo.com>
Cc: "beginners@haskell.org" <beginners@haskell.org>
Message-ID:
        <CAKFCL4V+YtA7pE-85JsPWY85T5A1p8HE4qPqD=vjnmx6zjj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Thu, May 31, 2012 at 3:48 PM, Stan Kulp <stan_k...@yahoo.com> wrote:

> I have been working my way through "Learn You a Haskell for Greater Good"
> and am stumped when I get to the "Syntax in Functions - Pattern Matching"
> section.
>
> The book shows the following expression...
>
> ghci> lucky :: (Integral a) => a -> **String
>
> ...but when I try to execute it in GHCi I get the following error...
>
> <interactive>:1:1: Not in scope: `lucky'
>
> What am I missing?
>

ghci is intended for interactive evaluation; it doesn't (currently; this
might change in future versions) do declarations the same way you would in
a source file.

You can still do them with do-style let binding:

    Prelude> let lucky :: (Integral a_ => a -> String; lucky = ...

(This all has to fit on a single line unless you use braces and have done
":set +m"; this may also require a recent GHC.)

-- 
brandon s allbery                                      allber...@gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120531/87f669f4/attachment.htm>

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

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 47, Issue 34
*****************************************

Reply via email to