Skip to content

Commit e9313e2

Browse files
committed
Eta-expand all the things to help optimizer
1 parent 8be2c78 commit e9313e2

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

src/Effect/Uncurried.purs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132

133133
module Effect.Uncurried where
134134

135-
import Data.Function (($))
136135
import Data.Monoid (class Monoid, class Semigroup, mempty, (<>))
137136
import Effect (Effect)
138137

@@ -190,61 +189,61 @@ foreign import runEffectFn10 :: forall a b c d e f g h i j r.
190189
EffectFn10 a b c d e f g h i j r -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> Effect r
191190

192191
instance semigroupEffectFn1 :: Semigroup r => Semigroup (EffectFn1 a r) where
193-
append f1 f2 = mkEffectFn1 $ runEffectFn1 f1 <> runEffectFn1 f2
192+
append f1 f2 = mkEffectFn1 \a -> runEffectFn1 f1 a <> runEffectFn1 f2 a
194193

195194
instance semigroupEffectFn2 :: Semigroup r => Semigroup (EffectFn2 a b r) where
196-
append f1 f2 = mkEffectFn2 $ runEffectFn2 f1 <> runEffectFn2 f2
195+
append f1 f2 = mkEffectFn2 \a b -> runEffectFn2 f1 a b <> runEffectFn2 f2 a b
197196

198197
instance semigroupEffectFn3 :: Semigroup r => Semigroup (EffectFn3 a b c r) where
199-
append f1 f2 = mkEffectFn3 $ runEffectFn3 f1 <> runEffectFn3 f2
198+
append f1 f2 = mkEffectFn3 \a b c -> runEffectFn3 f1 a b c <> runEffectFn3 f2 a b c
200199

201200
instance semigroupEffectFn4 :: Semigroup r => Semigroup (EffectFn4 a b c d r) where
202-
append f1 f2 = mkEffectFn4 $ runEffectFn4 f1 <> runEffectFn4 f2
201+
append f1 f2 = mkEffectFn4 \a b c d -> runEffectFn4 f1 a b c d <> runEffectFn4 f2 a b c d
203202

204203
instance semigroupEffectFn5 :: Semigroup r => Semigroup (EffectFn5 a b c d e r) where
205-
append f1 f2 = mkEffectFn5 $ runEffectFn5 f1 <> runEffectFn5 f2
204+
append f1 f2 = mkEffectFn5 \a b c d e -> runEffectFn5 f1 a b c d e <> runEffectFn5 f2 a b c d e
206205

207206
instance semigroupEffectFn6 :: Semigroup r => Semigroup (EffectFn6 a b c d e f r) where
208-
append f1 f2 = mkEffectFn6 $ runEffectFn6 f1 <> runEffectFn6 f2
207+
append f1 f2 = mkEffectFn6 \a b c d e f -> runEffectFn6 f1 a b c d e f <> runEffectFn6 f2 a b c d e f
209208

210209
instance semigroupEffectFn7 :: Semigroup r => Semigroup (EffectFn7 a b c d e f g r) where
211-
append f1 f2 = mkEffectFn7 $ runEffectFn7 f1 <> runEffectFn7 f2
210+
append f1 f2 = mkEffectFn7 \a b c d e f g -> runEffectFn7 f1 a b c d e f g <> runEffectFn7 f2 a b c d e f g
212211

213212
instance semigroupEffectFn8 :: Semigroup r => Semigroup (EffectFn8 a b c d e f g h r) where
214-
append f1 f2 = mkEffectFn8 $ runEffectFn8 f1 <> runEffectFn8 f2
213+
append f1 f2 = mkEffectFn8 \a b c d e f g h -> runEffectFn8 f1 a b c d e f g h <> runEffectFn8 f2 a b c d e f g h
215214

216215
instance semigroupEffectFn9 :: Semigroup r => Semigroup (EffectFn9 a b c d e f g h i r) where
217-
append f1 f2 = mkEffectFn9 $ runEffectFn9 f1 <> runEffectFn9 f2
216+
append f1 f2 = mkEffectFn9 \a b c d e f g h i -> runEffectFn9 f1 a b c d e f g h i <> runEffectFn9 f2 a b c d e f g h i
218217

219218
instance semigroupEffectFn10 :: Semigroup r => Semigroup (EffectFn10 a b c d e f g h i j r) where
220-
append f1 f2 = mkEffectFn10 $ runEffectFn10 f1 <> runEffectFn10 f2
219+
append f1 f2 = mkEffectFn10 \a b c d e f g h i j -> runEffectFn10 f1 a b c d e f g h i j <> runEffectFn10 f2 a b c d e f g h i j
221220

222221
instance monoidEffectFn1 :: Monoid r => Monoid (EffectFn1 a r) where
223-
mempty = mkEffectFn1 mempty
222+
mempty = mkEffectFn1 \_ -> mempty
224223

225224
instance monoidEffectFn2 :: Monoid r => Monoid (EffectFn2 a b r) where
226-
mempty = mkEffectFn2 mempty
225+
mempty = mkEffectFn2 \_ _ -> mempty
227226

228227
instance monoidEffectFn3 :: Monoid r => Monoid (EffectFn3 a b c r) where
229-
mempty = mkEffectFn3 mempty
228+
mempty = mkEffectFn3 \_ _ _ -> mempty
230229

231230
instance monoidEffectFn4 :: Monoid r => Monoid (EffectFn4 a b c d r) where
232-
mempty = mkEffectFn4 mempty
231+
mempty = mkEffectFn4 \_ _ _ _ -> mempty
233232

234233
instance monoidEffectFn5 :: Monoid r => Monoid (EffectFn5 a b c d e r) where
235-
mempty = mkEffectFn5 mempty
234+
mempty = mkEffectFn5 \_ _ _ _ _ -> mempty
236235

237236
instance monoidEffectFn6 :: Monoid r => Monoid (EffectFn6 a b c d e f r) where
238-
mempty = mkEffectFn6 mempty
237+
mempty = mkEffectFn6 \_ _ _ _ _ _ -> mempty
239238

240239
instance monoidEffectFn7 :: Monoid r => Monoid (EffectFn7 a b c d e f g r) where
241-
mempty = mkEffectFn7 mempty
240+
mempty = mkEffectFn7 \_ _ _ _ _ _ _ -> mempty
242241

243242
instance monoidEffectFn8 :: Monoid r => Monoid (EffectFn8 a b c d e f g h r) where
244-
mempty = mkEffectFn8 mempty
243+
mempty = mkEffectFn8 \_ _ _ _ _ _ _ _ -> mempty
245244

246245
instance monoidEffectFn9 :: Monoid r => Monoid (EffectFn9 a b c d e f g h i r) where
247-
mempty = mkEffectFn9 mempty
246+
mempty = mkEffectFn9 \_ _ _ _ _ _ _ _ _ -> mempty
248247

249248
instance monoidEffectFn10 :: Monoid r => Monoid (EffectFn10 a b c d e f g h i j r) where
250-
mempty = mkEffectFn10 mempty
249+
mempty = mkEffectFn10 \_ _ _ _ _ _ _ _ _ _ -> mempty

0 commit comments

Comments
 (0)