#1721: Make GHCi print the entire result of an interactive 'bind' statement
------------------------------+---------------------------------------------
Reporter: simonpj | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.6.1
Severity: normal | Keywords:
Difficulty: Unknown | Os: Unknown
Testcase: | Architecture: Unknown
------------------------------+---------------------------------------------
Suppose
{{{
foo :: Int -> IO (Maybe Int, Bool)
}}}
Then here's a GHCi interaction:
{{{
Prelude> foo 3
(Just 3,True) -- Entire result printed
Prelude> (Just x, _) <- foo 3
3 -- Value of x printed
Prelude> (Just x, y) <- foo 3
-- Nothing at all printed
Prelude> (_, _) <- foo 3
-- Nothing at all printed
Prelude>
}}}
GHCi prints the result of a bind, `p <- e`, if and only if the pattern `p`
binds exactly one variable. This is a bit odd; you get no info if it
binds more than one.
A different and simpler behaviour would be to print the entire result
every time. That is, all the commands above would print `(Just 3, True)`.
I'm recording this ticket so that we remember the suggestion. I don't
know for sure if it's a good one. Add comments if you have an opinion
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1721>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs