Tue, 2 Nov 1999 12:59:58 -0800 (PST), Ronald J. Legere [EMAIL PROTECTED] pisze:
BTW, I know about the array type. Actually I dont understand it
very well though. Between looking at the source and the docs, i
still cant see how it is meant to be used. I would love to look at
an example.
4 Nov 1999 10:09:48 GMT, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] pisze:
[...]
In my example it is not so trivial: the states are stored in some
lists, compared to one another and passed to a function together
with a different line contents than the previous time, so it is
not sufficient
I tried to haskellize an algorithm which poorly fits into the
functional style: plasma fractal generation. It computes a rectangular
array in a funny order, using previously computed elements, and uses
random numbers all the time.
It works (I didn't check if the result is correct but it's not
Fri, 25 Jun 1999 09:25:48 -0700, Simon Marlow [EMAIL PROTECTED] pisze:
f = f where
g = g
then it isn't immediately clear whether the 'g = g' declaration belongs to
the where clause, or to the top level (and the where clause is empty).
Hmm, is it so important to allow using
Tue, 6 Jul 1999 12:51:23 +0100 (BST), Peter Hancock [EMAIL PROTECTED] pisze:
I thought that one could start with something simple, like a "before"
list and an "after list".
Ah, thanks, I've forgotten about this trick, which I've seen a long
time ago in some Turbo Pascal demo! :-) It might be
1. Is there any difference between
\a b - (a, b)
and
let f a b = (a, b) in f
?
2. Is there any difference between
case x of (a, b) - (b, a)
and
let (a, b) = x in (b, a)
?
--
__("Marcin Kowalczyk * [EMAIL PROTECTED] http://kki.net.pl/qrczak/
\__/ GCS/M d- s+:--
Sat, 24 Jul 1999 00:41:08 +0200, Lennart Augustsson [EMAIL PROTECTED] pisze:
a) The behaviour in for the operator in C is undefined when
the number of steps is larger than the number of bits.
b) Haskell does not have a function called primShiftInt so
you can't say that's intended or
Wed, 28 Jul 1999 22:31:41 +0400 (MSD), Grigoriy Strokin [EMAIL PROTECTED] pisze:
- In TclPrims.g302.hs some functions looked like
primInitTcl:: IO Bool
primInitTcl = map int2bool (_ccall_ primInitTcl)
I can't understand why (map int2bool) is applied to
a non-list, neither
Fri, 30 Jul 1999 05:12:51 -0700, Simon Marlow [EMAIL PROTECTED] pisze:
The main reason for its inclusion was to allow things like
let f x = x in ...
and also to automatically insert the final '}' before the end of file.
Perhaps the layout rule should be restricted to these two
Sat, 14 Aug 1999 02:31:00 +1000, Fergus Henderson [EMAIL PROTECTED] pisze:
The merits of this restriction have been the subject of quite a
bit of debate. I think there is a reasonably good chance that it
may be dropped in Haskell 2.
How does the Haskell standard evolve? Who decides how it
Thu, 19 Aug 1999 19:08:49 +1000, Fergus Henderson [EMAIL PROTECTED] pisze:
The problem with this is that the caller of `biggest' needs to call
`mkShape' on each element in the list before it can construct the list.
Not _bad_, but rather unwieldy. The caller can't simply use `map' either
Fri, 20 Aug 1999 02:59:09 +1000, Bob Howard [EMAIL PROTECTED] pisze:
data BTree Integer = Leaf Integer | Node Integer (BTree Integer) (BTree Integer)
Write either
data BTree a = Leaf a | Node a (BTree a) (BTree a)
or
data BTree = Leaf Integer | Node Integer BTree BTree
depending on what
Fri, 20 Aug 1999 15:57:51 +0200 (CEST), xander [EMAIL PROTECTED] pisze:
is there an opposite (:) available in haskell?
[...]
Sometimes it suffices to create the list backwards and reverse it at
the end. This is O(n) instead of O(n^2) for repeated (++[x]).
I think that composing a list by (.)
Sun, 22 Aug 1999 00:30:29 +0200, Erik Meijer [EMAIL PROTECTED] pisze:
Well, in some sense .h files are a dedicated interface language
(and IDl is nothing more than a header file with some directional
attributes).
I already know C and .h format. Where can I learn IDL?
--
__("Marcin
Tue, 24 Aug 1999 09:28:51 -0700 (PDT), Ronald J. Legere [EMAIL PROTECTED] pisze:
It WOULD be nice if you could match on functions and not just
constructors. But I presume that the constructor/function dichotomy
in Haskell is what allows it to be strongly typed?
How would you define the
Wed, 8 Sep 1999 18:36:14 +0900, Frank A. Christoph [EMAIL PROTECTED] pisze:
concatSep :: [a] - [[a]] - [a]
with semantics
concatSep _ [] = []
concatSep _ [xs] = [xs]
concatSep sep (xs:xss) = xs ++ sep ++ concatSep sep xss
It is already defined: concat . List.intersperse
--
I have just read http://www.cs.chalmers.se/~rjmh/Papers/arrows.ps.
Very interesting. Where can I read more? Are there plans to replace
standard Haskell's monads with arrows or integrate them in some
other way? I'm not sure how exactly could it look like in practice.
--
__("Marcin Kowalczyk
Thu, 9 Sep 1999 14:48:50 +0100 (BST), [EMAIL PROTECTED]
[EMAIL PROTECTED] pisze:
I missed the discussion that decided that show should omit the
syntactically unnecessary spaces when converting lists and tuples.
While this may save space in files, I don't see that we are
On 14-Sep-1999, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
the semantics of hGetFileContents was just as if
the entire contents of the file was read instantaneously
Tue, 14 Sep 1999 20:41:40 +1000, Fergus Henderson [EMAIL PROTECTED] pisze:
Well, consider the case where the file
Wed, 15 Sep 1999 00:02:02 +0200, Lennart Augustsson [EMAIL PROTECTED] pisze:
Only numeric types are subject to defaulting.
And I don't like this solution. Maybe it is practical, but inelegant.
Haskell is very elegant in general but `deriving' and `default' have
too arbitrary rules for my
Sat, 18 Sep 1999 00:06:37 +0200 (MET DST), Juergen Pfitzenmaier
[EMAIL PROTECTED] pisze:
I dont't care very much how fast a program runs. I care about how
long it takes me to write it. If you take a programming task of
reasonable complexity you will finish *months* earlier using a
--good--
Wed, 22 Sep 1999 14:26:03 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
So far, no clear progrm example appeared in this list to demonstrate
Haskell's in-efficiency in comparison to other languages.
I have not done benchmarking myself yet, but in
Thu, 23 Sep 1999 14:19:54 +0900, Manuel M. T. Chakravarty [EMAIL PROTECTED]
pisze:
The fact that the given URL simply produces a "not found" error
message on my machine,
I am sorry, I didn't know it was no longer there. I am putting it in
http://kki.net.pl/qrczak/bridging.ps.gz
PS: I am
Thu, 16 Sep 1999 12:07:14 -0400 (EDT), Christopher Jeris [EMAIL PROTECTED] pisze:
Then BtreeMap is not an instance of Map, because its methods come
with the constraint (Ord a).
[...]
This subject is discussed in
http://research.microsoft.com/users/simonpj/Papers/collections.ps.gz
This
Wed, 29 Sep 1999 11:43:06 +0200, George Russell [EMAIL PROTECTED] pisze:
When that happens in my code it counts as a bug! Therefore error
is appropriate. If you are in some larger Haskell universe calling
component Haskell code it is unfortunate if a single error calls the
entire universe
Thu, 30 Sep 1999 02:08:23 +1000, Fergus Henderson [EMAIL PROTECTED] pisze:
I only don't like the details about IOError. It's not extensible
and Dynamic is still not nice. I have no idea how to make it
better. Probably some general way of making extensible datatypes.
Could you explain
Fri, 8 Oct 1999 01:22:43 +0100 (BST), Adrian Hey [EMAIL PROTECTED] pisze:
I've read this paper, and it is good, but I still see no reason
to change my opinion regarding referential transparency and IO.
But I am terribly confused about this issue, there seems to be
no real consensus about
Tue, 5 Oct 1999 14:10:26 -0400 (EDT), Kevin Atkinson [EMAIL PROTECTED] pisze:
1) Dynamic types. You can't cast up. That is you can't recover the
original type from an object in a existential collection. You need to
use a dynamic type library for that. And the library proved with hugs
and
Fri, 8 Oct 1999 19:01:07 +0100 (BST), [EMAIL PROTECTED]
[EMAIL PROTECTED] pisze:
Some time ago there was a discussion about what to call reverse
composition (I can't find it in the archive - needs a search option?)
Just now I thought of .~ from . for composition and ~ (tilde,
but commonly
Sat, 9 Oct 1999 12:42:20 +1300, Brian Boutel [EMAIL PROTECTED] pisze:
Be careful. '-' is two symbols. Replacing it by one symbol can change the
semantics of a program by affecting layout.
No, because only the indent before the first non-whitespace character
in a line matters. Haskell
Thu, 07 Oct 1999 19:13:34 -0400, Kevin Atkinson [EMAIL PROTECTED] pisze:
One think I really think it needs is the ability to group a
collection of functions with a tag. And then when importing a
module you can ask to only import that tag. For example:
module A
list: head tail foldr
Sat, 09 Oct 1999 13:08:39 +0200, Lennart Augustsson [EMAIL PROTECTED] pisze:
No, because only the indent before the first non-whitespace character
in a line matters. Haskell programs can be typeset even in proportional
font as long as indents have correct relationships between their
Sun, 5 Dec 1999 17:46:57 +0300 (MSK), S.D.Mechveliani [EMAIL PROTECTED] pisze:
Is not deleteBy :: (a-Bool) - [a] - [a]
more natural for the library than
deleteBy :: (a-a-Bool) - a - [a] - [a]
?
Possibly, but then IMHO it should not be called
Tue, 18 Jan 2000 12:44:57 +0300 (MSK), S.D.Mechveliani [EMAIL PROTECTED] pisze:
By the way, the List.partition definition
\p xs - (filter p xs, filter (not .p) xs)
is not it the simplest and the best implementation?
It evaluates p twice on each element.
--
Tue, 18 Jan 2000 13:46:27 +0100, Jan Kort [EMAIL PROTECTED] pisze:
This minor inconsistency has been bothering me for some time:
Prelude drop 10 "test"
""
Prelude drop (-1) ""
""
Prelude drop (-1) "a"
"
Program error: Prelude.drop: negative argument
Hmm, right...
We could argue what
Mon, 24 Jan 2000 07:49:30 -0800, Simon Peyton-Jones [EMAIL PROTECTED] pisze:
(A) Make them defined for any n. If n 0, do something reasonable:
take: give empty list
drop: give whole list
(B) Make them defined for n length xs, but fail for n 0.
I vote for (B) or
Tue, 25 Jan 2000 12:14:29 -0500 (EST), Chris Okasaki [EMAIL PROTECTED] pisze:
I would have no arguments with either approach, or with any other
approach that makes Nat explicit in the type.
But if the type *says* Int, then it should have reasonable behavior
for ints.
I can't agree with
Tue, 25 Jan 2000 18:12:32 +0100, jwit [EMAIL PROTECTED] pisze:
What I'm getting at is some kind of way to get your
hands on an abstract syntax representation of a Haskell
expression/datatype/module, modifying it, re-typechecking it,
and then transforming it back into a Haskell value.
In
Wed, 26 Jan 2000 08:34:59 -, Chris Angus [EMAIL PROTECTED] pisze:
One thing I dont like, is going through IO, although I guess this
wouldnt matter so much.
*Of course* it has to be in IO! Loading an external function has
everything to do with I/O.
When you write
fooBar x =
Tue, 25 Jan 2000 14:41:54 -0800, Craig Dickson [EMAIL PROTECTED] pisze:
And I like having "head []" be an error, because if it returned
[], then it seems to me that that would have nasty implications
for pattern-matching.
head [] can't return anything than bottom because anything else has
Tue, 25 Jan 2000 15:33:25 -0800, Craig Dickson [EMAIL PROTECTED] pisze:
If "(x:xs)" does not match [], then the reason for this should be
that [] has no head to bind to x, nor tail to bind to xs;
No, the reason is simply that [] and (:) are distinct constructors.
E.g. the pattern Nothing
Wed, 26 Jan 2000 16:16:39 +0100 (MET), Ch. A. Herrmann
[EMAIL PROTECTED] pisze:
the problem with an unnecessary restriction is that it complicates
reasoning about the program.
Instead of
xs
= { take/drop-law }
take (n-m) xs ++ drop (n-m) xs
you have to write, e.g.:
xs
Thu, 3 Feb 2000 23:56:02 +1300 (NZD), Tom Pledger [EMAIL PROTECTED] pisze:
I hope that Double isn't Bounded. Double was meant to be one of the
"other things" in the opening remark:
"Everything which is both an X and a Y is also a Z, and some other
things are Zs too."
OK, the
Sun, 6 Feb 2000 11:29:28 +0300 (MSK), S.D.Mechveliani [EMAIL PROTECTED] pisze:
In my case, it was not so bad. The results were different in a weaker
sense. It was like this:
card z5 -- Fin 5
"integers modulo 5 has finite cardinality 5"
Thu, 10 Feb 2000 23:17:13 +1100 (EST), [EMAIL PROTECTED] [EMAIL PROTECTED] pisze:
Could we please have lightweight extensible records for Haskell
(as in the paper by (Mark|Simon Peyton) Jones in the 1999 Haskell
Workshop).
(http://www.cse.ogi.edu/~mpj/pubs/recpro.ps.gz)
I've read it. I
More. Extensible records makes a syntactic difference between field
access and function call. So if one wants to export a type abstractly
or simply to provide functions operating on it without fixing the
fact that they are physically fields, he ends in writing functions like
size:: MyRecord -
Sun, 27 Feb 2000 19:21:05 +0300 (MSK), S.D.Mechveliani [EMAIL PROTECTED] pisze:
module G (g)
where
g:: Eq a = (a - Bool) - [a] - [Bool]
gh xs = map h xs
Back to the topic of visible imports. Change this definition to:
g:: Eq a = (a - Bool) - [a] - [Bool]
g h
Thu, 10 Feb 2000 23:00:08 +0300 (MSK), S.D.Mechveliani [EMAIL PROTECTED] pisze:
Generally it does not fit into my mental model of a Haskell class.
How could it be that adding an instance *constrains* what else we
can do with a type (define an instance of another class)?
In what way it
Thu, 24 Feb 2000 14:17:43 +0300 (MSK), S.D.Mechveliani [EMAIL PROTECTED] pisze:
That is, f receives a dictionary of Eq methods on the type a, as
specified in its type. It builds a dictionary of Eq methods on the
type Maybe a itself, but the fact that it uses instance Eq (Maybe a)
is not
On Mon, 28 Feb 2000, S.D.Mechveliani wrote:
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]
g h xs@(x:_) = (Just x == Just x) : map h xs
- "because this g uses Eq
Tue, 29 Feb 2000 13:26:00 +0300 (MSK), S.D.Mechveliani [EMAIL PROTECTED] pisze:
I propose for the user to remain with `Eq a ='.
Let the compiler itself deduce and add the needed context.
No, no, no.
Would the function really have the type that is specified, or the
one with extended context?
Tue, 29 Feb 2000 14:20:32 +0300 (MSK), S.D.Mechveliani [EMAIL PROTECTED] pisze:
h :: Eq a = a - a - Int
h x y = if x == y then 0 else 1 + h [x] [y]
which would make h "1" "2" return 7 if in some other module there is:
instance Eq [[[String]]] where
x == y =
Wed, 1 Mar 2000 21:09:17 +0300 (MSK), S.D.Mechveliani [EMAIL PROTECTED] pisze:
But the instance (dictionary) for Eq [Bool] can be deduced in
multiple ways! The first is the standard `deriving'. The second
deduces from the user instance.
But I have certain wise rules to
Why are they undefined? IMHO [] would be a perfect answer.
Consistent with
scanr1 f . drop n = drop n . scanr1 f
scanl1 f . take n = take n . scanl1 f
and everything else I can imagine.
--
__("Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
\__/ GCS/M
Tue, 14 Mar 2000 13:54:49 + (GMT), [EMAIL PROTECTED] [EMAIL PROTECTED] pisze:
I have heard that rpm version 3 now contains a way to specify
build-time requirements (as distinct from install-time).
Yes, "BuildRequires:".
Is it sufficient to describe the bootstrapping of self-compiling
Thu, 16 Mar 2000 18:00:35 +, Malcolm Wallace [EMAIL PROTECTED] pisze:
GHC and HBC tend to produce code that is, broadly speaking,
equally fast,
I experienced each of these compilers producing code about 3 times
faster than the other for a simple program.
--
__("Marcin Kowalczyk *
Thu, 16 Mar 2000 14:38:30 -0500, Chris Okasaki [EMAIL PROTECTED] pisze:
How are these two statements reconciled for recursive
types such as
newtype Foo = F Foo
IMHO simply the only value of this type is bottom. I see no problem
here, neither does Hugs.
But GHC sees some problem and
Mon, 20 Mar 2000 14:59:26 +0100, Jan Brosius [EMAIL PROTECTED] pisze:
let v = runst (newVar True)
in
runST (readVar v)
Consider the last line ;
Consider the first line before, because it must be typed in order to
type the last line.
"newVar True" has type "ST s (MutVar s
Wed, 22 Mar 2000 15:23:32 +0100 (MET), Bjorn Lisper [EMAIL PROTECTED] pisze:
I think the cleanest solution is to add a method "hseq" to the Eval
class, which is similar to seq but evaluates its first argument
hyperstrictly before returning its second.
You mean "implicit Eval"? Then I would
Wed, 22 Mar 2000 17:26:25 +0100 (MET), Bjorn Lisper [EMAIL PROTECTED] pisze:
I don't know about full polymorphism (I guess hseq would not work
well for function-typed arguments, for instance), but I know there
are situations where it can be important from a practical perspective
to add
23 Mar 2000 20:27:13 +0900, Jens-Ulrik Petersen [EMAIL PROTECTED] pisze:
Do any of you know of an (n)curses binding written in Haskell?
http://qrczak.ids.net.pl/Curses.hs might be a very incomplete starting
point (for GHC). I don't plan to continue it soon, I only needed it
for some
Mon, 27 Mar 2000 16:15:45 +0200, Sven Panne [EMAIL PROTECTED]
pisze:
The time has come for another "final" :-} word on the low-level API for
Haskell's foreign function interface.
What about the high-level API (apart from C2HS)?
To solve this problem, every Haskell implementation should
Tue, 28 Mar 2000 02:22:46 +1000, Fergus Henderson [EMAIL PROTECTED] pisze:
This mapping assumes that you want the unboxed types in C. What if
you want to pass an unevaluated closure (e.g. so that you can later
pass it back to Haskell and then evaluate it)?
StablePtr is already there.
What
Tue, 28 Mar 2000 12:26:34 +1000, Fergus Henderson [EMAIL PROTECTED] pisze:
It would be fine to have a `typedef void *HsStablePtr'. But it is important
that you do not lose static type information when exporting Haskell functions
to C. So a parameter of type `StablePtr Int' on the Haskell
Tue, 28 Mar 2000 18:25:27 +1000, Manuel M. T. Chakravarty [EMAIL PROTECTED] pisze:
One idea that we discussed is that `GtkText*' would map to
`Ptr GtkText', where `GtkText' is opaque und would indeed be
implemented as
newtype GtkText = GtkText ()
And Ptr is what?
"type Ptr a = Addr"
Tue, 28 Mar 2000 20:14:26 +1000, Fergus Henderson [EMAIL PROTECTED] pisze:
For type constructors like `-', `[]', and `Maybe', which (unlike
StablePtr) don't have any C equivalent, I think you probably need
to drop the structure, and just keep the top-level type constructor,
thus mapping that
Tue, 28 Mar 2000 14:52:56 +0200, Sven Panne [EMAIL PROTECTED]
pisze:
[...]
Strange: I agree in every point!
3) If ISO C has long long (don't know, my copy of Harbison/Steele doesn't
mention it), Int64/Word64 should be made mandatory.
C99, the recently approved ISO C standard, does have
Tue, 28 Mar 2000 14:52:56 +0200, Sven Panne [EMAIL PROTECTED]
pisze:
1) To be honest, I don't know enough about char/wchar_t/Unicode/ISO-10646
to make suggestions here. Could somebody more knowledgeable make a
proposal how these should be handled in the FFI? Keep in mind that this
Wed, 29 Mar 2000 15:00:46 +1000, Manuel M. T. Chakravarty [EMAIL PROTECTED] pisze:
6) Add HsBool with a mapping to an arbitrary integral C type, see Fergus'
point about a Haskell API. (Should we guarantee that False maps to 0 and
True to something 0?)
We don't make any guarantees
Wed, 29 Mar 2000 00:52:32 -0800, Simon Marlow [EMAIL PROTECTED] pisze:
data CLDouble = CLD# Double# -- ugh, plain newtype won't work
if we transparently pass newtypes' contents through FFI :-o
could you elaborate?
If we say that "newtype A = A B" is passed to and from foreign
functions
Wed, 05 Apr 2000 19:37:06 +0200, Ralf Muschall [EMAIL PROTECTED] pisze:
and the type declaration you gave seems to be the most general
possible anyway, i.e. it does not carry any information.
It does: documentation.
It happens that in this case "flip (.)" is more clear documentation
for me
Thu, 06 Apr 2000 22:23:10 +0200, Ralf Muschall [EMAIL PROTECTED] pisze:
And if I call the label on the stones "integer_from_string"
and "integer_from_intlist", unflipped (.) does as well.
In OCaml such functions are called int_of_string etc.
--
__("Marcin Kowalczyk * [EMAIL PROTECTED]
Mon, 17 Apr 2000 14:47:49 -0400 (EDT), Sitzman [EMAIL PROTECTED] pisze:
| otherwise = False
2
/ should be a BST too.
1
checkL = ((treeVal (leftSub thetree)) (treeVal (thetree)))
checkR = ((treeVal (rightSub thetree)) (treeVal (thetree)))
It's not enough:
3
/ \
2
Wed, 19 Apr 2000 10:19:08 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
I have an impression that Haskell-98 calls `Integral' various models
for the domain of integer numbers. And this is for Haskell-98'.
While the good standard of future (I hope for Haskell-2) has, to my
mind, to
Wed, 19 Apr 2000 03:29:44 -0700, Simon Peyton-Jones [EMAIL PROTECTED] pisze:
There is also the question of whether newtype is a good thing at all.
Maybe we'd be better off with Gofer's restricted type synonyms.
I prefer newtypes, because (1) IMHO the rules are simpler, (2) newtype
is often
Mon, 17 Apr 2000 10:07:51 -0400, Chris Okasaki [EMAIL PROTECTED] pisze:
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
Mon, 24 Apr 2000 11:05:56 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
In ghc-4.06, -O s1 costs 10 times more than s,
s2 costs same as s1.
Probably because Prelude.lhs contains:
{-# SPECIALISE sum :: [Int] - Int #-}
{-# SPECIALISE sum :: [Integer] -
Tue, 25 Apr 2000 15:45:04 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
I meant - to derive all the instances the user listed in the
declaration
newtype ... deriving( class1, class2 ... ),
and enabling the user to include in this list the user classes, not
only the
Wed, 26 Apr 2000 23:49:43 -0700, Mike Jones [EMAIL PROTECTED] pisze:
(||*):: Vi Bool - Vi Bool - Vi Bool
b1 ||* b2 = do
p - b1
if p then return True else b2
The definition does not use anything specific to this particular monad.
The most general type that can be
Thu, 27 Apr 2000 00:27:05 -0700, Mike Jones [EMAIL PROTECTED] pisze:
class (Monad m) = InstrumentMonad m where
yuck :: a - m a
This means that any type constructor that is an instance of Monad can
be made an instance of InstrumentMonad by providing the implementation
of yuck for this
Thu, 27 Apr 2000 19:20:57 +0200, Ralf Krueger [EMAIL PROTECTED]
pisze:
main = do text - readFile "xxx"
text' - process $! text
$! will usually not suffice, because it forces only the beginning of
the list.
"foldr seq (return ()) text" should suffice.
Or use a GHC extension:
Sat, 29 Apr 2000 13:22:36 +0200 (MET DST), Tommy Thorn [EMAIL PROTECTED] pisze:
Probable cause: missing `Show a' in type signature for `return'
Sure there's a missing Show a, but I can't change the signature
of return and it seems to me that Show a should follow from the
constraint on
Tue, 2 May 2000 10:14:40 +0200, Jan Brosius [EMAIL PROTECTED] pisze:
Suppose in some function definition some variable is of type A s a and I
want to do something like this : if the type variable of the first parameter
in A s a
is s then do this if not then do something else.
This is
Tue, 2 May 2000 19:21:22 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
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
Just a small generic comment:
IMVHO we should concentrate on making the thing useful for programmers.
Not on exact modelling of mathematical concepts.
This is a programming language, not a tutorial on algebra.
Let's see what concepts will be useful in real programs, what has to
be
Tue, 2 May 2000 22:47:08 +0200, Jan Brosius [EMAIL PROTECTED] pisze:
First I want to end this with the following observation : if the
forall in ( forall s1 . ST s1 T(s) ) really had the meaning
of the logical forall , that is if " forall s1 . ST s1 T(s)
is true then the case ST s
Wed, 3 May 2000 13:04:32 +0200, Jan Brosius [EMAIL PROTECTED] pisze:
So I looked to the example below:
forall x . x + a x is not true , however forall x. x + a = x is true,
If "a" is 1, then the first is true too.
runST :: forall a. (forall s. ST s a) - a
It means that ST is a
Wed, 3 May 2000 18:20:28 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
PartialOrd was asked by Tom Pledger.
I responded: "if other people would not object".
Trying to be a kind guy. Let the others decide whether PartialOrd
is necessary.
It's not just a single place that I
Fri, 5 May 2000 13:36:19 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
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
Fri, 5 May 2000 16:53:12 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
You should not skip it, unless this is an unfortunate case where
particular classes do not fit well into what we are defining and
there is not any good definition of fromInteger.
The situation with my
Fri, 05 May 2000 16:17:42 +0200, Sven Panne [EMAIL PROTECTED]
pisze:
data Fn = Fn (Float - Float) Int
deriving Show
Functions are not an instance of Show, so you have to supply
instance Show (a - b) where
Better supply a Show instance for Fn, not by deriving, but by
Sat, 6 May 2000 13:07:03 +0200 (MET DST), Bart Demoen [EMAIL PROTECTED]
pisze:
I am quite happy with not getting a compile-time error for
non-implemented class methods, as long as I get a compile-time error
when I try to use a non-implemented class method.
This is impossible.
I mean
Sat, 6 May 2000 15:30:39 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
| if such a default does not exist then a compile-time error results.
The existence of this loop-hole compromises Haskell's static type
safety.
I agree that disallowing this would be a good thing.
There are
Sun, 7 May 2000 00:56:57 +1000, Fergus Henderson [EMAIL PROTECTED] pisze:
Incidentally, this is an area where Mercury is more expressive than
Haskell. In Mercury, dummy arguments are still needed sometimes.
But using Mercury's mode system, you can express in the function's
declaration the
Why not have
fix :: (a - a) - a
fix f = f (fix f)
in the Prelude?
It's nicer to write
someFunction arg = do
x - prepare arg
fix $ \loop - do
workOn x
cond - test x
if cond then return x else loop
than
someFunction arg = do
Sun, 07 May 2000 18:23:33 +, Sebastian Schulz [EMAIL PROTECTED] pisze:
where ggt is a function which calculates the biggest common divisor
It is already in Prelude under the name gcd.
I thought that it is no Problem to use the '/' operator with two Ints.
(/) does not work on Ints. You
Mon, 8 May 2000 20:42:10 -0700 (PDT), Ronald J. Legere [EMAIL PROTECTED] pisze:
I have a very simple question. What is the best way to
convert a float to a double?
I use fromRational.toRational, and the notes in the prelude
seem to imply that this is optimized into something sensible..
Wed, 10 May 2000 13:04:19 +0200 (CEST), Thorsten Altenkirch
[EMAIL PROTECTED] pisze:
data RegExp sigma = Empty | Epsilon | Sym sigma
| Seq (RegExp sigma,RegExp sigma)
BTW, why not Seq (RegExp sigma) (RegExp sigma)?
data (Fin sigma) = NFA' sigma = forall q. (Fin q) = NFA'
Wed, 10 May 2000 15:32:41 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
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
Thu, 11 May 2000 13:43:20 +0400 (MSD), S.D.Mechveliani [EMAIL PROTECTED] pisze:
Why the classes are desirable here?
Because the example functions fsq, (==), (+), (*)
act in a *uniform way* for the residue domains
Z/(4), Z/(5) ...
1 - 100 of 694 matches
Mail list logo