Stefan,
Data.Derive is a most awesome piece of code!
Is there soemething in DrIFT that you did not like that made you
write it?
Thanks a lot!
On Apr 5, 2007, at 12:48 AM, Stefan O'Rear wrote:
Data.Derive can do this. In an attempt to avoid munging the relevent
files they are
Stefan,
What version of ghc are you using? Mine is 6.6.
Data/Derive/Play.hs:9:7:
Could not find module `Control.Monad.State':
it is a member of package mtl-1.0, which is hidden
I commented out that import line.
Preprocessing library derive-0.1...
Preprocessing executables for
On Apr 5, 2007, at 11:04 AM, Joel Reymont wrote:
This is in Language.Haskell.TH.Syntax which is imported at the top
of Data/Derive/TH.hs so I don't understand the cause of the error
Apparently instance Functor Q was added to 6.6 very recently and it's
not in MacPorts yet.
I decided to
That did it, thanks!
On Apr 5, 2007, at 12:07 PM, Twan van Laarhoven wrote:
instance Functor Q where
fmap = liftM
--
http://wagerlabs.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Joel Reymont wrote:
This is in Language.Haskell.TH.Syntax which is imported at the top of
Data/Derive/TH.hs so I don't understand the cause of the error
instance Functor Q where
fmap f (Q x) = Q (fmap f x)
...
Any suggestions?
Since Q is a Monad, you can make the instance
instance
This is in Language.Haskell.TH.Syntax which is imported at the top of
Data/Derive/TH.hs so I don't understand the cause of the error
instance Functor Q where
fmap f (Q x) = Q (fmap f x)
Copying the above into TH.hs gives me
Preprocessing library derive-0.1...
Preprocessing executables for
Joel Reymont wrote:
Folks,
I have very uniform Parsec code like this and I'm wondering if I can
derive it using TemplateHaskell or DrIFT or some other tool. Any ideas?
Others have given good answers on how to use code-generation. I am more
interested in whether code generation is actually
Jules Bean wrote:
data paramType = JNum | JBool | JStr
paramParser JNum = numExpr
paramParser JBool = boolExpr
paramParser JStr = strExpr
unary x pt = reserved (quasiShow (x undefined)) parens (paramParser
pt) = return . x
strCall = choice ( map unary
With derive compiled and installed I thought I would change the code
a bit and try it...
ghci -fth -v0 -e '$( _derive_print_instance makeFunParser
Foo )' baz.hs
baz.hs:30:3: Not in scope: `a1'
Any help is appreciated!
Thanks, Joel
---
FunParser.hs:
module FunParser where
Here's the output from -ddump-splices (thanks Saizan for the tip).
It's returning a1 instead of a0.
ghci -fth -e '$( _derive_print_instance makeFunParser Foo )'
baz.hs -ddump-splices
baz.hs:1:0:
baz.hs:1:0: Splicing declarations
derive makeFunParser 'Foo
==
On Thu, Apr 05, 2007 at 02:47:21PM +0100, Joel Reymont wrote:
Here's the output from -ddump-splices (thanks Saizan for the tip).
It's returning a1 instead of a0.
ghci -fth -e '$( _derive_print_instance makeFunParser Foo )'
baz.hs -ddump-splices
baz.hs:1:0:
baz.hs:1:0: Splicing
On Thu, Apr 05, 2007 at 03:19:15PM +0100, Joel Reymont wrote:
numExpr :: GenParser Char a NumExpr
numExpr =
choice [ integer = return . Int
, float = return . Num
]
Parsec's choice operator works by parsing the first, and only parsing
the second if the first fails
Shouldn't this work just as well?
numExpr =
choice [ try $ float = return . Num
, integer = return . Int
]
It works on Foo(10.345) but not on Bar(10, 103.34).
On Apr 5, 2007, at 4:09 PM, Stefan O'Rear wrote:
numExpr :: GenParser Char a NumExpr
numExpr = do sg -
On Wed, Apr 04, 2007 at 04:48:56PM -0700, Stefan O'Rear wrote:
Data.Derive can do this. In an attempt to avoid munging the relevent
files they are attached.
You might want to note that DrIFT used to be called derive before it
(amicably) changed its name due to a conflict with a product
of the
On Thu, Apr 05, 2007 at 12:14:52AM +0100, Joel Reymont wrote:
Folks,
I have very uniform Parsec code like this and I'm wondering if I can
derive it using TemplateHaskell or DrIFT or some other tool. Any ideas?
Note that
1) The reserved word matches the constructor
2) No arguments
15 matches
Mail list logo