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

Parse Error on empty closed type families #438

Open
JakobBruenker opened this issue Aug 26, 2019 · 0 comments
Open

Parse Error on empty closed type families #438

JakobBruenker opened this issue Aug 26, 2019 · 0 comments

Comments

@JakobBruenker
Copy link

JakobBruenker commented Aug 26, 2019

GHC parses the following file just fine, but using haskell-src-exts' parseFile results in a Parse Error:

{-# LANGUAGE TypeFamilies #-}

type family Test where

If you add a line like

  Test = ()

To the end of this file, parseFile works.

Empty closed type families can be useful when the return type is void, as in

{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}

import Data.Type.Equality
import Data.Void

type family OneIsn'tZero (p :: 1 :~: 0) :: Void where

This is also how I encountered this bug.

This might be related to #358

Version: Both 1.21.0 on hackage and the master branch.

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

1 participant