Fwd: Re: [Haskell-cafe] Broken ghc documentation links

2010-04-26 Thread hask...@kudling.de
FYI
 

-- Ursprüngliche Nachricht --
Von: "hask...@kudling.de" 
An: Ivan Lazar Miljenovic 
Cc: Neil Mitchell 
Datum: 26. April 2010 um 13:45
Betreff: Re: [Haskell-cafe] Broken ghc documentation links

Hi,
 
> So, the problem is that there are broken links _in Hoogle_; have you
> thought about contacting the author Neil Mitchell directly?
 
While the URL http://www.haskell.org/hoogle/ contains the word "Hoogle", the URL
http://haskell.org/ghc/docs/6.12.1/html/libraries/base-4.2.0.0/Prelude.html#t%3AIO
does not and it does no mention "Hoogle" on the page either.
 
How did you determine that the latter is related to Hoogle?
 
Bye,
Lnny___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Ada-style ranges

2010-04-26 Thread hask...@kudling.de
Hi list,
 
how would you describe Ada's ranges in Haskell's typesystem?
http://en.wikibooks.org/wiki/Ada_Programming/Types/range
 
I feel, you can not because this is a runtime property.
 
Bye,
Lenny___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Broken ghc documentation links

2010-04-26 Thread hask...@kudling.de
To reproduce:
 
1) Look for "data IO" on Hoogle, e.g.
http://haskell.org/ghc/docs/6.12.1/html/libraries/base-4.2.0.0/Prelude.html#t%3AIO

2) Click "source", which redirects to
http://haskell.org/ghc/docs/6.12.1/html/libraries/base-4.2.0.0/src/GHC-Types.html#IO
 
3) Observe a "Not Found" page
 
Is there anyone interested in fixing this?
 
Bye,
Lenny___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Failing to install hxt: tagsoup versioning

2010-01-25 Thread hask...@kudling.de
> Specifying one exact version is too restrictive, you'll end up with 
> everybody having umpteen versions of almost all packages installed.

I don't see this as a problem. Disk space is extremely cheap, but our time is
precious.
Aplications on Mac OS X provide necessary libraries in their .app folder.
That's some waste but it relieves you from dependency hell.

> Minor version bumps which leave the API unchanged shouldn't break anything,
> small additions to the API should rarely break things, so if people adhere 
> to http://www.haskell.org/haskellwiki/Package_versioning_policy ,

Indeed.

Neil, in this case i think, tagsoup's version shouldn't have changed from 0.6 to
minor 0.8
while exported definitions such as "optLookupEntity" were removed.

What do you think?

I'd be glad if we could find a general solution.
Currently everybody using ghc 6.10.4 and trying to install hxt will go through
this hassle.
Which would be almost everybody.___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Failing to install hxt

2010-01-24 Thread hask...@kudling.de
Thank you, that worked. 


I wonder two things:


1) How to downgrade cabal packages? Just installing tagsoup-0.6 and removing
every trace of tagsoup-0.8 somehow didn't work for me. cabal still insisted that
there should be a tagsoup-0.8.


2) Is the commonly used version-scheming >= XYZ ideal? Maybe package maintainers
should depend on exactly one version they know that works? I mean how can you
guarantee, that every future version of a package will work?





Daniel Fischer  hat am 24. Januar 2010 um 00:59
geschrieben:

> cabal unpack hxt-8.3.2
>
> open hxt.cabal in kate, change the range of the required tagsoup to
> (>= 0.6 && < 0.7)
>
> cd hxt-8.3.2
> cabal install
>
> perhaps not the _best_ solution, but quick and it usually works
>___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Failing to install hxt

2010-01-24 Thread hask...@kudling.de

> I think the best bet is to:
> 
>     cabal install tagsoup-0.6 --reinstrall 


This somehow didn't work, since hxt-3.8.2 insisted on using tagsoup-0.8 even
when i removed every tagsoup-0.8 directory.

> And perhaps send the HXT maintainer a cabal patch?



Ok, did this.___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Failing to install hxt

2010-01-23 Thread hask...@kudling.de

Don Stewart  hat am 24. Januar 2010 um 00:10 geschrieben:

> haskell:
> > > Looks like the author of hxt has decided to support 6.12 only, at the
> > > moment.
> > >
> > >     base (>=4.2 && <5)
> > >
> > > Ensures this will only work on the 6.12 series of compilers.
> > 
> > Thanks. I know.
> > 
> > My point is, i don't understand why hxt-8.3.2 (base >= 4 && <5) fails to
> > install for me with:
> > 
> > "
> > src/Text/XML/HXT/Parser/TagSoup.hs:292:8:
> >     Not in scope: `optLookupEntity'
> > cabal: Error: some packages failed to install:
> > hxt-8.3.2 failed during the building phase. The exception was:
> > exit: ExitFailure 1
> > "
> 
> That looks like an error relating to the versoin of tagsoup used?



You're right, thanks.
"optLookupEntity" is defined in tagsoup-0.6, but not in tagsoup-0.8.
But hxt-8.3.2 broadly requires tagsoup
[http://hackage.haskell.org/package/tagsoup-0.8]  (>=0.6 && <1).


I am no cabal expert. What is the best solution here?___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Failing to install hxt

2010-01-23 Thread hask...@kudling.de
> Looks like the author of hxt has decided to support 6.12 only, at the
> moment.
> 
>     base (>=4.2 && <5)
> 
> Ensures this will only work on the 6.12 series of compilers.



Thanks. I know.


My point is, i don't understand why hxt-8.3.2 (base >= 4 && <5) fails to install
for me with:


"
src/Text/XML/HXT/Parser/TagSoup.hs:292:8:
    Not in scope: `optLookupEntity'
cabal: Error: some packages failed to install:
hxt-8.3.2 failed during the building phase. The exception was:
exit: ExitFailure 1
"___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Failing to install hxt

2010-01-23 Thread hask...@kudling.de
Hi guys, 


i have some troubles to install hxt.


My first naive attempt "cabal install hxt" fails with
"cabal: cannot configure hxt-8.5.0. It requires base >=4.2 && <5".


I guess that's because i use ghc 6.10.4, since
"base-4.2.0.0" depends on "integer-simple" which seems to only come with ghc
6.12.


I then tried to install hxt-8.3.2, which seems to be the last version supporting
ghc 6.10.4.
If fails with:


"

src/Text/XML/HXT/Parser/TagSoup.hs:292:8:
    Not in scope: `optLookupEntity'
cabal: Error: some packages failed to install:
hxt-8.3.2 failed during the building phase. The exception was:
exit: ExitFailure 1
"


I have no idea, what that means. What am i doing wrong?


Thanks,
Lenny___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Deconstruction

2009-12-26 Thread hask...@kudling.de

Oh, you're right, thanks.
I got lost in types and GHC error messages. :/
Miguel Mitrofanov  hat am 26. Dezember 2009 um 18:09
geschrieben:

> Your code is equivalent to this:
> 
> adjustToBox (ObjectWrapper object) box = adjustToBox object box
> 
> but what you've probably intended to write was
> 
> adjustToBox (ObjectWrapper object) box = ObjectWrapper (adjustToBox  
> object box)
> 
> It has nothing to do with existentials - it's a simple type mismatch.
> 
> On 26 Dec 2009, at 19:53, hask...@kudling.de wrote:
> 
> > Hi all,
> >
> > thanks for the insight.
> >
> > > But you can deconstruct the enclosed value temporarily:
> > >
> > > getSomething :: Bar -> Double
> > > getSomething b =
> > >      case b of
> > >          Bar a -> doSomething a
> >
> > Somehow i fail to apply this.
> >
> > If you look at
> > http://chlor.svn.sourceforge.net/viewvc/chlor/trunk/haskell/Chlor/Object.hs?revision=603&view=markup
> >
> > in line 26 i used this for function "adjustToBox", but i still get:
> >
> > Chlor/Object.hs:33:36:
> >     Couldn't match expected type `ObjectWrapper'
> >            against inferred type `a'
> >       `a' is a rigid type variable bound by
> >           the constructor `ObjectWrapper' at Chlor/Object.hs:33:12
> >     In the expression: adjustToBox object
> >     In a case alternative: ObjectWrapper object -> adjustToBox object
> >     In the expression:
> >         case wrapper of { ObjectWrapper object -> adjustToBox object }
> >
> > :(
> > ___
> > Haskell-Cafe mailing list
> > Haskell-Cafe@haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Deconstruction

2009-12-26 Thread hask...@kudling.de
Hi all, 


thanks for the insight.

> But you can deconstruct the enclosed value temporarily:
>
> getSomething :: Bar -> Double
> getSomething b =
>      case b of
>          Bar a -> doSomething a



Somehow i fail to apply this.


If you look at
http://chlor.svn.sourceforge.net/viewvc/chlor/trunk/haskell/Chlor/Object.hs?revision=603&view=markup


in line 26 i used this for function "adjustToBox", but i still get:



Chlor/Object.hs:33:36:
    Couldn't match expected type `ObjectWrapper'
           against inferred type `a'
      `a' is a rigid type variable bound by
          the constructor `ObjectWrapper' at Chlor/Object.hs:33:12
    In the expression: adjustToBox object
    In a case alternative: ObjectWrapper object -> adjustToBox object
    In the expression:
        case wrapper of { ObjectWrapper object -> adjustToBox object }


:(___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Deconstruction

2009-12-26 Thread hask...@kudling.de
Hi, 


while this works:





data Foo a = Foo a


unwrapFoo :: Foo a -> a
unwrapFoo (Foo x) = x




this:




{-# LANGUAGE ExistentialQuantification #-}



class BarLike a where
    doSomething :: a -> Double



data Bar = forall a. BarLike a => Bar a


unwrapBar :: Bar -> a
unwrapBar (Bar x) = x




gives me:





    Couldn't match expected type `a' against inferred type `a1'
      `a' is a rigid type variable bound by
          the type signature for `unwrapBar' at test.hs:8:20
      `a1' is a rigid type variable bound by
           the constructor `Bar' at test.hs:9:11
    In the expression: x
    In the definition of `unwrapBar': unwrapBar (Bar x) = x





How can i deconstruct the enclosed value of type a?


Thanks,
Lenny___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Design question

2009-12-17 Thread hask...@kudling.de
> I'd strongly recommend you simply choose a set of geometric objects
> paths, polygons, whatever... and work with those, only considering SVG
> as a final rendering step when you could probably just generate

I do, cheers.

The SVG model is just an intermediate representation for the SVG export/import
part.
Past experience told me, mapping SVG to my own models in one pass gets pretty
ugly.

Bye,
Lenny___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Design question

2009-12-17 Thread hask...@kudling.de
Hi all,

thanks for your ideas so far.

> I think you might be looking for too much sugar.  I don't know much
> about your problem, but I would use approximately your approach and be
> straightforward:

To bother you with some details: i am building a model for an SVG document.
http://chlor.svn.sourceforge.net/viewvc/chlor/trunk/haskell/Chlor/FileFormat/Svg/SvgDocument.hs

There are many SVG elements, of which only a few are valid as the content of
each other SVG elements.
SvgDocumentElement defines the allowed subset for the SVG document.

I want to generate a "DList Char" for all those sub-elements and finally
collapse them to one "DList Char" representing the whole SVG document.
So it's a bit more complicated than your "Either" example

I need to manually efine such subset data structures for most SVG elements which
does not feel most elegant already.
Additionally instantiating a class for the subset structures, in order to being
able to iterate over them, feels even more clumsy.

So i wonder whether i am missing a more clean approach to the problem "easily
combining data structures but also easy iteration over them".

> 
> type SubSet = Either A C
> 
> > and use it in Foo:
> >
> >     data Foo = Foo [SubSet]
> >
> > No i want to perform a polymorphic operation on the contents of A,B,C, e.g.
> >
> > doSomething :: Foo -> [Double]
> > doSomething (Foo s) = map doSomethingElse s
> 
> doSomething (Foo s) = map (doSomethingWithA ||| doSomethingWithC) s
> 
> (||| is from Control.Arrow)
> 
> If that gets too complicated, you can build the "doSomething"
> functions in a type-directed way using typeclasses:
> 
> class DoSomething a where
>     doSomething :: a -> Double
> 
> instance DoSomething A where ...
> instance DoSomething B where ...
> instance DoSomething C where ...
> 
> instance (DoSomething a, DoSomething b) => DoSomething (Either a b) where
>     doSomething = doSomething ||| doSomething
> 
> Luke___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Design question

2009-12-16 Thread hask...@kudling.de
Hi,

i am not quite sure how to do this in the most elegant way:

I have some data structures:

data A = A Double
data B = B Double
data C = C Double
...

and i want to allow only a subset in another data structure, so i did something
like this:

    data SubSet = SubSetA A | SubSetC C

and use it in Foo:

    data Foo = Foo [SubSet]

No i want to perform a polymorphic operation on the contents of A,B,C, e.g.

doSomething :: Foo -> [Double]
doSomething (Foo s) = map doSomethingElse s


Now i have two questions:

1) Is the way i define and use "SubSet", the only/valid way to define subsets?

2) What's the best way to make "doSomethingElse" polymorphic?

There's the tedious way:

doSomethingElse (SubSetA x) = doSomethingElse x
doSomethingElse (SubSetB x) = doSomethingElse x

or i could make SubSet and A,B,C instances of a type class with the function
"doSomethingElse".
But i have several different subsets so the type class aproach feels like
overkill for these helper structures.


Whatever my approach is, it does not feel right. Can you help me step back and
get the picture?

Thanks,
Lenny___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] Re: Idea for a very simple GUI llibrary

2009-11-24 Thread hask...@kudling.de
I dream of mostly generated bindings for Haskell to the native windowing
toolkit.
Eclipse's SWT proves, this is a viable path.

See my proposal here:
http://www.reddit.com/r/haskell_proposals/comments/9w7nk/adjust_the_swt_binding_generators_for_haskell/

Sam Martin  hat am 23. November 2009 um 19:04
geschrieben:

> 
> Thinking of a parallel with Java for a second, is there a GUI library out
> there that's structured like Java Swing? Meaning, there is a GUI library that
> has a small platform-specific GUI foundation (e.g. a per platform
> implementation of the core AWT functionality) and the rest of the
> functionality is pure haskell?
> 
> Supporting cross platform guis is often a bit ... complicated. Java attempted
> to resolve their debug-everywhere nightmare with AWT by making the
> per-platform bit as small as possible, and building everything else in Java.
> 
> I guess in theory gtk and wxWidgets take on this support burden, but you do
> get some fairly hefty imperative apis as a result. Perhaps it would make sense
> to focus efforts on stabilising a small 'core gui' library that can act as the
> foundation stone for all manner of pure haskell gui libraries?*
> 
> Or perhaps this already exists?
> 
> Just a thought.
> 
> Cheers,
> Sam___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Reverse dependencies in Hackage

2009-10-14 Thread hask...@kudling.de
Nice, thank you for the great work.

Browsing the reverse dependencies of popular packages like "bytestring"
http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/bytestring-0.9.1.5
can be improved a bit.

1) Can you please sort the reverse dependent package names? That makes it easier
to find packages with certain names.

2) I found the columns "Direct" and "Indirect" confusing until i found out that
they show the number of reverse dependencies for those packages themselves and
are not related to direct/indirect dependencies of the current package. I don't
think it is necessary to provide those data here and i would be in favor of
reducing the information overload by leaving those data to each package detail
page.

3) Can you try to print the reverse packages horizontally instead of vertically
in tables? Browsing two long tables of direct/indirect reverse dpependencies
like for "bytestring" makes it tedious to get an overview.

Besides that, i am quite happy.

Thanks,
Lenny___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe