Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. development workflow ? (John M. Dlugosz)
2. Re: development workflow ? (Daniel Trstenjak)
3. easy question: transform Float -> Int how? (John M. Dlugosz)
4. Re: development workflow ? (John M. Dlugosz)
5. Re: easy question: transform Float -> Int how? (David McBride)
6. Re: easy question: transform Float -> Int how? (Arjun Comar)
7. Re: development workflow ? (Daniel Trstenjak)
8. Re: development workflow ? (John M. Dlugosz)
9. Re: development workflow ? (Daniel Trstenjak)
10. Re: development workflow ? (John M. Dlugosz)
----------------------------------------------------------------------
Message: 1
Date: Fri, 25 Apr 2014 09:41:32 -0500
From: "John M. Dlugosz" <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] development workflow ?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed
If you're working on a Haskell project that includes packages, and the packages
are in
subdirectories of the source tree, how do you "build"?
In my case, I want to alter the "gloss" package so I unpacked it, changed the
name to
"customgloss" in the .cabal file, and installed. Meanwhile, I used the
package-quallified
import GHC feature.
So I have to go into that subdirectory and run cabal install, let it recompile
everything
in there and copy it to the repository, then chdir back out and build/run my
main program.
How about a "make"-like way that knows if a source file in that package
directory has
changed, only recompiles the changed parts, and can put the output files in my
directory
tree with the source rather than copying to the machine repository?
How do you normally go about developing a new version of a package?
?John
------------------------------
Message: 2
Date: Fri, 25 Apr 2014 16:55:36 +0200
From: Daniel Trstenjak <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] development workflow ?
Message-ID: <20140425145536.GB7761@machine>
Content-Type: text/plain; charset=us-ascii
Hi John,
On Fri, Apr 25, 2014 at 09:41:32AM -0500, John M. Dlugosz wrote:
> How do you normally go about developing a new version of a package?
A cabal sandbox with 'add-source' might help here.
If your directory tree looks something like:
/whatever/customgloss
/whatever/yourproject
Then you could do:
cd /whatever/yourproject
cabal sandbox init
cabal sandbox add-source ../customgloss
cabal install
If your code in 'customgloss' changes, then calling again 'cabal install'
in 'yourproject' will rebuild 'customgloss'.
But you might rethink if copying 'gloss' that way is really a good long term
solution.
Greetings,
Daniel
------------------------------
Message: 3
Date: Fri, 25 Apr 2014 09:56:16 -0500
From: "John M. Dlugosz" <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] easy question: transform Float -> Int
how?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed
If I have a value of type Float, and I want to pass it (approximately rounded)
to a
function wanting an Int, how do I do that?
------------------------------
Message: 4
Date: Fri, 25 Apr 2014 09:58:04 -0500
From: "John M. Dlugosz" <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] development workflow ?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 4/25/2014 9:55 AM, Daniel Trstenjak wrote:
> But you might rethink if copying 'gloss' that way is really a good long term
> solution.
>
I have no idea what's a good idea; I'm just showing what I've learned thus far.
What is
the right way to develop a package?
------------------------------
Message: 5
Date: Fri, 25 Apr 2014 11:03:04 -0400
From: David McBride <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] easy question: transform Float -> Int
how?
Message-ID:
<can+tr42qo+kxyssjz8+lw1eybs2z7lsk_rjje2dypfhvpus...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Use the round function (or ceiling or floor).
On Fri, Apr 25, 2014 at 10:56 AM, John M. Dlugosz
<[email protected]>wrote:
> If I have a value of type Float, and I want to pass it (approximately
> rounded) to a function wanting an Int, how do I do that?
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140425/531fd23b/attachment-0001.html>
------------------------------
Message: 6
Date: Fri, 25 Apr 2014 11:03:36 -0400
From: Arjun Comar <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] easy question: transform Float -> Int
how?
Message-ID:
<CADjRcrV_0hEOBf1mtHJR=XjM7Td0Pa256zbEwU5qGCoa4vSG=g...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi John,
This page <http://www.haskell.org/haskellwiki/Converting_numbers> should
have you covered. Check section 3 especially.
Thanks,
Arjun
On Fri, Apr 25, 2014 at 10:56 AM, John M. Dlugosz
<[email protected]>wrote:
> If I have a value of type Float, and I want to pass it (approximately
> rounded) to a function wanting an Int, how do I do that?
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140425/9ae20916/attachment-0001.html>
------------------------------
Message: 7
Date: Fri, 25 Apr 2014 17:06:08 +0200
From: Daniel Trstenjak <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] development workflow ?
Message-ID: <20140425150608.GA8860@machine>
Content-Type: text/plain; charset=us-ascii
On Fri, Apr 25, 2014 at 09:58:04AM -0500, John M. Dlugosz wrote:
> I have no idea what's a good idea; I'm just showing what I've
> learned thus far. What is the right way to develop a package?
Why have you copied gloss?
Have you just added a new function?
Have you modified the code?
------------------------------
Message: 8
Date: Fri, 25 Apr 2014 11:14:41 -0500
From: "John M. Dlugosz" <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] development workflow ?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 4/25/2014 10:06 AM, Daniel Trstenjak wrote:
> On Fri, Apr 25, 2014 at 09:58:04AM -0500, John M. Dlugosz wrote:
>> I have no idea what's a good idea; I'm just showing what I've
>> learned thus far. What is the right way to develop a package?
>
> Why have you copied gloss?
> Have you just added a new function?
> Have you modified the code?
>
Because the circles are not round. I've modified one function. Maybe I'll do
more with
it and invite them to Pull.
------------------------------
Message: 9
Date: Fri, 25 Apr 2014 18:26:48 +0200
From: Daniel Trstenjak <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] development workflow ?
Message-ID: <20140425162648.GA11380@machine>
Content-Type: text/plain; charset=us-ascii
On Fri, Apr 25, 2014 at 11:14:41AM -0500, John M. Dlugosz wrote:
> Because the circles are not round. I've modified one function.
> Maybe I'll do more with it and invite them to Pull.
If you're changes are sensible and you could get your changes
merged back, than this is certainly the way to go.
If you can't get your changes merged back - or for the short
term - it might be easier to just copy the specific
function, modify and rename it.
I don't know nothing about gloss, so would this approach be possible?
Copying the whole package seems a bit excessive.
Greetings,
Daniel
------------------------------
Message: 10
Date: Fri, 25 Apr 2014 11:26:44 -0500
From: "John M. Dlugosz" <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] development workflow ?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
On 4/25/2014 10:06 AM, Daniel Trstenjak wrote:
> On Fri, Apr 25, 2014 at 09:58:04AM -0500, John M. Dlugosz wrote:
>> I have no idea what's a good idea; I'm just showing what I've
>> learned thus far. What is the right way to develop a package?
>
> Why have you copied gloss?
> Have you just added a new function?
> Have you modified the code?
>
To be specific, in Graphics/Gloss/Internals/Render/Circle.hs
{-# INLINE circleSteps #-}
circleSteps :: Float -> Int
circleSteps sDiam
| sDiam < 8 = 8
| sDiam < 16 = 16
| sDiam < 32 = 32
| otherwise = round sDiam
Originally, the otherwise branch said 64. When drawing my Pappas Chain, the
outer circle
was not tangent to all the little circles, but clipped through them and when
zoomed was
obviously a polygon and not a circle at all.
So, why's it limited to 64? Maybe we don't want to go crazy if zoomed in
deeply, and most
of it doesn't show anyway. So I thought I might tinker with it some more to
make it
proper circle quality only where it intersects the viewport, and crude outside
(if not
omitted entirely).
I might also turn on anti-aliasing, which if not exposed already means adding a
function
in the private guts to change the setting of the OpenGL handle.
But more generally, everyone who develops a package and continues to develop a
new version
while the old one is installed and used by other components must be doing
something
(sandbox for this case, I think). And even if a body of code is not intended
to be a
general purpose library shipped on its own, a big project ought to be divided
into parts,
so it is desirable to know which files changed and do far less work to build
than to
compile every single source file again.
?John
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 70, Issue 47
*****************************************