on master help sign in
remove use of DeriveAnyClass
8579263Rui Barreiro
src/IRTS/JavaScript/Codegen.hs+2−4
@@ -12,7 +12,6 @@ module IRTS.JavaScript.Codegen( codegenJs
12 , CGStats(..)
12 , CGStats(..)
13 ) where
13 ) where
14
14
15−import Control.DeepSeq
16import Idris.Core.TT
15import Idris.Core.TT
17import IRTS.CodegenCommon
16import IRTS.CodegenCommon
18import IRTS.JavaScript.AST
17import IRTS.JavaScript.AST
@@ -85,10 +84,10 @@ codegenJs conf ci =
85 else pure ()
84 else pure ()
86 let defs = Map.fromList $ liftDecls ci
85 let defs = Map.fromList $ liftDecls ci
87 let used = Map.elems $ used_defs defs [sMN 0 "runMain"]
86 let used = Map.elems $ used_defs defs [sMN 0 "runMain"]
88− used `deepseq` if debug then
87+ if debug then
89 do
88 do
90− putStrLn $ "Finished calculating used"
91 writeFile (outputFile ci ++ ".LDeclsDebug") $ (unlines $ intersperse "" $ map show used) ++ "\n\n\n"
89 writeFile (outputFile ci ++ ".LDeclsDebug") $ (unlines $ intersperse "" $ map show used) ++ "\n\n\n"
90+ putStrLn $ "Finished calculating used"
92 else pure ()
91 else pure ()
93
92
94 let (out, stats) = doCodegen conf defs used
93 let (out, stats) = doCodegen conf defs used
@@ -99,7 +98,6 @@ codegenJs conf ci =
99 else return ""
98 else return ""
100
99
101
100
102− out `deepseq` if debug then putStrLn $ "Finished generating code" else pure ()
103 includes <- get_includes $ includes ci
101 includes <- get_includes $ includes ci
104 TIO.writeFile (outputFile ci) $ T.concat [ header conf
102 TIO.writeFile (outputFile ci) $ T.concat [ header conf
105 , "\"use strict\";\n\n"
103 , "\"use strict\";\n\n"
src/IRTS/JavaScript/LangTransforms.hs+1−28
@@ -5,7 +5,7 @@ Copyright :
5License : BSD3
5License : BSD3
6Maintainer : The Idris Community.
6Maintainer : The Idris Community.
7-}
7-}
8−{-# LANGUAGE DeriveAnyClass, DeriveDataTypeable, DeriveGeneric,
8+{-# LANGUAGE DeriveDataTypeable, DeriveGeneric,
9 FlexibleInstances, OverloadedStrings, StandaloneDeriving #-}
9 FlexibleInstances, OverloadedStrings, StandaloneDeriving #-}
10
10
11module IRTS.JavaScript.LangTransforms( used_defs
11module IRTS.JavaScript.LangTransforms( used_defs
@@ -29,7 +29,6 @@ import IRTS.Lang
29import Data.Data
29import Data.Data
30import Data.Generics.Uniplate.Data
30import Data.Generics.Uniplate.Data
31import GHC.Generics (Generic)
31import GHC.Generics (Generic)
32−import Idris.Core.DeepSeq
33
32
34deriving instance Typeable (LAlt' LExp)
33deriving instance Typeable (LAlt' LExp)
35deriving instance Data (LAlt' LExp)
34deriving instance Data (LAlt' LExp)
@@ -48,32 +47,6 @@ deriving instance Data LDecl
48deriving instance Typeable LOpt
47deriving instance Typeable LOpt
49deriving instance Data LOpt
48deriving instance Data LOpt
50
49
51−deriving instance Generic LDecl
52−deriving instance NFData LDecl
53−deriving instance Generic LOpt
54−deriving instance NFData LOpt
55−deriving instance Generic LExp
56−deriving instance NFData LExp
57−deriving instance NFData PrimFn
58−deriving instance Generic LVar
59−deriving instance NFData LVar
60−deriving instance NFData (LAlt' LExp)
61−deriving instance Generic (LAlt' e)
62−deriving instance NFData FDesc
63−deriving instance Generic FDesc
64−
65−{-
66−deriving instance NFData FC
67−deriving instance NFData FC'
68−deriving instance NFData SpecialName
69−deriving instance NFData Name
70−deriving instance NFData ArithTy
71−deriving instance NFData IntTy
72−deriving instance NFData NativeTy
73−deriving instance NFData Const
74−deriving instance NFData CaseType
75−-}
76−
77
50
78restrictKeys :: Ord k => Map k a -> Set k -> Map k a
51restrictKeys :: Ord k => Map k a -> Set k -> Map k a
79restrictKeys m s = Map.filterWithKey (\k _ -> k `Set.member` s) m
52restrictKeys m s = Map.filterWithKey (\k _ -> k `Set.member` s) m