[GHC] #9966: Allow switching to different monads in GHCi

#9966: Allow switching to different monads in GHCi -------------------------------------+------------------------------------- Reporter: gridaphobe | Owner: Type: feature | Status: new request | Milestone: Priority: low | Version: 7.11 Component: GHCi | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- GHCi can evaluate individual `IO` actions, e.g. {{{ ghci> writeFile "foo.txt" "bar" ghci> readFile "foo.txt" bar }}} but, as far as I know, this doesn't extend to other monads. Instead you have to compose an entire computation and then run it with the standard eliminators, e.g. {{{ ghci> evalState 0 (put 1 >> get) 1 }}} It would be quite nice if we could tell GHCi to temporarily jump into a different top-level monad, e.g. {{{ -- we start in IO as usual ghci> :monad runState 0 -- now we're in `State Int` with the initial state set to 0 ghci> put 1 -- we can evaluate individual State actions without the ceremony of `runState`, -- and having to track the updated state ourselves between actions ghci> get 1 ghci> :monad IO -- now we're back in IO }}} I'm not sure how feasible this is (it seems tricky), but it would provide a very nice UX for GHCi in the context of larger Haskell applications. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9966 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9966: Allow switching to different monads in GHCi -------------------------------------+------------------------------------- Reporter: gridaphobe | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by carter): that might be a good Userland patch in https://github.com/chrisdone/ghci- ng or https://hackage.haskell.org/package/ghci-ng -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9966#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9966: Allow switching to different monads in GHCi -------------------------------------+------------------------------------- Reporter: gridaphobe | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by monoidal): Duplicate of #4316? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9966#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9966: Allow switching to different monads in GHCi -------------------------------------+------------------------------------- Reporter: gridaphobe | Owner: Type: feature request | Status: closed Priority: low | Milestone: Component: GHCi | Version: 7.11 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: #4316 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by gridaphobe): * status: new => closed * resolution: => duplicate * related: => #4316 Comment: good points both, i'll close this as a duplicate. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9966#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC