Raul Miller-4 wrote:
> 
> On Sat, Jan 16, 2010 at 9:47 PM, Viktor Cerovski
> <[email protected]> wrote:
>> In one of my posts I surmised that tacit verb programming
>> should be an instance of monadic computations, where monadic
>> is meant in the Haskell sense of the word.  Since the claim
>> is that monads are all-pervasive, just not usually seen as
>> such, it's interesting to recognize which, if any, J programs
>> could be proved to be (instances of) monadic computations.
> 
> I do not know about this claim.
> 
I'll address this in a moment.


> I understand that a monadic system pervades all functions
> used within that system.[...]
> 
That's true and important to emphasize: to fully use monads
in the Haskell sense of the word, we need a language that
supports what Haskell does: typed lambda calculus and
parametric types to begin with, or something equivalent to
that.

So I'm not trying to define Haskell monads in J settings, that,
as I gather from surfing the web, seems to me impossible to 
properly do in any of the other "standard" languages (the list is 
long), but only to find an example of some operations that could 
be considered as instances of Haskell monads.


[...]  But I do not know if that matches
> the sense of the claim you were referring to.
> 
What I meant by all-pervasiveness is something different---let's 
consider a much simpler example, that of commutativity: we say 
that since a+b = b+a for any a and b, + is commutative.

In that sense one can claim that commutativity is all-pervasive: 
it pops up as a(n algebraic) property of some operations 
regardless of whether the language is imperative, functional, 
OO, etc, or whether we call those operations functions, methods 
or verbs.

Monads are considerably more tricky, because at first
glance, they are trying to solve a problem that does not even
appear as a problem in imperative languages.  Once this has
been accomplished, however, there is suddenly a powerful way 
of talking about various types of programs, be they sequential 
or not.



>> The fruitful part of the endeavor was that, in order for
>> any combination of verbs and conjunctions to become
>> instances of monadic computations, three extensions
>> of J parsing rules would suffice:
>>
>> 1)  CONJ ADV VN * --> CONJ (VN ADV) * *
> ...
>> 2)  END ADV CONJ VN1 VN2  -->  END VN1 CONJ VN2 ADV
> ...
> 
> I would like to see useful examples of these.
> 
> Number 2, especially, seems convoluted.
> 

No 1 would provide means to define tacit conjunctions,
albeit very simple ones.   No 2 surely does look strange
and out of sync with other rules at first glance.

Both would boost tacit programming.  I both like tacit
programming and do share views of yours and others 
about its practicality, so I've been working towards more 
powerful and practical tacit programming, and got various 
backward-compatible extensions of J.  In the last two weeks 
I think I finally solved a whole bunch of problems at more 
or less once, and I should look at these three rules first 
in the context of this ongoing investigations.



>> 3) This extension is pertinent specifically to the
>>   example of ("_) as Lift and @ or @: as Bind, namely:
>>
>>   f @ x  ===  f x       f @: x  === f x
> 
> We already have a bind conjunction in J
> which does exactly that.
> 
> I have also wished that @ would implement
> this functionality directly.
> 
> -- 
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Monads-and-Categories-in-J-tp27195812s24193p27209309.html
Sent from the J Programming mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to