haskell / haskell/haskell-mode

haskell-decl-scan doesn't deal with TypeOperators

Open
#229 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
1.4k
Forks
354
Avg merge
5d 10h
Merged PRs (30d)
2

Description

When you have a file with the following:

```
{-# LANGUAGE TypeOperators #-}

type x :^: y = y -> x
```

haskell-decl-scan will erroneously list this under `Datatypes -> x`.

I believe it's because this:

```
(if (looking-at "[ \t]*\\(\\sw+\\)")
(progn
(setq name (match-string-no-properties 1))
(setq name-pos (match-beginning 1))
(setq type 'datatype)))
```

just takes the first identifier listed there (without considering whether it's a valid name for a data type).

On the other hand, if we define the datatype as follows:

```
type (:^:) x y = y -> x
```

then haskell-decl-scan doesn't pick it up at all.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.