[GHC] #12410: Somehow detect splicing in ghci

GHC ghc-devs at haskell.org
Wed Jul 20 00:41:47 UTC 2016


#12410: Somehow detect splicing in ghci
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 Replying to [comment:3 goldfire]:
 > But perhaps GHCi can detect what you mean by the types and Do The Right
 Thing. Just like it already does to detect when you want an `IO` action.

 Yes I had something like that in mind, detect if the type is `DecsQ`

 ----

 Side note:

 {{{#!hs
 -- WORKS

 >>> pure @Q @[Dec] []; $(reify ''() >>= runIO.print >> return [])
 TyConI (DataD [] GHC.Tuple.() [] Nothing [NormalC GHC.Tuple.() []] [])
 }}}

 {{{#!hs
 -- WORKS

 >>> (pure [] :: DecsQ); $(reify ''() >>= runIO.print >> return [])
 TyConI (DataD [] GHC.Tuple.() [] Nothing [NormalC GHC.Tuple.() []] [])
 }}}

 {{{#!hs
 -- DOESN'T

 >>> pure [] :: DecsQ; $(reify ''() >>= runIO.print >> return [])

 <interactive>:374:1: error:
     Invalid type signature: pure [] :: ...
     Should be of form <variable> :: <type>
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12410#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list