Modules again

1992-02-17 Thread Lennart Augustsson
Well, here's another problem I've encountered. Consider this module: module M(T) where data T = T Is this legal? Clearly I am just trying to export the type T, but it happens that the type has a constructor with the same name. Naming a constructor in the export list is

Re: haskell

1995-03-10 Thread Lennart Augustsson
Dear Kevin Hammond If you think this flame not too intemperate, please put it out on the haskell mailing list. Don't blame Kevin! You're not the first one who complains about the Prelude being structured in the wrong way. Unfortunately the Haskell class system isn't powerful enough to

Re: haskell

1994-03-17 Thread Lennart Augustsson
class Eq_Monad f where result :: a - f a bind :: Eq b = f a - (a - f b) - f b join :: Eq a = f (f a) - f a ... Is there any reason why qualified types should not appear as the declared types of instance variables in class declarations? Polymorphic Huh?? Methods with

Re: Multiple Parameter Classes

1994-03-15 Thread Lennart Augustsson
The main implementation problem is extending instance lookup to cover multiple type constructors. The prototype Glasgow compiler was designed to allow this, and I believe hbc also does this (as well as Gofer, of course), so it's not a big issue! No, hbc don't do this (yet). But the

Suggestion to simplify the Haskell grammar

1994-03-12 Thread Lennart Augustsson
In order to simplify and make Haskell more consistent I suggest the following additions to the grammar () should be treated as a conid (or con) [] should be treated as a conid (or con) and less urgent (-)should be a con This simplifies the grammar, and

Re: haskell

1994-02-18 Thread Lennart Augustsson
Am I alone in finding the standard prelude for Haskell unsatisfactory when it comes to dealing with different sorts of numbers and how they are related? No, I do too!! lower in the hierarchy. It is a great relief to be able to use pi/2 rather than pi/2.0 every time. I Haskell you have

Layut question (again!)

1993-12-15 Thread Lennart Augustsson
Is the following legal Haskell? (I'm sure I've asked this before, but i don't think there was a consensus.) f x = g x where g y = case y of [] - 0 The problem is that after where a '{' is inserted and another after of. The report now says that for each subsequent line if a line

Re: Making argv a constant

1997-01-18 Thread Lennart Augustsson
I would claim it has really nothing to do with first-class modules or parameterized modules. They can be simulated by ordinary Haskell data types with named fields. No they can not. Haskell records do not allow local polymorphism, so you have a significant loss of power. -- Lennart

Re: polymorphic higher-order terms

1997-03-13 Thread Lennart Augustsson
data F = MkF t - t -- did I get the syntax right? Almost data F = MkF (t - t) foo :: (Int, String, F) - (Int, String) foo (i, s, MkF f) = (f i, f s) In fact, this extension has been implemented in Hugs and ghc as well as I understand it, but neither of these

Re: Preliminary Haskell 1.3 report now available

1996-03-07 Thread Lennart Augustsson
I always favoured `=' over `-', but I don't care much. -- Lennart

Re: Haskell 1.3

1996-03-08 Thread Lennart Augustsson
Suggestion: Include among the basic types of Haskell a type `Empty' that contains no value except bottom. Absolutely! But I don't think it should be built in (unless absolutely necessary). It looks ugly, but we could say that a data declaration does not have to have any constructors:

Re: Preliminary Haskell 1.3 report now available

1996-03-07 Thread Lennart Augustsson
I always favoured `=' over `-', but I don't care much. -- Lennart

Re: typekind inference

1996-03-10 Thread Lennart Augustsson
Are partial applications of data-types allowed then? If not, the higher kinds would not make sense. Yes, partial appication of data types is allowed. As you said, without it there wouldn't be much much point of it all. The report has a pointer to a paper by Mark Jones, where this is

Re: typekind inference

1996-03-11 Thread Lennart Augustsson
The restriction on the currying of type synonyms is therefore a semantic restriction on types, not just a syntactic restriction on type expressions. Exactly. But I don't think we need to complicate the kind system by having special kinds for type synonyms. In fact type synonyms can be said

Re: Type inference bug?

1996-10-29 Thread Lennart Augustsson
Doesn't Haskell do the same if you say: class Cow a where pig :: a - Int fly :: Int This is not legal Haskell. The class variable must occur in every method type. -- Lennart

HBC 0.9999.4

1997-04-24 Thread Lennart Augustsson
*** Haskell B. release 0..4 *** Hbc 0..4 is a compiler for full Haskell 1.4, both the language and the libraries. It is available for a large number of platforms (see below). * How to get it Use ftp to ftp://ftp.cs.chalmers.se/pub/haskell/chalmers/ and get the parts that

Report bug

1992-02-17 Thread Lennart Augustsson
The 1.2 preface says that type synonyms are exported with "T..", shouldn't that be "T(..)"? -- Lennart

Re: Division, remainder, and rounding functions

1992-02-17 Thread Lennart Augustsson
I think the suggestion Joe has made about division is good, but I also think it is overkill! Let's not add even more things to the Prelude that are not going to be used. My opinions on this matter is: - have something which is efficiently implementable (i.e. close to what the

Haskell library

1992-02-17 Thread Lennart Augustsson
The Haskell library seems to be contain few entries (none to be exact), so I've decided to add something. On animal.cs.chalmers.se I've placed two very simple, but useful modules. One implements a random number generator (a very good one; I didn't design it), and the other a sorting function

1.2 alpha mistake

1992-02-17 Thread Lennart Augustsson
In the table of Prelude operators (p. 53) the operator :% is listed, this operator is not (and should not be) exported from the Prelude, and should be removed from the table. -- Lennart

unzip

1992-02-25 Thread Lennart Augustsson
The new unzip* functions in 1.2 are not suitable for unzipping an infinite list. (What Phil called "A splitting headache".) Is this deliberate or a mistake? I'd like them to be lazier. All you need is to change from unzip = foldr (\(a,b) (as,bs) - (a:as,b:bs)) ([],[]) to

Prelude bug

1992-02-25 Thread Lennart Augustsson
After 3 hours of debugging I finally found it!! There is a bug in the definition of Complex cos, tan, cosh, and tanh in the Prelude (just sign flipping error). They should be as below. All this work using Standard Math really brings back memories... -- Lennart cos (x:+y) =

Re: Existential types

1992-03-19 Thread Lennart Augustsson
Nigel writes: [Note: Hope+C is not totally sound - but this is not due to the type system itself but rather to the existance of the unsafe (and untypeable) polymorphic equality function (alpha # alpha - truval). As in many (most?) functional languages this function is a bit-level compare...

Re: New lmlc/hbc

1992-07-30 Thread Lennart Augustsson
What is your problem with -i? I don't know that I've changed anything. But maybe some change got lost somehow? -- Lennart

New lmlc/hbc

1992-07-30 Thread Lennart Augustsson
if you want to know more. -- Lennart Augustsson - New Haskell B./LML release (0.998.1) There is now a new version of the Haskell B./LML compiler

Re: Is Haskell I/O system adequate?

1992-08-03 Thread Lennart Augustsson
IS THE I/O SYSTEM IN HASKELL ADEQUATE? I think the answer is: NO! What you want to do cannot be done in Haskell. Some people may argue that it should be done in another way, but I think your Miranda solution is perfectly good. If you are more interested in getting a running

Re: Is Haskell I/O system adequate?

1992-08-06 Thread Lennart Augustsson
I don't agree with this. Certainly for the example given, it is possible to code the required problem in Haskell, as Junxian J Liu indicated in the original posting: Of course Haskell is adequate in some sense. Just like Turing machines are. I always take these questions as regarding how

Re: What am I doing wrong???

1992-09-05 Thread Lennart Augustsson
The constructor layout is quite complicated (to save some space for common cases), in this case it would be like this --- | TAG | cno | | ---/--- __/ / v | VEK | 5 | | | ptr | ptr | ptr |

Re: A question on Haskell B compiler

1992-11-18 Thread Lennart Augustsson
Make sure you have the latest version, 0.998.5. If you still get the error mail me again. -- Lennart

Re: Another import question

1992-12-29 Thread Lennart Augustsson
kh In that case, perhaps you should always use data declarations (with a kh dummy constructor) rather than type synonyms. Some compilers will give kh you better error messages this way, and a good compiler might eliminate kh the extra constructor anyway (depending on how good a strictness

New version of the HBC Haskell compiler - 0.999.1

1993-01-14 Thread Lennart Augustsson
if you want to know more. -- Lennart Augustsson - New Haskell B./LML release (0.999.1) There is now a new version of the Haskell B./LML compiler

Re: hbc: Int/Integer

1993-03-30 Thread Lennart Augustsson
Evaluating sum [1..10] (compiled with hbc) results in a wrong value. Haskell seems to assume Int to be the correct type. But Integer is needed. Haskell assumes nothing at all. Haskell uses its default rules for ambiguous type resolution, and the normal setting of this is that Int is

Layout

1993-04-21 Thread Lennart Augustsson
Oh ye Haskell wizards. Is the following program syntactically legal or not? x = leta = let { b=1; c=2 } in 3 in 4 I.e. is the layout rule from an outer scope in effect even inside explicit brackets? Here's another x = let a = let in 3 in 4 OK, what

n+k patterns

1993-05-17 Thread Lennart Augustsson
Could those in charge of the formal semantics of Haskell (yes, that's you folks in Glasgow!) tell me what the meaning of n+k patterns are? In the report it says that case e0 of { x+k - e; _ - e' } translates to if e0 = k then { let { x' = e0-k } in e[x'/x] else e' Which =

More questions

1993-05-17 Thread Lennart Augustsson
More questions along the same lines as for n+k: Does == in the pattern match translation refer to == in PreludeCore? Does negate in the translation of -e refer to negate in PreludeCore? -- Lennart

Re: n+k patterns

1993-05-18 Thread Lennart Augustsson
Both (=) and (-) belong to classes defined in PreludeCore, and hence cannot be rebound. This was a deliberate decision, made in order to turn your point into a non-problem. It's true that things from PreludeCore cannot be rebound on the top level, but they can be rebound locally. So the

- again

1993-05-23 Thread Lennart Augustsson
I'm still struggeling with syntactic issues. Is the following expression allowed in Haskell? 2 * -3 Hbc, ghc, and gofer all accept it, but as far as I can see from the grammar it should not be allowed. What is the intention? -- Lennart

Re: the hbc parsing library

1993-09-20 Thread Lennart Augustsson
This is a rather belated summary of the replies to my earlier query about the library of parsing combinators which comes with the hbc compiler. OK, I'll try again. My last reply bounced. The parsing library you have got was just an experiment. It should never have been released. A much

Re: ADTs in Haskell

1993-10-04 Thread Lennart Augustsson
What, precisely, is the definition of a constructor strict in a specified field? In particular, how do you define it, and implement it, if that field has a functional type? Remember, in Haskell function types are unlifted, so we should have (\_ - bottom) = bottom. Well, if you go for

Re: ADTs in Haskell

1993-10-04 Thread Lennart Augustsson
Phil suggests that we add newtype T a_1 ... a_k = C t_1 ... t_n and use that to construct non-lifted ADTs. While this works well, I'd prefer to have strictness annotations on construtors instead. Haskell has very few means for making programs more efficient when you really need

Re: Arrays and Assoc

1993-10-05 Thread Lennart Augustsson
1. We should get rid of Assoc. I agree wholeheartedly! Do we have tp consider backwards compat? 2. Arrays should be lazier. I agree again. But I think both kinds should be provided. 3. AccumArray should mimic foldr, not foldl. Right! -- Lennart

Re: Haskell 1.3 (n+k patterns)

1993-10-12 Thread Lennart Augustsson
jl writes: I feel the need to be inflamatory: I believe n+k should go. Again, I agree completely. Let's get rid of this horrible wart once and for all. It's a special case that makes the language more difficult to explain and implement. I've hardly seen any programs using it so I don't

Re: Binary mode I/O

1993-10-13 Thread Lennart Augustsson
I find that this limits considerably its usage. Can't the Bin representations of Char, Int, Float and Double (and maybe more) be standardized? I think Haskell Bin stuff is braindamaged and rather useless. I suggest we remove from Haskell until we figure out how to do what that tries to do in

Re: re. 1.3 cleanup: patterns in list comprehensions

1993-10-15 Thread Lennart Augustsson
Stefan Kahrs writes: [About Miranda] This works, because patterns are syntactically a subclass of expressions. But this is not true for Haskell (@ and _ are only in patterns), but the technique still works. You just have to work harder and join pat and exp and then always have a semantic

Re: Strictness

1993-11-02 Thread Lennart Augustsson
To correctly evaluate seq (x, y) 5 it would be necessary to concurrently evaluate x and y, since (x, y) is bottom if and only if both x and y are bottom. (I enjoy finding a flaw in Miranda because there are so few to be found!) Another flaw: There is a seq hidden in foldl. --

Obfuscated Haskell Code Contest

1993-11-05 Thread Lennart Augustsson
), and a semantics that is still debated. The goal: a program of at most 1024 characters that is as incomprehensible as possible. Deadline: 1 Jan 1994. Send to: [EMAIL PROTECTED] Full rules (stolen from the C contest) below. Have fun -- Lennart Augustsson 1st International

Question

1993-11-17 Thread Lennart Augustsson
Prompted by an IOHCC entry I have the following question: Is the following legal? -- module M(x) where x = 1 z = x==1 -- If the definition of z wasn't there it would clearly be illegal since it exports an overload non-function value. But the use of x

Re: A new view of guards

1997-04-28 Thread Lennart Augustsson
Is this a storm in a teacup? Much huff and puff for a seldom-occurring situation? No! It happens to me ALL THE TIME. The Glasgow Haskell Compiler is absolutely littered with definitions like clunky. I agree! I considered a similar extension some years ago now, but I never wrote it down.

Re: local definitions of `=' etc.

1997-05-27 Thread Lennart Augustsson
Should `test' evaluate to `[1,2,3,4,5,6]' or `[4,5,6,4,5,6,4,5,6]'? That is, should the `do' syntactic sugar expand to code that uses plain `' or `Prelude.'? The Haskell 1.4 report is not clear on this point, IMHO. Here is a quote from the report (3 Expressions): Free variables and

Re: RE: how about main :: IO Int

1997-08-22 Thread Lennart Augustsson
Isn't this a Unix-specific convention, to treat the value returned by main() as the exit value of the process? Yes, and it only works in some flavours of Unix. The proper way to exit a C program is to call exit(). The proper way to exit a Haskell program is to call exitWith. --

Re: length that yields Integer - Int is a WART

1997-08-25 Thread Lennart Augustsson
I need the length of a list and it should be of type Integer, while the prelude function yields type Int. This looks like a bug in the prelude to me. It's not inconceivable that in some implementation it might be possible to have a list with length greater than the capacity of Int. So

Re: RE: how about main :: IO Int

1997-08-22 Thread Lennart Augustsson
Nope, returning from main is defined by the C standard to be equivalent to calling exit(), as if main() where invoked as `exit(main(argc, argv))'. Well, it might be standardized, but I've been bitten by implementations that generate a random exit code if you just return 0 from main. This was

Re: Haskell 1.4 and Unicode

1997-11-07 Thread Lennart Augustsson
Unicode was added at the last moment, so there is likely to be some descrepancies. 1) I assume that layout processing occurs after Unicode preprocessing; otherwise, you can't even find the lexemes. If so, are all Unicode characters assumed to be the same width? I think that's what is

Re: Monads and their operational behavior

1997-11-27 Thread Lennart Augustsson
Space leaks like this are lurking in a lot of places in the standard prelude, so it's quite funny that Hugs/GHC don't address this problem, although solutions are known. What's the behaviour of NHC/HBC in these cases? hbc has 876 bytes in use on the heap and the stack is 13 entries deep.

Re: 2^(-1)

1998-04-09 Thread Lennart Augustsson
Why is the class heirarchy set up such that 2^(-1) gives and error in hugs and ghc? It has nothing to do with ghc or Hugs, it's the way Haskell is defined. If (^) was defined the way you suggest then it would be impossible to raise a number from the Integral class to an exponent since there

Re: FW: Exceptions are too return values!

1998-06-10 Thread Lennart Augustsson
* raise :: String - a * handle :: (String - IO a) - IO a - IO a I'd be interested to know what people think of this. I like the trick of handle being in the IO monad to avoid problems with evaluation order. As usual though, it can be a high price to pay if all you wanted was a little local

Re: Declared type too general?

1998-06-20 Thread Lennart Augustsson
I have defined: class Aggregate a where toList::(Num b)=a-[b] fromList::(Num b)=[b]-a data MyAgg =Agg Int Int instance Aggregate MyAgg where toList (Agg x y) = [x,y] fromList [x,y] = (Agg x y) Hugs won't compile this because it says the declared type is too general.

Re: Declared type too general?

1998-06-23 Thread Lennart Augustsson
class Aggregate a where toList::(Num b)=a-[b] fromList::(Num b)=[b]-a data MyAgg =Agg Int Int instance Aggregate MyAgg where toList (Agg x y) = [x,y] fromList [x,y] = (Agg x y) I understand what it is saying. I don't understand why it is a problem. MyAgg abides

Re: RE: Felleisen on Standard Haskell

1998-08-04 Thread Lennart Augustsson
That said, the more I think about it, I don't really believe that "Standard Haskell" will accomplish much. The fact is that everyone wants many of the features in Haskell 2, and so even today would prefer using an implementation that is probably not fully compliant with anything that is

Re: declaring properties

1998-10-21 Thread Lennart Augustsson
I am wondering if it would be feasible to declare laws that are guaranteed to hold for some objects in a Haskell-like functional language. It's feasible. But you need a richer language than Haskell. A language with dependent types would work. Take a look at Cayenne. It can express these kind

Re: declaring properties

1998-10-21 Thread Lennart Augustsson
Thank you. I had a look a couple months back but I would be glad if you could provide a small example (please do not use your obfuscating skills :-) I think the example of having a proof that the (==) is an equivalence relation is exactly what you're talking about. It's given in the paper.

Re: MonadZero (concluded?)

1998-11-05 Thread Lennart Augustsson
Option 1: Monad( .., mfail, mzero ), MonadPlus( mplus ) Option 2: Monad( .., mfail), MonadPlus( mzero, mplus ) Option 3: Monad( .., mfail), MonadPlus( mplus ), MonadZero( mzero ) I prefer 3 (with 2 as a close second) since it is most like status quo. -- Lennart

Re: Haskell 98 progress

1998-11-05 Thread Lennart Augustsson
Simon wrote: - The do-expression and MonadZero debate. You'll have seen a lot about this, and I'll circulate a separate proposal. Sorry, I'm not happy with this proposal. Monads are a well defined mathematical concept and I think the Monad class should reflect this. Having a mzero (and

Re: MonadZero (concluded)

1998-11-06 Thread Lennart Augustsson
This is ok by me. Does anyone object? I don't understand why MonadZero/MonadPlus should go away. Isn't the idea that when in doubt Haskell 98 should do what Haskell 1.4 did? What's the compelling reason for removing these classes? I've used several of the functions that would go away. It

Re: monomorphism etc.

1998-11-12 Thread Lennart Augustsson
I think it would be really nice if it were possible to create a container capable of containing any number of objects of any number of types It would That's not possible in Haskell. Since you want an any number of different types in this new type it would need to have a variable number

Re: monomorphism etc.

1998-11-12 Thread Lennart Augustsson
[...] if you dislike tuples you can use nested pairs At the cost of losing a little type-safety. That's really a very minimal loss. (And it's not really a loss of type safety, just the possibilty of confusing a part of a "tuple" with another "tuple"). I'd be more worried about the

Re: Haskell 98 progress...

1998-11-23 Thread Lennart Augustsson
I'd better make sure that scanning *can't* give an error, though. There are several errors that can occur in the lex phase, e.g., '\q'bad character literal "\q"bad string literal \u0001 bad character in input I REALLY dislike the idea of having my

Re: Haskell 98 progress...

1998-11-23 Thread Lennart Augustsson
Actually, shouldn't "isn't" be parsed as a single varid? From the 1.4 report: OK, OK, let me change my example: {- A comment, isn 't it? -} -- Lennart

Re: Reduction count as efficiency measure?

1998-11-24 Thread Lennart Augustsson
which of those data structures would give me the best response time? There is no simple answer to that question. It depends on how you use it and what implementation you're going to use. Set up a typical usage scenario and test it on the platform you are going to use it on, that's

Re: Reduction count as efficiency measure?

1998-11-24 Thread Lennart Augustsson
So are assembly language instructions. Yet, I could think about some average instruction size for similarly written programs. Do you mean `time' rather than `size'? If you do, then you can get rather wrong results when considering assembly language since the concept of timing an individual

Re: Random comments

1998-12-03 Thread Lennart Augustsson
The stream-based approach has its problems if one requires random values of different types. If this is vital one automatically starts to use functions of type Seed - (value, Seed). I don't understand at all. Why would random values of different types require that signature? Why can you use

Re: Random comments

1998-12-03 Thread Lennart Augustsson
I guess you would end up with nearly the same code (unless I overlook an obvious alternative in which case I would love to see the simple and straightforward solution ;-). Let's be concrete: say you need n Integers within range (l, r), m Ints and p Doubles. Using a monad-based approach one

Re: Haskell 2 -- Dependent types?

1999-02-17 Thread Lennart Augustsson
I'm not sure that anybody has "accepted" undecidable type checking. People using Gofer or C++ seem to have. -- Lennart

Re: Haskell 2 -- Dependent types?

1999-02-17 Thread Lennart Augustsson
2.in the face of the above, we need to give the compiler more guidance. Personally, I favour type declarations everywhere: all identifiers should be introduced as being of a particular specified type. Of course, whether these principles are compatible with Haskell it another

Re: A plea for a little Haskell help.

1999-02-17 Thread Lennart Augustsson
What's wrong with class Foo a b where write :: a - b - IO () ? Well, it's not Haskell. :-) -- Lennart

Re: Haskell 2 -- Dependent types?

1999-02-19 Thread Lennart Augustsson
OK, I'm curious. Two people replied that C++ has undecidable type checking. I was not aware of this (although I can't say I'm too surprised); do you have a reference? It's actually the template processing that can loop, but it is sort of part of the type checking. You can find an article

Re: Haskell 2 -- Dependent types?

1999-02-20 Thread Lennart Augustsson
Nick Kallen [EMAIL PROTECTED] wrote: apply f (p:ps) = apply (f p) ps apply f [] = f I wanted to express the type as something like: apply :: (a - a - ... - a) [a] - a No, that's not what you want. :-) You want apply :: (a - a - ... - b) [a] - b I think the distinction is important

Re: Haskell 2 -- Dependent types?

1999-02-21 Thread Lennart Augustsson
The basic problem that I have with this is that although dependent types do allow you to specify a lot of things in the type system, I'm not sure that using the type system is really the best way to specify these things. Well, I think types are just the place for these things. People already

Re: Haskell 2 -- Dependent types?

1999-02-21 Thread Lennart Augustsson
Well if the ComplicatedTypeToSpecifySorting is correct (I don't know if this is possible, but I suspect it isn't) it will of course not type check. Of course it is possible. The types in Cayenne have the same power as predicate logic, so you can specify most anything you like. Here's a

Re: Haskell 2 -- Dependent types?

1999-02-21 Thread Lennart Augustsson
F a * = member (map (F a) [0..]) // member [a] a - Bool I mave no clue what this means. What is `member'? Member is memq, in, etc. Checks for membership in a list. I'm still lost. What is // and how does it bind? This is how I parse it: (member (map (F a) [0..])) // ( (member [a] a)

Re: Haskell 2 -- Dependent types?

1999-02-22 Thread Lennart Augustsson
No, the proof (whereever it is) would no longer type check. As I understand it, this is not necessarily true: if the proof contains loops, it might type check, even though it is not really a valid proof. You're right. If the proof is looping it will still pass as a proof. --

Re: Haskell 2 -- Dependent types?

1999-02-21 Thread Lennart Augustsson
Well, yes, up to a point, but it may be clearer if the simple regular types part is kept separate from the undecidable part, as was done in NU-Prolog, or as is done in Eiffel. I'm not necesssarily advocating that the properties and proofs of these properties should be mixed with the regular

Re: Haskell 2 -- Dependent types?

1999-02-22 Thread Lennart Augustsson
I consider even the second one to be mixing the proofs with the code, because there's no easy way that I can tell at a glance that `sortReallySorts' is a proof rather than a program. But I consider that a feature and not a bug. :-) -- Lennart

Re: Haskell 2 -- Dependent types?

1999-02-22 Thread Lennart Augustsson
[EMAIL PROTECTED] wrote: enabling types to express all properties you want is, IMO, the right way. Why do I feel that there must be another approach to programming? How many people do you expect to program in Haskell once you are done adding all it takes to "express all imaginable

Re: Haskell 2 -- Dependent types?

1999-02-22 Thread Lennart Augustsson
...I thought about this pretty hard. Particularly I thought about using classes; this was fruitless. So I decided I'd invent a new language feature and a nice little syntax to handle it. Sorted l r = Ordered r /\ Permutation l r sort :: (l :: [a]) - (r :: [a]) = Sorted l r You've

Re: Haskell-2

1999-02-23 Thread Lennart Augustsson
I think views are really neat, but am not quite sure how I feel about pattern guards. Views are neat. Pattern guards are an absolute must. They are just The Right Thing when you need them, and working around not having them is clumsy. -- Lennart

Re: Haskell 2 -- Dependent types?

1999-02-25 Thread Lennart Augustsson
I've lost track of what we're talking about here. In what system can we not hope for principal types? (I believe that there are type theories with dependent types, such as the one in Thompson's _Type Theory and Functional Programming_, where each term has at most one type; so it can't

Re: Haskell 2 -- Dependent types?

1999-02-26 Thread Lennart Augustsson
This occurs because in the absense of type declarations, Haskell assumes that any recursion will be monomorphic, which is in general not necessarily the case. As I'm sure you know, type inference is in general impossible for polymorphic recursion, and since Haskell insists on decidable type

Re: Haskell 2 -- Dependent types?

1999-02-27 Thread Lennart Augustsson
So what does Cayenne do if you don't declare the type for `push'? Does it report an error? The basic principle in Cayenne is that you need type signatures everywhere. This is sometimes rather verbose and is relaxed in some cases, but not here. If you omit the type signature the compiler

Re: constructor class data constructor context

1999-03-02 Thread Lennart Augustsson
data (Num a) = Rsi a = Rsi a a data (Integral a) = Rse a = Rse a a Contexts on data declarations in Haskell essentially pointless. Just remove them and figure out how to make your code work without them, since they don't do anything. -- Lennart

Re: question to GHC 4.02

1999-03-29 Thread Lennart Augustsson
I have written this small simple program module Add where add :: Int - Int - Int addx1 x2 x1 + x2 I have create an object file with the command % ghc -c additon.hs Now I will create an executable file. What I have to do? Well, where is your Main module? Haskell programs

Re: Plea for Change #2: Tools

1999-03-29 Thread Lennart Augustsson
ghc -c Add.hs ghc -c Main.hs ghc -o Main Main.o Add.o Or just ghc Add.hs Main.gs But I agree. I always use hbcmake and it does what I want. -- Lennart

Re: {-# rules

1999-05-08 Thread Lennart Augustsson
Wolfram Kahl wrote: In the end, my dreams even include a proof format that can be checked by the compiler :-) Dependent types! That's all you need. -- -- Lennart

Re: View on true ad-hoc overloading.

1999-05-19 Thread Lennart Augustsson
Kevin Atkinson wrote: I was wondering what the generally felling to allowing true ad-hoc overloading like it is done in C++ in Java but more powerful because functions can also be overloaded by the return value. As I see it it will solve a hole series of problems: 1) Allow constructor

Re: Kind Question

1999-05-26 Thread Lennart Augustsson
Kevin Atkinson wrote: Kevin Atkinson wrote: Lennart Augustsson wrote: Your grammar does not seem to cover ((*-*) - *) - * which you could get (as the kind of D) e.g. from data D c = C (c []) Now how would I use a type considering its constructor has a signature

Re: Kind Question

1999-05-26 Thread Lennart Augustsson
Now how would I use a type considering its constructor has a signature of: C :: a [] - D a data L1 f = C1 (f Int) x :: D L1 x = C (C1 []) -- Lennart

Re: Kind Question

1999-05-26 Thread Lennart Augustsson
Kevin Atkinson wrote: I have a question for the Haskell experts on the list. (Especially Haskell compiler writers). Is it possible to have a kind more complicated than: kind = kind' | kind' - kind kind' = * | ( kind'' ) kind'' = * | * - kind'' Yes, kinds are generated by the grammar

Re: how to write a simple cat

1999-06-01 Thread Lennart Augustsson
Keith Wansbrough wrote: Sven Panne wrote: Don't fear! Mr. One-Liner comes to the rescue:;-) longerThan fn lenlim = readFile fn = lines .| filter (length .| (lenlim)) .| zip [1..] .| map (\(n,l) - shows n ") " ++ l) .| unlines .| putStr Friedrich wrote: Do you want to

Re: how to write a simple cat

1999-06-04 Thread Lennart Augustsson
Friedrich Dominicus wrote: That might be good advice but I/O is one of the most essential things and I have to know how to use it proper for writing small skripts. Actually, you can do a lot without learning about I/O. The function `interact' converts a `String-String' function into an IO

Re: Language Feature Request: String Evaluation

1999-06-08 Thread Lennart Augustsson
"S. Alexander Jacobson" wrote: HacWrite certainly seems like an improvement over Haskell. However, it is just not as good as the scripting languages. HacWrite still requires the author to differentiate between strings and other types, still requires explicit use of show and still requires

  1   2   3   4   5   6   7   8   9   10   >