[Haskell-cafe] Displaying specializations in :info or separately?

David Kraeutmann kane at kane.cx
Mon Oct 19 16:47:41 UTC 2015


Hi,

I'm working on a GHC feature [1] that allows users to view
specializations of functions like in (name subject to change)

----
> :binfo find
find :: Foldable t => (a -> Bool) -> t a -> Maybe a
Specialisations:
 t ~ [] => find :: (a -> Bool) -> [a] -> Maybe a

> :binfo first
first :: Arrow a => a b c -> a (b, d) (c, d)
Specialisations:
 a ~ (->) => first :: (b -> c) -> (b, d) -> (c, d)
----

Now there are two things left to decide on:
* What command should the specializations be visible under? We can
either put it under :info or make a special command :sinfo or :binfo
that displays only the expression's type and specialisations like in the
example above?

* What specializations do we want to display? goldfire suggested using
the default list, which has the added benefit of being customizable by
e.g. instructors, so adding a default Maybe (in conjunction with [2])
gives the desired behavior and not too many specializations.


Thanks for your time!
David


----
Links:
[1] : https://ghc.haskell.org/trac/ghc/ticket/10972
[2] : https://ghc.haskell.org/trac/ghc/ticket/10971

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4291 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151019/91b1888d/attachment.bin>


More information about the Haskell-Cafe mailing list