Skip to main content
Computer Science

Questions tagged [functional-programming]

Functional programming is a programming paradigm which primarily uses functions as means for building abstractions and expressing computations that comprise a computer program.

Filter by
Sorted by
Tagged with
-2 votes
0 answers
21 views

how to make conditional formatting formula for changing color if cell stays blank?

An excel cell is already conditioned to be yellow if blank -> how to make formula for conditional formatting if the cell stays same blank tomorrow and beyond than the cell color changes from yellow ...
4 votes
0 answers
119 views

Mathematical explanation and functional pearls

There is a well-established philosophical line of inquiry into mathematical explanation, the idea that, while all sound proofs justify a theorem, some can be more or less (or differently) explanatory. ...
3 votes
0 answers
42 views

What is a minimal set of combinators capable of performing any tree permutation in a linear setup?

Let's define a Tree of Ints as: data Tree = Node Tree Tree | Leaf Int Let X be a source tree, and ...
1 vote
0 answers
47 views

Why does the G-machine push arguments before the function for application (MKAP)?

I'm reading The implementation of functional programming languages (1987) by Peyton Jones and he mentions (p.307) that the MKAP (make application) instruction is more convenient if the argument is ...
1 vote
1 answer
49 views

Do cumulative type universes also contain *values*, or just types?

Apologies if this is obvious, but I can't seem to find an explicit answer to this anywhere. I know that the hierarchy of type universes contain each other, such that Type0 belongs to Type1, and also ...
0 votes
0 answers
64 views

Why [b] → Int < a → Int holds according to the contravariant manner for function types but length is a counter example for that

In the paper Practical type inference for arbitrary-rank types, the covariance and contravariance rules are essential when dealing with function types. Covariance applies to the return types of ...
4 votes
3 answers
750 views

Functor composition rule necessary?

Sorry if this is a dumb question, but I don't quite understand the composition rule for functors.I see how the identity rule makes sense, as mapping the functor over the id function shouldn't change ...
2 votes
1 answer
126 views

Is Calling a Function a Side Effect

I've noticed a pattern in trying to make functional programming effective - there is still some kind of impure, effectful operation going on, but it gets holed up in a single, manageable imperative ...
1 vote
1 answer
87 views

Understanding how lazy functional languages achieve IO (...sometimes?)

An Alternative view of I/O programs, popular in earlier lazy functional programming languages, was to see the input and output as Strings, that is as lists of characters. Under that model an I/O ...
0 votes
1 answer
155 views

Free variable in the programming language

From the wikipedia of Free variables and bound variables In computer programming, the term free variable refers to variables used in a function that are neither local variables nor parameters of that ...
0 votes
1 answer
67 views

What are the non-overlapping properties of a function?

Specifically, properties that identify preconditions over which a function can be used without resulting in undefined behavior or data races. For example, I am familiar with 3 important properties: ...
2 votes
1 answer
84 views

Is there any reference materials on complexity analysis for lazy languages?

Is there any books, papers or articles on how to analyze the time complexity of programs written in lazy languages such as Haskell? I know how laziness is implemented and how it can be expanded and ...
1 vote
2 answers
113 views

(how) is assignment or binding possible in purely functional languages?

i can't seem to find much info on the following question: how (if at all) is the fixing of names to values (by binding or assignment) possible in a purely functional system like the lambda calculus? i'...
0 votes
0 answers
93 views

Representation of pairs in System F

System F defines the data type pair as: $$X\times Y := \Pi Z. (X\to Y \to Z)\to Z$$ with: $$\langle x,y \rangle := \Lambda Z. \lambda p^{X\to Y\to Z}.p \text{ }x\text{ } y$$ Projections are defined: $$...
0 votes
1 answer
65 views

time complexity of loops

what is the time complexity of: for (i = 1; i <= n; i = 2*i) for (j = 0; j < i; j++) sum++; ? I thought it is O(nlogn) since the otter loop ...

15 30 50 per page
1
2 3 4 5
...
27

AltStyle によって変換されたページ (->オリジナル) /