On 4/16/11 9:55 AM, Felipe Almeida Lessa wrote:
On Sat, Apr 16, 2011 at 10:29 AM, Nikhil A. Patil
patil.nik...@gmail.com wrote:
doit :: DSL Term
doit = do (+)- (+)
n0- n0
k- k
-- begin beautiful DSL code
let x = k + n0
return $ x + x
I
Hi,
I am planning a simple monadic DSL (frankly, calling it a DSL is a bit
of a stretch; it's just a somewhat glorified state monad), and I wish to
implement some kind of import functionality for it.
The DSL code looks something like this:
doit :: DSL Term
doit = do (+) - define_function + 2
On Sat, Apr 16, 2011 at 10:29 AM, Nikhil A. Patil
patil.nik...@gmail.com wrote:
doit :: DSL Term
doit = do (+) - (+)
n0 - n0
k - k
-- begin beautiful DSL code
let x = k + n0
return $ x + x
I guess the core problem is that on each time
On Sat, Apr 16, 2011 at 08:55 CDT, Felipe Almeida Lessa wrote:
On Sat, Apr 16, 2011 at 10:29 AM, Nikhil A. Patil
patil.nik...@gmail.com wrote:
doit :: DSL Term
doit = do (+) - (+)
n0 - n0
k - k
-- begin beautiful DSL code
let x = k + n0
You can get away with this using {-# LANGUAGE RecordWildCards #-}, if you
put your prelude into a record. Here's a test I did to make sure the
technique worked:
{-# LANGUAGE RecordWildCards #-}
import Prelude hiding ((+))
data Foo = Foo {
(+) :: Int - Int - Int,
n0 :: Int
}
prelude
On Sat, Apr 16, 2011 at 13:49 CDT, Luke Palmer wrote:
You can get away with this using {-# LANGUAGE RecordWildCards #-}, if you
put your prelude into a record. Here's a test I did to make sure the
technique worked:
{-# LANGUAGE RecordWildCards #-}
import Prelude hiding ((+))
data Foo