Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing confused by type-level string (Symbol) #50

Closed
jchia opened this issue Dec 21, 2017 · 1 comment
Closed

Parsing confused by type-level string (Symbol) #50

jchia opened this issue Dec 21, 2017 · 1 comment

Comments

@jchia
Copy link

jchia commented Dec 21, 2017

The following code snippet is parsed incorrectly. The last two lines for main are completely unhighlighted in the vscode editor. The problem goes away if "of" is changed to "f". I'm running language-haskell 2.4.0 on vscode 1.19.0 with ghc 8.2.2.

{-# LANGUAGE DataKinds, FlexibleInstances, KindSignatures, MultiParamTypeClasses, FunctionalDependencies #-}

import GHC.TypeLits

data Label (l :: Symbol) = Get

class Has a l b | a l -> b where
  from :: a -> Label l -> b

data Point = Point Int Int deriving Show

instance Has Point "of" Int where from (Point x _) _ = x

example = from (Point 1 2) (Get :: Label "of")

main :: IO ()
main = undefined
@jchia jchia changed the title Parsing confused by type-level String Parsing confused by type-level string (Symbol) Dec 21, 2017
@JustusAdam
Copy link
Owner

Also I am noticing that attaching the kind signature to the l type parameter makes the data keyword not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants