Re:Running a Startup on Haskell
by Dn_Ab on Monday October 31, 2011 @11:16PM
(#3180454)
The higher order monadic join concept cannot be implemented in java but a simpler function in terms of flattening a list of list is easy enough. In a functional language a simple way would be to fold over (++) append.
so in java a simple way would be to initialize an l = arrayList and then do a foreach on each list in the list of the lists and foreach element in each list add it to the arrayList l. Not as elegant, much more how instead of what but 4 noisy lines max.
so in java a simple way would be to initialize an l = arrayList and then do a foreach on each list in the list of the lists and foreach element in each list add it to the arrayList l. Not as elegant, much more how instead of what but 4 noisy lines max.
C# has list.selectMany( _ => _ ) for that.