Applicative functors other than monads and ZipList?
Two well-known examples of applicatives are monads and ziplists. Are there any other examples? ...
Two well-known examples of applicatives are monads and ziplists. Are there any other examples? ...
I read the mapreduce at http://en.wikipedia.org/wiki/MapReduce ,understood the example of how to get the count of a "word" in many "documents". However I did not understand the following line: Thus the MapReduce framework transforms a list of (key, value) pairs into a list of values. This behavior is different from the functional pro...
Is there any standard documentation (like UML for OO) for functional languages? After downloading couch db which is written in erlang and looking at the source code I was shocked, there is hardly a line of documentation. Is there no need to document how all these functions depend on each other? Are there better documented medium size pro...
Hello, I am trying to create an overloaded Add method as an extension to the OrderedDictionary class and would like to add the key/value based on some curried predicate. The calling code would look like this: OrderedDictionary dict = new OrderedDictionary(); Predicate<int> lessThan5 = i=>; i < 5; Predicate<string> lenOf2 = s=> s.le...
Recently Erik Meijer and others have show how IObservable/IObserver is the dual of IEnumerable/IEnumerator. The fact that they are dual means that any operation on one interface is valid on the other, thus providing a theoretical foundation for the Reactive Extentions for .Net Do other dual interfaces exist? I'm interested in any exampl...
In F#, what is the difference between functions "Seq.collect" and "Seq.map"? They seem equivalent from the description on MSDN. ...
(I finally posted and accepted an answer to the effect of "no, there isn't, and the question isn't actually that general".) Consider the Common Lisp function 'mapcar'. It takes a function and some lists as arguments, and calls the function with arguments pulled from the same position in each list. Do standard libraries typically have a...
In R. Kent Dybvig's paper "Three Implementation Models for Scheme" he speaks of "FFP languages" and "FFP machines". Apparently there is some correlation between FFP machines, and string-reduction on multiple processors. Googling doesn't really uncover much in terms of explanations or examples. Can anyone shed some light on this topic? ...
Why does Haskell's sort of Data.List ignore the third digit? Prelude>sort ["1","200","234","30"] ["1","200","234","30"] EDIT: Sorry, I did not realized that were string. My fault. ...
monads are described as the haskell solution to deal with IO. I was wondering if there were other ways to deal with IO in pure functional language. ...
I would like to learn F#, mentally wise, it is a different way of programming, how would you shift away from the OOP paradigm in learning the functional aspects of the language itself? I know I run the risk of getting this closed as it is subjective... Any tips/advice would be appreciated. Best regards, Tom. ...
On Page 175 Paragraph 1 of Effective C++ Meyers has this to say about generalized functors and binding: I find what tr1::function lets you do so amazing, it makes me tingle all over. If you're not tingling , it may be because you're staring at the definition of ... and wondering what's going on with the .... And I agree w...
I recently heard about F# in coming. I wonder why .NET world need another programming language ? What the deal? Is there a problem that C# cant solve and F# can? Is F# a dynamic language? [Update :Be careful not to confuse type inference with dynamic typing. Although F# allows you to omit types when writing code, that doesn’t mean...
When my friend started learning Prolog in school, I made fun of him for learning a useless language. However, he's showed me some stuff I never even knew possible; I want to know where this technique comes from. The technique is this: permutation(List) :- isAMember(X, List), deleteFirstElement(X, List, Substring), % and so...
I wonder what this means in F#. “a function taking an integer, which returns a function which takes an integer and returns an integer.” But I don't understand this well. Can anyone explain this so clear ? [Update]: > let f1 x y = x+y ;; val f1 : int -> int -> int What this mean ? ...
I was reading this article by Tomas Petricek, and it mentioned the pipelining |> as in the example given: > let nums = [1; 2; 3; 4; 5];; val nums : list<int> > let odds_plus_ten = nums |> List.filter (fun n-> n%2 <> 0) |> List.map (add 10) val odds_plus_ten : list<int> = [11; 13; 15];; What does pipelining m...
I would like to learn a functional programming language to see a different programming paradigm. My background in programming: Java (I have just passed the SCJP exam), some ruby and very limited Rails. I use bash for basic sysadmin tasks. I use Ubuntu 9.04. As a second goal I would like to use fp to show kids (14-18 years olds) how mat...
It may sound like a stupid idea but I was just wondering if there is an equivalent of DDD in FP? It seems to me that DDD is only valid in OOP paradigm. Thanks. ...
I know in Prolog you can do something like someFunction(List) :- someOtherFunction(X, List) doSomethingWith(X) % and so on This will not iterate over every element in List; instead, it will branch off into different "machines" (by using multiple threads, backtracking on a single thread, creating parallel universes or what...
Possible Duplicate: Open file in ML(SMLNJ) I have a string value which has value like this: "[(1,2,3),(2,3),(6,8)]" -> string but I want to have these values in int type like this: [(1,2,3),(2,3),(6,8)] -> (int list) list what should I do?is there any function which can help me? or I have to do it myself? ...