TH bug: Lift (a - b) where

2004-05-21 Thread Saswat Anand
Hello, I dont know if it has been reported, this looks like a bug in TH. The program goes into infinite loop. Saswat - instance Lift (a - b) where lift f = [| f |] compile :: (a - b) - ExpQ compile p = lift p printE :: ExpQ - IO () printE expQ = do exp - unQ expQ

Re: Newbie building GHC

2002-09-24 Thread Saswat Anand
I ran strace with -ff option. Attached is the trace file. I can see many No such file or directory in the trace. Can you see the problem? Thanks Saswat g Description: Binary data

RE: Newbie building GHC

2002-09-23 Thread Saswat Anand
Hi I am also facing the same problem. I tried to build a virgin tree, but with no success as Simon PJ has pointed out. I have attached my strace file. Saswat On Mon, 23 Sep 2002, Simon Marlow wrote: I have been trying to build GHC, but the ghc.exe that gets built for ghc-inplace

RE: meta-haskell-branch

2002-09-17 Thread Saswat Anand
Thanks for the pointer. I still get the following error, when I do gmake. echo '#!/bin/sh' ghc-inplace echo exec /root/fptools/ghc/compiler/ghc-5.05 '-B/root/fptools' '$@' ghc-inplace chmod 755 ghc-inplace

-O2

2002-04-15 Thread Saswat Anand
Hi, In my program I observe that, with -O2 flag turned on, Program 1 behaves like Program 2. And without O2, their outputs are different. Is it the desirable behaviour? For my program, I did not expect the optimizer to do this transformation. Thanks, Saswat Program 1: eval = \..-

All Segments Problem

2002-02-28 Thread Saswat Anand
Hi All, This is not a haskell problem.I need some pointers which some of you might provide. In program calculation community, segement problems e.g. maximum sum problemhave been studiedextensively. The problems involve finding a segment of the list that maximizes some objective function

RE: Why is (monad) elegance so costly?

2001-11-02 Thread Saswat Anand
Hi, I feel embarrased when I post newbie questions after one year of decent Haskell programming. But it feels much better to ask than to suffer in ignorance. My newbie question is: Could anyone explain why the second version of the following function is better. Is there a tutorial kind of

A small doubt

2001-10-19 Thread Saswat Anand
Hi, I am wondering why this function should not work with input [x,y] (list with two elements) too, since third element is not referenced. Why is it so eager to pattern match. fun = \list - let [a,b,c] = list in [a,b] Thanks, Saswat

How to read heap Profile?

2001-10-05 Thread Saswat Anand
Hi, Ghc doc does not say much about how to read the heap profile (.hp file). Could somebody explain. And how can one tell from the graph generated by hp2ps if the program has space leak. Thanks, Saswat ___ Glasgow-haskell-users mailing list

Re: Small confusion with monads

2001-10-04 Thread Saswat Anand
Unsafely you can write: import IOExts contents :: [String] - [String] content = unsafePerformIO . sequence . (map readFile) Saswat ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

streching storage manager

2001-09-28 Thread Saswat Anand
Hi, I need some pointers and suggestion in the following problem: I have a very large time-series data. I need to perform some operation on that. At any instant of time, I only need a window-full of data, size of window being known. Starting from the first point, I slide the window towards

Re: streching storage manager

2001-09-28 Thread Saswat Anand
The downside is that accessing elements within the window will take time O(window size). Are the windows large enough that this is a concern? Yes windows are quite large and elements need to be accessed very frequently. As regard to Marcin's suggestion of using a list of compact arrays,

Profiling Question

2001-09-23 Thread Saswat Anand
Hi, In the following profile, should not the sum of %time and %alloc be less than or equal to 100. It is not in this case. What do they mean then? Thanks, Saswat total time = 324.38 secs (16219 ticks @ 20 ms) total alloc = 4,577,009,108 bytes (excludes profiling

Type Problem

2001-09-16 Thread Saswat Anand
Hi, I am wondering how can I pass an overloaded function as a parameter to another function. Consider the following example. I want to tell the compiler that the argument `fun' in `trickyFun' definition is always either ord' or chr', and hence it can find the correct overloaded version in

Profiling with -O2

2001-08-14 Thread Saswat Anand
Hi, When I am trying to compile my prgram with -prof -auto-all -O2, It fails saying: Failed to find interface decl for But it is fine if I compile with either profiling or optimization options alone. Are they not supposed to work together? Thanks, Saswat

Functional Dependency

2001-06-06 Thread Saswat Anand
Hi,I am trying to define a commutative operator :(%+) :: a - b - c(%+) :: b - a - c instead of defining a class and instantiating twice every time, I am trying to do the following: class Commutative a b c where(%+) :: a - b - c class Operation a b c | a b - c where(%+%) :: a - b - c

Seq ??

2001-06-04 Thread Saswat Anand
In ghc-5.00.1, seq (2/0) 3 gives 3. Should it not give error. Hugs does. Thanks, S ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Instance Declaration discrepancy

2001-06-02 Thread Saswat Anand
class MyShow a where sh :: a - String instance (Integral a) = Show a where sh = Integer + show a Ghc 5.00.1 (with -fglasgow-exts) does not accept the above, while hugs with extensions has no problem with this. Is it a bug? Thanks, S ___

Re: Instance Declaration discrepancy

2001-06-02 Thread Saswat Anand
I am sorry for the typos. It should have been instance (Integral a) = Show a where sh a = Integer ++ (show a) class MyShow a where sh :: a - String instance (Integral a) = Show a where sh = Integer + show a Ghc 5.00.1 (with -fglasgow-exts) does not accept the above,

-fno-implicit-prelude

2001-06-01 Thread Saswat Anand
does not work with ghci-5.00. Shouldn't it? Thanks, S ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

fatal error: interpretBCO

2001-05-17 Thread Saswat Anand
I get the following error with one of my programs. ghc5.00: fatal error: interpretBCO: unknown or unimplemented opcode Is it a bug? I am using i386-unknown-linux binary on SuSE 7.0. Thanks, Saswat ___ Glasgow-haskell-bugs mailing list [EMAIL

problem with installing ghc-5.00 from .hc file

2001-04-16 Thread Saswat Anand
I am trying to install ghc-5.00 from .hc files on windows NT. But I get the following error. It seems Package.hc is missing. Please help. BTW when the windows binaries will be on sale? Thanks, Saswat ==fptools== make all

Fast Reading from File

2001-04-09 Thread Saswat Anand
I have a need to read large lists of numbers from a file and operate on them. I tried the following: read' =do s - readFile "temp" print $ sum $ map (fst.head.readDec)(lines s) But this is quite slow even for 1000 numbers. Are there any other ways to do it faster? Will it help

ghc hdirect on windows

2001-03-27 Thread Saswat Anand
I am trying to install ghc and hdirect on windows. But I have failed miserably. Initially I was able to install and run ghc, but after failing to run hdirect examples i did some changes to environment settings, and now none of them work. I also tried reinstalling both. 1. If I do mount c: /

Can Class do this?

2001-03-06 Thread Saswat Anand
I have a problem as follows - type CF = Char - Float type IF = Integer - Float type CIF = (Char,Integer) - Float There be two functions: fun :: CF fun = fromInt.ord sun :: IF sun = fromInteger I want the followings to be valid. x :: IF x = sun \+ sun y :: IF y = sun \+ sun \+ sun --

Re: Can Class do this?

2001-03-06 Thread Saswat Anand
Thanks a lot. It works great with Hugs. But it has a small problem. I also want to be able to write 4 \+ fc :: CF fc \+ 4 :: CF ic \+ 4 :: IF 4 \+ fc \+ ic :: CIF Well for that I did this, instance (Rational a) = Plus a CF CF where --to support 4.0 \+ fc f \+ g = \c - (realToFrac f)

Lifting to the limit

2001-02-16 Thread Saswat Anand
Dear All, I have this following simplified problem. Please help. type Formula a b = a - b type Env = (Integer,Char) fun :: Formula Integer Integer fun n = n+1 sun :: Formula Char Integer sun c = toInteger.ord c I want to be able to write (sun + fun) (2,'a') (fun + sun) (2,'a')

A simple problem

2001-01-18 Thread Saswat Anand
class C a where fun :: a - Integer instance C Integer where fun x = x+ 1 with these definitons: fun 3 --gives error in Hugs fun (3::Integer) -- OK I am a building an embedded language, so don't want user to cast. Is there a solution? Thanks, Saswat