Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`inferior-haskell-type` inside a `where` clause?

Tags:

Does haskell-mode or some alternative package offer something akin to the wonderful inferior-haskell-type inside a where clause?

For example, suppose I have

foo = undefined where
    bar = complicated
    ...

it would be super-awesome to be able to place the marker at bar and inspect its type.

like image 766
gspr Avatar asked Oct 17 '11 10:10

gspr


1 Answers

This is possible with Scion in combination with Emacs.

C-c C-t shows type of identifier at point. This only works if the current file typechecks, but then it also works for local identifiers. For polymorphic function it will show the type to which they are instantiated, e.g.,

f x = x + (1::Int)

Calling this command on + will print Int -> Int -> Int instead of Num a => a -> a -> a.

like image 138
dbr Avatar answered Sep 20 '22 16:09

dbr