16
votes
1answer
2k views

Java monad implementation

I'm learning functional programming and their concept of Monads. I've found nothing more effective in learning than writing an implementation in a programming language I have experience with. I came ...
13
votes
3answers
619 views

Effective use of multiple streams

I am experimenting with streams and lambdas in Java 8. This is my first serious foray using functional programming concepts; I'd like a critique on this code. This code finds the Cartesian product of ...
6
votes
1answer
69 views

Monadic Immutable Linked List in the Least Functional Language Evar

I've written a List monad as an example for a related question. This is a rather frustrating experience as I wanted to use Java, which (as of Java 7) still lacks lambda expressions and lacks ...
3
votes
1answer
80 views

Hangman game background image inefficient?

I'm making a Hangman game and it seems that my code doesn't provide me much freedom with using layouts. I added an image to my JFrame then I added a JPanel to my image which I'm using for all the ...
3
votes
1answer
69 views

Determining maximum profit to be made from selling shares

Question Your algorithms have become so good at predicting the market that you now know what the share price of Wooden Orange Toothpicks Inc. (WOT) will be for the next \$N\$ days. ...
3
votes
2answers
430 views

Format names to title case

So I'm writing a program to format names to title case and display them in alphabetic order. Any advice please? And how can i add more methods? ...
2
votes
1answer
97 views

Implementing logic in a different way

I need to write a function which will do the following functionalities I would get a string and a array as input parameters The string would be like one of the following for example ...