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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:29:17+00:00 2026-05-26T16:29:17+00:00

Looking at the docs for Control.Applicative , I notice that they have instance declarations

  • 0

Looking at the docs for Control.Applicative, I notice that they have instance declarations for certain monads (e.g. IO, Maybe and notably ST), but there are no instances for MTL monads such as State and RWS. Instead it looks like there’s a general-purpose WrappedMonad type defined, which I’m guessing is to cover all other cases.

So here are my questions:

  1. Why aren’t there Applicative instances for MTL monads? The best answer I’ve been able to find on my own so far is a three year old post, where somebody implemented these instances and was summarily ignored.

  2. What’s the deal with WrappedMonad? I found a post on Reddit that explains it briefly, but I think I’m confused about how to use it.

Ultimately I’d like to be able to use State in an applicative style (as was recommended to me), but if I have to litter my code with WrappedMonad data constructors then it doesn’t seem like a win. I could also ignore WrappedMonad entirely, and define the Applicative instance myself the same way that was done for IO, ST and so on: in terms of return and ap… But that seems goofy as well.

  • 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-05-26T16:29:18+00:00Added an answer on May 26, 2026 at 4:29 pm

    That documentation is generated based solely on the contents of the base package, which does not contain State – so it does not contain Applicative instances for it. If you look in the MTL documentation, you’ll see an Applicative instance listed.

    Alternately, you can open up GHCi, import Control.Monad.State and Control.Applicative, and use :i Applicative to list the instances of Applicative or :i StateT to list the classes for which StateT has instances (State is a type alias for StateT with one of its parameters fixed). Either will show that there is indeed such an instance.

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

Sidebar

Related Questions

I was looking at the docs for NSTableViewDataSource and they say that this protocol
I'm looking through the docs for the jQuery UI Datepicker ( http://jqueryui.com/demos/datepicker/ ), but
In looking at the docs for Play Scala Anorm, they show specifying a alternate
I've been looking over the docs at developer.mozilla.org and the Apple dev docs but
I have an interesting problem and I was looking for a solution; Hoping that
Frequently, I've dug into apropos and docs looking for something like the following only
I was looking through the docs and stumbled onto mysql_real_escape_string() and I'm not understanding
I'm looking at the MySQL docs and trying to sort out the distinction between
I'm looking at the PayPal IPN docs , and it says the datetime stamps
I've been looking at examples of REST API's like Netflix http://developer.netflix.com/docs/REST_API_Reference#0_59705 and Twitter and

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.