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 formulati
"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
>> f
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 imag
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 sys
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
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,
>
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 mod
[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 i
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 list
* 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 gener
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 lar
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 i
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, a
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 (o
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
"Yitzchak Gale" <[EMAIL PROTECTED]> writes:
>> In some usage patterns, it can reduce
>> the cost of processing from linear in the size of the document, to a
>> constant (the distance into the document to find a particular element).
> Oh oh - does that mean that Ketil's original case
> (an element
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
"Yitzchak Gale" <[EMAIL PROTECTED]> wrote:
> > In some usage patterns, it can reduce
> > the cost of processing from linear in the size of the document, to a
> > constant (the distance into the document to find a particular
> > element).
>
> Oh oh - does that mean that Ketil's original case
> (an
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 de
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 difficu
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 Un
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
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
Haskell-Cafe@
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"
>
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 pa
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 whi
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 outpu
On Mon, 22 Oct 2007 14:04:34 -0400, bbrown wrote
> Ok, sorry to bring this back up again. I asked before and kind of
> went to a working linux system.
>
> My question; On Win32, has anyone seen where you try to run the
> application but the window will not stay open. There are no errors,
> t
"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
On 10/23/07, Isaac Dupree <[EMAIL PROTECTED]> wrote:
> maybe first the paragraph for the end-user, followed by CURRENT
> IMPLEMENTATION DETAILS/NOTES:
>
> After all, those are sometimes relevant or interesting to the "end-user"
> (or are the implementation descriptions consistently several times
>
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 langu
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 r
"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 pe
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
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 'automatica
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]
> >
>
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
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
> >
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,
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'
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
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.
>
Hello,
I am trying to use a Haskell shell (Hsh.hs). I am a little frustrated.
There are two modules that are imported:
import LibPosix
import LibSystem
I am running WinHugs (Windows) and hugs/ghci can't find LibSystem. I am
confused about 1) what are currently standard libraries, etc. in H
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
>
I'm relatively new to Haskell, so maybe this answer is a bit off, in
that I'm sure there are times when some sort of auto-existential
creation may have a point, but generally I've found that when I want
it I've been thinking about the problem wrong.
The bigger issue is that as soon as you g
55 matches
Mail list logo