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

  • Home
  • SEARCH
  • 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 8873375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:26:57+00:00 2026-06-14T18:26:57+00:00

I have a small question about value in context. Take Just ‘a’ , so

  • 0

I have a small question about value in context.

  • Take Just 'a', so the value in context of type Maybe in this case is 'a'

  • Take [3], so value in context of type [a] in this case is 3

  • And if you apply the monad for [3] like this: [3] >>= \x -> [x+3], it means you assign x with value 3. It’s ok.

But now, take [3,2], so what is the value in the context of type [a]?. And it’s so strange that if you apply monad for it like this:

[3,4] >>= \x -> x+3  

It got the correct answer [6,7], but actually we don’t understand what is x in this case. You can answer, ah x is 3 and then 4, and x feeds the function 2 times and concat as Monad does: concat (map f xs) like this:

[3,4] >>= concat (map f x) 

So in this case, [3,4] will be assigned to the x. It means wrong, because [3,4] is not a value. Monad is wrong.

  • 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-14T18:26:59+00:00Added an answer on June 14, 2026 at 6:26 pm

    I think your problem is focusing too much on the values. A monad is a type constructor, and as such not concerned with how many and what kinds of values there are, but only the context.

    A Maybe a can be an a, or nothing. Easy, and you correctly observed that.

    An Either String a is either some a, or alternatively some information in form of a String (e.g. why the calculation of a failed).

    Finally, [a] is an unknown number of as (or none at all), that may have resulted from an ambiguous computation, or one giving multiple results (like a quadratic equation).


    Now, for the interpretation of (>>=), it is helpful to know that the essential property of a monad (how it is defined by category theorists) is

    join :: m (m a) -> m a.
    

    Together with fmap, (>>=) can be written in terms of join.

    What join means is the following: A context, put in the same context again, still has the same resulting behavior (for this monad).

    This is quite obvious for Maybe (Maybe a): Something can essentially be Just (Just x), or Nothing, or Just Nothing, which provides the same information as Nothing. So, instead of using Maybe (Maybe a), you could just have Maybe a and you wouldn’t lose any information. That’s what join does: it converts to the “easier” context.

    [[a]] is somehow more difficult, but not much. You essentially have multiple/ambiguous results out of multiple/ambiguous results. A good example are the roots of a fourth-degree polynomial, found by solving a quadratic equation. You first get two solutions, and out of each you can find two others, resulting in four roots.

    But the point is, it doesn’t matter if you speak of an ambiguous ambiguous result, or just an ambiguous result. You could just always use the context “ambiguous”, and transform multiple levels with join.

    And here comes what (>>=) does for lists: it applies ambiguous functions to ambiguous values:

    squareRoots :: Complex -> [Complex] 
    
    fourthRoots num = squareRoots num >>= squareRoots
    

    can be rewritten as

    fourthRoots num = join $ squareRoots `fmap` (squareRoots num)
    -- [1,-1,i,-i]    <-  [[1,-1],[i,-i]]  <-       [1,-1] <- 1
    

    since all you have to do is to find all possible results for each possible value.

    This is why join is concat for lists, and in fact

    m >>= f == join (fmap f) m
    

    must hold in any monad.

    A similar interpretation can be given to IO. A computation with side-effects, which can also have side-effects (IO (IO a)), is in essence just something with side-effects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have small question about pdp-11(simulator), I have this command (it begins from the
I just have a small beginners question, and it's about the code below. I
I have a small question about the Core Bluetooth framework. I know Core Bluetooth
I have a question about a small problem I am having in Magento. When
I'm using BerkeleyDB to develop a small app. And I have a question about
Just a small question regarding joins. I have a table with around 30 fields
I have a question about strange return sizes when calling GetUserNameEx(). Maybe someone has
This is a generalization of my previous question about pluralize filter: Does lift have
I have a small question about a problem I encountered writing my first python
I have a small question about using jquery. I have the following code: <html>

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.