<br><br><br><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><br><meta http-equiv="Content-Style-Type" content="text/css"><br><title></title><br><meta name="Generator" content="Cocoa HTML Writer"><br><style type="text/css"><br>p.p1 {margin: 0.0px 0.0px 0.0px 0.0px}<br>p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px}<br>span.s1 {font-family: 'Helvetica'; font-weight: normal; font-style: normal; font-size: 12.00pt}<br></style><br><br><br><p class="p1"><span class="s1">I think that in Smalltalk a </span></p><p class="p1"><span class="s1">     Haskell Arrow </span></p><p class="p1"><span class="s1">     is just a 1 input valuable plus some composition methods </span></p><p class="p1"><span class="s1"><br></span></p><p class="p1"><span class="s1">     like<span class="Apple-converted-space"> </span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space"><br></span></span></p><br><p class="p1"><span class="s1">>>into: = return a function composition ,<span class="Apple-converted-space"> </span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">     ( f into: g ) = [ :x | g value: ( f value: x ) ]</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space"><br></span></span></p><br><p class="p1"><span class="s1">>>pair: = return a do both functions and return a size 2 Array ,<span class="Apple-converted-space"> </span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">     ( f pair: g ) = [ :x | Array with:( f value: x )with:( g value: x ) ]</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space"><br></span></span></p><br><p class="p1"><span class="s1">>>binOp: = return a binary op on Array ,<span class="Apple-converted-space"> </span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">     ( p binOp: b ) = [ :array | b value:( p value:( array first ) )</span></span></p><p class="p1"><span style="font-family:Helvetica">                                               value:( p value:( array second ) )</span><span style="font-family:Helvetica;font-size:12pt"> ]</span></p><p class="p1"><span style="font-family:Helvetica;font-size:12pt"><br></span></p><br><p class="p1"><span class="s1">>>doAt1 = return a do function on p's Array at:1 and return Array ,<span class="Apple-converted-space"> </span></span></p><p class="p1"><span class="s1">     ( p doAt1 ) = [ :array | array at:1put:( p value: ( array first ) ) ; yourself ]<span class="Apple-converted-space"><br></span></span></p><p class="p1"><span class="s1"><br></span></p><br><p class="p1"><span class="s1">>>doAt2 = return a do function on Array at:2 and return Array ,<span class="Apple-converted-space"> </span></span></p><p class="p1"><span class="s1">     ( p doAt2 ) = [ :array | array </span></p><p class="p1"><span class="s1">                                                 at:2put:( p value: ( array second ) ) ; </span></p><p class="p1"><span class="s1">                                                 yourself ]<---------------[ is faster ]<span class="Apple-converted-space"><br></span></span></p><p class="p1"><span class="s1">     ( p doAt2 ) = ( p swap into: doAt1 ) swap <---------[ it's shorter it's simpler ]</span></p><p class="p1"><span class="s1"><br></span></p><br><p class="p1"><span class="s1">>>swap = return a do p and return Array transposed</span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">     ( p swap ) = [ :x | ( p value: x ) reverse ]</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space"><br></span></span></p><br><p class="p1"><span class="s1">etc ( a 1 input valuable is anything that responds to #value: )</span></p><p class="p1"><span class="s1"><br></span></p><p class="p1"><span class="s1">Haskell seems to get a lot of mileage out of this</span></p><p class="p1"><span class="s1">     kind of Category theoretical </span></p><p class="p1"><span class="s1">     function composition</span></p><p class="p1"><span class="s1">and no doubt the Haskell type system aids in this </span></p><p class="p1"><span class="s1">     and practically Maybe demands it </span></p><p class="p1"><span class="s1">     and makes it really convoluted</span></p><p class="p1"><span class="s1">          they rebelled against lispy simplicity</span></p><p class="p1"><span class="s1">               in order to make it simple   in order to not to scare the newbies</span></p><p class="p1"><span class="s1">          they dumped all the parens overboard </span></p><p class="p1"><span class="s1">          replaced them all with a complicated set of precedent rules</span></p><p class="p1"><span class="s1">          so now you got to have a parser in your head</span></p><p class="p1"><span class="s1">          to read the stuff</span></p><p class="p1"><span class="s1">          and if you don't where you gonna get one</span></p><p class="p1"><span class="s1">          is that guy going to parse it for you     i don't think so</span></p><p class="p1"><span class="s1">          which far from making it easier</span></p><p class="p1"><span class="s1">          for anybody but a rank newbie       a ranking newbie  got to impressem </span></p><p class="p1"><span class="s1">          this induced parserhead requirement on human</span></p><p class="p1"><span class="s1">          Haskell code readers</span></p><p class="p1"><span class="s1">          instead of making it any easier makes it really really hard   out on the deep end</span></p><p class="p1"><span class="s1">          of the pool   there is a tremendous drop off    a under water cliff</span></p><p class="p1"><span class="s1">               where newbies who reach puberty  begin hanging thenselves  out to dry</span></p><p class="p1"><span class="s1">               which doesn't really work     cause they keep getting   all wet</span></p><p class="p1"><span class="s1">          and this may well be a great resistance to</span></p><p class="p1"><span class="s1">          Haskell uptake</span></p><p class="p1"><span class="s1">          and seems to be an endless source of</span></p><p class="p1"><span class="s1">          confusion contusion and discussion as meetup people's</span></p><p class="p1"><span class="s1">          personal Haskell brain pan parsers shift in and out</span></p><p class="p1"><span class="s1">          of true conformity to the standard </span></p><p class="p1"><span class="s1">          as we speak    as we keep on speaking</span></p><p class="p1"><span class="s1">          and </span></p><p class="p1"><span class="s1">               No wait-</span></p><p class="p1"><span class="s1">          s abound</span></p><p class="p1"><span class="s1">          but the people who got a Haskell parser in they head</span></p><p class="p1"><span class="s1">               they say  oh no  I'm not going through That again</span></p><p class="p1"><span class="s1">               No you get a parser in your head </span></p><p class="p1"><span class="s1">               or you're out</span></p><p class="p1"><span class="s1">but i regress  -digress!</span></p><p class="p1"><span class="s1">     The Smalltalk runtime type system makes it a lot</span></p><p class="p1"><span class="s1">     simpler to see what is going on</span></p><p class="p1"><span class="s1">     so i wonder</span></p><p class="p1"><span class="s1">     what effect this kind of function composition</span></p><p class="p1"><span class="s1">     style could have on Smalltalk code</span></p><p class="p1"><span class="s1">Where maybe you have a bunch of Methods</span></p><p class="p1"><span class="s1">     that just return 1 input valuables </span></p><p class="p1"><span class="s1">          ( [ :x | ... ] ,    SomeFunctionClass>>value: ,    etc )</span></p><p class="p1"><span class="s1">     which then get turned into Arrows</span></p><p class="p1"><span class="s1">     and get categorically indubitably </span><span style="font-family:Helvetica">functionally </span><span style="font-family:Helvetica;font-size:12pt">composed</span></p><p class="p1"><span class="s1">who knows what could happen</span></p><p class="p1"><span class="s1"><br></span></p><p class="p1"><span class="s1">the Objects themselves in this functional Smalltalk style could be</span></p><p class="p1"><span class="s1">     mostly empty except for accessors</span></p><p class="p1"><span class="s1">and then stateless Traits </span></p><p class="p1"><span class="s1">     could be the functions</span></p><p class="p1"><span class="s1">or there could be separate stateless functional Classes</span></p><p class="p1"><span class="s1">     that have the stateless functions</span></p><p class="p1"><span class="s1">     which could be pluggable</span></p><p class="p1"><span class="s1">     on multiple different applicable Object Classes</span></p><p class="p1"><span class="s1">          ( kind of a pluggable multiple inheritance thing going on )( ? )</span></p><p class="p1"><span class="s1">because</span></p><p class="p1"><span class="s1">     supposedly </span></p><p class="p1"><span class="s1">     then</span></p><p class="p1"><span class="s1">     you can make new functions</span></p><p class="p1"><span class="s1">     by just using</span></p><p class="p1"><span class="s1">     very simplified </span></p><p class="p1"><span class="s1">          composition expressions</span></p><p class="p1"><span class="s1">          as in the short example above       ( p doAt2 ) = ^(</span><span style="font-family:Helvetica;font-size:12pt"> p swap into: doAt1 ) swap</span></p><p class="p1"><span class="s1">     as opposed to having to know a lot about</span></p><p class="p1"><span class="s1">          all the inputs and all about how the sends are supposed to fit together</span></p><p class="p1"><span class="s1">          involving lots of looking things up over and over</span></p><p class="p1"><span class="s1">     the composition combinators do all that</span></p><p class="p1"><span class="s1">          for you</span></p><p class="p1"><span class="s1">     or so the combinator propaganda goes</span></p><p class="p1"><span class="s1">but is it really true</span></p><p class="p1"><span class="s1">     or do you have to know just as much</span></p><p class="p1"><span class="s1">     or more to actually get the </span></p><p class="p1"><span class="s1">     function combinators to work</span></p><p class="p1"><span class="s1">     or do you have to finally wise up</span></p><p class="p1"><span class="s1">          and get smart</span></p><p class="p1"><span class="s1">          and stop fooling around with writing yet </span></p><p class="p1"><span class="s1">               another monad</span></p><p class="p1"><span class="s1">          tutorial(s) just like all the other ranking newbies     </span><span style="font-family:Helvetica;font-size:12pt">and get serious</span></p><p class="p1"><span class="s1">               and write a brain pan parser compiler</span></p><p class="p1"><span class="s1">          and become a first class tenderfoot</span></p><p class="p1"><span class="s1">     And now you're much worse off</span></p><p class="p1"><span class="s1">          than before</span></p><p class="p1"><span class="s1">          in the time spent column</span></p><p class="p1"><span class="s1">          and you don't even know it</span></p><p class="p1"><span class="s1">          that's the sad part</span></p><p class="p1"><span class="s1">          because the Maybe she's elegance column is calling   sirens calling</span></p><p class="p1"><span class="s1">               clouding your mind with foggy fogged up window pain desires</span></p><p class="p1"><span class="s1">               and you don't even know which end is up anymore</span></p><p class="p1"><span class="s1">               and you want some of that categorical shit</span></p><p class="p1"><span class="s1">               they're having at the big people's table</span></p><p class="p1"><span class="s1">               </span></p><p class="p1"><span class="s1">so is it worth it</span></p><p class="p1"><span class="s1">does it work as advertised </span></p><p class="p1"><span class="s1">  or is it just to be deride</span></p><p class="p1"><span class="s1">i wonder</span></p><br><p class="p2"><span class="s1"></span><br></p><p class="p2"><br></p><p class="p2"><br></p><p class="p2"><br></p><p class="p2"><br></p><p class="p2"><br></p><br><p class="p1"><span class="s1">But i would like it if a </span></p><p class="p1"><span class="s1">     Smalltalk Arrow </span></p><p class="p1"><span class="s1">     could explain itself</span></p><p class="p1"><span class="s1">So an Arrow is just an Object that contains a 1 input valuable</span></p><p class="p1"><span class="s1">     and a BinaryArrow isA Arrow and contains 2 Arrows</span></p><p class="p1"><span class="s1">    </span><span style="font-family:Helvetica;font-size:12pt"> so Arrow>>explainYourself</span></p><p class="p1"><span style="font-family:Helvetica;font-size:12pt">          returns</span></p><p class="p1"><span class="s1">          an Array tree of oneInputValuable source code Strings </span></p><p class="p1"><span class="s1">          which describe how </span></p><p class="p1"><span class="s1">          the Arrow works because otherwise it's just a great big mystery<span class="Apple-converted-space"> </span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">     Arrow</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">          hasA  oneInputValuable <---[ a one input function ]</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">          BinaryArrow isA Arrow</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">               hasA  </span></span><span style="font-family:Helvetica;font-size:12pt">firstArrow</span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">                         secondArrow</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space"><br></span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">But the </span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">     BlockClosure>>into: >>pair: >>binOp: >>at1Do >>at2Do >>swap    etc</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">     and</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">     the</span></span></p><p class="p1"><span class="s1"><span class="Apple-converted-space">     </span></span><span style="font-family:Helvetica">Object>>into: >>pair: >>binOp: >>at1Do >>at2Do >>swap    etc</span></p><p class="p1"><span style="font-family:Helvetica">work too</span></p><p class="p1"><span style="font-family:Helvetica">maybe quicker</span></p><p class="p1"><span style="font-family:Helvetica">     or</span></p><p class="p1"><span style="font-family:Helvetica">     ( anArrow asValuable ) <---[ which gets rid of all the explanation bits ]</span></p><p class="p1"><span style="font-family:Helvetica">                                          <---[ couldn't the Smalltalk compiler optimize this</span></p><p class="p1"><span style="font-family:Helvetica">                                                   functional as it sits ]</span></p><br><p class="p2"><span class="s1"></span><br></p><p class="p2"><br></p><p class="p2"><br></p><p class="p2"><br></p><p class="p2">Haskell is very big on Immutablility</p><p class="p2">     But in Smalltalk exscpecially in the GUI making everything immutable </p><p class="p2">     just doesn't seem right</p><p class="p2">     because you've got all these Objects which are sitting in this web</p><p class="p2">     and they are taking inputs from god knows everywhere</p><p class="p2">     and broadcasting them back out again</p><p class="p2">     so you have the idea of a web of important Objects</p><p class="p2">     with not so important contents which are coming and going</p><p class="p2">     and recording them all all that and saving them all</p><p class="p2">     for posterity just don't seem right</p><p class="p2">     dependent Objects that are interested can note the changes</p><p class="p2"><br></p><br><p class="p1"><span class="s1">In Smalltalk when i want an immutable copy of an </span></p><p class="p1"><span class="s1">     ( Object o ) where o might be changing i just get </span></p><p class="p1"><span class="s1">     ( o copy ) or ( o deepCopy ) to take a snapshot<span class="Apple-converted-space"> of o</span></span></p><br><p class="p1"><span class="s1">     but then you have to keep track of when to take a snapshot</span></p><p class="p1"><span class="s1">     it's true</span></p><br><p class="p2"><span class="s1"></span><br></p><br><p class="p1"><span class="s1">But Smalltalk can have a</span></p><p class="p1"><span class="s1">     Immutable Class </span></p><p class="p1"><span class="s1">     maybe a subClass of ProtoObject?  </span></p><p class="p1"><span class="s1">          to make mixins Object Class complete?</span></p><p class="p1"><span class="s1">     where an ( Immutable m ) is on another ( Object o ) </span></p><p class="p1"><span class="s1">     Immutable </span></p><p class="p1"><span class="s1">          hasA object <---[ object = o ]</span></p><p class="p1"><span class="s1">     and m forwards all Messages to o after </span></p><p class="p1"><span class="s1">     making a copy of itself m and o and returning the copy of itself m unless<span class="Apple-converted-space"> </span></span></p><br><p class="p1"><span class="s1">     ( ( o aMessage ) ~= o ) in which case<span class="Apple-converted-space"> </span></span></p><br><p class="p1"><span class="s1">     ( ( o aMessage ) asImmutable ) is returned</span></p><br><p class="p1"><span class="s1">then you don't have to keep track of when to copy m</span></p><p class="p1"><span class="s1">     but there could be any amount of copying </span></p><p class="p1"><span class="s1">     going on</span></p><p class="p1"><span class="s1">     so hopefully it's not too much</span></p><br><p class="p2"><span class="s1"></span><br></p><br><p class="p1"><span class="s1">Maybe Object>>immutableCopy might be good which </span></p><p class="p1"><span class="s1">     could be called if it is defined? Maybe not Probably not</span></p><br><p class="p2"><span class="s1"></span><br></p><br><p class="p1"><span class="s1">so hopefully the programmer can tell when </span></p><p class="p1"><span class="s1">     copy is Immutable enough and </span></p><p class="p1"><span class="s1">     when an Immutable wrapper is ok good</span></p><p class="p1"><span class="s1"><br></span></p><p class="p1"><span class="s1"><br></span></p><p class="p1"><span class="s1"><br></span></p><br><br><br>