[GHC] #14157: Flipping (give :: a -> (Given a => r) -> r) has type (r -> a -> r)

GHC ghc-devs at haskell.org
Sat Aug 26 15:11:30 UTC 2017


#14157: Flipping (give :: a -> (Given a => r) -> r) has type (r -> a -> r)
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 [https://hackage.haskell.org/package/reflection-2.1.2/docs/Data-
 Reflection.html#v:give give] from the ''reflection'' library has the
 following type

 {{{#!hs
 give :: forall a r. a -> (Given a => r) -> r
 }}}

 but `flip give :: r -> a -> r`!

 This works with our own `Given`, `give`

 {{{
 $ ghci -ignore-dot-ghci -XRankNTypes
 GHCi, version 8.3.20170605: http://www.haskell.org/ghc/  :? for help
 Prelude> class Given a
 Prelude> give :: a -> (Given a => r) -> r; give = undefined
 Prelude> :t flip give
 flip give :: c -> a -> c
 Prelude>
 }}}

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


More information about the ghc-tickets mailing list