Hi again,
Following up on my previous thread, I have figured out why it bothered
me that we cannot have a list such as the following: [abc, 123, (1,
2)] :: Show a = [a]
It seems to me that there is an annoying duality in treating simple
algebraic data type vs type classes. As it stands, I can
On 22. Oct 2007, at 20:16 , Stefan O'Rear wrote:
This type signature means that 'port' is return type overloaded -
it can
return ANY kind of port, and the caller gets to choose. Which I don't
think is what you want.
True.
(Requires type family extension in GHC 6.8; an equivalent
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes:
On Oct 21, 2007, at 6:29 , Jon Fairbairn wrote:
No, they (or at least links to them) typically are that bad!
Mind you, as far as fragment identification is concerned, so
are a lot of html pages. But even if the links do have
fragment ids,
On 10/23/07, Luke Palmer [EMAIL PROTECTED] wrote:
On 10/23/07, TJ [EMAIL PROTECTED] wrote:
What I find strange is, if we can have functions with hidden
parameters, why can't we have the same for, say, elements of a list?
Suppose that I have a list of type Show a = [a], I imagine that it
Derek Elkins [EMAIL PROTECTED] writes:
On Mon, 2007-10-22 at 01:12 +0100, Lennart Augustsson wrote:
There's nothing wrong with Haskell types. It's the terms that make
Haskell types an inconsistent logic.
Logics are what are consistent or not, so saying the logic Haskell's
type system
On 10/23/07, TJ [EMAIL PROTECTED] wrote:
What I find strange is, if we can have functions with hidden
parameters, why can't we have the same for, say, elements of a list?
Suppose that I have a list of type Show a = [a], I imagine that it
would not be particularly difficult to have GHC insert
Short answer: You are worrying about syntax. The things you want are
possible.
TJ wrote:
Following up on my previous thread, I have figured out why it bothered
me that we cannot have a list such as the following: [abc, 123, (1,
2)] :: Show a = [a]
That type doesn't mean what you want it to
On 10/23/07, Jules Bean [EMAIL PROTECTED] wrote:
Short answer: You are worrying about syntax. The things you want are
possible.
TJ wrote:
Following up on my previous thread, I have figured out why it bothered
me that we cannot have a list such as the following: [abc, 123, (1,
2)] :: Show
Hi,
in order to upload my teaching programms to hackage, I look for an accepted
hierarchy to put the modules into.
My current version is Learning.Donnerhacke.Algorithms.Sort ... etc. pp.
Would such a hierarchy make sense? Is the a hope for inclusion of other
modules?
The main purpose of this
[EMAIL PROTECTED] writes:
1. Avoid two pass filtering.
2. Avoid unecessary (++), with an accumulator. For example:
Also, I find that
3. Accumulate equal elements, too
pa (y:ys) s e b = case compare x y of ...
to be a good choice. Otherwise, quicksort easily grows towards
quadratic if
Bernie Pope wrote:
On 23/10/2007, at 8:09 AM, Thomas Hartman wrote:
(Prelude sort, which I think is mergesort, just blew the stack.)
GHC uses a bottom up merge sort these days.
It starts off by creating a list of singletons, then it repeatedly merges
adjacent pairs of lists until there
* Lutz Donnerhacke wrote:
The main purpose of this moduls in my special case are: Implementation of
the algorithms from Sedgewick's famous book. ...
Sorry, I hit the send button a bit too early.
... They are used with very small main programms containing a FFI inclusion
of a external C object
It has been noted in a few places that the 2 line quicksort demo in the
Introduction section of the haskell wiki
http://www.haskell.org/haskellwiki/Introduction
isn't a real quicksort, and wouldn't scale well with longer lists.
Interested, and wanting to put my recently learned test data
TJ wrote:
No. I am saying that Haskell's type system forces me to write boilerplate.
Fair enough.
Why can't it automatically construct them then? Assuming we do have a
syntax for A list of objects, each of which is of some
possibly different type 'a', subject only to the restriction that a
Yitzchak Gale [EMAIL PROTECTED] wrote:
Henning Thielemann wrote:
HXT uses Parsec, which is strict.
Is is strict to the extent that it cannot produce any
output at all until it has read the entire XML document?
That would make HXT (and Parsec, for that matter)
useless for a large
Alfonso Acosta wrote:
I'm beginning to get familiar with Haddock and I want to document a
library which, as usually happens, has some ADT definitions.
I'd like to document the ADTs both for the end-user (who shouldn't be
told about its internal implementation) and future developers.
Haddock
Malcolm Wallace wrote:
HaXml now uses the polyparse library, and you can choose whether you
want well-formedness checking with the original strict parser, or lazy
space-efficient on-demand parsing. Initial performance results show
that parsing XML lazily is always better than 2x as fast, and
Galchin Vasili wrote:
I am really talking about a module or perhaps a Haskell class that
provides notion for multiple threads of execution, semaphores, .. that
hides POSIX vs Win32 APIs ..
I wonder if this discussion is missing the point: if you only want to do
threads, then Haskell (or
On 10/23/07, Jules Bean [EMAIL PROTECTED] wrote:
I believe it is to do with the requirement that expressions have a
unique principle type. Certainly in principle the algorithm you outline
is possible, but I don't know what else you would lose.
I'm not familiar with the term principal type. I
My collection of data encoding functions are now available at
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/dataenc-0.9:
Dependencies base
License LGPL
Copyright Magnus Therning, 2007
AuthorMagnus Therning
Maintainer
Brent Yorgey wrote:
The point is, what you'd *like* (say) extendSequence
[1,2,5,14,42] to do is return the *infinite* list of Catalan numbers, but
that's very, very difficult to do in general!
Actually impossible, since OEIS contains Busy Beaver sequences, which
are not computable! (although
Simon Marlow wrote:
Alfonso Acosta wrote:
I'm beginning to get familiar with Haddock and I want to document a
library which, as usually happens, has some ADT definitions.
I'd like to document the ADTs both for the end-user (who shouldn't be
told about its internal implementation) and future
Galchin Vasili wrote:
In
discussing this OS Abstraction Layer, I think I am thinking of some notion
of laziness (read ... decisions made at run-time .. not compile-time ..
otherwise I think we have to resort to ifdefs which are not so nice and
require a lot of code maintenance.)
It is
Another question about HaXML and HXT -
what is the level of XML spec. compliance?
The many who have tried to implement compliant
XML parsers in various languages - and the few
who have succeeded - all agree that this is much
harder than it seems at first.
Most of the time, the final result is an
Magnus Therning wrote:
My collection of data encoding functions are now available
Nice!
Should this effort be coordinated with Unicode-related
encoding/decoding? See the Encoding class in
Twan van Laarhoven's CompactString library:
http://twan.home.fmf.nl/compact-string/
and Johan Tibell's
Malcolm Wallace wrote:
I have been considering moving the lexer to use
ByteString instead of String, which would neatly solve that problem too.
Doesn't the lexer come only after decoding?
Then you have Unicode. Does ByteString still help?
-Yitz
___
Hello Luke,
Tuesday, October 23, 2007, 12:42:19 PM, you wrote:
of me whining about Haskell's lack of OO features. How are you
supposed to design your programs modularly if you can't have a
type-agnostic list?
But it doesn't bug me anymore. I can't really say why.
i tink because it's very
I'm pleased to announce updates to the zlib and bzlib packages.
The releases are on hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zlib
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bzlib
What's new in these releases is that the packages work with a wider
range
Duncan Coutts wrote:
I'm very happy to get feedback on the API, the documentation or of
course any bug reports.
It would be nice if the API could be the same for all
character and data codecs.
Thanks,
Yitz
___
Haskell-Cafe mailing list
On Mon, Oct 22, 2007 at 09:44:11PM -0500, Galchin Vasili wrote:
Hi Ryan,
Thanks for your generous response. By the way, you don't want to
use typeclasses here; they solve the problem of having more than one
possible interface at runtime, whereas you only care about compile-time
.. in
Hi Mark,
Declaration Formula
--- ---
class Eq a = Ord a forall a. Ord a = Eq a
instance Eq a = Eq [a] forall a. Eq a = Eq [a]
class C a b | a - b forall a, b. C a b /\ C a c = b = c
This correspondence between declarations and
Yitzchak Gale wrote:
Another question about HaXML and HXT -
what is the level of XML spec. compliance?
Implementing the XML 1.0 Standard was
one of the goals of HXT when starting the project.
This includes full support of DTD processing,
which turned out to be the hardest part of the
whole
On Tue, Oct 23, 2007 at 09:10:02AM -0400, Isaac Dupree wrote:
Galchin Vasili wrote:
In
discussing this OS Abstraction Layer, I think I am thinking of some notion
of laziness (read ... decisions made at run-time .. not compile-time ..
otherwise I think we have to resort to ifdefs which are not
On Tue, 2007-10-23 at 16:34 +0200, Yitzchak Gale wrote:
Duncan Coutts wrote:
I'm very happy to get feedback on the API, the documentation or of
course any bug reports.
It would be nice if the API could be the same for all
character and data codecs.
Hmm, though the inputs and outputs are
Uwe Schmidt [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
it into HXT.
This still does not solve the processing of very very large
XML document. I doubt, whether we can do this with a DOM
like approach, as in HXT or HaXml. Lazy input does not solve all problems.
A SAX like
David Roundy wrote:
On Mon, Oct 22, 2007 at 09:44:11PM -0500, Galchin Vasili wrote:
Hi Ryan,
I am trying to avoid ifdef's and have all
decisions made at run-time (maybe given the nature of Haskell .. i..e
static/compile-time type checking this is impossible) ...
I don't see how in any
On 10/22/07, Neil Mitchell [EMAIL PROTECTED] wrote:
If this now reports no errors, who wants to guess which come up as
escape codes, and which don't. The way other languages like C# have
dealt with this is by introducing a new type of quoted string:
@:\/
The C# implementation is really
Rene de Visser [EMAIL PROTECTED] writes:
If I undertand the coding correctly every tag is stored as a seperate
Haskell string. As each byte of a string under GHC takes 12 bytes this alone
leads to high memory usage.
Not that it detracts from your point, but I guess that is 24 bytes per
2007/10/23, Justin Bailey [EMAIL PROTECTED]:
My two cents - I haven't found another language that handles heredocs as
nicely as Ruby does.
Perl Heredocs do the same things and predates Ruby's (at least they do
all you described and a bit more).
But what would be really nice is a way to write
On Tue, 2007-10-23 at 17:40 +0800, TJ wrote:
On 10/23/07, Jules Bean [EMAIL PROTECTED] wrote:
That is, the type inference algorithm which GHC uses, which is not the
only one you can imagine, but for a variety of reasons is considered to
be one of the best choices, cannot 'automatically'
Ketil Malde [EMAIL PROTECTED] writes:
HaXml on my list after TagSoup, which I'm about to get to work, I
think (got distracted a bit ATM).
As it is, I managed to parse my document using TagSoup. One major
obstacle was the need to process a sizeable partition of the file.
Using 'partitions'
Why can't it automatically construct them then? Assuming we do have
a syntax for A list of objects, each of which is of some possibly
different type 'a', subject only to the restriction that a is a
member of typeclass Show, as the following:
ls :: [a where Show a]
Then I would
On 23/10/2007, Jules Bean [EMAIL PROTECTED] wrote:
I will also repeat the non-justified assertion that others have made,
and that I've made myself in the other thread, that you don't need
existentials as often in haskell as you do in OO languages, and they
certainly don't always need to be
On Fri, 2007-10-12 at 13:52 -0400, Steve Schafer wrote:
On Fri, 12 Oct 2007 18:24:38 +0100, you wrote:
I was actually thinking more along the lines of a programming language
where you can just write
head :: (n 1) = List n x - x
tail :: List n x - List (n-1) x
(++) :: List n x
On Fri, 2007-10-19 at 00:02 +0200, [EMAIL PROTECTED]
wrote:
Dan Weston writes:
... now I am totally flummoxed:
thm1 :: (a - a) - a
thm1 f = let x = f x in x
thm1 (const 1)
1
I *thought* that the theorem ((a = a) = a) is not derivable (after all,
0^(0^0) = 0^1 = 0),
On Fri, 2007-10-19 at 23:57 +0800, TJ wrote:
Henning Thielemann:
class Renderable a where
render :: a - RasterImage
scene :: Renderable a = [a]
This signature is valid, but it means that all list elements must be of
the same Renderable type.
Yes, that's exactly the
On Fri, 2007-10-12 at 19:33 -0400, Brandon S. Allbery KF8NH wrote:
On Oct 12, 2007, at 18:35 , Albert Y. C. Lai wrote:
You are not expected to be convinced this, but it seems
continuations completely characterize system programming. :)
Didn't someone already prove all monads can be
On Fri, 2007-10-19 at 02:45 +0200, [EMAIL PROTECTED]
wrote:
PR Stanley writes:
One of the reasons I'm interested in Wikipedia and Wikibook is because
you're more likely to find Latex source code used for typesetting the
maths.
Latex is the one and only 100% tool right now.
A lot of
Tristan Allwood:
Very cool. I don't understand some (a lot of) parts though:
instance Show a = Reify (ShowConstraint a) where
reify = ShowC
ShowC has type (Show a) = ShowConstraint a, whereas reify is
supposed to have type ShowConstraint a.
data SingleList (a :: * - *) where
Cons :: (a
49 matches
Mail list logo