[Haskell-cafe] pointer equality

2011-07-19 Thread Nikhil A. Patil
Hi, Is there any way of getting the following code to immediately return True without performing the element-by-element comparison? Essentially this boils down to checking whether pointers are equal before comparing the contents. > main = print $ f == f > where f = [1..10^9] Thanks!! nikhil

Re: [Haskell-cafe] "import" functionality in DSLs

2011-04-16 Thread Nikhil A. Patil
, that's pretty sweet! Thank you very much! :) nikhil > > > ghci> doit > 12 > > On Sat, Apr 16, 2011 at 7:29 AM, Nikhil A. Patil > wrote: > > > Hi, > > > > I am planning a simple monadic DSL (frankly, calling it a DSL is a bit > >

Re: [Haskell-cafe] "import" functionality in DSLs

2011-04-16 Thread Nikhil A. Patil
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 > wrote: > >> doit :: DSL Term > >> doit = do (+) <- (+) > >>           n0  <- n0 > >>           k   <- k > >>        

[Haskell-cafe] "import" functionality in DSLs

2011-04-16 Thread Nikhil A. Patil
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