[GHC] #10963: Beginner-targeted language extension

GHC ghc-devs at haskell.org
Mon Apr 25 14:52:05 UTC 2016


#10963: Beginner-targeted language extension
-------------------------------------+-------------------------------------
        Reporter:  kanetw            |                Owner:
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2136
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by kanetw):

 Replying to [comment:7 takenobu]:
 > Hi,
 >
 > Is Alexander Kjeldaas's representation idea useful? [1]
 >
 > [1] https://mail.haskell.org/pipermail/ghc-
 devs/2016-February/011398.html
 >
 >
 > {{{
 > Prelude> :t foldr
 > foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
 > For example:
 > foldr :: (a -> b -> b) -> b -> [a] -> b
 > foldr :: (a -> b -> b) -> b -> Maybe a -> b
 > foldr :: (a -> b -> b) -> b -> Identity a -> b
 > foldr :: (a -> b -> b) -> b -> (c, a) -> b
 > and more
 > }}}

 I like this, but this is also kinda difficult. When I was planning on
 implementing this I ran into the problem that we have a very rapidly
 growing number of example specializations, and it's hard to decide which
 ones should be shown and which ones shouldn't. See also some of the
 discussion [https://ghc.haskell.org/trac/ghc/ticket/10972 here] and
 [https://mail.haskell.org/pipermail/haskell-cafe/2015-October/121835.html
 here].

 I'm not sure whether I'd prefer this to be under :t, :i, or separate.
 :t right now is nicely copy-pastable and adding more info would impact
 that.
 :i can't evaluate expressions so it'd have to be overloaded.
 Having it separate makes it less obvious for beginners who might be using
 old course material that doesn't know of :<fancy new command>.

 I think having it in :t would be the least worst option assuming people
 who write stuff that uses GHCi programatically agree.

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


More information about the ghc-tickets mailing list