Linking Problem, ghc 5.02: cannot find -lreadline
Dear all, After a long time I decided to start using Haskell again:-) I've downloaded rpm sources (RPMs for SuSE Linux 7.3 (i386, glibc 2.2) from Ralf Hinze: base and docs RPM, and profiling libraries RPM.) from the ghc site and installed them. The only problem I had was that I had to re-install gmp using rpm. So that was great. When I tried to compile some large program I was delighted to see that all object files got created smoothly. At the linking stage I got an error: ''cannot find -lreadline collect2: ld returned 1 exit status'' I couldn't find anything about this on the web or in the mini faq. Anybody there to give me a quick hint how to get around this? Regards, Marc van Dongen -- Marc van Dongen | [EMAIL PROTECTED] | Computer Science Department | Western Road | () ASCII ribbon campaign University College Cork |Cork, Ireland | /\ against HTML mail phone: +353 (0)21 4903578 | fax: 4903978 | ghc -H20M -recomp -v -fglasgow-exts -cpp -syslib posix -syslib util -fvia-C -funbox-strict-fields -ddump-rules -ddump-simpl-stats -O2 -o Groebner Groebner.o Ring.o RingPrelude.o MarcMap.o MarcTypes.o GroebnerTypes.o GroebnerBasis.o Balanced.o Sort.o Result.o MarcShow.o MarcUtils.o Utilities.o WH.o Terms.o ParseUtils.o PolyParse.o PolyLexer.o Coefficient.o ChangeBasis.o Simplex.o Glasgow Haskell Compiler, Version 5.02.2, for Haskell 98, compiled by GHC version 5.02.2 Using package config file: /usr/lib/ghc-5.02.2/package.conf Hsc static flags: -static -funbox-strict-fields -fignore-asserts -ffoldr-build-on -fdo-eta-reduction -fdo-lambda-eta-expansion -fcase-merge -flet-to-case -flet-no-escape *** Linker gcc -v -o Groebner -DDONT_WANT_WIN32_DLL_SUPPORT Groebner.o Ring.o RingPrelude.o MarcMap.o MarcTypes.o GroebnerTypes.o GroebnerBasis.o Balanced.o Sort.o Result.o MarcShow.o MarcUtils.o Utilities.o WH.o Terms.o ParseUtils.o PolyParse.o PolyLexer.o Coefficient.o ChangeBasis.o Simplex.o -L/usr/lib/ghc-5.02.2 -lHSutil -lHSutil_cbits -lreadline -lncurses -lHSconcurrent -lHSposix -lHSposix_cbits -lHSlang -lHSlang_cbits -lHSstd -lHSstd_cbits -lHSrts -lm -lgmp -u Addr_Azh_static_info -u PrelBase_Izh_static_info -u PrelBase_Czh_static_info -u PrelFloat_Fzh_static_info -u PrelFloat_Dzh_static_info -u PrelPtr_Ptr_static_info -u PrelWord_Wzh_static_info -u PrelInt_I8zh_static_info -u PrelInt_I16zh_static_info -u PrelInt_I32zh_static_info -u PrelInt_I64zh_static_info -u PrelWord_W8zh_static_info -u PrelWord_W16zh_static_info -u PrelWord_W32zh_static_info -u PrelWord_W64zh_static_info -u PrelStable_StablePtr_static_info -u PrelBase_Izh_con_info -u PrelBase_Czh_con_info -u PrelFloat_Fzh_con_info -u PrelFloat_Dzh_con_info -u PrelPtr_Ptr_con_info -u PrelStable_StablePtr_con_info -u PrelBase_False_closure -u PrelBase_True_closure -u PrelPack_unpackCString_closure -u PrelIOBase_stackOverflow_closure -u PrelIOBase_heapOverflow_closure -u PrelIOBase_NonTermination_closure -u PrelIOBase_BlockedOnDeadMVar_closure -u PrelWeak_runFinalizzerBatch_closure -u __stginit_Prelude -u PrelMain_mainIO_closure -u __stginit_PrelMain Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.3/specs gcc version 2.95.3 20010315 (SuSE) /usr/lib/gcc-lib/i486-suse-linux/2.95.3/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o Groebner -u Addr_Azh_static_info -u PrelBase_Izh_static_info -u PrelBase_Czh_static_info -u PrelFloat_Fzh_static_info -u PrelFloat_Dzh_static_info -u PrelPtr_Ptr_static_info -u PrelWord_Wzh_static_info -u PrelInt_I8zh_static_info -u PrelInt_I16zh_static_info -u PrelInt_I32zh_static_info -u PrelInt_I64zh_static_info -u PrelWord_W8zh_static_info -u PrelWord_W16zh_static_info -u PrelWord_W32zh_static_info -u PrelWord_W64zh_static_info -u PrelStable_StablePtr_static_info -u PrelBase_Izh_con_info -u PrelBase_Czh_con_info -u PrelFloat_Fzh_con_info -u PrelFloat_Dzh_con_info -u PrelPtr_Ptr_con_info -u PrelStable_StablePtr_con_info -u PrelBase_False_closure -u PrelBase_True_closure -u PrelPack_unpackCString_closure -u PrelIOBase_stackOverflow_closure -u PrelIOBase_heapOverflow_closure -u PrelIOBase_NonTermination_closure -u PrelIOBase_BlockedOnDeadMVar_closure -u PrelWeak_runFinalizzerBatch_closure -u __stginit_Prelude -u PrelMain_mainIO_closure -u __stginit_PrelMain /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i486-suse-linux/2.95.3/crtbegin.o -L/usr/lib/ghc-5.02.2 -L/usr/lib/gcc-lib/i486-suse-linux/2.95.3 -L/usr/i486-suse-linux/lib Groebner.o Ring.o RingPrelude.o MarcMap.o MarcTypes.o GroebnerTypes.o GroebnerBasis.o Balanced.o Sort.o Result.o MarcShow.o MarcUtils.o Utilities.o WH.o Terms.o ParseUtils.o PolyParse.o PolyLexer.o Coefficient.o ChangeBasis.o Simplex.o -lHSutil -lHSutil_cbits -lreadline -lncurses -lHSconcurrent -lHSposix -lHSposix_cbits -lHSlang -lHSlang_cbits -lHSstd -lHSstd_cbits -lHSrts -lm -lgmp -lgcc -lc -lgcc /usr/lib/gcc-lib/i486-suse-linux/2.95.3/crtend.o /usr/lib/crtn.o /usr/i486-suse-linux/bin/ld: cannot find
Re: GC options. Reply
S.D.Mechveliani ([EMAIL PROTECTED]) wrote: : Issue 1: should the maximum heap size be unbounded by default? : Currently the maximum heap size is bounded at 64M. : [..] : 1. remove the default limit altogether : 2. raise the default limit : 3. no change : : Put the default to 30M. That seems to be on the low side. Obviously people's opinions will always differ. Why not introduce environment variables to allow for people to set their own defauls settings? Regards, Marc [still lurking] van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 4903578 University College Cork, NUIC | Fax:+353 21 4903113 Western Road, Cork, Ireland | Email: [EMAIL PROTECTED] ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Two Times [was Re: Happy and Macros (was Re: ANNOUNCE: Happy 1.10 released)]
Manuel M. T. Chakravarty ([EMAIL PROTECTED]) wrote: [received message twice] Am I just the only one or does everybody receive messages posted to [EMAIL PROTECTED] and [EMAIL PROTECTED] twice? I find it a bit (I know I am exaggerating) annoying. Is there a way to avoid this? Regards, Marc ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
lreadline
Hello all, When linking, ghc-4.08.1 fails due to a ld: fatal: library -lreadline: not found error. Is this a ghc error or should I get that library from somewhere else? Thanks in advance. Marc van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 4903578 University College Cork, NUIC | Fax:+353 21 4903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED] ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: My program is crashing - help!
Marcin 'Qrczak' Kowalczyk ([EMAIL PROTECTED]) wrote: [HEELP] Are you using RULES? If you are then try turning them all off. Just a thought. Regards, Marc ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Wish list: RULES, line number and filenames.
Simon Marlow ([EMAIL PROTECTED]) wrote: : yes, I should have mentioned that you need to use a cpp macro to achieve the : desired effect. eg. GHC's "ASSERT" macro: : :#define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else Cool. I'll try it the next time I have to debug some code. Thanks. Regards, Marc
Wish list: RULES, line number and filenames.
Dear ghc-team, At the moment I think it is only possible that error messages about functions can refer to line numbers and names of source files at the points of *definition* of these functions. These error messages are the ones that ghc automatically generates when there is a pattern matching error. I think it would be useful to have error messages about functions that refer to the line number and the name of the source files at the moment these functions are *used*. This would make it a lot easier to locate errors. I also think it would be handy to give the user more control about line numbers and file names. One possibility (modulo newlines in the RULES section) would be an extension as follows: {-# RULES "lookupFM.range check" forall m key . rdMap m key = maybe (lookupFmError #LINE #FILE) id (#lookupFM m key) #-} -- lookupFmError line file = error $ concat ["lookupFM :: key not in range in line ",line," in ",file] The function #lookupFM would be the ``real'' lookupFM function. The idea is that after debugging of a function one can just disable a rule in the RULES section. Just a thought. Regards, Marc van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 4903578 University College Cork, NUIC | Fax:+353 21 4903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
Wish List: Number of function calls
Dear ghc-team, I would like to do the following: 1) Utter some magic spell like ``{- COUNTAPPS f g h -}'' in my ghc-program. 2) Run my program with an RTS flag say +RTS +countapps f g -countapps -RTS 3) Have my program output (on stderr) the number of applications of the functions f and g. I need this kind of functionality to measure performance. Until now I had to hardwire the counting of function applications into my program, thereby increasing the number that was really needed (because I ``lost'' lazyness). I would be entirely happy if I had to compile my program for profiling. BTW: Is there a way to do this with profiling as it is at the moment? Yours, Marc van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 4903578 University College Cork, NUIC | Fax:+353 21 4903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
Mutable Arrays
Hello again, Sorry for asking again but I can't find the answer in the on line user manual. What does one have to do to use mutable arrays? An old program won't compile anymore with a very recent ghc from CVS. I am using GlaExts. Thanks in advance. Regards, Marc van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 4903578 University College Cork, NUIC | Fax:+353 21 4903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
Re: Mutable Arrays
Michael Weber ([EMAIL PROTECTED]) wrote: [...] : $ cvs log ghc/lib/std/PrelArr.lhs : : revision 1.19 : date: 2000/03/14 12:16:00; author: simonmar; state: Exp; lines: +57 -57 : Simplfy the mutable array story: : - rename MutableArray to STArray (and similarly : for all operations on MutableArray, eg newArray : is now newSTArray). : - remove the extra level of indirection between : STArrays and MutableArrays. : - remove the MutableArray interface from : hslibs/lang/MutableArray. This module will go : away soon - Andy, don't bother porting it to Hugs. Thanks! Compiles hapilly now. Regards, Marc
Mutable Arrays
Hello all, I wanted to recompile some old programs with the latest ghc from CVS. MutableArray wasn't known any more. I do import GlaExts. What am I missing? Regards, Marc van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 4903578 University College Cork, NUIC | Fax:+353 21 4903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
Re: key for fast compilation
S.D.Mechveliani ([EMAIL PROTECTED]) wrote: : : yFields = [e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, :e11,e12,e13,e14,e15,e16,e17,e18,e19,e20, :e21,e22,e23,e24,e25,e26,e27,e28,e29,e30, :e31,e32,e33,e34,e35,e36,e37,e38,e39,e40 : ] :: [ [(Int,(Int,Int,Int),[Int])] ] : : e1 = -- the largest of all e_i : [(3,(2,0,2),[3,0,0,0]), (4,(2,0,1),[3,0,0,1]), (1,(2,0,0),[3,0,0,2]), : (5,(1,1,1),[3,0,0,0]), (3,(1,1,0),[3,0,0,1]), (1,(1,0,4),[]), : (1,(1,0,3),[2,0,0,0]), (2,(1,0,2),[3,1,0,0]), (1,(1,0,2),[2,0,0,1]), : (3,(1,0,1),[3,1,0,1]), (5,(0,1,1),[3,1,0,0]), (3,(0,1,0),[3,1,0,1]), : (1,(0,0,3),[2,1,0,0]), (1,(0,0,2),[3,2,0,0]), (1,(0,0,2),[2,1,0,1]) : ] Hi Sergey, Since this is a problem in ghc's parsing. Would it solve your problems if your program were to read the values for yFields from a file? Just a thought. Regards, Marc van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 903578 University College Cork, NUIC | Fax: +353 21 903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
[dongen@cs.ucc.ie: Re: Debugging techniques]
Sorry about this. I forgot to group reply. - Forwarded message from Marc van Dongen [EMAIL PROTECTED] - Date: Fri, 7 Apr 2000 09:55:12 +0100 From: Marc van Dongen [EMAIL PROTECTED] To: "Michael A. Jones" [EMAIL PROTECTED] Subject: Re: Debugging techniques X-Mailer: Mutt 1.0.1i In-Reply-To: [EMAIL PROTECTED]; from [EMAIL PROTECTED] on Thu, Apr 06, 2000 at 03:05:23PM -0700 Michael A. Jones ([EMAIL PROTECTED]) wrote: : Well, I tried the trace function as was recommended, linking in IOExts and : all, but I get the following error when I run the application: : : main: fatal error: No threads to run!: Deadlock? : : The statement where it is used is: : : datalogQueryHistogramResult = IOExts.trace "here" : (processStaticHistogramQuery datalogQuery datalogQueryRequest2 : datalogQueryFilter6) : : testDatalogQuery = : putStrLn (show (firstPageOfHistogramData : datalogQueryHistogramResult)) : : Any ideas how to deal with this problem? Hi Michael, This is really a big problem. I have been strugling with it myself. The safest thing to do is to use `error' (sad but true). That's the only thing I can recommend:-( Regards, Marc van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 903578 University College Cork, NUIC | Fax: +353 21 903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED] - End forwarded message ----- -- Marc van Dongen, CS Dept | phone: +353 21 903578 University College Cork, NUIC | Fax: +353 21 903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
cvs update - patch: invalid options
Hello there, When doing cvs updates I get a lot of errors of the form patch: Invalid options. patch: Usage: patch [-blNR] [-c|-e|-n] [-d dir] [-D define] [-i patchfile]\ [-o outfile] [-p num] [-r rejectfile] [file] cvs update: could not patch ParseIface.y; will refetch Should I ignore these or look for a different patch? Thanks in advance. Regards, Marc van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 903578 University College Cork, NUIC | Fax: +353 21 903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
Re: cvs update - patch: invalid options
George Russell ([EMAIL PROTECTED]) wrote: [...] : Should I ignore these or look for a different patch? : My first reaction would be to look for a different CVS, like GNU CVS 1.10. If you're : already using that, get the GNU patch as well (which has many more options than : most patches). Thanks. I think my patch was too old. Regards, Marc
Re: cvs update - patch: invalid options
Julian Seward (Intl Vendor) ([EMAIL PROTECTED]) wrote: [patch problems] : This is the one we use: : : cam-02-unx:~/Feb24/fpt/ghc$ patch -v : patch 2.5 : Copyright 1988 Larry Wall : Copyright 1997 Free Software Foundation, Inc. : : It has never given me any problems. I think it is part of the : GNU textutils package. Perhaps you are using a Solaris implementation : instead? I just installed gnu patch. I thought I should mention because if this happens on other systems as well then maybe it should be recommended to use a different patch. Regards, Marc
Dowloading ghc
Hello, I had some probelms dowloading ghc from haskell.org. Sergey reported a similar problem after which Simon Marlow posted some answer (about a different place for downloading [I think]). Could somebody repost this answer? I tried to find Simon's message in the archives but couldn't find it because the archives don't seem to be updated on a day to day-ish basis. Is there any chance this will be done? I find the archives very useful. Regards, Marc van Dongen -- Marc van Dongen, CS Dept | phone: +353 21 903578 University College Cork, NUIC | Fax: +353 21 903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
Re: Dowloading ghc
Simon Marlow ([EMAIL PROTECTED]) wrote: [problems with downloading] : The main GHC site is still at haskell.org (at Yale), and I don't know of any : mirrors. Is there anyone well-connected out there that would like to : provide a mirror of www.haskell.org/ghc? : Just checking: are you using the archives at www.mail-archive.com? They lag : slightly behind, but I was under the impression it was less than 24 hours. Well, ehm, dunno what to say/type When I go to the list now. At the top of the list is Sergey's question. Yesterday I only saw old messages (I think). Sorry about the confusion. Regards, Marc van Dongen
Re: Dynamic scopes in Haskell
Jerzy Karczmarczuk [EMAIL PROTECTED]: : I don't fully understand the issue. If it is only : a syntactic problem, and for a given chunk, say, : a module, your set of flags is fixed, and does not change : between one expression and another, you can always define : : add flagSet x y = ...-- your addition function-- : : and then overload : : x+y = add myCurrentEnv x y : : in this module. (I can't resist complaining once more about : the inadequacy of the Num class hierarchy in Haskell ...; : one will have to do the same in the Rational or Floating : instance definitions, which is clumsy). Unless I am missing somthing I think that in general this is not just a syntactical issue. E.g. consider polynomial remainder. At run time an order on terms is determined (A term order is an order on terms. It is a generalisation of a variable order). The order may even change. Now if x precedes y w.r.t. the term order then rem (x + y) (x - y) == 2x otherwise rem (x + y) (x - y) == 2y And the result can only be determined at run time. I haven't had the chance to look into dynamic scopes. Could somebody who knows more about it enlighten me if by using dynamic scoping I could play games as with the remainder example above, i.e. compute remainders depending on the ``current'' term order? I would be delighted if it were possible because at the moment I am still resorting to clumsy expressions like ``remainder order p1 p2'' and the like because of the dependence on the term order. Regards, Marc van Dongen
Re: Haskell and Computer Algebra
[I cc'd this to haskell users since I couldn't find out what the name was of the forum to which the original thread belonged to. Appologies if I have made a mistake and I am upseting somebody.] Jerzy Karczmarczuk: : horrible complexity. Does it answer your question? ** It does. I just hadn't heared of the term you used before. Sometimes one has to resort to this kind of algorithms. The polynomial remainder e.g. is just the same as the result of a substitution: rem p1 (x - p2) == subs( x = p2, p1 ) where it is assumed that x is the leading term of x - p2. ** I am using Haskell for Gr{\"o}bner basis computations and conversions of such bases. I am quite happy with it: - I have implemented existing algorithms quite easilly. In particular I found list comprehensions very useful because they allow for an almost one to one translation from mathematical set comprehension to a program in Haskell; - The basic (Gr{\"o}bner basis) algorithms perform quite well. I have not yet been able to carry out a fair comparison with other CAS (Computer Algebra Systems) but the Haskell based algorithms do leave Maple *far* behind. For reasons mentioned earlier in this thread, I do not take that to be a proof for the superiority of Haskell based CA Algorithms:-) - Finally I have been able to implement some new algorithms without much problems (i.e. from a programmer's point of view). The new algorithms outperform the existing ones I was trying to improve. I hope to be able to report on this as soon as I have some more time. Regards, Marc
Re: Scientific uses of Haskell?
: From: "Rob MacAulay" [EMAIL PROTECTED] : I have long been interested in Computer Algebra systems, and I : admit that one of the things that attracted me to Haskell were the : tantalizing hints that it would be ideal for mathematical : programming. [snip] : Would it also be true to say that FP offers the possibilty of : implementing more mathematically rigorous 'proof' systems as : well? I haven't had the time to find out more about this project. Also I don't know if you know about this yet. If not you may find the following interesting [quote from one of Bruno Buchberger's pages] The development of a new approach to mathematics that integrates "pure" and "algorithmic" mathematics in one common logical and software technological frame and is meant as an alternative to the currently prevailing "Bourbaki" formalization of mathematics. This research combines my past research experience in algorithmic mathematics, foundations of mathematics and computer science, didactics of mathematics, software and algorithm design, see publications since 1994. For more details, see the Theorema project http://www.theorema.org Regards, Marc van Dongen ___________ Marc van Dongen, CS Dept | phone: +353 21 903578 University College Cork, NUIC | Fax: +353 21 903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
Re: redirecting *.hi
Sergey: One small correction: The sed script should be: sed -e 's/.*\/\([^\/][^\/]*\)\.hs/$(E)\/\1.o, $(E)\/\1.hi/' Of course: :g/.*\/\([^\/][^\/]*\)\.hs/s//$(E)\/\1.o, $(E)\/\1.hi/ in vi should also work. Regards, Marc
gmp.info
Dear all, According to the user guide (section 6.2) there should be a document calld gmp.info in the distribution. I tried to locate it, but it is not there. Is there anybody who can tell me where to get it. Regards, Marc van Dongen Marc van Dongen, Computer Science Dept | phone: +353 21 903084 University College Cork, NUIC | Fax: +353 21 903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
Is there anybody who can help me with this
Dear all, Hopefully somebody can help me out with this. I am looking for the file where the low level primops for operations on Integers are defined. I've had a look in Primops.h but that only includes cmpInteger# and a few friends. Where can I find the remaining ones? Any help would be greatly appreciated. Regards, Marc van Dongen Marc van Dongen, Computer Science Dept | phone: +353 21 903084 University College Cork, NUIC | Fax: +353 21 903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
State Interface Description
Dear All, I am hoping that somebody will be able to help me with this before the hollidays are over:-) I am trying to locate a document with a name state_interface or something similar which is being named in some file in the 4-01 distribution. I have tried to locate it but failed. It seems as if it's not included in the disctibution any more. Is there anybody who has a recent copy? Regards, Marc
how is this implemented
Dear ghc guru's, Could somebody tell me how (==) :: Integer - Integer - Bool is implemented in ghc? Is this done as (==) a b = (==) (a - b) 0 or is this done by calling some C-function which compares two integers? The reason why I want to know is that I have a function which does subtraction of integers where more than 40% of the execution time is spent. Depending on the way comparing for equality is implemented, I may, or may not, be able to squeeze a bit more performance out of my code. Thanks in advance, Marc Marc van Dongen, Computer Science Dept | phone: +353 21 903083 University College Cork, NUIC | Fax: +353 21 903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED]
class system
Dear Group, I want to define two classes called Group and Ring. The Group class is for Abelian Groups (G,+), i.e. groups with a binary commutative operator ``+'' and an identity element normally denoted by ``0''. The Ring class is meant for cummutative rings (R,+,*) with binary operators ``+'' and ``*'', where ``+'' is commutative and has identity element ``0'', and ``*'' is commutative with identity ``1''. I want to use classes because I want to define rings in terms of existing rings later. A neat way to define the Group and Ring classes seems to have the Ring class being a subclass of the Group class (each Ring should inherit the properties for addition from some Group). Let R be a Ring defined as such. Now it seems to me I have to do something along the following lines: instance Num R where (+) r1 r2 = .. -- because r1 + r2 reads a lot better than ``plus r1 r2'' (*) r1 r2 = .. -- ,,* ,, times ,, fromEnum i = .. -- so one can say sexy things like 1::R and the like instance Group R where -- I only want to use (+) :: R - R - R but where I can use (*) :: R - R - R, which (to me) does not seem to be appropriate. Is there a proper (and simple) way of defining my Group and Ring which still allows me to overload (+) and (*)? Regards, Marc