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.  how to know if a value has already been  evaluated? (Ut Primum)
   2.  Re: how to know if a value has already been      evaluated?
      (GUO Xing)


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

Message: 1
Date: Sun, 18 Mar 2018 14:37:31 +0100
From: Ut Primum <utpri...@gmail.com>
To: beginners@haskell.org
Subject: [Haskell-beginners] how to know if a value has already been
        evaluated?
Message-ID:
        <CANjDmKJbXnffCkgj6p4sHssf39yCo=9v5_ibwksjt9udaoe...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

In Haskell, the value of a variable is not always evaluated.
This is fundamental when working with infinite lists.
Is there a way of determining whether, at a certain point of the execution
of a program, a value has been calculated or not?

In particular, I would like to write a function that works on an infinite
list that:
- if the first value of a list, x, has already been evaluated, returns [x]
- Else waits until it is evaluated, but without forcing its evaluation.
(eventually, its evaluation will be forced later by other functions). Until
then, the result of this function must be considered as [ ]. As soon as x
is computed, it can return [x].

Is something like this possible in Haskell?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20180318/df35151a/attachment-0001.html>

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

Message: 2
Date: Sun, 18 Mar 2018 13:53:51 +0000
From: GUO Xing <higuox...@outlook.com>
To: Ut Primum <utpri...@gmail.com>, "beginners@haskell.org"
        <beginners@haskell.org>
Subject: [Haskell-beginners] Re: how to know if a value has already
        been    evaluated?
Message-ID:
        
<hkxpr06mb06149dcb895933cb6c650b40b8...@hkxpr06mb0614.apcprd06.prod.outlook.com>
        
Content-Type: text/plain; charset="utf-8"

Sounds like an *await* expression ...

I am curious about it too!

Regards
Xing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20180318/d4cbf710/attachment-0001.html>

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

Subject: Digest Footer

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


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

End of Beginners Digest, Vol 117, Issue 10
******************************************

Reply via email to