Closed
Description
Types and constructors share namespace in Haskell and only context tell how a token starting with uppercase letter should be interpreted. Emacs' font lock isn't best at context but can be coerced to use one. The plan:
- Trigger type font lock on
::
token. - Parse what comes after that as a type expression.
- Mark where the type expression starts and ends.
- Font lock tokens in marked region as types instead of constructors.
Tricky situations:
putStrLn (123 :: Int)
x :: String <- return ""
x :: String = "xx"
x :: (HasField "field" r) => r
x + y :: Int where y = 45
data T = C
And everything related to DataKinds
.
Metadata
Metadata
Assignees
Labels
No labels