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
3 votes
0 answers
33 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
39 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
38 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
52 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
718 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
111 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
77 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
139 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
52 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
73 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
99 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
77 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
54 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 ...
-1 votes
1 answer
225 views

Call by value is known as pure function how ?give reason

I think call by value may be pure function or impure function... And pure function can be written through call by value or call by reference.... So according to the facts (c) should be correct ans......
4 votes
1 answer
85 views

What is the object translating part of a monadic endofunctor?

A monad is an endofunctor $T:C\rightarrow C$ with natural transformations $\eta:id_C\rightarrow T$ and $\mu:T^2\rightarrow T$. Being natural transformations mean that $$T(f)\circ \eta_A = \eta_B\circ ...

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

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