POV-Ray : Newsgroups : povray.off-topic : Monads in C# : Re: Monads in C# Server Time
29 Jul 2024 02:31:46 EDT (-0400)
  Re: Monads in C#  
From: Orchid Win7 v1
Date: 1 Apr 2013 17:04:24
Message: <5159f658$1@news.povray.org>
On 01/04/2013 04:12 PM, Warp wrote:
> Orchid Win7 v1<voi### [at] devnull>  wrote:
>> Really, a monad is
>> simply a specific way of chaining operations together; nothing more
>> complicated than that.
>
> And this is somehow different from just a regular function somehow?

Well, yeah, that's the crux of the matter.

In a pure language like Haskell, a *function* takes several inputs and 
produces an output, and that's all it's allowed to do. If you want to do 
something more complicated, you represent it as a monad.

Now, if you're working in an OO language, then you automatically have 
access to facilities like I/O, global variables, exception handling and 
so on. So you don't need a monad to represent these things.

But now suppose that you want some facility that the OO framework 
doesn't natively support. Whether it's non-deterministic computation or 
backtracking or partial failure or atomic transactions or whatever... A 
monad is one possible way of dealing with these things.


Post a reply to this message

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