on master help sign in
Merge pull request #3399 from enolan/hot-comments

Remove a bunch of "deriving instance NFData" hot comments

commit4615cffd1868b85391b0d151f93fb995eb09f8d2 authorAhmad Salim Al-Sibahi <asal@itu.dk> dateSun 4 Sep 2016, 13:23 (10 years ago) parentc328d7c9c636f4
4 files changed−69
src/Idris/AbsSyntaxTree.hs−26 src/Idris/Core/CaseTree.hs−2 src/Idris/Core/Evaluate.hs−18 src/Idris/Core/TT.hs−23
src/Idris/AbsSyntaxTree.hs−26
@@ -320,7 +320,6 @@ data SizeChange = Smaller | Same | Bigger | Unknown
320320 deriving (Show, Eq, Generic)
321321{-!
322322deriving instance Binary SizeChange
323−deriving instance NFData SizeChange
324323!-}
325324
326325type SCGEntry = (Name, [Maybe (Int, SizeChange)])
@@ -333,7 +332,6 @@ data CGInfo = CGInfo {
333332 } deriving (Show, Generic)
334333{-!
335334deriving instance Binary CGInfo
336−deriving instance NFData CGInfo
337335!-}
338336
339337primDefs = [ sUN "unsafePerformPrimIO"
@@ -428,9 +426,6 @@ throwError = Trans.lift . throwE
428426data Codegen = Via IRFormat String
429427 | Bytecode
430428 deriving (Show, Eq, Generic)
431−{-!
432−deriving instance NFData Codegen
433−!-}
434429
435430data IRFormat = IBCFormat | JSONFormat deriving (Show, Eq, Generic)
436431
@@ -567,7 +562,6 @@ data Fixity = Infixl { prec :: Int }
567562 deriving (Eq, Generic)
568563{-!
569564deriving instance Binary Fixity
570−deriving instance NFData Fixity
571565!-}
572566
573567instance Show Fixity where
@@ -584,7 +578,6 @@ instance Show FixDecl where
584578
585579{-!
586580deriving instance Binary FixDecl
587−deriving instance NFData FixDecl
588581!-}
589582
590583instance Ord FixDecl where
@@ -595,7 +588,6 @@ data Static = Static | Dynamic
595588 deriving (Show, Eq, Data, Generic, Typeable)
596589{-!
597590deriving instance Binary Static
598−deriving instance NFData Static
599591!-}
600592
601593-- ^ Mark bindings with their explicitness, and laziness
@@ -620,7 +612,6 @@ data Plicity = Imp { pargopts :: [ArgOpt]
620612
621613{-!
622614deriving instance Binary Plicity
623−deriving instance NFData Plicity
624615!-}
625616
626617is_scoped :: Plicity -> Maybe ImplicitInfo
@@ -664,7 +655,6 @@ data FnOpt = Inlinable -- ^ always evaluate when simplifying
664655 deriving (Show, Eq, Generic)
665656{-!
666657deriving instance Binary FnOpt
667−deriving instance NFData FnOpt
668658!-}
669659
670660type FnOpts = [FnOpt]
@@ -767,7 +757,6 @@ data PDecl' t
767757 deriving (Functor, Generic)
768758{-!
769759deriving instance Binary PDecl'
770−deriving instance NFData PDecl'
771760!-}
772761
773762-- | The set of source directives
@@ -839,7 +828,6 @@ data PClause' t = PClause FC Name t [t] t [PDecl' t] -- ^ A
839828 deriving (Functor, Generic)
840829{-!
841830deriving instance Binary PClause'
842−deriving instance NFData PClause'
843831!-}
844832
845833-- | Data declaration
@@ -869,7 +857,6 @@ mapPDataFC f g (PLaterdecl n nfc tycon) =
869857 PLaterdecl n (g nfc) (mapPTermFC f g tycon)
870858{-!
871859deriving instance Binary PData'
872−deriving instance NFData PData'
873860!-}
874861
875862-- Handy to get a free function for applying PTerm -> PTerm functions
@@ -1174,7 +1161,6 @@ mapPTermFC f g (PQuoteName n x fc) = PQuoteName n x (g fc)
11741161
11751162{-!
11761163dg instance Binary PTerm
1177−deriving instance NFData PTerm
11781164!-}
11791165
11801166mapPT :: (PTerm -> PTerm) -> PTerm -> PTerm
@@ -1238,7 +1224,6 @@ data PTactic' t = Intro [Name] | Intros | Focus Name
12381224 deriving (Show, Eq, Functor, Foldable, Traversable, Data, Generic, Typeable)
12391225{-!
12401226deriving instance Binary PTactic'
1241−deriving instance NFData PTactic'
12421227!-}
12431228instance Sized a => Sized (PTactic' a) where
12441229 size (Intro nms) = 1 + size nms
@@ -1285,7 +1270,6 @@ data PDo' t = DoExp FC t
12851270 deriving (Eq, Functor, Data, Generic, Typeable)
12861271{-!
12871272deriving instance Binary PDo'
1288−deriving instance NFData PDo'
12891273!-}
12901274
12911275instance Sized a => Sized (PDo' a) where
@@ -1339,7 +1323,6 @@ instance Sized a => Sized (PArg' a) where
13391323
13401324{-!
13411325deriving instance Binary PArg'
1342−deriving instance NFData PArg'
13431326!-}
13441327
13451328pimp n t mach = PImp 1 mach [] n t
@@ -1421,7 +1404,6 @@ data InterfaceInfo = CI {
14211404 } deriving (Show, Generic)
14221405{-!
14231406deriving instance Binary InterfaceInfo
1424−deriving instance NFData InterfaceInfo
14251407!-}
14261408
14271409-- Record data
@@ -1442,7 +1424,6 @@ data FnInfo = FnInfo { fn_params :: [Int] }
14421424 deriving (Show, Generic)
14431425{-!
14441426deriving instance Binary FnInfo
1445−deriving instance NFData FnInfo
14461427!-}
14471428
14481429data OptInfo = Optimise {
@@ -1451,7 +1432,6 @@ data OptInfo = Optimise {
14511432 } deriving (Show, Generic)
14521433{-!
14531434deriving instance Binary OptInfo
1454−deriving instance NFData OptInfo
14551435!-}
14561436
14571437-- | Syntactic sugar info
@@ -1468,7 +1448,6 @@ data DSL' t = DSL {
14681448 } deriving (Show, Functor, Generic)
14691449{-!
14701450deriving instance Binary DSL'
1471−deriving instance NFData DSL'
14721451!-}
14731452
14741453type DSL = DSL' PTerm
@@ -1479,7 +1458,6 @@ data SynContext = PatternSyntax
14791458 deriving (Show, Generic)
14801459{-!
14811460deriving instance Binary SynContext
1482−deriving instance NFData SynContext
14831461!-}
14841462
14851463data Syntax = Rule [SSymbol] PTerm SynContext
@@ -1499,7 +1477,6 @@ syntaxSymbols (Rule ss _ _) = ss
14991477syntaxSymbols (DeclRule ss _) = ss
15001478{-!
15011479deriving instance Binary Syntax
1502−deriving instance NFData Syntax
15031480!-}
15041481
15051482data SSymbol = Keyword Name
@@ -1512,7 +1489,6 @@ data SSymbol = Keyword Name
15121489
15131490{-!
15141491deriving instance Binary SSymbol
1515−deriving instance NFData SSymbol
15161492!-}
15171493
15181494newtype SyntaxRules = SyntaxRules { syntaxRulesList :: [Syntax] }
@@ -1572,7 +1548,6 @@ data Using = UImplicit Name PTerm
15721548 deriving (Show, Eq, Data, Generic, Typeable)
15731549{-!
15741550deriving instance Binary Using
1575−deriving instance NFData Using
15761551!-}
15771552
15781553data SyntaxInfo = Syn {
@@ -1595,7 +1570,6 @@ data SyntaxInfo = Syn {
15951570 , withAppAllowed :: Bool
15961571 } deriving (Show, Generic)
15971572{-!
1598−deriving instance NFData SyntaxInfo
15991573deriving instance Binary SyntaxInfo
16001574!-}
16011575
src/Idris/Core/CaseTree.hs−2
@@ -50,7 +50,6 @@ data SC' t = Case CaseType Name [CaseAlt' t] -- ^ invariant: lowest tags first
5050 deriving (Eq, Ord, Functor, Generic)
5151{-!
5252deriving instance Binary SC'
53−deriving instance NFData SC'
5453!-}
5554
5655data CaseType = Updatable | Shared
@@ -66,7 +65,6 @@ data CaseAlt' t = ConCase Name Int [Name] !(SC' t)
6665 deriving (Show, Eq, Ord, Functor, Generic)
6766{-!
6867deriving instance Binary CaseAlt'
69−deriving instance NFData CaseAlt'
7068!-}
7169
7270type CaseAlt = CaseAlt' Term
src/Idris/Core/Evaluate.hs−18
@@ -757,15 +757,6 @@ deriving instance Binary CaseInfo
757757{-!
758758deriving instance Binary CaseDefs
759759!-}
760−{-!
761−deriving instance NFData Def
762−!-}
763−{-!
764−deriving instance NFData CaseInfo
765−!-}
766−{-!
767−deriving instance NFData CaseDefs
768−!-}
769760
770761instance Show Def where
771762 show (Function ty tm) = "Function: " ++ show (ty, tm)
@@ -794,9 +785,6 @@ instance Show Def where
794785
795786data Accessibility = Hidden | Public | Frozen | Private
796787 deriving (Eq, Ord, Generic)
797−{-!
798−deriving instance NFData Accessibility
799−!-}
800788
801789instance Show Accessibility where
802790 show Public = "public export"
@@ -813,17 +801,11 @@ data Totality = Total [Int] -- ^ well-founded arguments
813801 | Unchecked
814802 | Generated
815803 deriving (Eq, Generic)
816−{-!
817−deriving instance NFData Totality
818−!-}
819804
820805-- | Reasons why a function may not be total
821806data PReason = Other [Name] | Itself | NotCovering | NotPositive | UseUndef Name
822807 | ExternalIO | BelieveMe | Mutual [Name] | NotProductive
823808 deriving (Show, Eq, Generic)
824−{-!
825−deriving instance NFData PReason
826−!-}
827809
828810instance Show Totality where
829811 show (Total args)= "Total" -- ++ show args ++ " decreasing arguments"
src/Idris/Core/TT.hs−23
@@ -182,7 +182,6 @@ fileFC s = FileFC s
182182
183183{-!
184184deriving instance Binary FC
185−deriving instance NFData FC
186185!-}
187186
188187instance Sized FC where
@@ -246,7 +245,6 @@ data Provenance = ExpectedType
246245 | SourceTerm Term
247246 deriving (Show, Eq, Data, Generic, Typeable)
248247{-!
249−deriving instance NFData Err
250248deriving instance Binary Err
251249!-}
252250
@@ -344,10 +342,6 @@ instance Alternative TC where
344342 empty = mzero
345343 (<|>) = mplus
346344
347−{-!
348−deriving instance NFData Err
349−!-}
350−
351345instance Sized ErrorReportPart where
352346 size (TextPart msg) = 1 + length msg
353347 size (TermPart t) = 1 + size t
@@ -499,7 +493,6 @@ caseName _ = False
499493
500494{-!
501495deriving instance Binary Name
502−deriving instance NFData Name
503496!-}
504497
505498data SpecialName = WhereN !Int !Name !Name
@@ -514,7 +507,6 @@ data SpecialName = WhereN !Int !Name !Name
514507 deriving (Eq, Ord, Data, Generic, Typeable)
515508{-!
516509deriving instance Binary SpecialName
517−deriving instance NFData SpecialName
518510!-}
519511
520512sInstanceN :: Name -> [String] -> SpecialName
@@ -695,11 +687,6 @@ intTyName (ITChar) = "Char"
695687
696688data ArithTy = ATInt IntTy | ATFloat -- TODO: Float vectors https://github.com/idris-lang/Idris-dev/issues/1723
697689 deriving (Show, Eq, Ord, Data, Generic, Typeable)
698−{-!
699−deriving instance NFData IntTy
700−deriving instance NFData NativeTy
701−deriving instance NFData ArithTy
702−!-}
703690
704691instance Pretty ArithTy OutputAnnotation where
705692 pretty (ATInt ITNative) = text "Int"
@@ -752,7 +739,6 @@ instance Eq Const where
752739
753740{-!
754741deriving instance Binary Const
755−deriving instance NFData Const
756742!-}
757743
758744isTypeConst :: Const -> Bool
@@ -850,7 +836,6 @@ instance Pretty Raw OutputAnnotation where
850836
851837{-!
852838deriving instance Binary Raw
853−deriving instance NFData Raw
854839!-}
855840
856841data ImplicitInfo = Impl { tcinstance :: Bool, toplevel_imp :: Bool,
@@ -859,7 +844,6 @@ data ImplicitInfo = Impl { tcinstance :: Bool, toplevel_imp :: Bool,
859844
860845{-!
861846deriving instance Binary ImplicitInfo
862−deriving instance NFData ImplicitInfo
863847!-}
864848
865849-- The type parameter `b` will normally be something like `TT Name` or just
@@ -910,7 +894,6 @@ data Binder b = Lam { binderTy :: !b {-^ type annotation for bound variable-}
910894 deriving (Show, Eq, Ord, Functor, Foldable, Traversable, Data, Generic, Typeable)
911895{-!
912896deriving instance Binary Binder
913−deriving instance NFData Binder
914897!-}
915898
916899instance Sized a => Sized (Binder a) where
@@ -953,9 +936,6 @@ internalNS = "(internal)"
953936data UExp = UVar String Int -- ^ universe variable, with source file to disambiguate
954937 | UVal Int -- ^ explicit universe level
955938 deriving (Eq, Ord, Data, Generic, Typeable)
956−{-!
957−deriving instance NFData UExp
958−!-}
959939
960940instance Sized UExp where
961941 size _ = 1
@@ -995,7 +975,6 @@ data NameType = Bound
995975 deriving (Show, Ord, Data, Generic, Typeable)
996976{-!
997977deriving instance Binary NameType
998−deriving instance NFData NameType
999978!-}
1000979
1001980instance Sized NameType where
@@ -1035,7 +1014,6 @@ data TT n = P NameType n (TT n) -- ^ named references with type
10351014 deriving (Ord, Functor, Data, Generic, Typeable)
10361015{-!
10371016deriving instance Binary TT
1038−deriving instance NFData TT
10391017!-}
10401018
10411019class TermSize a where
@@ -1109,7 +1087,6 @@ data TypeInfo = TI { con_names :: [Name],
11091087 deriving (Show, Generic)
11101088{-!
11111089deriving instance Binary TypeInfo
1112−deriving instance NFData TypeInfo
11131090!-}
11141091
11151092instance Eq n => Eq (TT n) where