Re: [Haskell-cafe] Transforming a ADT to a GADT

2012-09-14 Thread Tsuyoshi Ito
Dear Florian, On Fri, Sep 14, 2012 at 6:45 AM, Florian Lorenzen florian.loren...@tu-berlin.de wrote: Now, I'd like to have a function typecheck :: Exp - Maybe (Term t) typecheck exp = ... that returns the GADT value corresponding to `exp' if `exp' is type correct. If you can add “deriving

[Haskell-cafe] Is there a tool for automatic update of other-extensions and other-modules sections in a .cabal file?

2012-09-01 Thread Tsuyoshi Ito
Hello, I have a *.cabal file which contains a package description for several executables (which share some of the source files). Is there a tool which updates other-extensions section and other-modules section in the .cabal file automatically to synchronize them to the source files? If it

Re: [Haskell-cafe] Plain lambda inside banana brackets in the arrow notation

2012-07-15 Thread Tsuyoshi Ito
On Fri, Jul 13, 2012 at 8:11 AM, Ross Paterson r...@soi.city.ac.uk wrote: On Thu, Jul 12, 2012 at 02:47:57PM +0100, Ross Paterson wrote: Though one possibility that might get us most of the way there would be to refactor the Arrow class as class PreArrow a where premap :: (b - b') - a

Re: [Haskell-cafe] Plain lambda inside banana brackets in the arrow notation

2012-07-15 Thread Tsuyoshi Ito
On Sun, Jul 15, 2012 at 6:30 PM, Ross Paterson r...@soi.city.ac.uk wrote: Silly me -- that code works with the current GHC (module attached). Aha! Now I see why the GHC documentation states “the arrows involved need not be the same” in the section about banana brackets. After all, I was wrong

Re: [Haskell-cafe] Plain lambda inside banana brackets in the arrow notation

2012-07-06 Thread Tsuyoshi Ito
Dear Ertugrul, Thank you for your input. To answer your question: Arrow notation has no support for what you want, so if you stick with it you will have to write the inner proc explicitly. Oh. I was afraid of that. However: The code may look much nicer, if you use applicative style for

[Haskell-cafe] Plain lambda inside banana brackets in the arrow notation

2012-07-05 Thread Tsuyoshi Ito
Hello, In a program, I have an arrow MyArr and a combinator called repeat of the following type: repeat :: Int - (Int - MyArr e a) - MyArr e a My problem is that the code becomes messy when I use this combinator inside the arrow notation, and I am looking for a way to write the code in a

[Haskell-cafe] Can we write a parser with both name resolution and error handling by using Happy?

2012-04-29 Thread Tsuyoshi Ito
Hello, I have a question about Happy, the parser generator. Section 2.1 of Happy User Guide explains a neat trick to perform the name resolution inside a parser by turning the semantic values of nonterminal symbols into Reader monads.