POV-Ray : Newsgroups : povray.off-topic : An explanation of what next_permutation does : Re: An explanation of what next_permutation does Server Time
4 Sep 2024 17:20:03 EDT (-0400)
  Re: An explanation of what next_permutation does  
From: Darren New
Date: 4 Dec 2009 11:51:32
Message: <4b193e14$1@news.povray.org>
scott wrote:
>>     ([] , _  ) -> Nothing
> 
> Yeh, it's really clear what this line does to a non-Haskeller :-)

It's pretty standard notation for functional languages. Erlang uses the same 
notation. If you get a two-element tuple with the first element being an 
empty list, the result is an arbitrary atomic value (not unlike an "enum") 
called "Nothing".

It's no less clear than function calls or array indexes if you've ever used 
that operation before in a programming language. It's about as complex as a 
case statement.

-- 
Darren New, San Diego CA, USA (PST)
   Human nature dictates that toothpaste tubes spend
   much longer being almost empty than almost full.


Post a reply to this message

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