Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Doesn't tacit programming correspond pretty closely to combinator logic or <strike>pointless</strike> point-free style in Haskell? For instance, while I don't know J from what I gather a "fork" translates three functions <code>f</code>, <code>g</code>, and <code>h</code> and an argument <code>x</code> into an expression <code>g (f x) (h x)</code>. The operation of "apply multiple functions to a single argument, then apply the results to each other in sequence" is a generalization of <strike>Curry's</strike> Schönfinkel's <strong>S</strong> combinator and in Haskell corresponds to the <code>Applicative</code> instance of the Reader monad.</p> <p>A <code>fork</code> combinator in Haskell such that <code>fork f g h x</code> matches the result specified above would have the type <code>(t -&gt; a) -&gt; (a -&gt; b -&gt; c) -&gt; (t -&gt; b) -&gt; t -&gt; c</code>. Interpreting this as using the Reader functor <code>((-&gt;) t)</code> and rewriting it for an arbitrary functor, the type becomes <code>f a -&gt; (a -&gt; b -&gt; c) -&gt; f b -&gt; f c</code>. Swapping the first two arguments gives us <code>(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c</code>, which is the type of <code>liftA2</code>/<code>liftM2</code>.</p> <p>So for the common example of computing the average, the fork <code>+/ % #</code> can be translated directly as <code>flip liftA2 sum (/) (fromIntegral . length)</code> or, if one prefers the infix <code>Applicative</code> combinators, as <code>(/) &lt;$&gt; sum &lt;*&gt; fromIntegral . length</code>.</p> <blockquote> <p>If not, is there a technical issue that makes this impossible, or is it just not worth doing?</p> </blockquote> <p>In Haskell at least, I think the main issue is that extremely point-free style is considered obfuscated and unreadable, particularly when using the Reader monad to split arguments.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload