[Haskell-cafe] Fw: Bikeshedding request for GHCi's :type

Matt parsonsmatt at gmail.com
Thu Apr 28 22:24:31 UTC 2016


It seems that we really want is something like Idris's `:doc` command:

Idris> :doc map
> Prelude.Functor.map : Functor f => (m : a -> b) -> f a -> f b
>     Apply a function across everything of type 'a' in a
>     parameterised type
>
>     The function is Total



>
> Idris> :doc length
> Prelude.List.length : List a -> Nat
>     Compute the length of a list.
>
>     Runs in linear time
>
>     The function is Total
> Prelude.Strings.length : String -> Nat
>     Returns the length of the string.
>
>         > length ""
>         0
>
>         > length "ABC"
>         3
>
>     The function is Total


I don't like the idea of making `:type` more complicated, and I think this
would satisfy the need for understanding much more effectively.

Matt Parsons

On Thu, Apr 28, 2016 at 3:35 PM, Daniel Díaz <diaz.carrete at gmail.com> wrote:

> I like the flag idea mentioned by Eric Seidel:
>
> > Perhaps instead of changing the default behavior of :type or adding new
>
> commands, we could add a flag to enhance :type's output.
>
>
> Would it be overkill to have two flags, one that enabled showing the full type + specializations, and a "newbie mode" flag that only showed a few specializations?
>
>
> Daniel.
>
>
> On Wednesday, April 27, 2016 at 2:34:29 PM UTC+2, Takenobu Tani wrote:
>>
>> Dear cafe,
>>
>> I'm forwarding mail from ghc-devs ML [1].
>>
>> I think `:type` command is very important for beginners and middle users.
>> Please feedback your opinion to them ;)
>>
>> [1]: https://mail.haskell.org/pipermail/ghc-devs/2016-April/011933.html
>>
>>
>> > 2016-04-26 22:08 GMT+09:00 Richard Eisenberg <e... at cis.upenn.edu>:
>> > Hi devs,
>> >
>> > Over the weekend, I was pondering the Haskell course I will be teaching
>> next year and shuddered at having to teach Foldable at the same time as
>> `length`. So I implemented feature request #10963 (
>> https://ghc.haskell.org/trac/ghc/ticket/10963), which allows for a way
>> for a user to request a specialization of a type. It all works wonderfully,
>> but there is a real user-facing design issue here around the default
>> behavior of :type and whether or not to add new :type-y like commands. I
>> have outlined the situation here:
>> https://ghc.haskell.org/trac/ghc/wiki/Design/GHCi/Type
>> >
>> > I'd love some broad input on this issue. If you've got a stake in how
>> this all works, please skim that wiki page and comment on #10963.
>> >
>> > Thanks!
>> > Richard
>>
>> Cheers,
>> Takenobu
>>
>>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160428/16fb22a6/attachment.html>


More information about the Haskell-Cafe mailing list