Send Beginners mailing list submissions to beginners@haskell.org 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 beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. convert to fixed length Int (Christopher Howard) 2. Re: convert to fixed length Int (Carlos J. G. Duarte) 3. Re: cabal install errors & issues (Antoine Latter) 4. Re: cabal install errors & issues (Gregory Guthrie) 5. Re: cabal install errors & issues (Antoine Latter) 6. Re: cabal install errors & issues (Brandon Allbery) 7. Re: cabal install errors & issues (Gregory Guthrie) 8. Re: cabal install errors & issues (Antoine Latter) 9. Re: cabal install errors & issues (Gregory Guthrie) ---------------------------------------------------------------------- Message: 1 Date: Thu, 16 Aug 2012 16:42:08 -0800 From: Christopher Howard <christopher.how...@frigidcode.com> Subject: [Haskell-beginners] convert to fixed length Int To: Haskell Beginners <beginners@haskell.org> Message-ID: <502d9360.8070...@frigidcode.com> Content-Type: text/plain; charset="iso-8859-1" Hi. In Haskell, how would I go about converting from a Double (or Float) type to a Data.Int.Int8, Data.Int.Int16, and so forth? (Of course, expecting rounding and damage to out of range values.) I was playing around with signal generation using trig functions (hence the floating types) but the actual output has to be Int16. -- frigidcode.com indicium.us -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 554 bytes Desc: OpenPGP digital signature URL: <http://www.haskell.org/pipermail/beginners/attachments/20120816/10ff76fd/attachment-0001.pgp> ------------------------------ Message: 2 Date: Fri, 17 Aug 2012 02:06:14 +0100 From: "Carlos J. G. Duarte" <carlos.j.g.dua...@gmail.com> Subject: Re: [Haskell-beginners] convert to fixed length Int To: beginners@haskell.org Message-ID: <502d9906.30...@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 08/17/12 01:42, Christopher Howard wrote: > Hi. In Haskell, how would I go about converting from a Double (or Float) > type to a Data.Int.Int8, Data.Int.Int16, and so forth? (Of course, > expecting rounding and damage to out of range values.) > > I was playing around with signal generation using trig functions (hence > the floating types) but the actual output has to be Int16. > > Don't know if there's a better or correct way, but this seems to work: ghci> let c = (round 256.6) :: Int16 ghci> :type c c :: Int16 It rolls over at overflow: ghci> let c = (round 65537) :: Int16 ghci> c 1 ------------------------------ Message: 3 Date: Thu, 16 Aug 2012 21:21:56 -0500 From: Antoine Latter <aslat...@gmail.com> Subject: Re: [Haskell-beginners] cabal install errors & issues To: Gregory Guthrie <guth...@mum.edu> Cc: "beginners@haskell.org" <beginners@haskell.org> Message-ID: <cakjsnqhe-wmtndmyjo0b1rqtwxvetbs3qxiieqfonmkay_b...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 On Thu, Aug 16, 2012 at 8:18 AM, Gregory Guthrie <guth...@mum.edu> wrote: > Thanks for the advice and pointers, I will try to make this transition, but > it looks like it is not so simple. > > Trying to bootstrap into cabal-dev seems to require some external > installations as well; > > >>cabal install cabal-dev --force-reinstalls Maybe I'm missing some context, but is there a reason you're using the "--fore-reinstalls" flag? If you didn't pass that then 'cabal' maybe would not try to re-install the 'network' package and you wouldn't run into this. Antoine ------------------------------ Message: 4 Date: Thu, 16 Aug 2012 21:30:25 -0500 From: Gregory Guthrie <guth...@mum.edu> Subject: Re: [Haskell-beginners] cabal install errors & issues To: Antoine Latter <aslat...@gmail.com> Cc: "beginners@haskell.org" <beginners@haskell.org> Message-ID: <08ef9da445c4b5439c4733e1f35705ba01e267667...@mail.cs.mum.edu> Content-Type: text/plain; charset="utf-8" Yes, because a simple "cabal install" failed, and said the only way to do it was to force-installs. But if this is a dependency, wouldn't it be requires (or not) either way? ------------------------------------------- > -----Original Message----- > > Trying to bootstrap into cabal-dev seems to require some external > > installations as well; > > > > >>cabal install cabal-dev --force-reinstalls > > Maybe I'm missing some context, but is there a reason you're using the > "--fore-reinstalls" > flag? If you didn't pass that then 'cabal' maybe would not try to re-install > the 'network' > package and you wouldn't run into this. ------------------------------ Message: 5 Date: Thu, 16 Aug 2012 21:36:54 -0500 From: Antoine Latter <aslat...@gmail.com> Subject: Re: [Haskell-beginners] cabal install errors & issues To: Gregory Guthrie <guth...@mum.edu> Cc: "beginners@haskell.org" <beginners@haskell.org> Message-ID: <cakjsnqgaiait8qiwmecwa0xp3jfcsmoc7o+ga0jis16vcpc...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Oh, I was assuming you already had a version of 'network' installed that came with the Haskell Platform - the platform comes with: network-2.3.0.13 HTTP-4000.2.3 So I assumed they were being installed again because of the flag. Really, the platform comes with everything that cabal-dev depends on, so it might be easier to solve whatever error message you're getting without the '--force' flag. Antoine On Thu, Aug 16, 2012 at 9:30 PM, Gregory Guthrie <guth...@mum.edu> wrote: > Yes, because a simple "cabal install" failed, and said the only way to do it > was to force-installs. > > But if this is a dependency, wouldn't it be requires (or not) either way? > > ------------------------------------------- >> -----Original Message----- >> > Trying to bootstrap into cabal-dev seems to require some external >> > installations as well; >> > >> > >>cabal install cabal-dev --force-reinstalls >> >> Maybe I'm missing some context, but is there a reason you're using the >> "--fore-reinstalls" >> flag? If you didn't pass that then 'cabal' maybe would not try to re-install >> the 'network' >> package and you wouldn't run into this. ------------------------------ Message: 6 Date: Thu, 16 Aug 2012 22:43:01 -0400 From: Brandon Allbery <allber...@gmail.com> Subject: Re: [Haskell-beginners] cabal install errors & issues To: Antoine Latter <aslat...@gmail.com> Cc: Gregory Guthrie <guth...@mum.edu>, "beginners@haskell.org" <beginners@haskell.org> Message-ID: <cakfcl4x25oud9skgddzrnl2xpx9+c85mshnms_uh6pttriz...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On Thu, Aug 16, 2012 at 10:36 PM, Antoine Latter <aslat...@gmail.com> wrote: > Really, the platform comes with everything that cabal-dev depends on, > so it might be easier to solve whatever error message you're getting > without the '--force' flag. Unfortunately I'm seeing the same thing, but on OS X (Lion): "cabal install cabal-dev", with no local packages, wants to reinstall/break a bunch of Platform libraries. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120816/48f5e274/attachment-0001.htm> ------------------------------ Message: 7 Date: Thu, 16 Aug 2012 21:54:40 -0500 From: Gregory Guthrie <guth...@mum.edu> Subject: Re: [Haskell-beginners] cabal install errors & issues To: Antoine Latter <aslat...@gmail.com> Cc: "beginners@haskell.org" <beginners@haskell.org> Message-ID: <08ef9da445c4b5439c4733e1f35705ba01e267667...@mail.cs.mum.edu> Content-Type: text/plain; charset="utf-8" Here was my first try to install cabal-dev (to follow advice to vacate cabal install); C:\Users\ haskell >cabal install cabal-dev Resolving dependencies... In order, the following would be installed: tar-0.3.2.0 (new package) transformers-0.2.2.0 (reinstall) changes: base-4.3.1.0 -> 4.5.0.0 mtl-2.0.1.0 (reinstall) changes: base-4.3.1.0 -> 4.5.0.0 parsec-3.1.3 (reinstall) changes: mtl-2.1.2 -> 2.0.1.0 network-2.3.0.14 (new version) HTTP-4000.2.3 (reinstall) changes: mtl-2.1.1 -> 2.0.1.0, network-2.3.0.13 -> 2.3.0.14, parsec-3.1.2 -> 3.1.3 cabal-dev-0.9.1 (new package) cabal: The following packages are likely to be broken by the reinstalls: regex-base-0.93.2 regex-posix-0.95.1 regex-compat-0.95.1 haskell-platform-2011.3.0.0 regex-posix-0.94.4 regex-compat-0.93.1 haskell-platform-2011.2.0.1 parsec-3.1.1 network-2.3.0.5 cgi-3001.1.7.4 HTTP-4000.1.2 network-2.3.0.2 vcgi-3001.1.7.4 HTTP-4000.1.1 fgl-5.4.2.4 fgl-5.4.2.3 QuickCheck-2.4.0.1 haskell-platform-2012.2.0.0 Use --force-reinstalls if you want to install anyway. The force resultted in the previously reported error - Configuring network-2.3.0.14... cabal: The package has a './configure' script. This requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. cabal: Error: some packages failed to install: HTTP-4000.2.3 depends on network-2.3.0.14 which failed to install. cabal-dev-0.9.1 depends on network-2.3.0.14 which failed to install. network-2.3.0.14 failed during the configure step. The exception was: ExitFailure 1 Now after the attempt to do the force (which was advised earlier to resolve package shadowing problems left over from cabal-install's), C:\Users\haskell>cabal install cabal-dev Resolving dependencies... In order, the following would be installed: network-2.3.0.14 (new version) HTTP-4000.2.3 (reinstall) changes: mtl-2.1.1 -> 2.0.1.0, network-2.3.0.13 -> 2.3.0.14, parsec-3.1.2 -> 3.1.3 cabal-dev-0.9.1 (new package) cabal: The following packages are likely to be broken by the reinstalls: haskell-platform-2012.2.0.0 Use --force-reinstalls if you want to install anyway. And yes, I do have network installed; > network-2.3.0.13 ------------------------------------------- > -----Original Message----- > Oh, I was assuming you already had a version of 'network' installed that came > with the > Haskell Platform - the platform comes with: > > network-2.3.0.13 > HTTP-4000.2.3 > > So I assumed they were being installed again because of the flag. > > Really, the platform comes with everything that cabal-dev depends on, so it > might be easier > to solve whatever error message you're getting without the '--force' flag. ------------------------------ Message: 8 Date: Thu, 16 Aug 2012 22:59:25 -0500 From: Antoine Latter <aslat...@gmail.com> Subject: Re: [Haskell-beginners] cabal install errors & issues To: Brandon Allbery <allber...@gmail.com> Cc: Gregory Guthrie <guth...@mum.edu>, "beginners@haskell.org" <beginners@haskell.org> Message-ID: <cakjsnqgbxh3zrynulmoptfrc6dxg-pce2j9hgkmjrejzpq5...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 On Thu, Aug 16, 2012 at 9:43 PM, Brandon Allbery <allber...@gmail.com> wrote: > On Thu, Aug 16, 2012 at 10:36 PM, Antoine Latter <aslat...@gmail.com> wrote: >> >> Really, the platform comes with everything that cabal-dev depends on, >> so it might be easier to solve whatever error message you're getting >> without the '--force' flag. > > > Unfortunately I'm seeing the same thing, but on OS X (Lion): "cabal install > cabal-dev", with no local packages, wants to reinstall/break a bunch of > Platform libraries. Ug. I have a weird franken-install on my end, so "cabal install cabal-dev" (or even just a "cabal unpack" "cabal configure") works cleanly for me. Maybe you could file a ticket with "cabal-dev" to ask what you need to do to install on a fresh platform install, or ask on haskell-cafe. Can you try upgrading "cabal-install" to see if the new solver handles it better? I think the new version works with what is in the platform. If you also get errors there might be ways to make it go ... Antoine > > -- > brandon s allbery allber...@gmail.com > wandering unix systems administrator (available) (412) 475-9364 vm/sms > ------------------------------ Message: 9 Date: Thu, 16 Aug 2012 23:12:18 -0500 From: Gregory Guthrie <guth...@mum.edu> Subject: Re: [Haskell-beginners] cabal install errors & issues To: Benjamin Edwards <edwards.b...@gmail.com> Cc: "beginners@haskell.org" <beginners@haskell.org> Message-ID: <08ef9da445c4b5439c4733e1f35705ba01e267667...@mail.cs.mum.edu> Content-Type: text/plain; charset="iso-8859-1" Thanks. Yes, I only do simple things, so also thought I could use it as a plug-and-play beginner, but even trying to install a few libraries for demos or other class projects (e.g. diagrams, .) put me into the midst of the cabal install dependencies not possible "you must use force, and that will break things" jungle. I am hoping I just made a mistake using cabal-install, and if I can do a conversion into cabal-dev I will exit the various tangles. But the conversion itself seems troublesome. Perhaps I should start over with a clean install, and just avoid any cabal-install usage? Any hints on how to reset /restart the libraries and package repositories? ------------------------------------------- >> It really depends on what you are looking to teach! >> For professional dev with lots of packages and different projects then >> sandboxing is a must. >> I imagine for a lab you could get away with what's in the haskell platform. >> I got cabal-dev going on a windows box not too long ago. When I get >> home >> I will have a tinker. >> I am sure someone with more windows experience than I can chime in. >> On Aug 16, 2012 6:28 PM, "Gregory Guthrie" <guth...@mum.edu> wrote: >> Thanks for the clarification and info. >> >> From this I then deduce: >>? Using "cabal install" is dangerous, and leads to broken package structure >>(inconsistent package versions and shadowing). >>? Better to use cabal-dev, >>? ? But it requires network, which is external to Haskell, and a pain to >>build (on windows)... >> >> Thus, no good solution on Windows - is this right? >> >> Since Windows is 94%+ of computing environments today (all of our labs use >> Windows, and "standard" IDEs), then Haskell is not a good fit? >> We want to use Windows since that is what students will generally see in >> their professional environments. >> >> I hope not...!! ?:-) >> >> ------------------------------------------------------- >> >> Ahh, I think network is a pain to build on Windows. >> ?I don't as a rule do any haskell on windows because of the headaches of >> msys / mingw. ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 50, Issue 19 *****************************************