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 wrote: > Thanks for your answer, looks like this is my only option to do this. > > Can you provide some information about what does par

[Haskell-cafe] MonadCatchIO and bracket.

2010-06-28 Thread Carl Howells
-> m c) -> m c This would allow its definition in cases where it makes sense (Snap or MaybeT IO), 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

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
Enjoy the fun of not having kind polymorphism! Carl Howells On Fri, Sep 24, 2010 at 1:18 PM, Christopher Done wrote: > Suppose I have a data type: > > data A f = A { a :: f Integer } > > why can't I derive a Typeable instance like so? > > deriving instance Typeable (A Maybe

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 r

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

2010-12-19 Thread Carl Howells
uence (map return $ repeat 5) :: IO [Int] ^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

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 inpu

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 Typ

Re: [Haskell-cafe] pointer equality

2011-07-19 Thread Carl Howells
On Tue, Jul 19, 2011 at 11:14 PM, yi huang wrote: > 2011/7/20 Eugene Kirpichov >> >> 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 good optimization. False positives a

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 th

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 terminat

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 Alt