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:  Using stack inside a function without declaring it as
      input (Krzysztof Skrz?tnicki)
   2. Re:  Using stack inside a function without declaring it as
      input (Emanuel Koczwara)


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

Message: 1
Date: Mon, 11 Mar 2013 11:15:32 +0100
From: Krzysztof Skrz?tnicki <gte...@gmail.com>
Subject: Re: [Haskell-beginners] Using stack inside a function without
        declaring it as input
To: doaltan <doal...@yahoo.co.uk>,      The Haskell-Beginners Mailing List
        - Discussion of primarily       beginner-level topics related to Haskell
        <beginners@haskell.org>
Message-ID:
        <cam7aevhagkboornwmsu-ghym5sjixxg3haojtdjnya_x72t...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

There are some things clearly missing in your description. I think you need
to read your problem more carefully and perhaps consult some accompanying
materials too.

Other than that I see no way one can sensibly answer your question without
more information.

Best regards,
Krzysztof Skrz?tnicki


On Mon, Mar 11, 2013 at 10:36 AM, doaltan <doal...@yahoo.co.uk> wrote:

> Hi I have a function like this :
> myfunc :: [Char] -> [Char]
> It  is supposed to work pretty much like this :
>
>    1. Take a string
>    2. Put some elements of this input string to output string and put
>    others to stack.
>    3. Pop elements to that output string too.
>    4. Do 2 and 3 recursively until stack is empty.
>    5. Print the output string when stack is empty.
>
>
> I couldn't figure out where to define stack and output string. Can you
> help me with that? I'm new to Haskell so I can't think in Haskell's logic
> very well.
>
> _______________________________________________
> 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/20130311/b504dd28/attachment-0001.htm>

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

Message: 2
Date: Mon, 11 Mar 2013 11:29:27 +0100
From: Emanuel Koczwara <poc...@emanuelkoczwara.pl>
Subject: Re: [Haskell-beginners] Using stack inside a function without
        declaring it as input
To: doaltan <doal...@yahoo.co.uk>, The Haskell-Beginners Mailing List
        -       Discussion of primarily beginner-level topics related to Haskell
        <beginners@haskell.org>
Message-ID:
        <1362997767.13571.11.camel@emanuel-Dell-System-Vostro-3750>
Content-Type: text/plain; charset="UTF-8"

Hi,

Dnia 2013-03-11, pon o godzinie 09:36 +0000, doaltan pisze:
> Hi I have a function like this : 
> myfunc :: [Char] -> [Char] 
> It  is supposed to work pretty much like this : 
>      1. Take a string
>      2. Put some elements of this input string to output string and
>         put others to stack.
>      3. Pop elements to that output string too.
>      4. Do 2 and 3 recursively until stack is empty.
>      5. Print the output string when stack is empty.
> 
> I couldn't figure out where to define stack and output string. Can you
> help me with that? I'm new to Haskell so I can't think in Haskell's
> logic very well.
> 

  You can try to define a second function inside myfunc with the stack
as an argument:

myfunc :: String -> String
myfunc str = myfunc' [] str
  where myfunc' stack str = ...

  myfunc' can take the stack as an argument, myfunc can call myfunc'
passing the empty stack.

  You should describe your problem more precisely to get more accurate
answers.

Emanuel





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

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


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

Reply via email to