53m
comment Infinite type error when defining zip with foldr only; can it be fixed?
@CarstenKönig no matter; but won't I need mutually recursive types here? is it much different from what you've added there? (btw I assumed the "weaving" instead of zipping in that OP's code was an error on their part)
59m
comment Infinite type error when defining zip with foldr only; can it be fixed?
@CarstenKönig thanks! (also, that wasn't my question...)
1h
comment Least squares for circle detection
@AlicjaWasik good news; please accept one of the answers, that which was most helpful to you. this will show that the issue is resolved, and also will give you a +2 rep boost. :)
7h
revised Infinite type error when defining zip with foldr only; can it be fixed?
added 59 characters in body
8h
asked Infinite type error when defining zip with foldr only; can it be fixed?
9h
revised Why Haskell doesn't accept my combinatoric "zip" definition?
deleted 47 characters in body
9h
revised Why Haskell doesn't accept my combinatoric "zip" definition?
added 1871 characters in body
11h
answered Why Haskell doesn't accept my combinatoric "zip" definition?
11h
comment Implement zip using foldr
also, left fold that can stop early is foldlWhile t f a xs = foldr cons id xs a where cons x r a = if t x then r (f a x) else a
1d
comment Prolog Program To Check If A Number Is Prime
you're most welcome (though I personally didn't do much here); I'm sure you'll pay it forward whenever it's possible for you.
1d
comment Prolog Program To Check If A Number Is Prime
I've rolled back to the original edition; the latter edit changed the code completely, should have been a new question.
2d
revised Least squares for circle detection
added 72 characters in body
2d
answered Least squares for circle detection
Apr
23
comment Is there any fast way to generate the pairs of cartesian coordinates ordered by their product?
... and the accepted answer there looks correct in that there's no need to add the SW child to the PQ, just S and W should be enough!
Apr
22
comment Is there any fast way to generate the pairs of cartesian coordinates ordered by their product?
@Viclib I knew I've already answered something very similar once! see this for an actual Haskell code for another algorithm; it also contains additional hint how to speed it up by another factor of 2 (xy==yx, so work on a triangular half of the square, only - also halves the space needed).
Apr
22
comment Is there any fast way to generate the pairs of cartesian coordinates ordered by their product?
@greybeard and the question opens with "I want to generate the pairs of cartesian coordiantes inside a bounded square ordered by their product in descending order. " i.e. it does talk about generating the "pairs", plural. -- the OP then says "Is there any way to generate this list fast" again, talking about generating the whole list. Thus my reading of it.
Apr
22
comment Is there any fast way to generate the pairs of cartesian coordinates ordered by their product?
@greybeard what other answer here gives that mapping?
Apr
22
awarded Nice Answer
Apr
21
revised Is there any fast way to generate the pairs of cartesian coordinates ordered by their product?
added 166 characters in body
Apr
21
comment Is there an equivalent to a nested recursive function in C?
@Jean-ClaudeArbaut myself, I'm coming more from the Lisp world; full closures there are quite involved (check out the "funarg problem", leading to the necessity to maintain a tree of stack frames, not just a list). Hopefully you don't need the full sophistication.
1 2 3 4 5