Questions tagged [tacit-programming]

Tacit programming is a programming paradigm in which a function definition does not include information regarding its arguments, using combinators and function composition (but not λ-abstraction) instead of variables. The simplicity behind this idea allows its use on several programming languages, such as APL and J.

Wiki

Tacit programming is one of the styles possible in the J and APL programming languages, and means coding by combining functions, without reference to argument names. This idea may have been first brought up in functional programming; it's simpler than lambda calculus.

Tacit programming is also known as point-free style, or pointless programming, because of the lack of explicit arguments, or points.

Example

In J, the same sort of point-free code occurs in a function made to compute the average of a list (array) of numbers:

 avg=: +/ % #

Details: # counts the number of items in the array. +/ sums the items of the array. % divides the sum by the number of items.

Tag usage

The tag can be used for programming related questions in implementation of J and APL programming languages, Question with the tags or can also use tag . Please avoid theoretical questions on Stack Overflow.

Read more

74 questions
1
vote
2 answers

How can I generate the Rowland prime sequence idiomatically in J?

If you're not familiar with the Rowland prime sequence, you can find out about it here. I've created an ugly, procedural monadic verb in J to generate the first n terms in this sequence, as follows: rowland =: monad define result =. 0 $ 0 t…
Gregory Higley
  • 15,923
  • 9
  • 67
  • 96
1
vote
3 answers

J: Self-reference in bubble sort tacit implementation

Since I'm beginner in J I've decided to solve a simple task using this language, in particular implementing the bubblesort algorithm. I know it's not idiomatically to solve such kind of problem in functional languages, because it's naturally solved…
YasirA
  • 9,531
  • 2
  • 40
  • 61
1
vote
2 answers

Why is this J function not running?

I am attempting to learn J and the book I am using says this is the proper way to define a monadic function function =: 3:0 function statements so I followed this format and wrote the folding code. Can you tell me why this is throwing a…
faceless1_14
  • 7,382
  • 9
  • 31
  • 33
1
vote
2 answers

How do I use argument twice in a function in J?

I want to write prime function for purposes of learning J. So far I've come up with this: =&0+/(=&0)(2+i.(-&2)y)|y It's working great except that I should store number in y variable. y=.5 =&0+/(=&0)(2+i.(-&2)y)|y NB. prime cheker 1 …
defhlt
  • 1,775
  • 2
  • 17
  • 24
1
vote
3 answers

J @ not working as expected

I'm just starting to try to pick up the J language, and am confused by the following: 1 2 +/@{ i.4 1 2 +/ 1 2 { i.4 3 when in the documentation for @ it says: "x u@v y ↔ u x v y" I assume I'm just mistaking one part of speech for another, but…
cobbal
  • 69,903
  • 20
  • 143
  • 156
0
votes
0 answers

Standard library/`toolz` equivalent of basic Python functions to convert arguments into interables and vice-versa

I am learning how to properly use toolz and I am looking for something equivalent to: apply_tuple = lambda f: lambda *args: f(args) unpack_tuple = lambda f: lambda args: f(*args) However I cannot find an equivalent in the standard library nor in…
0
votes
1 answer

How to select with jq in an array of values?

I want to select elements >= 3 in an array like [2, 4, 3] with jq, how do I do it? I have found answers when the array contains objects (e.g [{Name:"a", Age:2} ...]}) with things like select (.Age >= 2) but I don't know how to refer to values
Thomas
  • 8,306
  • 8
  • 53
  • 92
0
votes
2 answers

How can I make a combinator with this type signature?

I've been trying to make a combinator with this type signature: (a -> b -> c) -> (c -> d -> e) -> a -> b -> d -> e I've been through Data.Aviary.Birds and all the tacit programming help sites that I can find, but to no avail. Also, if there's a…
APerson
  • 8,140
  • 8
  • 35
  • 49
0
votes
1 answer

Is there a points-free way of filtering out tuples from a list by comparing their elements?

So I have some code which has a requirement of calling xprod with (input, input), similar to as follows: const input = [ { id: 1, data: 'a' }, { id: 2, data: 'b' }, ]; const product = xprod(input, input); /* [ [ { id: 1, data: 'a' }, {…
dvlsg
  • 5,378
  • 2
  • 29
  • 34
0
votes
1 answer

Is there a formal way of proposing/discussing changes to Clojure?

Is there a formal way of proposing/discussing changes to Clojure?
Mario
  • 6,572
  • 3
  • 42
  • 74
0
votes
3 answers

How to refactor this in J?

Here is a different approach for the Project Euler #1 solution: +/~.(3*i.>.1000%3),5*i.>.1000%5 How to refactor it?
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
0
votes
1 answer

Finding integers divisible by x an y in J

Writing my first J program to solver Euler problem #1 (find the sum of all natural numbers below 1000 that are multiples of 3 or 5), I got the following solution: +/(+./0=3 5|/n)#n=.i.1000 However, I pretty sure there is a clever way of doing it,…
Charles Brunet
  • 21,797
  • 24
  • 83
  • 124
0
votes
3 answers

In APL, how can I compute the lowest unused positive integer from a given set of integers?

For example, given 1 8 4 9 0 2 , return 3. Thanks.
Paul Mansour
-12
votes
4 answers

How to write this function in point-free style?

How to rewrite the following function in point-free style, removing the parameter x from the definition completely (the other two may stay): between min max x = (min < x) && (x < max) This is not an assignment, just a question. I don't know how to…
1 2 3 4
5