combinators
How to Merge two Observables so the result completes when the any of the Observables completes?
I have this code: var s1 = new Subject<Unit>(); var s2 = new Subject<Unit>(); var ss = s1.Merge(s2).Finally(() => Console.WriteLine(\"Finished!\"));[详细]
2023-02-08 14:15 分类:问答Y Combinator in Scheme using Define
In order to learn what a fixed-point combinator is and is used for, I wrote my own. But instead of writing it with strictly anonymous functions, like Wikipedia\'s example, I just used define:[详细]
2023-02-03 23:22 分类:问答Backtracking in scala parser combinators?
It seems like scala\'s parser combinators don\'t backtrack. I have a grammar (see bottom) which can\'t parse the following \"stmt\" correctly:[详细]
2023-02-03 08:42 分类:问答returning meaningful error messages from a parser written with Scala Parser Combinators
I try to write a parser in scala using Parser Combinators. If I match recursively, def body: Parser[Body] =[详细]
2023-01-30 16:32 分类:问答Remove duplicates from list
I have datatype: data SidesType = Sides Int Int Int deriving (Show) And I need a function which get a list of SidesType and remove duplicates from it.[详细]
2023-01-28 20:45 分类:问答How would you (re)implement iterate in Haskell?
iterate :: (a -> a) -> a -> [a] (As you probably know) iterate is a function that takes a function and starting value. Then it applies the function to the starting value, the开发者_StackOve[详细]
2023-01-17 16:29 分类:问答foldl is tail recursive, so how come foldr runs faster than foldl?
I wanted to test foldl vs foldr. From what I\'ve seen you should use foldl over foldr when ever you can due to tail reccursion optimization.[详细]
2023-01-11 01:46 分类:问答Haskell map/zip Vs. list comprehension
Which of the following are you most likely to write? r = zip xs $ map sqrt xs or r = [(x, sqrt x) | x <- xs][详细]
2023-01-06 11:34 分类:问答foldl versus foldr behavior with infinite lists
The code for the myAny function in this question uses foldr.It stops processing an infinite list when the predicate is satisfied.[详细]
2023-01-04 07:56 分类:问答Scala: Can I nudge a combinator parser to be locally greedy?
Suppose I have an ambiguous language expressed in combinator parser. Is there a way to make certain expressions locally greedy? Here\'s an example of what I mean.[详细]
2022-12-26 04:54 分类:问答