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 8287897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:09:56+00:00 2026-06-08T12:09:56+00:00

Problem I am just going through the You Could Have Invented Monads! tutorial, and

  • 0

Problem

I am just going through the You Could Have Invented Monads! tutorial, and in the section entitled A Container: Multivalued Functions, where the function types (of complex square and cube roots) are:

Complex Float -> [Complex Float]

Bind is defined as:

bind :: (Complex Double -> [Complex Double]) -> ([Complex Double] -> [Complex Double])
bind f x = concat (map f x)
--shortcut:
f * g = bind f . g 

and unit and lift are:

unit x = [x]    
lift f = unit . f

Now I am confused, is the f in lift function the same as the f in the bind function?
In other words what are the type of the unit and lift functions?

Paradox

Also, by my reasoning I come to a strange paradox: If lift can take functions such as:

realRoot :: Double -> Double
realRoot x =  sqrt(x)

and lift it into our monad so that it becomes of type:

lift realRoot :: [Complex Double]

wouldn’t I be able to do stuff like:

(lift realRoot * imaginaryRoot) -1

where

imaginaryRoot :: [Complex Double]

But how can I take real root of complex numbers?

Any help appreciated!

  • 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-08T12:09:57+00:00Added an answer on June 8, 2026 at 12:09 pm

    Now I am confused, is the f in lift function the same as the f in the bind function? In other words what are the type of the unit and lift functions?

    No, it’s not the same. lift‘s argument is a function Complex Double -> Complex Double, so

    unit :: Complex Double -> [Complex Double]
    lift :: (Complex Double -> Complex Double) -> (Complex Double -> [Complex Double])
    

    and thus your realRoot is not an acceptable argument for lift.

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

Sidebar

Related Questions

Firstly, this is going to sound like homework, but it ain't. Just a problem
i have a problem just as title, and the http-status is 302 Moved Temporarily.
I have the problem I just installed the new Monodevelop 2.2.2 on Windows but
I am having a problem that just started happening in OS 3.1. I have
I have tried troubleshooting this problem and just ended up with nothing, I hope
I have been working through the tutorial by Alex Young on using flash messages
The problem is that I have n command-line arguments. There are always going to
I’m just really learning Java, going through tutorials in book Java how to Program
Ok, so I'm quite new to jQuery, but found this bizzare problem just now,
Edit: I fixed the problem by just starting from scratch. Sorry to waste y'alls

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.