@@ -95,8 +95,19 @@ literals = mkPattern' match'
9595 ]
9696 match (App _ (App _ (App _ (Indexer _ (Var _ fn) (Var _ fnMod)) [Indexer _ (Var _ dict) (Var _ dictMod)]) [x]) [y])
9797 | fnMod == dictMod
98− , dictMod == C.dataEq || dictMod == C.dataSemiring || dictMod == C.dataRing ||
99− dictMod == C.dataEuclideanRing || dictMod == C.dataHeytingAlgebra || dictMod == C.dataOrd
98+ , dictMod == C.dataEq || dictMod == C.dataOrd
99+ , Just op <- renderOp fn
100+ , Just t <- unboxType dict
101+ = mconcat <$> sequence
102+ [ return $ emit $ unbox' t x
103+ , return $ emit op
104+ , return $ emit $ unbox' t y
105+ ]
106+ match (App _ (App _ (App _ (Indexer _ (Var _ fn) (Var _ fnMod)) [Indexer _ (Var _ dict) (Var _ dictMod)]) [x]) [y])
107+ | not (isLiteral x) && not (isLiteral y)
108+ , fnMod == dictMod
109+ , dictMod == C.dataSemiring || dictMod == C.dataRing ||
110+ dictMod == C.dataEuclideanRing || dictMod == C.dataHeytingAlgebra
100111 , Just op <- renderOp fn
101112 , Just t <- unboxType dict
102113 = mconcat <$> sequence
@@ -500,13 +511,13 @@ implHeaderSource mn imports _ =
500511 "package " <> (if mn == "Main" then "main" else mn) <> "\n\n" <>
501512 "import . \"purescript\"\n" <>
502513 (if mn == "Main"
503− then "import \"purescript_ffi\"\n"
514+ then "import \"ffi\"\n"
504515 else "") <>
505516 T.concat imports <> "\n" <>
506517 "type IGNORE_UNUSED_IMPORTS = bool\n" <>
507518 "type _ = IGNORE_UNUSED_RUNTIME\n" <>
508519 (if mn == "Main"
509− then "\nconst _ = purescript_ffi.Loader\n\n"
520+ then "\nconst _ = ffi.Loader\n\n"
510521 else "\n")
511522
512523implFooterSource :: Text -> [Ident] -> Text