Reply: Z_n in Haskell

2002-03-31 Thread Serge D. Mechveliani
Hello, Hal Daume III <[EMAIL PROTECTED]> writes about Z_n in Haskell: > Suppose I want to define integers modulo n, I could do this something > like: > data Zn = Zn Integer Integer -- modulus, number > > instance Num Zn where >(Zn m1 n1) + (Zn m2 n2) > | m1 == m2 = Zn m1 (n1 + n2 `

Re: sort inefficiency

2002-04-02 Thread Serge D. Mechveliani
Glenn G. Chappell <[EMAIL PROTECTED]> writes > I am wondering about a design decision in the List module. > > To wit: "sort", in both the H98 library report and the Hugs file > List.hs, is implemented using a quadratic sort (insertion sort). > > Using the name "sort" certainly suggests that this

docon-2.04 announcement

2002-04-09 Thread Serge D. Mechveliani
Announcement The Algebraic Domain Constructor DoCon-2.04, a computer algebra program written in Haskell, is available at http://www.botik.ru/pub/local/Mechveliani/docon/2.04/ ftp.botik.ru/pub/local/Mechveliani/docon/2.04/ What is new --- * Performancec tests for

read int lists

2002-04-30 Thread Serge D. Mechveliani
Dear Haskellers, There is certain site (contact [EMAIL PROTECTED] ) where some computer algebra programs are gathered and compared. I submit here my CA program DoCon written in Haskell. And they require certain large set of tests to fill in. It appears also that many of the tests concern Haske

finding sublist

2002-05-02 Thread Serge D. Mechveliani
Thanks to people who helped me with the task >> Import two space separated columns of integers from file. Claus Reinke <[EMAIL PROTECTED]> recommends to exploit `lines'. Indeed, it bocomes shorter now: main = readFile "data" >>= (putStr . show . twoIntLists) where twoIntLists str =

e :: Double

2002-05-02 Thread Serge D. Mechveliani
Please, has Haskell e :: Double ( ~= limit (1 + 1/n)^n ) in its standard library? - Serge Mechveliani [EMAIL PROTECTED] ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

e = exp 1

2002-05-02 Thread Serge D. Mechveliani
I wrote about e :: Double for the Library. It can be obtained as exp 1, but I wonder whether it is good for the library to add the `e' denotation. - Serge Mechveliani [EMAIL PROTECTED] ___ Haskell mailing list [EMAIL PROTECTED] ht

Re: finding sublist

2002-05-06 Thread Serge D. Mechveliani
On Mon, May 06, 2002 at 09:30:02AM +0200, Ketil Z. Malde wrote: > "Garner, Robin" <[EMAIL PROTECTED]> writes: > > > See Dijkstra's 'Discipline of Programming' for an o(M + N) algorithm - naive > > approches are o(MN) where M and N are the length of the list and substring > > respectively. > > >

Re: GMP from haskell

2002-05-29 Thread Serge D. Mechveliani
> Hal Daume III <[EMAIL PROTECTED]> writes: > > The gnu web page > (www.gnu.org/manual/gmp-4.0.1/html_node/gmp_70.html) claims that Haskell > (GHC) has bindings to GMP. Is this true? How can I access these > routines? Some Haskell systems mention that they use GMP to implement many functions

state of Standard

2003-03-14 Thread Serge D. Mechveliani
Dear Haskellers, Could you, please, tell me what is the recent state of the Haskell Standard development? I have a wish for the Standard Library: FiniteMap, Set (of GHC library). And I have a question on the function name overloading, and on the record field name overloading. A language

let (d,k) = (g x y, h x d) ..

2003-06-27 Thread Serge D. Mechveliani
Dear Haskellers, Once I wrote a function f' :: Int -> Int -> Int -> (Int, Int) f' n m l = let (d,k) = (gcd n m, quot n d) in (k, l*k) (the simplified version of real program), placing erroneousely d to both parts of the pattern matching (d,k) = ... The intended program was f n m

access to fields in nested records

2003-11-05 Thread Serge D. Mechveliani
Dear Haskellers, My question is about a nice way to provide a getting/setting access to the nested record fields. Example: --- data House = House {houseNo:: Int, diningRoom :: DiningRoom

let-where difference

2003-12-22 Thread Serge D. Mechveliani
The program f = [ 1, 2, (a+b where a = 1 b = 2 ) ] is qualified by some compilers as a wrong syntax. And f = [ 1, 2, (let a = 1 b = 2 in a+b ) ] is accepted. What ma

data label overloading

2004-01-13 Thread Serge D. Mechveliani
Dear Haskellers, It is desirable to have shorter names for the data labels. Making a module out of a labeled data declaration does not look convenient. Providing the corresponding class operation is not always convenient. Maybe, future Haskell language could apprehend some special construct, li

Re: data label overloading

2004-01-14 Thread Serge D. Mechveliani
To my recent suggestion on the field label overloading > > ... > > data Foo1 = Foo1 {size :: Int ...} > > data Foo2 = Foo2 {size :: Int ...} > > ... > > f x y z = let size = Foo1..size in > >(size x)+(size y)+(Foo2..size z) > Hal Daume III wrote on Jan

[Haskell] Re: sizeFM type

2004-04-26 Thread Serge D. Mechveliani
e worth bothering > the programmer about. On Sun, 2004-04-25 Serge D. Mechveliani wrote to glasgow-haskell-users > > > Dear GHC developers, > > > > > > Probably, it is better to provide Integer > > > or

Re: [Haskell] Re: sizeFM type

2004-04-26 Thread Serge D. Mechveliani
On Mon, Apr 26, 2004 at 04:06:22PM +0100, Philippa Cowderoy wrote: > On Mon, 26 Apr 2004, Serge D. Mechveliani wrote: > > > Alexander is right. > > > > Also as Integer has more sense than Int, > > > > To ask a silly question, is Int defined as 32 bits or

Re: [Haskell] Re: sizeFM type

2004-04-26 Thread Serge D. Mechveliani
On Mon, Apr 26, 2004 at 10:09:18PM +0200, Ketil Malde wrote: > "Serge D. Mechveliani" <[EMAIL PROTECTED]> writes: > > > Alexander is right. > > > > Also as Integer has more sense than Int, > > I would suggest for the future standard Haskell

[Haskell] lazy printing

2004-09-10 Thread Serge D. Mechveliani
Dear Haskellers, Can you tell me how to force Haskell to output the results in a `lazy' way? Consider, for example, the program main = putStr (concat ["\n min1 = ", show min1, "\n min2 = ", show min2, "\n" ]

Re: [Haskell] lazy printing

2004-09-10 Thread Serge D. Mechveliani
To my request > > Can you tell me how to force Haskell to output the results in a > > `lazy' way? > [..] > > main = putStr (concat ["\n min1 = ", show min1, > >"\n min2 = ", show min2, > >"\n" > > ] > >

[Haskell] factoring `if'

2004-10-11 Thread Serge D. Mechveliani
Dear Haskell implementors, How do you think, is the program (1) equivalent to (2) in the meaning of Haskell-98 ? (1) (\ x -> (if p x then foo (g x) else foo (h x)) where p ... g ... h ... foo ... ) (2) (\ x -> foo ((if p x then g x else h x)

[Haskell] Re: factoring `if'

2004-10-11 Thread Serge D. Mechveliani
Thanks for the help! People note that in my example of > > (1) (\ x -> (if p x then foo (g x) else foo (h x)) ...) > > > > (2) (\ x -> foo ((if p x then g x else h x)) ) p x may be _|_, and this makes (1) not equivalent to (2). - Serge Mechveliani [EMAIL PROTECTED]

[Haskell] -allow-extension-for-bottom

2004-10-11 Thread Serge D. Mechveliani
Dear Haskell implementors, Consider the compilation flag -allow-extension-for-bottom which changes the language meaning so that allows to ignore the bottom value. For example, the programs (1) (\ x -> (if p x then foo (g x) else foo (h x)) ) and (2) (\ x -> foo ((if p x then g x

[Haskell] lazy constructors

2004-10-12 Thread Serge D. Mechveliani
Dear Haskellers, I try to organize a `lazy' output in my program, so that the data are accumulated, step by step in a pair (String, String) (a contrived simplified example). And the first component is a `story' to be printed out in a `lazy' manner, the

[Haskell] DoCon-2.08 announcement

2004-12-20 Thread Serge D. Mechveliani
Announcement A Computer Algebra program DoCon-2.08 is released: http://www.botik.ru/~mechvel/ click at docon-2.08 (Russian site), ftp.botik.ru/pub/local/Mechveliani/docon/ (same), http://www.haskell.org/docon/distr

[Haskell] `Dumatel' software announcement

2005-05-16 Thread Serge D. Mechveliani
A N N O U N C E M E N T D u m a t e l a prover program based on equational reasoning, Version 1.02 is available, together with its source program and manual book, at the following addresses: http://www.botik.ru/~mechvel/papers.html click at `dum

[Haskell] DoCon soft announcement

2007-06-15 Thread Serge D. Mechveliani
Software Announcement - The Algebraic Domain Constructor DoCon, Version 2.09, written in Haskell, is available, together with its source program, on Internet at the following addresses: http://www.botik.ru/~mechvel/ click at docon-2.09 (Russian site), ftp.botik.ru/p

[Haskell] typo in Haskell definition

2010-11-18 Thread Serge D. Mechveliani
Looking into the on-line Haskell-2010 definition, I see in the Library definition 20.4.3 ... iteratef (instead of "iterate f"), repeatx (instead of "repeat x"). Regards, - Serge Mechveliani mech...@botik.ru

[Haskell] reference to DoCon

2010-12-13 Thread Serge D. Mechveliani
Dear administration of www.haskell.org, (I am sorry for not finding a more appropriate list for this letter) In old days, my program system DoCon (computer algebra written in Haskell) had its copy on www.haskell.org/docon/ -- if I remember corr

Re: [Haskell] reference to DoCon

2010-12-13 Thread Serge D. Mechveliani
On Mon, Dec 13, 2010 at 10:33:47AM -0800, Don Stewart wrote: > mechvel: > > Dear administration of www.haskell.org, > > > > (I am sorry for not finding a more appropriate list for this letter) > > > > In old days, my program system DoCon > > > > (computer algebra written in Haskell) had its