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
3
votes
1 answer

takeWhile to test length of nested lists

I'm new to Haskell, and trying to do the following: takeWhile (length < 3) [[1],[1,2],[1..3],[1..4]]. But this gives an error which I believe is because takeWhile would test length < 3 [1] instead of length [1] < 3, which is what would work. Do I to…
TheStrangeQuark
  • 2,257
  • 5
  • 31
  • 58
3
votes
2 answers

How do I map & filter this in a point-free style

Dear StackOverflowers… I have a set of posts: const posts = [ { title: 'post1', tags: ['all', 'half', 'third', 'quarter', 'sixth']}, { title: 'post2', tags: ['all', 'half', 'third', 'quarter', 'sixth']}, { title: 'post3', tags: ['all', 'half',…
3
votes
3 answers

Arithmetic mean forwards vs backwards?

I'm familiar with this way of doing an arithmetic mean in J: +/ % # But it's also shown here as # %~ +/ Are these two versions interchangeable, and if not when should I use one versus the other?
Alex Shroyer
  • 3,499
  • 2
  • 28
  • 54
3
votes
1 answer

Why do I not get the correct answer for Euler 56 in J?

I've solved 84 of the Project Euler problems, mostly in Haskell. I am now going back and trying to solve in J some of those I already solved in Haskell, as an exercise in learning J. Currently, I am trying to solve Problem 56. Let me stress that I…
Gregory Higley
  • 15,923
  • 9
  • 67
  • 96
3
votes
1 answer

Is tacit programming possible in the statistical programming language R?

Is tacit programming also known as point-free style - an option in R?
v217
  • 765
  • 1
  • 6
  • 17
3
votes
1 answer

Setting the rank of a user-defined verb in J

Here's a function to calculate the digital sum of a number in J: digitalSum =: +/@:("."0)@": If I use b. to query the rank of this verb, I get _ 1 _, i.e., infinite. (We can ignore the dyadic case since digitalSum is not dyadic.) I would like the…
Gregory Higley
  • 15,923
  • 9
  • 67
  • 96
3
votes
2 answers

How do I define a monadic function to work on a list in J?

Let's say I have the following J expression: # 3 ((|=0:)#]) 1+i.1000 This counts the number of numbers between 1 and 1000 that are evenly divisible by 3. (Now, before anyone points out that there's an easier way to do this, this question is about…
Gregory Higley
  • 15,923
  • 9
  • 67
  • 96
3
votes
1 answer

Why the difference between type signatures of the same F# function in module vs class?

Closely related to my question here, but actually a different question... Consider the following F#:- type TestClass() = let getValFromMap m k = Map.find k m let mutable someMap : Map = Map.empty let getValFromMapPartial key…
Bellarmine Head
  • 3,397
  • 2
  • 22
  • 31
3
votes
2 answers

Why does this point-free F# function behave differently from the non-point-free version?

Consider the following F#:- type TestClass() = let getValFromMap m k = Map.find k m let addToMap map k i = map |> Map.add k i let mutable someMap : Map = Map.empty let getValFromMapPartial key = getValFromMap someMap…
Bellarmine Head
  • 3,397
  • 2
  • 22
  • 31
3
votes
1 answer

J: Gauss-Jordan elimination

Task to code Gauss-Jordan method of solving linear system of algebraic equations is an exercise that I've selected to advance in learning J. System is Ax=b, where A is n-by-n matrix, b and unknown x are n-vectors. Firstly, I've started with the…
Dan Oak
  • 704
  • 1
  • 7
  • 26
3
votes
1 answer

Is tacit programming possible in Rust?

Are some of the Haskell idioms of tacit programming translatable to Rust?
v217
  • 765
  • 1
  • 6
  • 17
3
votes
1 answer

Number of different rolls of K N-sided dice

I needed to calculate the number of different possible rolls that could arise from rolling K dice, each with N-sides. My definition of roll is that something like {1, 1, 2, 3, 4} is equivalent to {1, 4, 3, 1, 2} (order doesn't matter), but not to…
algorithmshark
  • 267
  • 2
  • 9
3
votes
2 answers

How to refactor this in J?

My newbie solution to Project Euler #1 +/((0=3|1+i.1000-1) +. (0=5|1+i.1000-1)) * (1+i.1000-1) I know that this can be refactored, and transformed into a function, i don't know how to do it, and I would have to read all the labs to learn it.
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
3
votes
2 answers

what is a good tacit form of sum(1/(1+x)^y) in J

As a beginner exercise I tried to calculate the following sum in J, sum(1/(1+0.03)^n for n = 1 to 30 using +/%(1 + 0.03)^ >:i.30. How can I write this into a simple tacit form? all I tried are significantly uglier than the explicit form above like…
ahala
  • 4,683
  • 5
  • 27
  • 36
3
votes
2 answers

Is a train in J associative

In programming language J, is a train of verbs always associative? If it is, Are there any proofs?
ahala
  • 4,683
  • 5
  • 27
  • 36