Half-integer

View: New views
11 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Re: Cabal fun [Half-integer]

by Jason Dagit-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Mon, Jun 29, 2009 at 11:57 AM, Andrew Coppin <andrewcoppin@...> wrote:
Andrew Coppin wrote:
Indeed. I've heard a few people claim that cabal-install is the best thing since sliced bread, but I've never touched it. I don't even know where to get it. (Presumably this will become fairly obvious once I go look for it...)

Fortunately, it turns out that a trivial Google search is all that is required to locate cabal-install. (Assuming you already know it exists.) Unfortunately I got as far as actually downloading the sources from Hackage before discovering that on Windows you actually need to download the pre-build binary. (Couldn't you mention this on the Hackage download page?)

Also fortunately, it appears to be pretty trivial to operate cabal-install. I didn't bother reading any instructions, just cabal --help. (Not sure why it needs to download the package list from Hackage - or where it puts it. But I'm sure there's a good reason.)

Rather less fortunately, it still doesn't actually fix my problem:

E:\Haskell\AOC-HalfInteger>cabal configure
Resolving dependencies...
Configuring AOC-HalfInteger-1.0...

E:\Haskell\AOC-HalfInteger>cabal sdist

Building source dist for AOC-HalfInteger-1.0...
Preprocessing library AOC-HalfInteger-1.0...
Source tarball created: dist\AOC-HalfInteger-1.0.tar.gz
cabal: dist\src\sdist.1288\AOC-HalfInteger-1.0\Data\HalfInteger.hs: removeFile: permission denied (Permission denied)

I have no idea what the hell it's upset about now... I've now been trying to create this damned tarball since 5PM yesterday, and I still haven't managed it. At this point I'm losing the will to continue with this crazy project. Clearly this is way too much effort to expend just to upload 50 lines of code.

I can't say for certain, but just reading the output it looks like it created a tarball in a temporary folder (that worked) and then when it tried to clean it up it failed.  Sounds like a bug report is in order.

Jason


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

Re: Cabal fun [Half-integer]

by Antoine Latter-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 29, 2009 at 2:12 PM, Jason Dagit<dagit@...> wrote:
>
>
> I can't say for certain, but just reading the output it looks like it
> created a tarball in a temporary folder (that worked) and then when it tried
> to clean it up it failed.  Sounds like a bug report is in order.
>

You may want to check the "dist" subdirectory of the folder you're
working in to see if it made the tarball.

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

Re: Cabal fun [Half-integer]

by Andrew Coppin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jason Dagit wrote:

>
>
> On Mon, Jun 29, 2009 at 11:57 AM, Andrew Coppin
> <andrewcoppin@... <mailto:andrewcoppin@...>> wrote:
>
>     Rather less fortunately, it still doesn't actually fix my problem:
>
>     E:\Haskell\AOC-HalfInteger>cabal configure
>     Resolving dependencies...
>     Configuring AOC-HalfInteger-1.0...
>
>     E:\Haskell\AOC-HalfInteger>cabal sdist
>
>     Building source dist for AOC-HalfInteger-1.0...
>     Preprocessing library AOC-HalfInteger-1.0...
>     Source tarball created: dist\AOC-HalfInteger-1.0.tar.gz
>     cabal:
>     dist\src\sdist.1288\AOC-HalfInteger-1.0\Data\HalfInteger.hs:
>     removeFile: permission denied (Permission denied)
>
>     I have no idea what the hell it's upset about now... I've now been
>     trying to create this damned tarball since 5PM yesterday, and I
>     still haven't managed it. At this point I'm losing the will to
>     continue with this crazy project. Clearly this is way too much
>     effort to expend just to upload 50 lines of code.
>
>
> I can't say for certain, but just reading the output it looks like it
> created a tarball in a temporary folder (that worked) and then when it
> tried to clean it up it failed.  Sounds like a bug report is in order.

So, yet again, it appears I'm the first poor soul to try using this on
Windows.

The very first time I tried to use Gtk2hs, the installer for Windows was
trivially broken. In fairness, Duncan fixed this within an hour or two
of me pointing out the problem. But the fact remains: It had been out
for a week, and I was the *only* person to have tried to use it on
Windows. (Or possibly the only person to actually complain, rather than
just give up.) Don kept telling me about some cool Core syntax hilighter
he wrote, so I went to all the trouble of downloading it, downloading
and building all of its dependencies, only to discover "oh, by the way,
it only works on Linux". A while back Cabal had a bug where (on Windows
only) it couldn't find ld or something daft. [Again, fortunately that
one got corrected - eventually - in the next GHC release.] I try to run
sdist, and discover that that's broken on Windows too. But don't worry,
there's a replacement tool... which is also broken on Windows... This is
an exercise in pure frustration! Sometimes it seems as if *everything*
is broken on Windows.

Hmm... I'm just ranting now. One presumes that when they "fixed" cabal
sdist to work on Windows, at least one person checked that it did, in
fact, work. That would mean it got broken again at some point after
this. Maybe I just need to find an older version or something...

And after that... I guess I create *another* account on *another* bug
tracker and submit *another* "hey, this is broken on Windows" ticket...

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

Re: Cabal fun [Half-integer]

by Ross Mellgren :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I presume that many of the developers do not have windows machines  
(presumably because windows sucks). Maybe you could help them by  
trying to track down where the error in the code is, and even better  
yet submitting a patch?

This is all free by the virtue of people giving what time they can,  
and if you don't happen to have a windows box to test on, it can be  
very hard to provide compatibility for it. Same in the reverse  
direction.

-Ross

On Jun 29, 2009, at 3:55 PM, Andrew Coppin wrote:

> Jason Dagit wrote:
>>
>>
>> On Mon, Jun 29, 2009 at 11:57 AM, Andrew Coppin <andrewcoppin@...
>>  <mailto:andrewcoppin@...>> wrote:
>>
>>    Rather less fortunately, it still doesn't actually fix my problem:
>>
>>    E:\Haskell\AOC-HalfInteger>cabal configure
>>    Resolving dependencies...
>>    Configuring AOC-HalfInteger-1.0...
>>
>>    E:\Haskell\AOC-HalfInteger>cabal sdist
>>
>>    Building source dist for AOC-HalfInteger-1.0...
>>    Preprocessing library AOC-HalfInteger-1.0...
>>    Source tarball created: dist\AOC-HalfInteger-1.0.tar.gz
>>    cabal:
>>    dist\src\sdist.1288\AOC-HalfInteger-1.0\Data\HalfInteger.hs:
>>    removeFile: permission denied (Permission denied)
>>
>>    I have no idea what the hell it's upset about now... I've now been
>>    trying to create this damned tarball since 5PM yesterday, and I
>>    still haven't managed it. At this point I'm losing the will to
>>    continue with this crazy project. Clearly this is way too much
>>    effort to expend just to upload 50 lines of code.
>>
>>
>> I can't say for certain, but just reading the output it looks like  
>> it created a tarball in a temporary folder (that worked) and then  
>> when it tried to clean it up it failed.  Sounds like a bug report  
>> is in order.
>
> So, yet again, it appears I'm the first poor soul to try using this  
> on Windows.
>
> The very first time I tried to use Gtk2hs, the installer for Windows  
> was trivially broken. In fairness, Duncan fixed this within an hour  
> or two of me pointing out the problem. But the fact remains: It had  
> been out for a week, and I was the *only* person to have tried to  
> use it on Windows. (Or possibly the only person to actually  
> complain, rather than just give up.) Don kept telling me about some  
> cool Core syntax hilighter he wrote, so I went to all the trouble of  
> downloading it, downloading and building all of its dependencies,  
> only to discover "oh, by the way, it only works on Linux". A while  
> back Cabal had a bug where (on Windows only) it couldn't find ld or  
> something daft. [Again, fortunately that one got corrected -  
> eventually - in the next GHC release.] I try to run sdist, and  
> discover that that's broken on Windows too. But don't worry, there's  
> a replacement tool... which is also broken on Windows... This is an  
> exercise in pure frustration! Sometimes it seems as if *everything*  
> is broken on Windows.
>
> Hmm... I'm just ranting now. One presumes that when they "fixed"  
> cabal sdist to work on Windows, at least one person checked that it  
> did, in fact, work. That would mean it got broken again at some  
> point after this. Maybe I just need to find an older version or  
> something...
>
> And after that... I guess I create *another* account on *another*  
> bug tracker and submit *another* "hey, this is broken on Windows"  
> ticket...
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@...
> http://www.haskell.org/mailman/listinfo/haskell-cafe

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

Re: Cabal fun [Half-integer]

by Andrew Coppin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ross Mellgren wrote:

> I presume that many of the developers do not have windows machines
> (presumably because windows sucks). Maybe you could help them by
> trying to track down where the error in the code is, and even better
> yet submitting a patch?
>
> This is all free by the virtue of people giving what time they can,
> and if you don't happen to have a windows box to test on, it can be
> very hard to provide compatibility for it. Same in the reverse direction.
>
> -Ross

Well, Duncan informs me that he's just set up a Windows XP VM for this
exact reason... Still, I guess this problem will only really be solved
once he have large quantities of Windows users hitting this stuff.

Indeed, Duncan seems to be one of the more helpful inhabitants of the
Haskell IRC channel. I talked to him tonight, and he's already fixed
some of the documentation issues I pointed out earlier, and done a
preliminary analysis of the sdist bug. (It's filed as ticket #565 now,
by the way.)

Anyway, for the time being, cabal-install does in fact generate the
tarball, it's just tripping over trying to delete the temp files
afterwards. So I can still uplo-- wait, you need an account?

Is anything ELSE going to stop me??

Time for bed, I think...

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

Re: Cabal fun [Half-integer]

by Jason Dagit-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Mon, Jun 29, 2009 at 12:55 PM, Andrew Coppin <andrewcoppin@...> wrote:

This is an exercise in pure frustration! Sometimes it seems as if *everything* is broken on Windows.

In my opinion you're right, Windows, and things built on it, tend to be very broken.  Maybe that's why so many of the Haskell devs aren't using Windows?
 

Hmm... I'm just ranting now.

Yes, you are :)  You'll catch more flies with honey than vinegar.

Good luck,
Jason


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

Re: Cabal fun [Half-integer]

by Andrew Coppin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Antoine Latter wrote:

> Personally, I've never used "runhaskell Setup sdist" and I've only
> ever used "cabal sdist". But I'm not sure where I learned that.
>
> I think cabal-install is a pretty standard util for people to have,
> and it ships with the Haskell platform now. So the big hurdle is
> documentation.
>
> Andrew - where does it state that "Setup sdist" is the recommended way
> of doing this? If it's a wiki you could go and edit it yourself.
>  

Start from the Hackage homepage:

  http://hackage.haskell.org/packages/hackage.html

Click on "how to create a Haskell package", takes you to

  http://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program

Section 2.10.1.1 shows you how to create a tarball - using setup sdist
rather than cabal sdist. Indeed, I don't think cabal-install is
mentioned anywhere.

If people seriously want this to become the preferred way to do things,
it needs to be much more prominently documented.

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

ANN: HalfInteger-1.1.1

by Andrew Coppin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Coppin wrote:
> I just wrote a small module for dealing with half-integers. (That is,
> any number I/2 where I is an integer. Note that the set of integers is
> a subset of this; Wikipedia seems to reserve "half-integer" for such
> numbers that are *not* integers.)
>
> Now, the question is... Is this useful enough to be worth putting on
> Hackage?

It's on Hackage:

   http://hackage.haskell.org/package/AC-HalfInteger-1.1.1

It'll be interesting to see if I uploaded it right... o_O

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

Re: ANN: HalfInteger-1.1.1

by Felipe Lessa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Jul 04, 2009 at 12:37:21PM +0100, Andrew Coppin wrote:
> It's on Hackage:
>
>   http://hackage.haskell.org/package/AC-HalfInteger-1.1.1
>
> It'll be interesting to see if I uploaded it right... o_O

I guess you did, congrats! :)

...on the Haddock comments of halve and double, it should be
"halve . double" and not "half . double", right?  You'll see that
after the first upload it is easy to do another one (hopefully).

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

Re: ANN: HalfInteger-1.1.1

by Andrew Coppin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Felipe Lessa wrote:

> On Sat, Jul 04, 2009 at 12:37:21PM +0100, Andrew Coppin wrote:
>  
>> It's on Hackage:
>>
>>   http://hackage.haskell.org/package/AC-HalfInteger-1.1.1
>>
>> It'll be interesting to see if I uploaded it right... o_O
>>    
>
> I guess you did, congrats! :)
>
> ...on the Haddock comments of halve and double, it should be
> "halve . double" and not "half . double", right?  You'll see that
> after the first upload it is easy to do another one (hopefully).
>  

Well that's a good start. Already somebody has found a bug to be fixed.
And in such a trivial package... o_O

Still, at least it's an easy fix. ;-) I don't think I'll bother making
another upload just for this; the fix is applied to my local copy, but
I'll wait until I have something more substantial to upload for the next
version.

"Thanks for the report."

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

Parent Message unknown Re: ANN: HalfInteger-1.1.1

by Andrew Coppin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alexander Dunlap wrote:
> Couple of suggestions:
>
> - You should put an (Integer i) => constraint on the halve function so
> that it becomes impossible to create invalid HalfIntegers.
>  

Right. Currently you can *make* such a HalfInteger. You just won't be
able to *do* anything with it afterwards. It would probably be more
sensible to just add a constraint there.

> - The documentation for toHalfInteger is truncated. Also, why can't
> you make the rounding more predictable?
>  

...wow. OK, I'm looking at the source, and it seems I must have got
distracted at that moment or something, because I just 100% didn't
actually finish writing the documentation! o_O That's pretty special. ;-)

As I *should* have written, the rounding for something like
toHalfInteger 0.25 is kind of unpredictable; but if you do toHalfInteger
0.5, the result is *guaranteed* to be exact. All the functions are
carefully tuned to work correctly on things which really are half
integers, and to give plausible results otherwise. Just don't let your
life depend on 0.25 being mapped to exactly a half or to exactly zero...

> Nice work!
>  

Heh, thanks.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe
< Prev | 1 - 2 | Next >