Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7716641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:41:06+00:00 2026-06-01T02:41:06+00:00

There are too many tutorials out there on monads that say… Look! here is

  • 0

There are too many tutorials out there on monads that say… “Look! here is a case where we can use a monad” or “This is what a monad is for”. What I want to know is what are some of the steps that people use to come to the conclusion that they can say to themselves – “Gee Whiz! It looks like we can use a monad here!”

So when someone tells me… “(blah) has nothing to do with a monad…”, it really doesn’t help me answer my questions, which are:

  • How do I go about determining what sort of patterns in programs could be expressed using monads?
  • How can I write my own customised monad when I have identified the potential to use them?

I started a really long question here about monads if anybody is interested to help – Map and Reduce Monad for Clojure… What about a Juxt Monad?.

Back to this Question:

When should we use a monad instead of a macro and vice-versa?

  • I’ve read articles and watched presentations that say… ‘Monads are used for DSL abstraction’ …. but most of the Clojure DSL libraries (eg. hiccup and korma) are using defmacro and it works great.

And why do we need monads in Clojure if we have macros?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:41:07+00:00Added an answer on June 1, 2026 at 2:41 am

    I’ve been using Clojure for two years now and the only time I ever used monads was as an exercise to show that it could be done. I’ve never needed them for “real” code.

    Monads are much more common in Haskell because:

    • They are the idiomatic way of handling stateful computations. In Clojure, you typically handle state with managed references, so monads aren’t needed nearly as much in Clojure.
    • Likewise for IO: Clojure allows you to do IO directly without declaring it in your type, so you don’t need the IO monad.

    My suggestion would be to focus on standard functional programming in Clojure. Unless you see that you really need monads then I wouldn’t invest too much time in trying to bring them in.

    Macros are a slightly different issue: they are for compile-time code generation and extensions to the language syntax (which might include DSLs, although DSLs don’t necessarily need macros). I use macros when both of the following are true:

    1. I want to extend the language syntax in a way that significantly improves my ability to address a particular problem domain.
    2. I can’t get the same functionality with normal functions / function composition. Normal functions should be your first choice if possible: they are usually simpler to write and maintain.

    P.S. If you are genuinely interested in monads for Clojure, here are two videos I personally found quite good:

    • http://vimeo.com/20717301 (Brian Marick’s excellent visual explanation of monads)
    • http://www.infoq.com/presentations/Monads-Made-Easy
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a discussion with some colleagues mentioning that there are not too many
I've found that there are too many issues with SpriteFont , for me to
There're too many databases, how can I query which database has a table named
There are too many method for embedding flash in html, which way is the
There are too many options for creating projects in XCode, But When we select
There is a Debian g++-4.4 package, but it's not Ubuntu. There are too many
There seems to be too many attributes/parameters in CSS... I want to know all
Is there such a thing as too many stored procedures? I know there is
When designing an application, does there come a point where you have too many
I won't post any code, because there is too much that could be relevant.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.