Where should I put a `condp` like function?

Idan Arye GenericNPC at gmail.com
Fri Apr 19 12:02:49 PDT 2013


On Thursday, 18 April 2013 at 17:12:51 UTC, Timon Gehr wrote:
> On 04/18/2013 04:18 PM, Idan Arye wrote:
>> On Thursday, 18 April 2013 at 13:04:19 UTC, Graham Fawcett 
>> wrote:
>>> On Sunday, 14 April 2013 at 23:52:37 UTC, Idan Arye wrote:
>>>>
>>>> Now, I've got it working(the example actually compiles and 
>>>> prints
>>>> "less then 5"), and I want to make a pull request to put it 
>>>> in
>>>> Phobos(because it's a useful function) but I don't really 
>>>> know where
>>>> to put it. None of the existing modules seems fit, and I 
>>>> don't want
>>>> to open a new module(std.monad?) for a single function.
>>>
>>> Nit-picky observation: there's nothing monadic about your 
>>> predSwitch
>>> function, it wouldn't belong in a 'std.monad' module.
>>>
>>> Best,
>>> Graham
>>
>> A monad is "a structure that represents computations"(quote 
>> from
>> Wikipedia).  ...
>
> Read on.

OK, so it's not a formal monad, but it has the same idea of - "an 
action that chooses the next action based on the results of 
previous actions" - for the same purpose - "insert additional 
operations around a program's domain logic".


More information about the Digitalmars-d mailing list