Thank you for your great answer Konrad.
On Jan 3, 9:46 am, googlegro...@khinsen.fastmail.net wrote:
> Dragan R writes:
>
> > On the net I read that "Impure functional programming doesn't really
> > need monads."
> > and "It appears that in the presence of mutable state, a lot of the
> > advant
Thanks to all authors for help.
Best regards,
Dragan Radevic
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
fi
Hi,
Am 04.01.2012 um 10:12 schrieb Thorsten Wilms:
>> (defn handler [{:keys [params] :as req}]
>> (if (person/valid? params)
>> {:status 200 :body (json/generate-string (person/create params))}
>> {:status 400}))
Or you let the create function return nil on invalid params.
(defn handl
On 01/04/2012 03:05 AM, Takahiro Hozumi wrote:
In MVC pattern, Model should take responsibility for business logic.
Therefore I write validate function for creating in the model.
If creating a instance of the model should be safe, I must validate a
parameter in the create function.
My problem is
In MVC pattern, Model should take responsibility for business logic.
Therefore I write validate function for creating in the model.
If creating a instance of the model should be safe, I must validate a
parameter in the create function.
My problem is that a controller have to validate a parameter tw
Some of the most common uses for monads have pre-existing mechanisms
with Clojure to handle them, e.g.:
sequence monad (for)
state monad (Clojure has many stateful mechansisms)
maybe monad (Clojure programmers usually just return nil for failure,
and use something like when-let to process it)
In t
On Jan 3, 2:46 am, googlegro...@khinsen.fastmail.net wrote:
> I probably use monad more than the average programme in my own code,
> but that's also because I happen to be familiar with them. I could
> very well live with fewer monads in my code. But once you know monads,
> they appear magically
We use monads within one of our work project, but not to any large
amount.
It mostly boils down to using the Maybe monad to avoid giant nested if-
lets.
- Lee Hinman
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to
On 3 January 2012 08:46, wrote:
> Dragan R writes:
>
> > On the net I read that "Impure functional programming doesn't really
> > need monads."
> > and "It appears that in the presence of mutable state, a lot of the
> > advantages of monads become moot."
>
> Monads are an abstraction mechanis
Hi,
I used monads in two projects.
* The last rewrite of ClojureQL before v1.0 used a state monad to keep track of
various things during query creation.
* ClojureCheck also uses a monad approach to create and combine generators for
test data.
* Dave Ray and I tried a monad style in the async br
Midje has some of its error handling code implemented with a monad.
https://github.com/marick/Midje/blob/master/src/midje/error_handling/monadic.clj#L32
`error-let` is like a regular let, except if there is a validation-error,
that error short-circuits out.
Alex
--
You received this message bec
On Mon, 2012-01-02 at 05:18 -0800, Dragan R wrote:
> and are monads realy useful in impure functional languages like
> clojure?
Clojure's impurity doesn't mean that we wouldn't like to avoid
side-effecty ways of doing stuff. Monads can help you there, among
other things.
The monad idea captures
12 matches
Mail list logo