Send Beginners mailing list submissions to
[email protected]
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
[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. Designing TimeOut for Search Algorithm (Leonhard Applis)
----------------------------------------------------------------------
Message: 1
Date: Mon, 07 Jun 2021 05:32:07 +0000
From: Leonhard Applis <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [Haskell-beginners] Designing TimeOut for Search Algorithm
Message-ID:
<uQuqjaYiJAswawx08P326_RHrscnV7dsukV2yf_m9Eu4tuvQYtPVWt3wWp7FU-0HJdA-bR5KP84nOGpG26gyg_e5xcm8Qhp8yy1qo0fZQbQ=@protonmail.com>
Content-Type: text/plain; charset="utf-8"
Good Morning,
I currently want to write a search algorithm with 3 end conditions:
a) Solution Found
b) N-iterations done
c) x minutes timeout
I would like to split the function in two pieces, one which is pure with a seed
and no timeout, and one time-outed in a monad (IO?).
So
pureSearch :: Seed -> Iterations -> Maybe Result
and
search :: Timeout -> Seed -> Iterations -> IO Maybe Result
Is this a known Pattern?
Do you know good examples for this behavior?
Any other recommendations before I start implementing?
Best
Leonhard
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20210607/4516ca68/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 509 bytes
Desc: OpenPGP digital signature
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20210607/4516ca68/attachment-0001.sig>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 155, Issue 5
*****************************************