fold
Left and Right Folding over an Infinite list
I have issues with the following passage from Learn You A Haskell (Great book imo, not dissing it): One big difference is that right[详细]
2023-04-04 05:22 分类:问答Scala Vector fold syntax (/: and :\ and /:\)
Can someone provide some examples for how /: :\\开发者_开发问答 and /:\\ Actually get used? I assume they\'re shortcuts to the reduce / fold methods, but there\'s no examples on how they actually g[详细]
2023-04-03 14:07 分类:问答Why does fold have the following type in Scala?
I was lo开发者_StackOverflow社区oking at the way fold is defined for immutable.Set: def fold [A1 >: A] (z: A1)(op: (A1, A1) ⇒ A1): A1[详细]
2023-03-26 20:44 分类:问答How to make a foldl on the values returned by a selector in jQuery?
Say I have some HTML elements: <div>First</div> <div>Second</div> <div>Third</div>[详细]
2023-03-12 08:38 分类:问答Using Haskell's map function to calculate the sum of a list
Haskell addm::[Int]->Int addm (x:xs) = sum(x:xs) I was able to achieve to get a sum of a list using sum function but is it po开发者_开发知识库ssible to get the sum of a list using map function?A[详细]
2023-03-09 10:15 分类:问答Excluding computed results from a map of [1..]?
I\'m currently working on a program which computes amicable pairs (Project Euler Problem 21). I\'ve already found the solution, however I noticed that a flaw in my program was that it evaluates all of[详细]
2023-03-09 05:21 分类:问答Can't perform I/O in foldr?
I have a Data.Map structure that maps Strings to Stringss. For whatever reason, I want to print the contents of the map in the format key: value using foldrWithKey, like so:[详细]
2023-03-06 13:39 分类:问答How to do an addition on a list with a condition?
I have a university course about functional programming, where I use SML. As a preparation for the exam, I am working on some of the older exam sets without solutions.[详细]
2023-03-04 06:50 分类:问答How would you define map and filter using foldr in Haskell?
I\'m doing a bit of self study on functional languages (currently using Haskell). I came across a Haskell based assignment which requires defining map and filter in terms of foldr. For the life of me[详细]
2023-02-27 00:03 分类:问答F# -> Fold with 2 parameters
I\'m trying to make a custom fold w开发者_开发百科hich goes through my sequence, and takes 2 Teams a time and assign them to a Match and then return a Match list in the end.[详细]
2023-02-20 21:14 分类:问答