File tree Expand file tree Collapse file tree 5 files changed +9
-28
lines changed
Expand file tree Collapse file tree 5 files changed +9
-28
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ module Main where
44 import Control.Monad.Eff
55 import Debug.Trace
66
7- bar :: String -> String -> String
87 bar = \s1 s2 -> s1 ++ s2
98
109 test1 :: forall n. (Num n ) => n -> n -> (n -> n -> n ) -> n
@@ -27,6 +26,8 @@ module Main where
2726
2827 test6 = ((\x -> x) `k ` 2) 3
2928
29+ (<>) = \s1 s2 -> s1 ++ s2
30+
3031 test7 = " Hello" <> " World!"
3132
3233 (@@) :: forall a b. (a -> b ) -> a -> b
Original file line number Diff line number Diff line change @@ -325,25 +325,13 @@ module Prelude where
325325 (|| ) = boolOr
326326 not = boolNot
327327
328- infixr 6 <>
329-
330- class Semigroup s where
331- (<>) :: s -> s -> s
332-
333328 infixr 5 ++
334329
335- (++) :: forall s . (Semigroup s ) => s -> s -> s
336- (++) = (<>)
337-
338- foreign import concatString
339- " function concatString(s1) {\
340- \ return function(s2) {\
341- \ return s1 + s2;\
342- \ };\
343- \}" :: String -> String -> String
344-
345- instance semigroupString :: Semigroup String where
346- (<>) = concatString
330+ foreign import (++) " function $plus$plus(s1) {\
331+ \ return function(s2) {\
332+ \ return s1 + s2;\
333+ \ };\
334+ \}" :: String -> String -> String
347335
348336module Data.Eq where
349337
Original file line number Diff line number Diff line change @@ -29,9 +29,6 @@ module Language.PureScript.Constants where
2929(++) :: String
3030(++) = " ++"
3131
32- (<>) :: String
33- (<>) = " <>"
34-
3532(>>=) :: String
3633(>>=) = " >>="
3734
@@ -149,9 +146,6 @@ pokeSTArray = "pokeSTArray"
149146monadEffDictionary :: String
150147monadEffDictionary = " monadEff"
151148
152- semigroupString :: String
153- semigroupString = " semigroupString"
154-
155149numNumber :: String
156150numNumber = " numNumber"
157151
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ optimize opts | optionsNoOptimizations opts = id
6464 , inlineOperator (C. $) $ \ f x -> JSApp f [x]
6565 , inlineOperator (C. #) $ \ x f -> JSApp f [x]
6666 , inlineOperator (C. !!) $ flip JSIndexer
67+ , inlineOperator (C. ++) $ JSBinary Add
6768 , inlineCommonOperators ]
6869
6970untilFixedPoint :: (Eq a ) => (a -> a ) -> a -> a
Original file line number Diff line number Diff line change @@ -83,10 +83,7 @@ inlineOperator op f = everywhere (mkT convert)
8383
8484inlineCommonOperators :: JS -> JS
8585inlineCommonOperators = applyAll
86- [ binary C. semigroupString (C. ++) Add
87- , binary C. semigroupString (C. <>) Add
88-
89- , binary C. numNumber (C. +) Add
86+ [ binary C. numNumber (C. +) Add
9087 , binary C. numNumber (C. -) Subtract
9188 , binary C. numNumber (C. *) Multiply
9289 , binary C. numNumber (C. /) Divide
You can’t perform that action at this time.
0 commit comments