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
Running derive/v2_6_2 with GHC8 I'm getting this error:
Bug2.hs:1:1: error:
Exception when trying to run compile-time code:
Could not convert Dec to Decl ()
TySynD Main.NewType [] (ConT Main.DataType)
derive/v2_6_2/src/Language/Haskell/Convert.hs:(41,14)-(45,8): Non-exhaustive patterns in case
CallStack (from HasCallStack):
derive/v2_6_2/src/Language/Haskell/Convert.hs:22:87 in derive:Language.Haskell.Convert
Code: derive makeNFData ''NewType
for the code below:
{-# LANGUAGE TemplateHaskell #-}
importControl.DeepSeq(NFData(..))
importData.DeriveTHtypeNewType=DataTypedataDataType=DataType$(derive makeNFData ''NewType)
Admittedly deriving something for a type is not exactly the best idea, but a more helpful error would be nice.
The text was updated successfully, but these errors were encountered:
Come to think of it, the issue is not in fact silly. In full code my data is parameterized by a type family. So I do need to derive the instance for the type Type = DataType Identity. Making this work is a functional requirement.
FWIW, this workaround kind of works, but I loathe mixing different styles of NFData:
Warning: This package has no official maintainer anymore. Use at your own risk. You may wish to consider the built-in mechanism GHC.Generics or libraries such as generic-deriving.
Running derive/v2_6_2 with GHC8 I'm getting this error:
for the code below:
Admittedly deriving something for a type is not exactly the best idea, but a more helpful error would be nice.
The text was updated successfully, but these errors were encountered: