Skip to content

TypeNats ghc vs mhs differences #447

@claudeha

Description

@claudeha
{-# LANGUAGE DataKinds #-}                         
 -- pragma needed for ghc-9.12.2
module TypeNat where                           
   
import GHC.TypeLits (Nat)                        
   -- import needed for kind signature in ghc-9.12.2   
  -- also in GHC.TypeNats                                       
  -- import fails in mhs-0.15.5.0
  -- import not needed in mhs-0.15.5.0            

data Foo (a :: Nat) = Foo                          
 -- kind signature not needed for ghc-9.12.2
  -- kind signature needed in mhs-0.15.5.0
  deriving (Show)                                 

main = print (Foo :: Foo 665)
  -- without kind signature mhs fails to unify Nat with Type
  -- without import ghc doesn't find Nat

I could use CPP to make the import conditional or add a module for impl mhs that fakes enough of GHC.TypeLits, so its not really a blocker at the moment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions