[EMAIL PROTECTED] writes
> On holiday, I started reading about Gaussian integers (as you do) and I
> thought this should be a piece of cake for Haskell. I get the following
> error in Hugs:
> [..]
>
> data Integral a => Gaussian a = Gaussian a a
> deriving (Eq, Show)
>
> instance Num (Gaussia
Who would tell me, please, what is the simplest way to read a
string from a file?
Namely, what has one to set in place of `...' in the program
main = putStr (...)
to obtain instead of `...' a string contained in the file
"foo.txt" ?
Thank you in advance for the help.
Zhe Fu <[EMAIL PROTECTED]> writes
> Is there any built-in functions in Haskell to implement
> diffential operation and partial diffential operation?
> Or can anyone give me some advices about how to implement them
> with Haskell? Thanks.
There are no differential operators in Haskell-98 sta
Toralf Wittner <[EMAIL PROTECTED]>
writes
> [..]
> data PowerNum = INT Integer | DBL Double deriving (Eq, Show, Read)
> [..]
> Now it basically works. However wouldn't it have been easier to write
> something like this:
>
> powPos :: Integer -> Integer -> Integer
> [..]
> powNeg :: Integer ->
Long ago I suggested to include FiniteMap into Haskell-98
standard library.
Is it still late to do this, or maybe, the situation has changed?
-
Serge Mechveliani
[EMAIL PROTECTED]
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.
Toralf Wittner <[EMAIL PROTECTED]> writes
> [..]
> power x y
> [..]
> | y > 0 = x * power x (y-1)
> | y < 0 = 1 / fromInteger x * power x (y+1)
>
> One recognizes that the function returns either an integer value
> if y > 0 or a float value if y < 0. Therefore I can't
Simon Peyton-Jones <[EMAIL PROTECTED]> writes
> [..]
> If someone could write a sentence or two to explain why gcd 0 0 = 0,
> (ideally, brief ones I can put in the report by way of explanation),
> I think that might help those of us who have not followed the details
> of the discussion.
Here
People write on gcd 0 0 :
Alan Bawden <[EMAIL PROTECTED]>
> If you take the point-of-view that gcd is actually an operation on
> ideals, then gcd(0, 0) is 0. I.e. define gcd(x, y) to be the smallest
> z >= 0 such that {m*x + n*y | m, n in Z} = {n*z | n in Z}. This is
> probably the most natu
People write about the Report definition of
gcd x y
as of greatest integer that divides x and y,
and mention
> gcd 0 0 = 0
But 2 also divides 0, because 2*0 = 0.
Does the Report specify that gcd 0 0 is not defined?
For an occasion:
People write
Fergus Henderson:
H> [...]
H> The whole idea of letting you omit method definitions for methods with
H> no default and having calls to such methods be run-time errors is IMHO
H> exceedingly odd in a supposedly strongly typed language, and IMHO ought
H> to be reconsidered in the next
S. Alexander Jacobson <[EMAIL PROTECTED]> writes
> I just found out about a functional programming language called
> Joy (see http://www.latrobe.edu.au/philosophy/phimvt/joy.html).
>
> Joy differs from Haskell in that it has no variables. Instead, all
> functions are postfix, taking a stack a
Luis Pablo Michelena <[EMAIL PROTECTED]> writes
on the subject `series'
> where to find a haskell program that calculates the number e, that is
> the list of infinite digits?
> [..]
> what i am looking for is something like the ertostenes sifts, that
> prints every prime number until it run
Paper announcement
--
The file
http://www.botik.ru/pub/local/Mechveliani/basAlgPropos/haskellInCA1.ps.zip
contains more expanded explanations on the BAL (Basic Algebra Library)
project
(previous variant was haskellInCA.ps.zip).
My real intention in whole this line of business
Ch. A. Herrmann <[EMAIL PROTECTED]>
writes
> [..]
> Anyway, an algebraic library is important:
> it is nice that Haskell has the rational numbers but recently, it
> appeared useful for me also to have the algebraic numbers, e.g.,
> to evaluate expressions containing roots exactly. The problem is
I was said that there exists an algebraic library proposal for
Haskell
(version 0.02) dated by February (2001?), by Dylan Thurston.
Who could, please, tell me where to download this document from?
For I could not find it from http://haskell.org
Thanks in advance for the help.
Andy Fugard <[EMAIL PROTECTED]> writes
> Hi all,
>
> I'm currently teaching myself a little Haskell. This morning I coded the
> following, the main function of which, permutate, returns all the
> permutations of a list. (Well it seems to at least!)
>
> [..]
The BAL library implements severa
This may sound strange, but
could Haskell think of supporting a true functional module loading?
As the interactive systems exist, with interactive loading, and so
on, maybe, it can be provided a library of Haskell functions:
compile :: Env -> SrcModule -> (Interface, CodeModule)
parse
Simon P. Jones mentions some paper on implicit parameters
in his recent letter on "Implicit parameters and monomorphism."
Please, where to find this paper?
-
Serge Mechveliani
[EMAIL PROTECTED]
___
Haskell mailing list
[EMAIL PROTECTED
Can we solve and close the problem of the meaning of decimal pointed
leterals?
To my
| People wrote about toRational (0.9) == 9%10 = False
| ...
| Probably, the source of a `bug' is a language agreement that the
| input is in decimal representation (`0.9') and its meaning
Lennart Augustsson <[EMAIL PROTECTED]> writes
> "S.D.Mechveliani" wrote:
>> the matter is in what the _language standard_ says.
>> If it puts that `0.9' in the user program means precizely 9%10,
>> then Lennart is right.
> I quote the report:
&g
Jerzy Karczmarczuk <[EMAIL PROTECTED]> writes
| Lennart Augustsson wrote:
>> "S.D.Mechveliani" wrote:
... ...
>> > Probably, the source of a `bug' is a language agreement that the
>> > input is in decimal representation (`0.9'
sorry, I did not know this.
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
People wrote about toRational (0.9) == 9%10 = False
...
Probably, the source of a `bug' is a language agreement that the
input is in decimal representation (`0.9') and its meaning is a
floating approximation in _binary_ representation.
For example, 1%5 yields a finite
Norman Ramsey <[EMAIL PROTECTED]> writes
> [..]
> class Formula f where
> eval:: f a -> Environment a -> Bool
> [..]
> type Environment a = Var -> a
> type Var = String
> [..]
> data Formula f => Row a = Row (f a, Weight)
> type Weight = Float
>
> Hugs rejects this program: [ .. ]
Mayb
Dylan Thurston <[EMAIL PROTECTED]> writes
> In thinking about various issues with the numeric classes, I came up
> with the following question: Is there a problem with having a class
> 'Convertible' as follows?
>
> class Convertible a b where
>convert :: a -> b
>
> [..]
The basic alge
Hi, all,
To Eric Allen Wohlstadter's ([EMAIL PROTECTED])
: Are there any Haskell libraries or programs related to group theory? I am
: taking a class and it seems like Haskell would be a good programming
: language for exploring/reasoning about group theory. What I had in mind
: was perhaps y
Information for the users of basAlgPropos, DoCon:
Starting from today, I shall be out of the business for about
a month.
Sergey Mechveliani
[EMAIL PROTECTED]
Andrew U. Frank <[EMAIL PROTECTED]>
write on 24 Aug 2000 on basAlgPropos
> i am interested in an improvement of the numeric classes and hope the
> proposal by Mechveliani can contribute to this.
basAlgPropos contains such suggestion.
> [..]
> i would suggest that the authors separate the pr
ANNOUNCE.
The computer algebra program DoCon-2.01
is available at
http://www.botik.ru/pub/local/Mechveliani/docon/2.01/
It is a slight development of DoCon-2.
It works under GHC-4.08.
With respect to basAlgPropos, DoCon has more complex
architecture and is designed mainly fo
Dear haskellers,
I suggest the two points to your attention.
New basAlgPropos
materials reside in
http://www.botik.ru/pub/local/Mechveliani/basAlgPropos
/haskellInCA.ps.zip
/bal-
Dear Haskellers,
This a report on the recent state of the Basic algebra proposal
(basAlgPropos).
And I need certain political advice about it.
There is also a section about Cayenne.
basAlgPropos was revised. The sample argument (SA) approach remains.
It was written a paper about this (12 page
There was earlier some discussion on the Basic algebra proposal
(basAlgPropos), in particular, about the Sample argument approach
(SA).
This SA is somehow opposed by the Haskell community.
On the other hand, it may occur that the dependent types, Cayenne
provide some alternative approach
Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> writes
> I would use a simpler interface:
>
>arithSequence :: Num a => a{-start-} -> a{-step-} -> [a]
>
>take 300 (arithSequence (-3.0) 0.02)
>arithSequence (-3.0) 0.02
>takeWhile (<3.01) (arithSequence (-3.0) 0.02)
Yes, this is
About the expressions like [1.0 .. 9.0], people write
Lennart Augustsson:
> By definition, if you follow the standard you can't be wrong. :)
> But the standard can be wrong. Perhaps this is a typo in the report?
George Russell <[EMAIL PROTECTED]>:
>> [..] The standard is kaput. It gets ev
People,
I want to comment my last letter on the need of profiling.
The matter is that it helps to find errors in theoretical
estimations, to find the estimation "bugs".
Analyzing a complex program, the designer may assign the cost
estimations to its parts. For example,
cos
Dear Haskell implementors,
Please, always try to provide the working profiling.
For it appears indeed very helpful.
I had made many experiments with certain large program.
Spent many days in this. And it was very hard to find out the
practically most expensive parts of the program. Finally, I
Sorry, I have to fix a typo in may last letter:
> There appeared a nice manner for the public discussion introduced
> recently by M.Kowalsky and encouraged by L.Augustsson [..]
I intended to write Kowalczyk instead of Kowalsky.
--
Sergey Mechveliani
[EMAIL PROTECTED]
Ketil Malde <[EMAIL PROTECTED]> writes
> I could accept "mode flags" if the algorithm is extremely similar,
> e.g. passing a comparator function to a sort is a kind of mode flag
> (think ordered/reversed) which I think is perfectly acceptable.
> Having flags indicating algorithm to use (sort Merg
D. Tweed <[EMAIL PROTECTED]> writes on 1 Jun 2000
>> We also may paste
>> True :: Bool instead of False
>> (the type design does not help),
>> x / 0 instead of x / 2,
>> tak
Fergus Henderson <[EMAIL PROTECTED]> writes on 1 Jun 2000
>> 'n' :: Char does not hold a name in the constructor name space.
> Yes, but it is also far from self-expanatory. With a constructor
> name, in a suitable environment you could just click on the
> constructor name and the environment
To my suggestion on the mode argument for some standard functions
>> quotRem ... divRem ...
>>
>> And we can hardly invent the mode type better than Char,
>> because any specially introduced mode types bring the long names.
>>
>> quotRem 'n' x (-3) looks better than the pair quotRem & divM
More example on standard functions needing the *mode*:
in quotRem, quot, rem,
divMod, div, mod.
the latter triplet is unnecessary, if the first has the mode
argument.
And we can hardly invent the mo
Thanks a lot.
As to `SYNTAX', all right, let it be two month later.
It makes sense when it is in the *standard*. If it is only GHC feature,
it is 50% good.
Michael Marte <[EMAIL PROTECTED]> writes on
30 May 2000
> Standard module List defines:
> [..]
> groupBy :: (a -> a -> Bool) -> [a] -> [[a]]
> groupBy eq []= []
> groupBy eq (x:xs)= (x:ys) : groupBy eq zs
> where (ys,zs) = span (eq x)
Hello, all,
It is again on re-preluding.
MyPrelude aims to hide
Ord(..), Bounded(..), Num(..), Integral(..),
Fractional(..), subtract, fromIntegral, even, odd, gcd, lcm,
(^), (^^)
of Prelude and to re-define Ord, (+),(*),(^), even, odd, gcd, lcm
The attempt ofmodule MyPrelude (.
To my
> When processing this tree, it would be natural to write in each node
>m + b and min [m,b].
>
> The former is "necessary" due to the infix-binary tradition.
> The latter uses [,] because it is good to have one function min for a
> list and for the two eleme
>to tell the compiler 'evaluate this to a static value'. I'd suggest
>doing it via a pseudo-function
> static :: a -> a
>which behaved like the identity function, except that it evaluated
>its argument rather eagerly at compile time.
AFAIK eagerness isn't addressed by the Haskell language
To my
| Here is some strange question:
| how to force the compiler to evaluate some things more statically
| and to convert some run-time errors into the compile-time ones?
Simon Peyton-Jones <[EMAIL PROTECTED]> writes
> Not strange at all. It would be quite reasonable to have some way
>
On my proposal for minBy, gcd ... :: [a] -> a
and remark on +, && ... being the exceptions
Matt Harden <[EMAIL PROTECTED]> writes on 19 May 2000
>> (+), (&&) ... are different. Because they have classical tradition
>> to be applied as binary infix operations.
>> And gcd, min, max, lcm
I wrote in previous letter on replacing
(Num.fromInteger 2 :: T) + x
with(Additive.fromInteger 2 :: T) + x
It occurs to me now that, probably, the popular preprocessors are
for such purposes. But I never tried ...
--
Sergey Mechveliani
[E
I wonder how to make the user prelude BPrelude to replace
2 + x :: T
with (Additive.fromInteger 2 :: T) + x
rather than (Num.fromInteger 2 :: T) + x
?
For BPrelude hides Num and moves +, fromInteger ... to
Additive. So, the compiler reports
(+), (&&) ... are different. Because they have classical tradition
to be applied as binary infix operations.
And gcd, min, max, lcm have not this "infix" tradition.
--
Sergey Mechveliani
[EMAIL PROTECTED]
> Summary: the Haskell 98 Report claims
>
> minimumBy :: (a -> a -> Ordering) -> [a] -> a
>
> but Hugs and GHC implement
>
> minimumBy :: (a -> a -> a) -> [a] -> a
> minimumBy = foldl1
The Haskell report says first
mimimumBy :: (a -> a -> Ordering) -> [a] -> a
in 7.7 - w
Here is some strange question:
how to force the compiler to evaluate some things more statically
and to convert some run-time errors into the compile-time ones?
Example.
f :: [Int] -> Int
fxs= if any (> 4) xs then error "f xs: x > 4 among xs"
else
ghc-4.06:
T.hs:10: parse error on input `Prelude.+'
I my last letter, the program contained g (x:xs) = xs
Correct it to g (x:xs) = x:x:xs.
--
Sergey Mechveliani
[EMAIL PROTECTED]
I thank people who explained the question of importing the List
constructor.
There remains a very practical question of how to improve the
program
---
import qualified Prelude
import Prelude ( [](..), Integer )
g (x:xs) = xs
c
I am again stuck. Who could help, please?
module T
where
import Prelude ( tail, (.) ) -- List(..) ?
f = tail . tail
g (x:xs) = xs
T wants to import explicitly tail, (.), .
---
tail, (.) work, and (:) does not, it require
I am sorry for my misunderstanding.
Last 1-2 years several people advised me, concerning basAlgPropos,
to present publicly the implementation of this library.
And only several days ago I have realized or recalled that it is
possible to replace some algebraic part of Prelude-98 with the
user prel
Sorry for easy question,
who could explain please, can Haskel work with the user-provided
prelude instead of standard?
For example, may it work moving +,-,* to different classes?
If yes, probably, the user has to put somewhere the path to
Prelude.hs or such, to do it culturally ...
(going to
Simon Peyton-Jones <[EMAIL PROTECTED]> writes on 11 May 2000
> I'd like to make a few comments about the recent
> discussion about Sergey's basAlgProp and related issues.
> [..]
> It may not be well known that
> there *is* no Haskell committee!
>
> There was a Haskell98 committee,
To my
> Here is a small, concrete and real example, more illustrative
> than the variable vector space, though, very similar with respect
> to Haskell.
> If this can be programmed adequately with the constructor classes,
> and such, this will mean a great deal.
Marcin 'Qrczak' Kowalczyk <[EMAI
Andreas C. Doering <[EMAIL PROTECTED]> writes
> As I understand the problem right,
> there is a need for classes computed dynamically
> like remainder rings polynomial rings and so forth.
No. Several classes are declared and fixed.
And there have to be generated dynamically and exploited sever
People,
Here is a very important point about basAlgPropos.
And it is a question to the haskellites that understand the Haskell
constructor classes, and such technique.
To my question on how to express a domain depending on the run-time-
found parameter
>> What we have for the *variable dimen
Marc Van Dongen
writes about the need of constant :: a -> b ->
and explains that it is needed, for example, to convert constant
to polynomial.
I consider this as kind of support for the
Domain conversion proposal in basAlgPropos, section 'dcon'.
It suggests
I wrote on Fergus's example with Alfred, Betty ...
type T a = T ...
instance Additive (T a) where
(T x)+(T y) = T (x+y)
...
It should be data T a ...
instance Additive a
Concerning the sample argument approach,
Marc van Dongen <[EMAIL PROTECTED]> writes on May 8 2000
> I am not sure if I understand this but I also used
> zero :: a -> a
> to create polynomials as opposed to a function
> zero :: a
> The application
> zero p
> created a zero polynomial with certa
Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> writes
on 5 May 2000
>> Let us call for the recent basAlgPropos discussion a hacker
>> any Haskell user who do not like to care of mathematics, especially,
>> of its most abstract parts.
>> And call a snob any user that feels it quite different.
People,
I appealed a couple of times to the expert committee to consider
basAlgPropos.
But just admit that now, on May 2000, basAlgPropos
is NOT ready to be considered officially by the committee.
I am sorry.
Probably, the revised version will appear within 2-5 months.
I am not su
To my
>> Because it is wrong for the standard classes to pretend for *all*
>> their operations to have a real sense in *all* the user instances.
>> The user may know better one's situation, one may rely on the
>> standard operation op1 and ignore another standard op2, having
>> some replac
To my
>> Alfred defined *his* user type T and *his* Set instance for it.
>> And Charles dislikes this instance.
>> Why basAlgPropos is guilty?
Marcin Qrczak Kowalczyk <[EMAIL PROTECTED]> writes
> Because it unnecessarily forced him to define a Set instance, and to
> do it early.
Alfred is no
To my
>> [..]
>> How the hacker uses them? One simply takes (+) from Additive,
>> (*) from Multiplicative, dimRem from EuclideanRing
>> - instead of Num, Integral of old Haskell-98.
>> When one wants the instance for the type T with, say, (*),
>> one needs to declare for it
>> insta
George Russell <[EMAIL PROTECTED]> writes 05 May 2000
> I think the way to proceed with basAlgPropos is to implement it
> outside the language as a library.
> [..]
> GHC
> [..]
> At the moment I feel it would be better to let it evolve.
You mean: non-standard library.
There is no need in decis
People, please, what would you say of the
-fadvancedAlgebra key proposal
contained in the middle of this letter?
This is new, I had not thought much about it and doubt what might be
wrong there. It is very short and, hope, can improve much.
The recent state of basAlgPropos discussion reveals the
important points enclosed below.
You also will find its copy in the directory
http://www.botik.ru/pub/local/Mechveliani/basAlgPropos/
in separate file, notes1.txt, or such.
--
Sergey Mechvelia
I recall one particular point about
Basic algebra proposal for Haskell
http://www.botik.ru/pub/local/Mechveliani/basAlgPropos/
Its English is not perfect. Naturally, the corrections are welcome.
--
Sergey Mechveliani
[EMAIL PROTECTED]
NO NO.
Almost like Field but maybe, non-commutative.
George Russell <[EMAIL PROTECTED]> writes on 03 May 2000
> There are two problems with freezing large modules into
> languages:
> (1) they make life harder for implementors
> (2) when you want to use them, it usually turns out that there is some
>slight niggle you want which the implementor
Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> writes on 2 May 2000
>> basAlgPropos says
>> "class (Show a, Eq a) => Set a where ...
>> is introduced as a superclass for all algebra. It also provides
>> compare_m for the partial ordering (which, for example, can be
>> defined trivially
I thank people for the discussing words on
http://www.botik.ru/pub/local/Mechveliani/basAlgPropos
I have found so far, the following concrete notices.
(1) Marcin Qrczak Kowalczyk <[EMAIL PROTECTED]> :
1.1. invalid arguments should be impossible to construct
if the va
Fergus Henderson <[EMAIL PROTECTED]>
writes on my letter on Basic algebra proposal
>> These features are not mandatory in proposal. The jury may decide to
>> rewrite the proposal removing the usage of these features.
>> [..].
> I think the "jury" is unlikely to rewrite the proposal;
> more like
To my
>> And I do not understand, why Haskell does not support `deriving'
>> for all the instances (user's too), at least, for newtype.
Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> writes
> It could be a good idea. But what about deriving Show and Read
> (should derived Show instance for newt
I am sorry for the long letter.
This is discussing an official proposal for the Haskell standard
library
http://www.botik.ru/pub/local/Mechveliani/basAlgPropos/
I wonder in what place such discussion might happen and decided that
at least the first response may to occur in this mail list
Chris Okasaki <[EMAIL PROTECTED]> wrote
| Many of you have run across the problem with
| newtypes that, although it is very cheap to
| coerce between the newtype and the base type, it
| can be very expensive to coerce between, say,
| a list of the newtype and a list of the base type.
| Stephanie
No. It is all right.
For example, gcdExt 4 6 = (2,-1,1),so -1*4 + 1*6 = 2 = gcd 4 6.
Maybe, you forgot of negatives?
--
Sergey Mechveliani
[EMAIL PROTECTED]
Dear Haskell implementors,
In what way the Haskell implementations may use the GMP library?
(GNU Multi-Precision integers ?)
I had some dim idea of that the implementations rely on gmp for the
arithmetic of integers of arbitrary size.
This letter encloses the reproduction of some part of the
To my suggestions on the error messages
Marc van Dongen <[EMAIL PROTECTED]> writes
> Printing the argument of a function as part of an error
> message may lead to infinite error messages.
> [..]
> A call to error terminates execution of the program
> and returns an appropriate error indication
Malcolm Wallace <[EMAIL PROTECTED]> writes
>> And for (head []) there's really no useful info to hand. So I'm stumped.
> Although you can't show the value (because there isn't one), you can
> at least show the type of the expression:
Printing the type is very desirable in this situation.
But
Keith Wansbrough <[EMAIL PROTECTED]> writes
> Sergey writes:
>> Maybe, there exists another possibility to print the values in the
>> error message like for
>>take (-1) xs, y % 0
>>
>> The implementors declare the "internal"
>> class Servic
Maybe, there exists another possibility to print the values in the
error message like for
take (-1) xs, y % 0
The implementors declare the "internal"
class ServiceShow where serviceShows :: ...
invisible for the user,
make *everything* to be t
To my suggestion on the error messages
Ketil Malde <[EMAIL PROTECTED]> writes
> [..]
> e.g instead of Hugs' Prelude head:
>
>head :: [a] -> a
>head (x:_)= x
>
> we can use:
>
>head :: [a] -> a
>head [] = error "Error: tak
Dear Haskell implementors,
What do you think of improving the error messages like
Prelude.head: empty list
(for say, head [] :: (Int,Char) )
Prelude.take: negative argument
(for say, take (-1) [(0,'b'),(1,'a')] )
?
As
There were several letters on the subject of constructing Ratio
values with n % m,
n :% m (impossible).
Haskell-98 provides the function (or operation) %
that models the rule for the symbol `/' for Rational numbers in
mathematics.
Similar as ` 4/(-6) = 2/(-3) = (-2)/3 '
i
Jan Brosius <[EMAIL PROTECTED]> writes
B> E.g. if one uses GHC to compile Haskell code into native code what
B> speed performance can be expected versus a same program written in
B> C [..]
M> [..]
M> In other, average case, I expect the ratio of 6-10.
B> This seems that Haskell cannot be co
Jan Brosius <[EMAIL PROTECTED]> writes on 16 Mar 2000
on speed and size of compiled Haskell code
> [..]
> E.g. if one uses GHC to compile Haskell code into native code what
> speed performance can be expected versus a same program written in
> C [..]
My experience with the program of gen
Mabye, STGHugs www page contains a bug?
For I had the same problem as Ronald J. Legere
when tried to find and download STGHugs starting from
http://haskell.org
> 15 Mar 2000
> From: "Ronald J. Legere" <[EMAIL PROTECTED]>
> Actually I wanted to try STG hugs on my win 98 machine (I know thats
Simon Peyton-Jones <[EMAIL PROTECTED]> writes on 8 Mar 2000
> There has been a great deal of mail about overlapping
> instances. I confess that I have read little of it.
> But I am interested in it.
>
> Would someone like to write a summary of
> what the issues are
>
To my notes on the overlapping instances and deduced contexts
Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> writes
on 29 Feb 2000
>> If we want the recent implementations to compile this as needed, we
>> have to write
>> g :: (Eq a, Eq (Maybe a)) => (a -> Bool) -> [a] -> [Bool]
>>
John Meacham <[EMAIL PROTECTED]> writes on 4 Mar 2000
> [..]
> It is VERY useful to allow reuseability of code in ways the original
> author did not anticipate.
> for an example from algebra imagine you are given a class Num a
> which basically represents a field and you need a Group class
To my suggestion on deduced contexts
Jeffrey R. Lewis <[EMAIL PROTECTED]> writes
L> Let's take f again, as you've typed it:
L>f :: Eq a => a -> Bool
L>f x = Just x == Just x
L> [..]
L> Would it make sense at this point for the compiler to
L> say, "heck, I don't know why he put `Eq
1 - 100 of 274 matches
Mail list logo