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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:55:20+00:00 2026-05-27T22:55:20+00:00

Having some idea of what the Comonad typeclass is in Haskell , I’ve heard

  • 0

Having some idea of what the Comonad typeclass is in Haskell, I’ve heard about the Store comonad. But looking at Control.Comonad.Store.Lazy, I don’t really get it. What does it mean? What is it for? I’ve heard that Store = CoState, the dual of the State Monad. What does that mean?

  • 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-27T22:55:20+00:00Added an answer on May 27, 2026 at 10:55 pm

    It’s much easier if you look at the definition of StoreT itself.

    You can think of it as a “place” in a larger structure. For instance, a lens is just a -> Store b a; you get the value of the b field, and a function b -> a to put a new value back into the larger context.

    Considering it in its simplified, non-transformer form:

    data Store s a = Store (s -> a) s
    
    instance Functor (Store s) where
      fmap f (Store g s) = Store (f . g) s
    
    instance Extend (Store s) where
      duplicate (Store f s) = Store (Store f) s
    
    instance Comonad (Store s) where
      extract (Store f s) = f s
    

    i.e. duplicate changes the s -> a into an s -> Store s a that just returns the “updated” place after replacing the value, and extract restores the original a by placing the value back into the larger structure.

    As far as its relation to State goes, you could look at it like this:

    type State s a = s -> (a, s)
    type Store s a = (s -> a, s)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble with the idea of accessing variables from other classes. I
I have this idea of having some kind of badges in my app. They
I'm having some difficulties with this problem. The main idea is, I initialized a
I am having some problems with memcached and one idea I am having is
I'm having some images from which the user should choose one. Now I don't
I'm having some trouble getting the scala plugin to work with IntelliJ IDEA 10.5.1
I'm having some trouble with ASP.NET MVC Beta, and the idea of making routes,
I'm having some problems with some python scripting I've been doing. The idea of
I'm new to java and having some problems. The main idea is to connect
Having some issues getting my head around the differences between UTF-8, UTF-16, ASCII 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.