Re: [Haskell-cafe] Are there standard idioms for lazy, pure error handling?

2009-12-04 Thread Jason McCarty
wren ng thornton wrote: > concat1 :: T a b -> (b -> T a b) -> T a b This could just as easily be concat :: T a b -> (b -> T a c) -> T a c right? It's a little weird to call this concatenation, but I bet it could come in

Re: [Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Jason McCarty
miring. The natural numbers extended with infinity is one example (if you don't take 0*x = 0 as an axiom, I think there are two possibilities for 0*∞). -- Jason McCarty ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Observations about foldM

2009-08-18 Thread Jason McCarty
(\h t -> flip f h >=> t) return xs depending on the monad. But they're both slower than foldM. > foldr1M f (x:xs) = foldrM f x xs > -- foldlM nests to the left: > -- foldlM f z [x1, ..., xn] = (...(flip f x1) >=> ..