You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
importData.KindimportData.Type.EqualityimportGHC.TypeLits#define N 2
typefamilyV (e::Nat) ::ConstraintwhereV (e::Nat) = (e `CmpNat` N~ 'EQ, e `CmpNat` N~ 'LT)
fails to generate a correctly expanded output, thus causing compilation failure down the line.
The relevant part of the expanded output is:
typefamilyV (e::Nat) ::ConstraintwhereV (e::Nat) = (e `CmpNat` 2~ 'EQ, e `CmpNat` N~ 'LT)
Notice that CPPHS substituted for the first occurrence of N, but not the second. Most likely it's getting confused by the occurrence of two ' characters, and leaving whatever is inside untouched. But that's not a valid Haskell character, so I would've expected this to work correctly.
There's a simple work-around by putting the second part in a line by itself:
V (e ::Nat) = ( e `CmpNat` N~ 'EQ
, e `CmpNat` N~ 'LT)
in which case the expansion correctly replaces N in both lines.
So, there's a work around; but would be nice if it wasn't needed.
The text was updated successfully, but these errors were encountered:
This program:
fails to generate a correctly expanded output, thus causing compilation failure down the line.
The relevant part of the expanded output is:
Notice that CPPHS substituted for the first occurrence of
N
, but not the second. Most likely it's getting confused by the occurrence of two'
characters, and leaving whatever is inside untouched. But that's not a valid Haskell character, so I would've expected this to work correctly.There's a simple work-around by putting the second part in a line by itself:
in which case the expansion correctly replaces
N
in both lines.So, there's a work around; but would be nice if it wasn't needed.
The text was updated successfully, but these errors were encountered: