Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Why is cabal trying to install a particular      dependency? (Peter)
   2. Re:  Why is cabal trying to install a     particular      dependency?
      (Ben Gamari)
   3. Re:  Why is cabal trying to install a     particular      dependency?
      (Peter)
   4. Re:  Haskeline and forkIO (Peter Jones)
   5. Re:  Why is cabal trying to install       a       particular      
dependency?
      (Gesh)


----------------------------------------------------------------------

Message: 1
Date: Thu, 28 Aug 2014 12:18:53 +0000 (UTC)
From: Peter <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Why is cabal trying to install a
        particular      dependency?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Sometimes I want to know why installing package X will require package Y.
After a lot of recursive manual inspection of .cabal files and --dry-run, I
discover that X depends on A, which depends on B, which depends on C, which
requires Y unless some flag is specified.

Is there a way to ask cabal to tell me this?



------------------------------

Message: 2
Date: Thu, 28 Aug 2014 08:38:47 -0400
From: Ben Gamari <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Why is cabal trying to install a
        particular      dependency?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

On August 28, 2014 8:18:53 AM EDT, Peter <[email protected]> wrote:
>Sometimes I want to know why installing package X will require package
>Y.
>After a lot of recursive manual inspection of .cabal files and
>--dry-run, I
>discover that X depends on A, which depends on B, which depends on C,
>which
>requires Y unless some flag is specified.
>
>Is there a way to ask cabal to tell me this?
>
Passing -v3 to cabal will cause it to emit all manner of useful (and less than 
useful) information. It's particularly handy when trying to identify which 
package is holding back a dependency.

Unfortunately it can be a bit tricky to quickly parse but grep can help here.

Cheers,

- Ben





------------------------------

Message: 3
Date: Thu, 28 Aug 2014 13:40:43 +0000 (UTC)
From: Peter <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Why is cabal trying to install a
        particular      dependency?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Ben Gamari <ben <at> smart-cactus.org> writes:

> Passing -v3 to cabal will cause it to emit all manner of useful (and less
than useful) information. It's
> particularly handy when trying to identify which package is holding back a
dependency.
> 
> Unfortunately it can be a bit tricky to quickly parse but grep can help here.

Not ideal, but a definite improvement on what I was doing before!





------------------------------

Message: 4
Date: Thu, 28 Aug 2014 08:11:15 -0600
From: Peter Jones <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Haskeline and forkIO
Message-ID: <[email protected]>
Content-Type: text/plain

"Jeff C. Britton" <[email protected]> writes:
> loop :: InputT IO ()
> loop = do
>     maybeLine <- getInputLine "Enter a file to compress> "
>     case maybeLine of
>       Nothing -> return ()      -- user entered EOF
>       Just "" -> return ()      -- treat no name as "want to quit" 
>       Just path -> do
>             return (runWorker path)
>             loop

The other issue you're having is because `runWorker path` is an `IO ()`
value but at the point where you use it in the code the type system
wants an `InputT IO ()`.  To try to satisfy the type system you used
`return` to build a `InputT IO (IO ())` value, but that doesn't actually
work (as you've noticed).  Since `InputT` is a transformer you have an
extra layer to work through and so need to *lift* your `IO ()` value
into the `InputT IO` layer.  Try this:

    -- Add this import
    import Control.Monad.IO.Class
    
    loop :: InputT IO ()
    loop = do
        maybeLine <- getInputLine "Enter a file to compress> "
        case maybeLine of
          Nothing -> return ()      -- user entered EOF
          Just "" -> return ()      -- treat no name as "want to quit" 
          Just path -> do
                liftIO (runWorker path)
                loop
    

You can think of `liftIO` as having this signature (in this context):

    liftIO :: IO () -> InputT IO ()
    
-- 
Peter Jones, Founder, Devalot.com
Defending the honor of good code



------------------------------

Message: 5
Date: Thu, 28 Aug 2014 17:57:05 +0300
From: Gesh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Why is cabal trying to install a
        particular      dependency?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

Wouldn't it make sense for cabal to provide a
list-dependencies command, which can query those
dependencies recursively?
Gesh


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 74, Issue 28
*****************************************

Reply via email to