POV-Ray : Newsgroups : povray.off-topic : I found this interesting : Re: [Caution: long monad ramble] Server Time
1 Oct 2024 15:19:29 EDT (-0400)
  Re: [Caution: long monad ramble]  
From: Darren New
Date: 13 Apr 2008 22:23:46
Message: <4802c032$1@news.povray.org>
Darren New wrote:
> I think the "until" is what I was after, but the Erlang syntax for 
> curried functions is just klunky enough to still make it annoying. 

Ah. Examining unfoldr, I see I was making it too complicated. I was 
trying to figure out how to make "while" (or "until") take two lambdas, 
one for the condition, one for the "body" of the loop. Much easier to 
just have the one function return whether to keep iterating.

Now I can easily say things like "keep prompting and reading a line 
until the user actually types an integer."

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.