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. Haskell and TimeZones (Thiago Negri) 2. Re: Haskell and TimeZones (Brent Yorgey) 3. Haskell platform confusing to me (Manfred Lotz) 4. Re: Haskell platform confusing to me (Magnus Therning) 5. Re: Haskell platform confusing to me (Alec Story) 6. Re: Haskell platform confusing to me (Manfred Lotz) 7. Re: Haskell platform confusing to me (Arthur Clune) 8. Re: Haskell platform confusing to me (Manfred Lotz) 9. Re: suggestions for optimizing sudoku solver (KC) ---------------------------------------------------------------------- Message: 1 Date: Tue, 3 Jan 2012 13:04:20 -0200 From: Thiago Negri <evoh...@gmail.com> Subject: [Haskell-beginners] Haskell and TimeZones To: beginners@haskell.org Message-ID: <cablneztd29s7tl+_ogdztjjeqzgreb7+ejrg52tewf0du1y...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Hi, How does Haskell handle TimeZone? Do I need to use Oslon to have a historical database of TimeZones in Haskell? I tried reading the package description and everything, but it seems complicated. Is there any easy to follow tutorial available? For example, here in Brazil the daylight savings rules change every year. How do I update the Haskell Data.Time.* packages to know of the new rules? Or does it uses the TimeZone database from O.S.? I'm looking for a solution that works in any platform (mac, linux, windows). Thanks, Thiago. ------------------------------ Message: 2 Date: Tue, 3 Jan 2012 11:30:46 -0500 From: Brent Yorgey <byor...@seas.upenn.edu> Subject: Re: [Haskell-beginners] Haskell and TimeZones To: beginners@haskell.org Message-ID: <20120103163046.ga12...@seas.upenn.edu> Content-Type: text/plain; charset=us-ascii On Tue, Jan 03, 2012 at 01:04:20PM -0200, Thiago Negri wrote: > Hi, > > How does Haskell handle TimeZone? > Do I need to use Oslon to have a historical database of TimeZones in Haskell? > > I tried reading the package description and everything, but it seems > complicated. > Is there any easy to follow tutorial available? > > For example, here in Brazil the daylight savings rules change every > year. How do I update the Haskell Data.Time.* packages to know of the > new rules? Or does it uses the TimeZone database from O.S.? > > I'm looking for a solution that works in any platform (mac, linux, > windows). Hi Thiago, The time package by itself does not know about changing time zone rules. However, the timezone-series package (http://hackage.haskell.org/package/timezone-series) claims to extend Data.Time with exactly that capability. You can use it in conjunction with the timezon-olson package (http://hackage.haskell.org/package/timezone-olson) for reading Olson timezone databases. (Disclaimer: I have never used these packages myself.) It would be really great if someone wrote an easy to follow tutorial for dealing with time in Haskell, but as far as I know no one has yet done so. The time package is indeed complicated, but unfortunately that's because representing time is a complicated subject. Any simpler and it would be wrong. -Brent ------------------------------ Message: 3 Date: Tue, 3 Jan 2012 20:00:17 +0100 From: Manfred Lotz <manfred.l...@arcor.de> Subject: [Haskell-beginners] Haskell platform confusing to me To: beginners@haskell.org Message-ID: <20120103200017.62a52...@arcor.com> Content-Type: text/plain; charset=US-ASCII Hi all, I have 2 questions regarding Haskell platform. 1. If I would like to install the newest Haskell platform on say Ubuntu Precise which is in the making I could proceed like follows: - install all dep packges from http://packages.ubuntu.com/precise/haskell-platform which means I would manually have to download all debs and install them thereafter. Is this true? 2. I have Ubuntu Lucid and like to install the newest Haskell platform. Do I have to build it from source? I didn't find any (big picture) documentation telling me how the installation pathes possibly are. As can be seen I'm pretty confused how to proceed. -- Manfred ------------------------------ Message: 4 Date: Tue, 3 Jan 2012 20:19:05 +0100 From: Magnus Therning <mag...@therning.org> Subject: Re: [Haskell-beginners] Haskell platform confusing to me To: beginners@haskell.org Message-ID: <20120103191905.GD2070@ohann> Content-Type: text/plain; charset="us-ascii" On Tue, Jan 03, 2012 at 08:00:17PM +0100, Manfred Lotz wrote: > Hi all, > I have 2 questions regarding Haskell platform. > > 1. If I would like to install the newest Haskell platform on say Ubuntu > Precise which is in the making I could proceed like follows: > - install all dep packges from > http://packages.ubuntu.com/precise/haskell-platform > which means I would manually have to download all debs and install > them thereafter. > > Is this true? > > 2. I have Ubuntu Lucid and like to install the newest Haskell platform. > Do I have to build it from source? > > > I didn't find any (big picture) documentation telling me how the > installation pathes possibly are. As can be seen I'm pretty confused > how to proceed. I don't have a Ubuntu Precise system to try this on, and it was a while since I stopped using Debian-based distros, but don't you just have to turn on the universe repo and then use apt-get? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves. -- Alan Kay -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: <http://www.haskell.org/pipermail/beginners/attachments/20120103/66237555/attachment-0001.pgp> ------------------------------ Message: 5 Date: Tue, 3 Jan 2012 14:24:18 -0500 From: Alec Story <av...@cornell.edu> Subject: Re: [Haskell-beginners] Haskell platform confusing to me To: Manfred Lotz <manfred.l...@arcor.de> Cc: beginners@haskell.org Message-ID: <cakcn5sqze0hvf2ocbyajwbxtfq_zfjzqtdjm9dme_ydenzz...@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" I think this will depend a lot on what you mean by "newest." If you really want an up-to-the-minute system, you'll of course have to compile it from yourself, out of the version control system. You might be able to install the build dependencies easily using apt-get build-deps. Of course, if you're happy with the debs in the repository, you can just install those through apt-get normally. If you're trying to backport newer debs to an older version of Ubuntu, that can be done, but will require some work, and may not be very easy if the new versions have dependencies on new versions of other packages. On Tue, Jan 3, 2012 at 2:00 PM, Manfred Lotz <manfred.l...@arcor.de> wrote: > Hi all, > I have 2 questions regarding Haskell platform. > > 1. If I would like to install the newest Haskell platform on say Ubuntu > Precise which is in the making I could proceed like follows: > - install all dep packges from > http://packages.ubuntu.com/precise/haskell-platform > which means I would manually have to download all debs and install > them thereafter. > > Is this true? > > 2. I have Ubuntu Lucid and like to install the newest Haskell platform. > Do I have to build it from source? > > > I didn't find any (big picture) documentation telling me how the > installation pathes possibly are. As can be seen I'm pretty confused > how to proceed. > > > -- > Manfred > > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners > -- Alec Story Cornell University Biological Sciences, Computer Science 2012 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120103/c0aeb346/attachment-0001.htm> ------------------------------ Message: 6 Date: Tue, 3 Jan 2012 20:39:43 +0100 From: Manfred Lotz <manfred.l...@arcor.de> Subject: Re: [Haskell-beginners] Haskell platform confusing to me To: beginners@haskell.org Message-ID: <20120103203943.080f5...@arcor.com> Content-Type: text/plain; charset=US-ASCII On Tue, 3 Jan 2012 14:24:18 -0500 Alec Story <av...@cornell.edu> wrote: > I think this will depend a lot on what you mean by "newest." If you > really want an up-to-the-minute system, you'll of course have to > compile it from yourself, out of the version control system. You > might be able to install the build dependencies easily using apt-get > build-deps. > Let's say I'd like to have a ghc 7.0x on Ubuntu Lucid. It seems that Lucid has ghc6 by default. > Of course, if you're happy with the debs in the repository, you can > just install those through apt-get normally. If you're trying to > backport newer debs to an older version of Ubuntu, that can be done, > but will require some work, and may not be very easy if the new > versions have dependencies on new versions of other packages. > You mean I would need to backport the ghc for Lucid if I like to have a ghc 7.0x with Lucid? -- Manfred ------------------------------ Message: 7 Date: Tue, 3 Jan 2012 20:15:51 +0000 From: Arthur Clune <art...@clune.org> Subject: Re: [Haskell-beginners] Haskell platform confusing to me To: Manfred Lotz <manfred.l...@arcor.de> Cc: beginners@haskell.org Message-ID: <caaa4kjyducgsj1cvxga7nz7dheazdzow3hx1d942rchylc+...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 For Lucid, there's various ppas. This one looks like it'll give you ghc7 on Lucid: https://launchpad.net/~mbeloborodiy/+archive/ppa For the latest Ubuntu, you can just pull from the standard repos arthur@jumpjet:/etc/apt$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 11.10 Release: 11.10 Codename: oneiric arthur@jumpjet:/etc/apt$ apt-cache search haskell-platform haskell-platform - Standard Haskell libraries and tools haskell-platform-doc - Standard Haskell libraries and tools; documentaion haskell-platform-prof - Standard Haskell libraries and tools; profiling libraries arthur@jumpjet:/etc/apt$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.0.3 -- Arthur Clune art...@clune.org On Tue, Jan 3, 2012 at 7:39 PM, Manfred Lotz <manfred.l...@arcor.de> wrote: > Let's say I'd like to have a ghc 7.0x on Ubuntu Lucid. It seems that > Lucid has ghc6 by default. ------------------------------ Message: 8 Date: Tue, 3 Jan 2012 21:51:25 +0100 From: Manfred Lotz <manfred.l...@arcor.de> Subject: Re: [Haskell-beginners] Haskell platform confusing to me To: beginners@haskell.org Message-ID: <20120103215125.54378...@arcor.com> Content-Type: text/plain; charset=US-ASCII On Tue, 3 Jan 2012 20:15:51 +0000 Arthur Clune <art...@clune.org> wrote: > For Lucid, there's various ppas. This one looks like it'll give you > ghc7 on Lucid: > > https://launchpad.net/~mbeloborodiy/+archive/ppa > > For the latest Ubuntu, you can just pull from the standard repos > Thanks a lot, that did the job nicely. -- Manfred ------------------------------ Message: 9 Date: Tue, 3 Jan 2012 19:01:56 -0800 From: KC <kc1...@gmail.com> Subject: Re: [Haskell-beginners] suggestions for optimizing sudoku solver To: peter.h...@memorphic.com, beginners@haskell.org Message-ID: <camlkxykkzmarcoouuoduhtr3zobn8vcnwewqk+rm34dhhfv...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Bird begins with the specification (without regard to efficiency): solve = filter valid . expand . choices And ends up with this third version of solve solve = search . choices search m | not (safe m) = [] | complete m' = [map (map head) m'] | otherwise = concat (map search (expand1 m')) | where m' = prune m Note: some functions are missing The interesting idea is how he uses equational reasoning to reach this solve. On Sun, Jan 1, 2012 at 7:27 PM, Peter Hall <peter.h...@memorphic.com> wrote: > I set myself a learning task of writing a sudoku solver. > (https://github.com/peterjoel/sudoku/blob/master/src/Sudoku.hs) > It works pretty well, but struggles with some of the harder grids. > e.g. data/hard4.txt and data/hard5.txt take around 18 seconds to > solve. Obviously there's a limit, but I feel like I should be able to > make this faster. > > I think the main issue is reading/writing to the cells in the grid, > since (!!) is O(n). Even though it never has to go beyond index 8, it > will add up over the millions of times it has to do it. I imagine it > could be a lot faster if I use a static, non-list data structure, but > I was hoping to keep it a bit more flexible. > > Also, I'm struggling to get started with performance profiling. Can > someone point me to some good resources? > > Peter > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners -- -- Regards, KC ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 43, Issue 5 ****************************************