Re: [Haskell-cafe] Lifting IO actions into Applicatives

2013-10-01 Thread Jose A. Lopes
On Tue, Oct 01, 2013 at 09:29:00AM +0200, Niklas Haas wrote: > On Tue, 1 Oct 2013 02:21:13 -0500, John Lato wrote: > > It's not a solution per se, but it seems to me that there's no need for the > > Monad superclass constraint on MonadIO. If that were removed, we could > > just have > > > > clas

Re: [Haskell-cafe] Template Haskell and Unit

2013-08-29 Thread Jose A. Lopes
> I can't answer about "expected behavior", but I can say that those > two constructions should be considered identical by the $(…) splice > construct. For better or worse, Template Haskell often offers > multiple ways of encoding the same source Haskell phrase, and any > code that processes Templa

[Haskell-cafe] Template Haskell and Unit

2013-08-29 Thread Jose A. Lopes
Hi, I am positive about the following situation, but I can't find any concrete answer on the Web. Can anyone confirm this ? In template-haskell-2.7.0, the following quote [t| () |] appears as a (ConT name), where "name" is the name for unit. However, in template-haskell-2.8.0, the same quote

Re: [Haskell-cafe] Template Haskell

2013-08-27 Thread Jose A. Lopes
Thanks, Jose -- Jose Antonio Lopes Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores Steuernummer: 48/725/00206 Umsatzsteueridentifikationsnumm

[Haskell-cafe] Template Haskell

2013-08-26 Thread Jose A. Lopes
Hi, Is it possible to retrieve all definitions contained in a module using Template Haskell ? Thanks, Jose -- Jose Antonio Lopes Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer:

Re: [Haskell-cafe] Errors with Template Haskell

2013-08-09 Thread Jose A. Lopes
Thank you! -- Jose Antonio Lopes Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores Steuernummer: 48/725/00206 Umsatzsteueridentifikationsnumme

[Haskell-cafe] Errors with Template Haskell

2013-08-09 Thread Jose A. Lopes
Hi, In Template Haskell, what is the proper way of signalling an error ? For example, you are generating code and you detect that a given parameter does not fulfill a precondition (e.g., String is empty), and you want to abort compilation with a descriptive error message. Thanks, Jose -- Jose

Re: [Haskell-cafe] Hoogle problems?

2013-08-01 Thread Jose A. Lopes
It also does not work for me when I try http://www.haskell.org/hoogle But you can cheat ;) Try this one instead http://www.haskell.org/hoogle? I don't know what the problem is; but seeing that some people have it and some people don't, perhaps it's a caching problem... Cheers, Jose On Thu, Au

[Haskell-cafe] Template Haskell and Haddock

2013-07-31 Thread Jose A. Lopes
Hi, Is there a way to access docstrings through Template Haskell ? For example, access the docstring of a function declaration ? Best regards, Jose ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-c

Re: [Haskell-cafe] Reify type

2013-07-12 Thread Jose A. Lopes
Hello, I am getting the following error message: No instance for (Lift Type) arising from a use of `lift' Possible fix: add an instance declaration for (Lift Type) I have imported Language.Haskell.TH.Instances. Is there anything else I have to do ? Regards, Jose _

Re: [Haskell-cafe] Reify type

2013-07-12 Thread Jose A. Lopes
That's exactly what I mean! I'll give it a try. Thanks Michael, Jose ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Reify type

2013-07-12 Thread Jose A. Lopes
Hello everyone, Is there a way to automatically reify a type ? In other words, to do the following: reifyType (LitT ...) = ConT ''LitT ... I am using Template Haskell and I want the generated code to have access to Type datatypes that were available to the Template Haskell code. Cheers, Jose _

Re: [Haskell-cafe] Simplest way to learn FRP through use

2013-06-01 Thread Jose A. Lopes
FRP research http://www.mpi-sws.org/~neelk/ On 01-06-2013 08:43, Christopher Howard wrote: On 05/31/2013 07:47 PM, Tikhon Jelvis wrote: My favorite mini app is John Conway's game of life. I implemented a version with reactive banana and found it perfect for le

Re: [Haskell-cafe] Generalizing unionWithKey, unionWith, ...

2013-05-28 Thread Jose A. Lopes
Yes! intersectionWith is just what I needed. In any case, coming back to your example, why would you want to use undefined in that particular case? What makes it an interesting example ? Best, Jose On 28-05-2013 12:32, Johannes Waldmann wrote: Jose A. Lopes ist.utl.pt> wri

[Haskell-cafe] Generalizing unionWithKey, unionWith, ...

2013-05-28 Thread Jose A. Lopes
Hello everyone, unionWithKey and unionWith have the following types unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a unionWithKey :: Ord k => (k -> a -> a -> a) -> Map k a -> Map k a -> Map k a Since they are implemented by means of mergeWithKey, wouldn't it be possible to g

[Haskell-cafe] List comprehensions with Word8

2013-05-16 Thread Jose A. Lopes
Hello everyone, I was playing with Word8 and list comprehensions and the following examples came up. I have to admit the behavior looks quite strange because it does not seem to be consistent. Can someone shed some light on reason behind some of these outputs? By the way, I have abbreviated some

Re: [Haskell-cafe] Parsing different types, same typeclass

2012-11-18 Thread Jose A. Lopes
Thanks Stephen, that worked out just fine! On 18-11-2012 18:23, Jose A. Lopes wrote: Thanks Stephen. I will try this! On 18-11-2012 17:56, Stephen Tetley wrote: With existentials an "extesible" version might look like this: {-# LANGUAGE ExistentialQuantification #-} {-

Re: [Haskell-cafe] Parsing different types, same typeclass

2012-11-18 Thread Jose A. Lopes
Thanks Stephen. I will try this! On 18-11-2012 17:56, Stephen Tetley wrote: With existentials an "extesible" version might look like this: {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ScopedTypeVariables #-} ... class Action and datatypes A and B the same as before ... -- some

Re: [Haskell-cafe] Parsing different types, same typeclass

2012-11-18 Thread Jose A. Lopes
Hey Chris, Thanks for you reply! So the thing is: I actually had an algebraic data type Action with several constructors, one for each Action. And I was deriving Read so there was no problem there. However, I want to be able to add and remove Actions more easily. That is why I transformed the a