Skip to content

Some function types don't seem to be shown by default #432

Closed
@ikirill

Description

@ikirill

Consider the following file; emacs 25.0.50 running with "-Q" and haskell-mode from git repository.

module A where

import Data.List
import Data.Ord

something :: [(Int, Int)]
something = sortBy (comparing fst) [(k, -k) | k <- [1..10]]

Start a ghci session, with no special settings. Then placing point on sortBy shows its type, but placing point on comparing shows nothing, which is disappointing.

I tried to set haskell-doc-use-inf-haskell (which I found in haskell-doc-sym-doc to t, but it did something rather strange to the ghci session, probably because I had enabled interactive-haskell-mode instead of inferior-haskell-mode.

Maybe I'm missing some configuration or something (I don't think so), but why doesn't haskell-mode (with interactive-haskell-mode) display types of fairly common functions, by default? How do I get it to do it?

P.S. Would it be interesting if haskell-mode could show the type of a selected region? That is, if you selected "comparing fst", it would show you the type comparing fst :: Ord a => (a, b) -> (a, b) -> Ordering.

I have patches, but is this actually a bug or am I misunderstanding something? I can't tell from documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions