Re: [Haskell-cafe] A question regarding reading CPP definitions from a C header

2013-10-07 Thread Carl Howells
Have you looked into using hsc2hs? If I understand your problem, it's designed exactly to solve it. -- Carl On Mon, Oct 7, 2013 at 12:20 PM, Ömer Sinan Ağacan omeraga...@gmail.comwrote: Thanks for your answer, looks like this is my only option to do this. Can you provide some information

Re: [Haskell-cafe] Alternative versus Monoid

2011-12-15 Thread Carl Howells
Monoid and Alternative are not the same. There is a very important difference between them: class Alternative f where (|) :: f a - f a - f a ... class Monoid a where mappend :: a - a - a ... The equivalent to Alternative is MonadPlus, not Monoid. The kinds matter. In

Re: [Haskell-cafe] Splitting off many/some from Alternative

2011-12-12 Thread Carl Howells
There is absolutely no implication of consuming anything in the definitions of many or some. This is how they happen to behave when used in the context of some parsing libraries, but that's all. If many or some always go into an infinite loop for some Alternative instance, then I suspect that

Re: [Haskell-cafe] Splitting off many/some from Alternative

2011-12-12 Thread Carl Howells
Don't be silly. The purpose of some and many is to be used with combinators that are expected to fail sometimes. If you use them with combinators that always succeed, of course you're going to get an infinite loop. Would you propose to ban recursive functions because they might not terminate?

Re: [Haskell-cafe] pointer equality

2011-07-20 Thread Carl Howells
On Tue, Jul 19, 2011 at 11:14 PM, yi huang yi.codepla...@gmail.com wrote: 2011/7/20 Eugene Kirpichov ekirpic...@gmail.com reallyUnsafePointerEq#, and it really is as unsafe as it sounds :) Why is it so unsafe? i can't find any documentation on it. I think always compare pointer first is a

Re: [Haskell-cafe] The Typeable class is changing

2011-07-11 Thread Carl Howells
This will affect snap-core and heist, of the things I've provided Typeable instances for. In snap-core, deriving makes it use the internal module name, rather than the canonical location of the type. This causes issues with the Hint library, so it's worked around by using a manual instance of

Re: [Haskell-cafe] Examples for the problem

2011-03-02 Thread Carl Howells
Actually, It's not | that's different, it's the string combinator. In Parsec, string matches each character one at a time. If the match fails, any partial input it matched is consumed. In attoparsec, string matches either the entire thing or not, as a single step. If it fails to match, no input

Re: [Haskell-cafe] IO, sequence, lazyness, takeWhile

2010-12-19 Thread Carl Howells
] ^CInterrupted. After a while, I got bored and interrupted it. Anyway. There's no documentation on the (non-)strictness of sequence, because it isn't actually defined. It depends on the choice of m. Carl Howells On Sun, Dec 19, 2010 at 1:58 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote

Re: [Haskell-cafe] Haskellers.com profiles: advice requested

2010-10-06 Thread Carl Howells
Complete side note: it's kind of funny that OpenID let's you specify some completely arbitrary string to appear in the resulting webpage[2]. Any server with that behavior is out of spec. Operating securely requires checking the return_to value against the trust_root, and checking that the

Re: [Haskell-cafe] Can't make a derived instance of `Typeable (A B)': `A' has arguments of kind other than `*'

2010-09-24 Thread Carl Howells
(* - *) - *. You'll have to manually write a Typeable instance if you want one. The process is somewhat trickier than you might expect, due to the fact that Typeable does some unsafe stuff. But there are plenty of examples for how to do it safely. Enjoy the fun of not having kind polymorphism! Carl Howells

[Haskell-cafe] MonadCatchIO and bracket.

2010-06-28 Thread Carl Howells
), but it could be left out in cases where it doesn't make sense, like ListT IO, even though MonadCatchIO makes sense there. Carl Howells ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe