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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:20:22+00:00 2026-06-06T13:20:22+00:00

I’m trying to understand code from http://www.yesodweb.com/book/conduits . After some fixes (like replacing Resource

  • 0

I’m trying to understand code from http://www.yesodweb.com/book/conduits. After some fixes (like replacing Resource with MonadResource) it still won’t compile:

sumSink :: MonadResource m => Sink Int m Int
sumSink = CL.fold (+) 0

sum' :: [Int] -> Int
sum' input = runST $ runResourceT $ CL.sourceList input $$ sumSink

gives me the following error:

    Couldn't match type `GHC.ST.ST s' with `IO'
    When using functional dependencies to combine
      Control.Monad.Trans.Control.MonadBaseControl
        (GHC.ST.ST s) (GHC.ST.ST s),
        arising from the dependency `m -> b'
        in the instance declaration in `Control.Monad.Trans.Control'
      Control.Monad.Trans.Control.MonadBaseControl IO (GHC.ST.ST s),
        arising from a use of `runResourceT'
        at D:\Works\stablename\test.hs:43:22-33
    In the expression: runResourceT
    In the second argument of `($)', namely
      `runResourceT $ CL.sourceList input $$ sumSink'

I’m using GHC 7.4.1 and conduit-0.4.2.

P.S. Is there any tutorial which isn’t broken / was written with conduit-0.4 in mind?

  • 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-06T13:20:23+00:00Added an answer on June 6, 2026 at 1:20 pm

    Answering my own question:

    • Monad m should be used instead of Resource m.
    • runResourceT needs to be applied if a function like sinkFile was used somewhere in the chain, because sinkFile requires MonadResource m and there is no instance for MonadResource IO.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand some example code on this web page: ( http://www.csharp-station.com/HowTo/HttpWebFetch.aspx
I am trying to compile the code from here: http://www.brackeen.com/javagamebook/#download (Chapter 6) and am
Code example from http://www.learncpp.com/cpp-tutorial/812-static-member-functions/ : class Something { private: static int s_nValue; }; int
I am trying to output audio samples, and do so with cswavplay from http://www.codeproject.com/KB/audio-video/cswavplay.aspx
I am trying to learn cocos2d for iphone, following the following book http://www.apress.com/9781430233039 .
I am trying to understand this inline assembly code which comes from _hypercall0 here
I am now trying to understand some code and I have found a pattern,
This is true for IE 7, 8, and 9. The page http://www.topics2look.com/code-examples/firebug-lite-race-condition/using-remote-firebug-lite-js-file.html loads Firebug
I'm trying to make a http request. The code looks like this: NSString *urlString
I'm trying to understand code that I bought so I can modify it. In

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.