@@ -12,30 +12,25 @@
12-- This module provides basic inlining capabilities
12-- This module provides basic inlining capabilities
14-----------------------------------------------------------------------------
14-----------------------------------------------------------------------------
18−module Language.PureScript.CodeGen.Cpp.Optimizer.Inliner (
15+module Language.PureScript.CodeGen.Cpp.Optimizer.Inliner
19− inlineVariables,
16+ ( inlineVariables
20− inlineValues,
17+ , inlineCommonValues
21− inlineOperator,
18+ , inlineOperator
22− inlineCommonOperators,
19+ , inlineCommonOperators
23− inlineFnComposition,
20+ , inlineFnComposition
24− etaConvert,
21+ , etaConvert
25− unThunk,
22+ , unThunk
26− evaluateIifes
23+ , evaluateIifes
29import Prelude.Compat
26import Prelude.Compat
31−#if __GLASGOW_HASKELL__ < 710
32−import Control.Applicative (Applicative)
34import Control.Monad.Supply.Class (MonadSupply, freshName)
28import Control.Monad.Supply.Class (MonadSupply, freshName)
35−import Language.PureScript.CodeGen.Cpp.Types
29+
36import Language.PureScript.CodeGen.Cpp.AST
30import Language.PureScript.CodeGen.Cpp.AST
37import Language.PureScript.CodeGen.Cpp.Common
31import Language.PureScript.CodeGen.Cpp.Common
38import Language.PureScript.CodeGen.Cpp.Optimizer.Common
32import Language.PureScript.CodeGen.Cpp.Optimizer.Common
33+import Language.PureScript.CodeGen.Cpp.Types
39import Language.PureScript.Names
34import Language.PureScript.Names
40import qualified Language.PureScript.Constants as C
35import qualified Language.PureScript.Constants as C
@@ -101,36 +96,30 @@ inlineVariables = everywhereOnCpp $ removeFromBlock go
101 go (map (replaceIdent var cpp) sts)
96 go (map (replaceIdent var cpp) sts)
102 go (s:sts) = s : go sts
97 go (s:sts) = s : go sts
104−inlineValues :: Cpp -> Cpp
99+inlineCommonValues :: Cpp -> Cpp
105−inlineValues = everywhereOnCpp convert
100+inlineCommonValues = everywhereOnCpp convert
107 convert :: Cpp -> Cpp
102 convert :: Cpp -> Cpp
108− convert (CppApp fn [dict]) | isDict semiringNumber dict && isFn fnZero fn = CppNumericLiteral (Left 0)
103+ convert (CppApp fn [dict])
109− | isDict semiringNumber dict && isFn fnOne fn = CppNumericLiteral (Left 1)
110− | isDict semiringInt dict && isFn fnZero fn = CppNumericLiteral (Left 0)
104+ | isDict' [semiringNumber, semiringInt] dict && isFn fnZero fn = CppNumericLiteral (Left 0)
111− | isDict semiringInt dict && isFn fnOne fn = CppNumericLiteral (Left 1)
105+ | isDict' [semiringNumber, semiringInt] dict && isFn fnOne fn = CppNumericLiteral (Left 1)
112− | isDict boundedBoolean dict && isFn fnBottom fn = CppBooleanLiteral False
106+ | isDict boundedBoolean dict && isFn fnBottom fn = CppBooleanLiteral False
113− | isDict boundedBoolean dict && isFn fnTop fn = CppBooleanLiteral True
107+ | isDict boundedBoolean dict && isFn fnTop fn = CppBooleanLiteral True
114− convert (CppApp fn [dict, x, y])
115− | isDict semiringInt dict && isFn fnAdd fn = CppBinary Add x y
116− | isDict semiringInt dict && isFn fnMultiply fn = CppBinary Multiply x y
117− | isDict moduloSemiringInt dict && isFn fnDivide fn = CppBinary Divide x y
118− | isDict ringInt dict && isFn fnSubtract fn = CppBinary Subtract x y
119 convert (CppApp (CppApp (CppApp fn [dict]) [x]) [y])
108 convert (CppApp (CppApp (CppApp fn [dict]) [x]) [y])
120− | isDict semiringInt dict && isFn fnAdd fn = CppBinary Add x y
109+ | isDict semiringInt dict && isFn fnAdd fn = intOp Add x y
121− | isDict semiringInt dict && isFn fnMultiply fn = CppBinary Multiply x y
110+ | isDict semiringInt dict && isFn fnMultiply fn = intOp Multiply x y
122− | isDict moduloSemiringInt dict && isFn fnDivide fn = CppBinary Divide x y
111+ | isDict euclideanRingInt dict && isFn fnDivide fn = intOp Divide x y
123− | isDict ringInt dict && isFn fnSubtract fn = CppBinary Subtract x y
112+ | isDict ringInt dict && isFn fnSubtract fn = intOp Subtract x y
125 convert other = other
113 convert other = other
126− fnZero = (C.prelude, C.zero)
114+ fnZero = (C.dataSemiring, C.zero)
127− fnOne = (C.prelude, C.one)
115+ fnOne = (C.dataSemiring, C.one)
128− fnBottom = (C.prelude, C.bottom)
116+ fnBottom = (C.dataBounded, C.bottom)
129− fnTop = (C.prelude, C.top)
117+ fnTop = (C.dataBounded, C.top)
130− fnAdd = (C.prelude, (C.+))
118+ fnAdd = (C.dataSemiring, C.add)
131− fnDivide = (C.prelude, (C./))
119+ fnDivide = (C.dataEuclideanRing, C.div)
132− fnMultiply = (C.prelude, (C.*))
120+ fnMultiply = (C.dataSemiring, C.mul)
133− fnSubtract = (C.prelude, (C.-))
121+ fnSubtract = (C.dataRing, C.sub)
122+ intOp op x y = CppBinary BitwiseOr (CppBinary op x y) (CppNumericLiteral (Left 0))
135inlineOperator :: (String, String) -> (Cpp -> Cpp -> Cpp) -> Cpp -> Cpp
124inlineOperator :: (String, String) -> (Cpp -> Cpp -> Cpp) -> Cpp -> Cpp
136inlineOperator (m, op) f = everywhereOnCpp convert
125inlineOperator (m, op) f = everywhereOnCpp convert
@@ -139,49 +128,60 @@ inlineOperator (m, op) f = everywhereOnCpp convert
139 convert (CppApp op' [x, y]) | isOp op' = f x y
128 convert (CppApp op' [x, y]) | isOp op' = f x y
140 convert (CppApp (CppApp op' [x]) [y]) | isOp op' = f x y
129 convert (CppApp (CppApp op' [x]) [y]) | isOp op' = f x y
141 convert other = other
130 convert other = other
142− isOp (CppAccessor (CppVar longForm) (CppVar m')) = m == m' && longForm == identToCpp (Op op)
131+ isOp (CppAccessor (CppVar longForm) (CppVar m')) = m == m' && longForm == identToCpp (Ident op)
143 isOp (CppIndexer (CppStringLiteral op') (CppVar m')) = m == m' && op == op'
132 isOp (CppIndexer (CppStringLiteral op') (CppVar m')) = m == m' && op == op'
144 isOp _ = False
133 isOp _ = False
146inlineCommonOperators :: Cpp -> Cpp
135inlineCommonOperators :: Cpp -> Cpp
147inlineCommonOperators = applyAll $
136inlineCommonOperators = applyAll $
148− [ binary semiringNumber (C.+) Add
137+ [ binary semiringNumber opAdd Add
149− , binary semiringNumber (C.*) Multiply
138+ , binary semiringNumber opMul Multiply
151− , binary ringNumber (C.-) Subtract
140+ , binary ringNumber opSub Subtract
152− , unary ringNumber C.negate CppNegate
141+ , unary ringNumber opNegate Negate
153− , binary ringInt (C.-) Subtract
142+ , binary ringInt opSub Subtract
154− , unary ringInt C.negate CppNegate
143+ , unary ringInt opNegate Negate
156− , binary moduloSemiringNumber (C./) Divide
145+ , binary euclideanRingNumber opDiv Divide
157− , binary moduloSemiringInt C.mod Modulus
146+ , binary euclideanRingInt opMod Modulus
159− , binary eqNumber (C.==) Equal
148+ , binary eqNumber opEq EqualTo
160− , binary eqNumber (C./=) NotEqual
149+ , binary eqNumber opNotEq NotEqualTo
161− , binary eqInt (C.==) Equal
150+ , binary eqInt opEq EqualTo
162− , binary eqInt (C./=) NotEqual
151+ , binary eqInt opNotEq NotEqualTo
163− , binary eqString (C.==) Equal
152+ , binary eqString opEq EqualTo
164− , binary eqString (C./=) NotEqual
153+ , binary eqString opNotEq NotEqualTo
154+ , binary eqChar opEq EqualTo
155+ , binary eqChar opNotEq NotEqualTo
165− , binary eqBoolean (C.==) Equal
156+ , binary eqBoolean opEq EqualTo
166− , binary eqBoolean (C./=) NotEqual
157+ , binary eqBoolean opNotEq NotEqualTo
168− , binary ordNumber (C.<) LessThan
159+ , binary ordBoolean opLessThan LessThan
169− , binary ordNumber (C.>) GreaterThan
160+ , binary ordBoolean opLessThanOrEq LessThanOrEqualTo
170− , binary ordNumber (C.<=) LessThanOrEqual
161+ , binary ordBoolean opGreaterThan GreaterThan
171− , binary ordNumber (C.>=) GreaterThanOrEqual
162+ , binary ordBoolean opGreaterThanOrEq GreaterThanOrEqualTo
163+ , binary ordChar opLessThan LessThan
164+ , binary ordChar opLessThanOrEq LessThanOrEqualTo
165+ , binary ordChar opGreaterThan GreaterThan
166+ , binary ordChar opGreaterThanOrEq GreaterThanOrEqualTo
172− , binary ordInt (C.<) LessThan
167+ , binary ordInt opLessThan LessThan
173− , binary ordInt (C.>) GreaterThan
168+ , binary ordInt opLessThanOrEq LessThanOrEqualTo
174− , binary ordInt (C.<=) LessThanOrEqual
169+ , binary ordInt opGreaterThan GreaterThan
175− , binary ordInt (C.>=) GreaterThanOrEqual
170+ , binary ordInt opGreaterThanOrEq GreaterThanOrEqualTo
176−
171+ , binary ordNumber opLessThan LessThan
177− , binary semigroupString (C.<>) Add
172+ , binary ordNumber opLessThanOrEq LessThanOrEqualTo
178− , binary semigroupString (C.++) Add
173+ , binary ordNumber opGreaterThan GreaterThan
179−
174+ , binary ordNumber opGreaterThanOrEq GreaterThanOrEqualTo
180− , binary booleanAlgebraBoolean (C.&&) And
175+ , binary ordString opLessThan LessThan
181− , binary booleanAlgebraBoolean (C.||) Or
176+ , binary ordString opLessThanOrEq LessThanOrEqualTo
182− , binaryFunction booleanAlgebraBoolean C.conj And
177+ , binary ordString opGreaterThan GreaterThan
183− , binaryFunction booleanAlgebraBoolean C.disj Or
178+ , binary ordString opGreaterThanOrEq GreaterThanOrEqualTo
184− , unary booleanAlgebraBoolean C.not CppNot
179+
180+ , binary semigroupString opAppend Add
182+ , binary heytingAlgebraBoolean opConj And
183+ , binary heytingAlgebraBoolean opDisj Or
184+ , unary heytingAlgebraBoolean opNot Not
186 , binary' C.dataIntBits (C..|.) BitwiseOr
186 , binary' C.dataIntBits (C..|.) BitwiseOr
187 , binary' C.dataIntBits (C..&.) BitwiseAnd
187 , binary' C.dataIntBits (C..&.) BitwiseAnd
@@ -189,43 +189,30 @@ inlineCommonOperators = applyAll $
189 , binary' C.dataIntBits C.shl ShiftLeft
189 , binary' C.dataIntBits C.shl ShiftLeft
190 , binary' C.dataIntBits C.shr ShiftRight
190 , binary' C.dataIntBits C.shr ShiftRight
191 -- , binary' C.dataIntBits C.zshr ZeroFillShiftRight
191 -- , binary' C.dataIntBits C.zshr ZeroFillShiftRight
192− , unary' C.dataIntBits C.complement CppBitwiseNot
192+ , unary' C.dataIntBits C.complement BitwiseNot
193− ] -- ++ -- DISABLE mkFn/runFn inlining
193+ ] ++
194 -- [ fn | i <- [0..10], fn <- [ mkFn i, runFn i ] ]
195 -- [ fn | i <- [0..10], fn <- [ mkFn i, runFn i ] ]
196− binary :: (String, String) -> String -> BinaryOp -> Cpp -> Cpp
197+ binary :: (String, String) -> (String, String) -> BinaryOperator -> Cpp -> Cpp
197− binary dict opString op = everywhereOnCpp convert
198+ binary dict fns op = everywhereOnCpp convert
199 convert :: Cpp -> Cpp
200 convert :: Cpp -> Cpp
200− convert (CppApp fn [dict', CppStringLiteral x, CppStringLiteral y])
201− | isDict dict dict' && isPreludeFn opString fn = CppStringLiteral (x ++ y)
202− convert (CppApp fn [dict', x, y]) | isDict dict dict' && isPreludeFn opString fn = CppBinary op x y
203− convert (CppApp (CppApp (CppApp fn [dict']) [CppStringLiteral x]) [CppStringLiteral y])
204− | isDict dict dict' && isPreludeFn opString fn = CppStringLiteral (x ++ y)
205− convert (CppApp (CppApp (CppApp fn [dict']) [x]) [y]) | isDict dict dict' && isPreludeFn opString fn = CppBinary op x y
201+ convert (CppApp (CppApp (CppApp fn [dict']) [x]) [y]) | isDict dict dict' && isFn fns fn = CppBinary op x y
206 convert other = other
202 convert other = other
207− binary' :: String -> String -> BinaryOp -> Cpp -> Cpp
203+ binary' :: String -> String -> BinaryOperator -> Cpp -> Cpp
208 binary' moduleName opString op = everywhereOnCpp convert
204 binary' moduleName opString op = everywhereOnCpp convert
210 convert :: Cpp -> Cpp
206 convert :: Cpp -> Cpp
211− convert (CppApp fn [x, y]) | isFn (moduleName, opString) fn = CppBinary op x y
212 convert (CppApp (CppApp fn [x]) [y]) | isFn (moduleName, opString) fn = CppBinary op x y
207 convert (CppApp (CppApp fn [x]) [y]) | isFn (moduleName, opString) fn = CppBinary op x y
213 convert other = other
208 convert other = other
214− binaryFunction :: (String, String) -> String -> BinaryOp -> Cpp -> Cpp
215− binaryFunction dict fnName op = everywhereOnCpp convert
217− convert :: Cpp -> Cpp
218− convert (CppApp fn [dict', x, y]) | isPreludeFn fnName fn && isDict dict dict' = CppBinary op x y
219− convert (CppApp (CppApp (CppApp fn [dict']) [x]) [y]) | isPreludeFn fnName fn && isDict dict dict' = CppBinary op x y
220− convert other = other
221− unary :: (String, String) -> String -> CppUnaryOp -> Cpp -> Cpp
209+ unary :: (String, String) -> (String, String) -> UnaryOperator -> Cpp -> Cpp
222− unary dict fnName op = everywhereOnCpp convert
210+ unary dicts fns op = everywhereOnCpp convert
224 convert :: Cpp -> Cpp
212 convert :: Cpp -> Cpp
225− convert (CppApp fn [dict', x]) | isPreludeFn fnName fn && isDict dict dict' = CppUnary op x
213+ convert (CppApp (CppApp fn [dict']) [x]) | isDict dicts dict' && isFn fns fn = CppUnary op x
226− convert (CppApp (CppApp fn [dict']) [x]) | isPreludeFn fnName fn && isDict dict dict' = CppUnary op x
227 convert other = other
214 convert other = other
228− unary' :: String -> String -> CppUnaryOp -> Cpp -> Cpp
215+ unary' :: String -> String -> UnaryOperator -> Cpp -> Cpp
229 unary' moduleName fnName op = everywhereOnCpp convert
216 unary' moduleName fnName op = everywhereOnCpp convert
231 convert :: Cpp -> Cpp
218 convert :: Cpp -> Cpp
@@ -235,8 +222,8 @@ inlineCommonOperators = applyAll $
235 -- mkFn 0 = everywhereOnCpp convert
222 -- mkFn 0 = everywhereOnCpp convert
237 -- convert :: Cpp -> Cpp
224 -- convert :: Cpp -> Cpp
238− -- convert (CppApp mkFnN [CppLambda caps [_] _ (CppBlock cpp)]) | isNFn C.mkFn 0 mkFnN =
225+ -- convert (CppApp mkFnN [CppLambda _ [_] _ (CppBlock cpp)]) | isNFn C.mkFn 0 mkFnN =
239− -- CppLambda caps [] Nothing (CppBlock cpp)
226+ -- CppLambda [CppCaptureAll] [] Nothing (CppBlock cpp)
240 -- convert other = other
227 -- convert other = other
241 -- mkFn n = everywhereOnCpp convert
228 -- mkFn n = everywhereOnCpp convert
@@ -246,14 +233,14 @@ inlineCommonOperators = applyAll $
246 -- Just (args, cpp) -> CppLambda [CppCaptureAll] args Nothing (CppBlock cpp)
233 -- Just (args, cpp) -> CppLambda [CppCaptureAll] args Nothing (CppBlock cpp)
247 -- Nothing -> orig
234 -- Nothing -> orig
248 -- convert other = other
235 -- convert other = other
249− -- collectArgs :: Int -> [(String, Maybe CppType)] -> Cpp -> Maybe ([(String, Maybe CppType)], [Cpp])
236+ -- collectArgs :: Int -> [String] -> Cpp -> Maybe ([String], [Cpp])
250 -- collectArgs 1 acc (CppLambda _ [oneArg] _ (CppBlock cpp)) | length acc == n - 1 = Just (reverse (oneArg : acc), cpp)
237 -- collectArgs 1 acc (CppLambda _ [oneArg] _ (CppBlock cpp)) | length acc == n - 1 = Just (reverse (oneArg : acc), cpp)
251 -- collectArgs m acc (CppLambda _ [oneArg] _ (CppBlock [CppReturn ret])) = collectArgs (m - 1) (oneArg : acc) ret
238 -- collectArgs m acc (CppLambda _ [oneArg] _ (CppBlock [CppReturn ret])) = collectArgs (m - 1) (oneArg : acc) ret
252 -- collectArgs _ _ _ = Nothing
239 -- collectArgs _ _ _ = Nothing
254 -- isNFn :: String -> Int -> Cpp -> Bool
241 -- isNFn :: String -> Int -> Cpp -> Bool
255 -- isNFn prefix n (CppVar name) = name == (prefix ++ show n)
242 -- isNFn prefix n (CppVar name) = name == (prefix ++ show n)
256− -- isNFn prefix n (CppAccessor (CppVar name) (CppVar dataFunction)) | dataFunction == C.dataFunction = name == (prefix ++ show n)
243+ -- isNFn prefix n (CppAccessor _ name (CppVar dataFunction)) | dataFunction == C.dataFunction = name == (prefix ++ show n)
257 -- isNFn _ _ _ = False
244 -- isNFn _ _ _ = False
259 -- runFn :: Int -> Cpp -> Cpp
246 -- runFn :: Int -> Cpp -> Cpp
@@ -269,78 +256,134 @@ inlineCommonOperators = applyAll $
270-- (f <<< g $ x) = f (g x)
257-- (f <<< g $ x) = f (g x)
271-- (f <<< g) = \x -> f (g x)
258-- (f <<< g) = \x -> f (g x)
272−inlineFnComposition :: (Applicative m, MonadSupply m) => Cpp -> m Cpp
259+inlineFnComposition :: (MonadSupply m) => Cpp -> m Cpp
273inlineFnComposition = everywhereOnCppTopDownM convert
260inlineFnComposition = everywhereOnCppTopDownM convert
275 convert :: (MonadSupply m) => Cpp -> m Cpp
262 convert :: (MonadSupply m) => Cpp -> m Cpp
276− convert (CppApp fn [dict', x, y]) | isFnCompose dict' fn = do
263+ convert (CppApp (CppApp (CppApp (CppApp fn [dict']) [x]) [y]) [z])
277− arg <- freshName
264+ | isFnCompose dict' fn = return $ CppApp x [CppApp y [z]]
278− return $ CppLambda [CppCaptureAll] [(arg, Just (CppAny [CppConst, CppRef]))] (Just $ CppAny []) (CppBlock [CppReturn $ CppApp x [CppApp y [CppVar arg]]])
265+ | isFnComposeFlipped dict' fn = return $ CppApp y [CppApp x [z]]
279− convert (CppApp (CppApp (CppApp (CppApp fn [dict']) [x]) [y]) [z]) | isFnCompose dict' fn =
266+ convert (CppApp (CppApp (CppApp fn [dict']) [x]) [y])
280− return $ CppApp x [CppApp y [z]]
267+ | isFnCompose dict' fn = do
281− convert (CppApp (CppApp (CppApp fn [dict']) [x]) [y]) | isFnCompose dict' fn = do
268+ arg <- freshName
269+ return $ CppLambda [CppCaptureAll] [(arg, constAnyRef)] Nothing (CppBlock [CppReturn $ CppApp x [CppApp y [CppVar arg]]])
270+ | isFnComposeFlipped dict' fn = do
282− arg <- freshName
271+ arg <- freshName
283− return $ CppLambda [CppCaptureAll] [(arg, Just (CppAny [CppConst, CppRef]))] (Just $ CppAny []) (CppBlock [CppReturn $ CppApp x [CppApp y [CppVar arg]]])
272+ return $ CppLambda [CppCaptureAll] [(arg, constAnyRef)] Nothing (CppBlock [CppReturn $ CppApp y [CppApp x [CppVar arg]]])
284 convert other = return other
273 convert other = return other
285 isFnCompose :: Cpp -> Cpp -> Bool
274 isFnCompose :: Cpp -> Cpp -> Bool
286− isFnCompose dict' fn = isDict semigroupoidFn dict' && (isPreludeFn (C.<<<) fn || isPreludeFn (C.compose) fn)
275+ isFnCompose dict' fn = isDict semigroupoidFn dict' && isFn fnCompose fn
287−
276+ isFnComposeFlipped :: Cpp -> Cpp -> Bool
277+ isFnComposeFlipped dict' fn = isDict semigroupoidFn dict' && isFn fnComposeFlipped fn
278+ fnCompose :: (String, String)
279+ fnCompose = (C.controlSemigroupoid, C.compose)
288−isDict :: (String, String) -> Cpp -> Bool
280+ fnComposeFlipped :: (String, String)
289−isDict (moduleName, dictName) (CppAccessor (CppVar x) (CppVar y)) = x == dictName && y == moduleName
281+ fnComposeFlipped = (C.controlSemigroupoid, C.composeFlipped)
292−isFn :: (String, String) -> Cpp -> Bool
293−isFn (moduleName, fnName) (CppAccessor (CppVar x) (CppVar y)) = x == (identToCpp (Ident fnName)) && y == moduleName
294−isFn (moduleName, fnName) (CppIndexer (CppStringLiteral x) (CppVar y)) = x == fnName && y == moduleName
297−isPreludeFn :: String -> Cpp -> Bool
298−isPreludeFn fnName = isFn (C.prelude, fnName)
300semiringNumber :: (String, String)
283semiringNumber :: (String, String)
301−semiringNumber = (C.prelude, C.semiringNumber)
284+semiringNumber = (C.dataSemiring, C.semiringNumber)
303semiringInt :: (String, String)
286semiringInt :: (String, String)
304−semiringInt = (C.prelude, C.semiringInt)
287+semiringInt = (C.dataSemiring, C.semiringInt)
306ringNumber :: (String, String)
289ringNumber :: (String, String)
307−ringNumber = (C.prelude, C.ringNumber)
290+ringNumber = (C.dataRing, C.ringNumber)
309ringInt :: (String, String)
292ringInt :: (String, String)
310−ringInt = (C.prelude, C.ringInt)
293+ringInt = (C.dataRing, C.ringInt)
312−moduloSemiringNumber :: (String, String)
295+euclideanRingNumber :: (String, String)
313−moduloSemiringNumber = (C.prelude, C.moduloSemiringNumber)
296+euclideanRingNumber = (C.dataEuclideanRing, C.euclideanRingNumber)
315−moduloSemiringInt :: (String, String)
298+euclideanRingInt :: (String, String)
316−moduloSemiringInt = (C.prelude, C.moduloSemiringInt)
299+euclideanRingInt = (C.dataEuclideanRing, C.euclideanRingInt)
318eqNumber :: (String, String)
301eqNumber :: (String, String)
319−eqNumber = (C.prelude, C.eqNumber)
302+eqNumber = (C.dataEq, C.eqNumber)
321eqInt :: (String, String)
304eqInt :: (String, String)
322−eqInt = (C.prelude, C.eqInt)
305+eqInt = (C.dataEq, C.eqInt)
324eqString :: (String, String)
307eqString :: (String, String)
325−eqString = (C.prelude, C.eqNumber)
308+eqString = (C.dataEq, C.eqString)
310+eqChar :: (String, String)
311+eqChar = (C.dataEq, C.eqChar)
327eqBoolean :: (String, String)
313eqBoolean :: (String, String)
328−eqBoolean = (C.prelude, C.eqNumber)
314+eqBoolean = (C.dataEq, C.eqBoolean)
316+ordBoolean :: (String, String)
317+ordBoolean = (C.dataOrd, C.ordBoolean)
330ordNumber :: (String, String)
319ordNumber :: (String, String)
331−ordNumber = (C.prelude, C.ordNumber)
320+ordNumber = (C.dataOrd, C.ordNumber)
333ordInt :: (String, String)
322ordInt :: (String, String)
334−ordInt = (C.prelude, C.ordInt)
323+ordInt = (C.dataOrd, C.ordInt)
325+ordString :: (String, String)
326+ordString = (C.dataOrd, C.ordString)
328+ordChar :: (String, String)
329+ordChar = (C.dataOrd, C.ordChar)
336semigroupString :: (String, String)
331semigroupString :: (String, String)
337−semigroupString = (C.prelude, C.semigroupString)
332+semigroupString = (C.dataSemigroup, C.semigroupString)
339boundedBoolean :: (String, String)
334boundedBoolean :: (String, String)
340−boundedBoolean = (C.prelude, C.boundedBoolean)
335+boundedBoolean = (C.dataBounded, C.boundedBoolean)
342−booleanAlgebraBoolean :: (String, String)
337+heytingAlgebraBoolean :: (String, String)
343−booleanAlgebraBoolean = (C.prelude, C.booleanAlgebraBoolean)
338+heytingAlgebraBoolean = (C.dataHeytingAlgebra, C.heytingAlgebraBoolean)
345semigroupoidFn :: (String, String)
340semigroupoidFn :: (String, String)
346−semigroupoidFn = (C.prelude, C.semigroupoidFn)
341+semigroupoidFn = (C.controlSemigroupoid, C.semigroupoidFn)
343+opAdd :: (String, String)
344+opAdd = (C.dataSemiring, C.add)
346+opMul :: (String, String)
347+opMul = (C.dataSemiring, C.mul)
349+opEq :: (String, String)
350+opEq = (C.dataEq, C.eq)
352+opNotEq :: (String, String)
353+opNotEq = (C.dataEq, C.notEq)
355+opLessThan :: (String, String)
356+opLessThan = (C.dataOrd, C.lessThan)
358+opLessThanOrEq :: (String, String)
359+opLessThanOrEq = (C.dataOrd, C.lessThanOrEq)
361+opGreaterThan :: (String, String)
362+opGreaterThan = (C.dataOrd, C.greaterThan)
364+opGreaterThanOrEq :: (String, String)
365+opGreaterThanOrEq = (C.dataOrd, C.greaterThanOrEq)
367+opAppend :: (String, String)
368+opAppend = (C.dataSemigroup, C.append)
370+opSub :: (String, String)
371+opSub = (C.dataRing, C.sub)
373+opNegate :: (String, String)
374+opNegate = (C.dataRing, C.negate)
376+opDiv :: (String, String)
377+opDiv = (C.dataEuclideanRing, C.div)
379+opMod :: (String, String)
380+opMod = (C.dataEuclideanRing, C.mod)
382+opConj :: (String, String)
383+opConj = (C.dataHeytingAlgebra, C.conj)
385+opDisj :: (String, String)
386+opDisj = (C.dataHeytingAlgebra, C.disj)
388+opNot :: (String, String)
389+opNot = (C.dataHeytingAlgebra, C.not)