[GHC] #11439: Request for comments: Allow duplicate type signatures

GHC ghc-devs at haskell.org
Wed Feb 24 23:02:25 UTC 2016


#11439: Request for comments: Allow duplicate type signatures
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.3
      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:4 adamgundry]:
 > I'm not really convinced by the original ticket: couldn't you just as
 well do something like

 Yes you can at the expense of introducing extraneous definitions, your
 solution works fine for the original example but I fear it does not scale.

 > On the other hand, being able to declare a bunch of specializations such
 that GHCi or Haddock can display them does seem rather useful, especially
 for the kind of very polymorphic code you get in `lens` or the post-FTP
 Prelude.

 Yes, I also emphasise parentheses to shift students' thinking from:

 {{{#!hs
 map :: (a -> b) -> [a] -> [b]
 }}}

 to

 {{{#!hs
 map :: (a -> b) -> ([a] -> [b])
 }}}

 You would never create a new function to accomplish this minor task but
 maybe this definition of `fmap` would prove useful to some:
 {{{#!hs
 class Functor f where
 {-# TYPECHECK
   fmap :: (a -> b) -> (f a -> f b) #-}
   fmap :: (a -> b) -> f a -> f b
 }}}

 Who knows.

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


More information about the ghc-tickets mailing list