I have just started delving into the world of functional programming.
A lot of OOP (Object Oriented Programming) concepts such as inheritance and polymorphism apply to most modern OO languages like C#, Java and VB.NET.
But how about concepts such as Map, Reduce, Tuples and Sets, do they apply to all FP (Functional Programming) language...
I was wondering if there is anyway to view the reduction steps in haskell, i.e trace the recursive function calls made, for e.g chez scheme provides us with trace-lambda, is there an equivalent form in Haskell, and how to use it?
Thanks,
Shiv
...
I'm considering dipping my toe in the functional programming world, and wondering if it would be better to start with Scala or Haskell. I'm coming at this primarily as a Python programmer. My only real functional programming experience with functional programming is using Scheme in an intro comp-sci class over a decade ago.
Some of th...
I've been reading articles on how to program in a functional (i.e F#) style in C#, for example, foregoing loops for recursion and always returning a copy of a value/object instead of returning the same variable with a new state.
For example, what sort of code inspection things should I watch out for? Is there any way to tell if a metho...
Functional programming is growing quickly. A lot of advices "How to prepare for the future" I've read contain "Learn a functional programming language".
I am new to functional programming. What is its true power? Is it replacing OOP? What fields of programming that functional programming is most powerful? What functional programming la...
I'm going to be teaching a lower-division course in discrete structures. I have selected the text book Discrete Structures, Logic, and Computability in part because it contains examples and concepts that are conducive to implementation with a functional programming language. (I also think it's a good textbook.)
I want an easy-to-underst...
In Python, I'd like to write a function that would pretty-print its results to the console if called by itself (mostly for use interactively or for debugging). For the purpose of this question, let's say it checks the status of something. If I call just
check_status()
I would like to see something like:
Pretty printer status check 0....
I am hoping that an architecture question is reasonable on Stackoverflow, so I am asking this here.
I have been trying to see where a functional language would be useful outside of math-oriented problems, and it dawned on me that an ESB (Enterprise Service Bus) would be perfect for a FP language, as there isn't anything shared between r...
I'm very new to SNL/NJ and was wondering how I could accomplish the following:
foo(stuff,counter)
{
while(counter > 0)
{
bar(stuff);
counter-1;
}
return;
}
Something like this, but how do I decrement?:
foo(stuff,counter) =
while counter > 0 do bar(stuff) ??? // how do I decrement counter here?
...
Hi,
1) Are functional languages suited for web applications development ?
2) Are functional languages suited for business/erp/crm type of applications ?
...
hey guys.
Firstly I can't get my head around the functional / Lambda aspects of .NET 3.5. I use these features everyday in LINQ, but my problem is understanding the implementation, and what they really mean (Lambda? System.Func? etc etc)
With this in mind, how would the following be achieved:
As an example, I'd like to have an Extensi...
Functional languages lead to use of recursion to solve a lot of problems, and therefore many of them perform Tail Call Optimization (TCO). TCO causes calls to a function from another function (or itself, in which case this feature is also known as Tail Recursion Elimination, which is a subset of TCO), as the last step of that function, t...
I have a problem, which I believe to be best solved through a functional style of programming.
Coming from a very imperative background, I am used to program design involving class diagrams/descriptions, communication diagrams, state diagrams etc. These diagrams however, all imply, or are used to describe, the state of a system and the ...
I want to extract a single item from a sequence in F#, or give an error if there is none or more than one. What is the best way to do this?
I currently have
let element = data |> (Seq.filter (function | RawXml.Property (x) -> false | _ -> true))
|> List.of_seq
|> (function head :: [] -> head | head...
I have been experimenting with functional programming and I still dont understand the concept. Do you guys know any good books or tutorials or examples that discuss this concept? Or if you could show small snippets about its usage, that would be great.
...
Can 2 or more equations defining a function in Haskell share the same where / let block?
Let me present a contrived example to illustrate the question.
First, consider the following code as a starting point:
someFunction v1 v2 v3 = difference ^ v3
where
difference = v1 - v2
So far, so good. But then, imagine I need to deal...
I have a question about whether or not a specific way of applying of the DRY principle is considered a good practice in Haskell.I'm going to present an example, and then ask whether the approach I'm taking is considered good Haskell style. In a nutshell, the question is this: when you have a long formula, and then you find yourself needi...
This is not homework. I'm learning Standard ML on my own. I know a bit of Scheme, too, so this question ought to be answerable in either language.
My self-imposed assignment is to write a function that constructs a list of integers from 1 to n. For example, list(7) should return [1,2,3,4,5,6,7]. An O(n) solution would be ideal.
It's ea...
I hear so much hype about F#. What makes functional programming so great? Is it really worth leaning?
...
I can't seem to find a compiler/plugin for mono. Does one exist?
...