Talk:Man or boy test: Difference between revisions

→‎Haskell version: Good thought, and a little faster too. (your liftM2 is still the fastest of all)
(Haskell version – could drop the Control.Monad import with `pure (+) <*> x4 <*> x5` in lieu of the liftM2 line)
(→‎Haskell version: Good thought, and a little faster too. (your liftM2 is still the fastest of all))
 
(2 intermediate revisions by 2 users not shown)
Line 129:
:: liftM2 (+) x4 x5 is equivalent to pure (+) <*> x4 <*> x5
: [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 00:08, 14 March 2017 (UTC)
:: Tho in fact I notice that the applicative reformulation seems to run a little slower … [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 00:17, 14 March 2017 (UTC)
::: What about:
:::: <code>(+) <$> x4 <*> x5</code>
::: Not sure if that's more readable than the <code>liftM2</code> version, but arguably more idiomatic nowadays. &mdash;''[[User:Ruud Koot|Ruud]]'' 08:42, 14 March 2017 (UTC)
:::: Good thought, and a little faster too. Perhaps your first instinct is right though ? liftM2 is not unreadable, and still seems to be the fastest of the three. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 11:53, 14 March 2017 (UTC)
9,655

edits