GHC 8.2's new ghci commands: `:type +d` and `:type +v`

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

GHC 8.2's new ghci commands: `:type +d` and `:type +v`

Takenobu Tani
Dear cafe,

GHC 8.2 supports two new ghci commands.
They are `:type +d` and `:type +v` [1].


0. normal `:type` command:

    Prelude> :type length
    length :: Foldable t => t a -> Int

    Prelude> :type ($)
    ($) :: (a -> b) -> a -> b


1. new `:type +d` command for newcomers:

    Prelude> :type +d length
    length :: [a] -> Int


2. new `:type +v` command for detail information:

    Prelude> :type +v ($)
    ($)
      :: forall (r :: GHC.Types.RuntimeRep) a (b :: TYPE r).
         (a -> b) -> a -> b


That's excellent :)

[1]: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html#ghci-cmd-:type

Regards,
Takenobu


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.