[Haskell] ANNOUNCE: lens-family 1.0.0

2013-10-29 Thread roconnor
Before there was lens there was lens-family I'm pleased to announce the second major release of the lens-family pacakges: lens-family-core-1.0.0 and lens-family-1.0.0. They can be found at * http://hackage.haskell.org/package/lens-family-core *

Re: Error building ghc on raspberry pi.

2013-01-27 Thread roconnor
On Mon, 21 Jan 2013, rocon...@theorem.ca wrote: On Mon, 21 Jan 2013, Karel Gardas wrote: On 01/21/13 12:49 AM, rocon...@theorem.ca wrote: On Sun, 20 Jan 2013, Karel Gardas wrote: Okay, I patched the settings filed generted by ./configure in the binary-dist and rank make install which

Re: Error building ghc on raspberry pi.

2013-01-21 Thread roconnor
On Mon, 21 Jan 2013, Karel Gardas wrote: On 01/21/13 12:49 AM, rocon...@theorem.ca wrote: On Sun, 20 Jan 2013, Karel Gardas wrote: Okay, I patched the settings filed generted by ./configure in the binary-dist and rank make install which completed. However, pi@raspberrypi /tmp/bindist $

Re: Error building ghc on raspberry pi.

2013-01-20 Thread roconnor
On Wed, 16 Jan 2013, Karel Gardas wrote: You should not IMHO. My patch should solve all your issues. :-) The only issue you may get is that your distro ghc will compile for soft-float ABI and your compiled GHC will compile to hard-float and object files will get mixed somewhere. But I trust

Re: Error building ghc on raspberry pi.

2013-01-20 Thread roconnor
On Sun, 20 Jan 2013, Karel Gardas wrote: On 01/20/13 07:17 PM, rocon...@theorem.ca wrote: On Wed, 16 Jan 2013, Karel Gardas wrote: You should not IMHO. My patch should solve all your issues. :-) The only issue you may get is that your distro ghc will compile for soft-float ABI and your

Re: Error building ghc on raspberry pi.

2013-01-20 Thread roconnor
On Sun, 20 Jan 2013, Karel Gardas wrote: On 01/20/13 07:50 PM, rocon...@theorem.ca wrote: Karel, maybe you should try deploying a binary-dist on your panda board? Sorry? What's binary-dist? And why I should do that? And what exactly do you mean by deploying? And on what OS? Ubuntu or

Re: Error building ghc on raspberry pi.

2013-01-20 Thread roconnor
On Sun, 20 Jan 2013, Karel Gardas wrote: On 01/20/13 07:17 PM, rocon...@theorem.ca wrote: On Wed, 16 Jan 2013, Karel Gardas wrote: You should not IMHO. My patch should solve all your issues. :-) The only issue you may get is that your distro ghc will compile for soft-float ABI and your

Re: Error building ghc on raspberry pi.

2013-01-20 Thread roconnor
On Sun, 20 Jan 2013, Karel Gardas wrote: On 01/20/13 08:27 PM, rocon...@theorem.ca wrote: Looks like you do have corrupted settings file. Recover it by adding HARD following armABI = , so result should be: ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = HARD} Okay, I patched the

Re: Error building ghc on raspberry pi.

2013-01-20 Thread roconnor
On Sun, 20 Jan 2013, Karel Gardas wrote: On 01/20/13 08:27 PM, rocon...@theorem.ca wrote: Looks like you do have corrupted settings file. Recover it by adding HARD following armABI = , so result should be: ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = HARD} Okay, I patched the

Re: Error building ghc on raspberry pi.

2013-01-18 Thread roconnor
On Thu, 17 Jan 2013, rocon...@theorem.ca wrote: On Thu, 17 Jan 2013, Austin Seipp wrote: There have been a few of these bugs recently it seems. If you could: use the stage1 compiler to compile a simple executable, like 'main = return ()' or hello world or whatever. The stage1 compiler can be

Re: Error building ghc on raspberry pi.

2013-01-18 Thread roconnor
On Fri, 18 Jan 2013, Karel Gardas wrote: On 01/18/13 05:49 PM, rocon...@theorem.ca wrote: I don't know much about gdb, but $ /usr/bin/gdb /tmp/Main GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later

Re: Error building ghc on raspberry pi.

2013-01-17 Thread roconnor
On Wed, 16 Jan 2013, Karel Gardas wrote: On 01/16/13 08:12 PM, rocon...@theorem.ca wrote: On Wed, 16 Jan 2013, Karel Gardas wrote: Good! So the patch I already provided is working fine at least w.r.t. change in configure. I've tested it here on my raspbian chroot on pandaboard where I've

Re: Error building ghc on raspberry pi.

2013-01-17 Thread roconnor
On Thu, 17 Jan 2013, Austin Seipp wrote: There have been a few of these bugs recently it seems. If you could: use the stage1 compiler to compile a simple executable, like 'main = return ()' or hello world or whatever. The stage1 compiler can be located in the build directory, under

Re: Error building ghc on raspberry pi.

2013-01-16 Thread roconnor
On Wed, 16 Jan 2013, Karel Gardas wrote: Guys, I've installed raspbian into ubuntu chroot on my panda. Now to simulate what GHC detects on your hardware, could you be so kind and send me output of: uname -m armv6l uname -r 3.6.11+ uname -s Linux uname -v #346 PREEMPT Fri Dec

Re: Error building ghc on raspberry pi.

2013-01-16 Thread roconnor
On Wed, 16 Jan 2013, Karel Gardas wrote: Good! So the patch I already provided is working fine at least w.r.t. change in configure. I've tested it here on my raspbian chroot on pandaboard where I've hacked config.guess to print exactly what you get on real rpi. Now, I'm curious if the hack

Re: Error building ghc on raspberry pi.

2013-01-15 Thread roconnor
On Mon, 14 Jan 2013, Thijs Alkemade wrote: Op 14 jan. 2013, om 17:30 heeft rocon...@theorem.ca het volgende geschreven: On Thu, 10 Jan 2013, Karel Gardas wrote: Hmm, are you using Raspbian? I.e. hard-float abi caught my eye in case of ARMv6/ARM11 chip here... I'm afraid LLVM is not well

Re: Error building ghc on raspberry pi.

2013-01-15 Thread roconnor
On Tue, 15 Jan 2013, Thijs Alkemade wrote: Op 15 jan. 2013, om 17:36 heeft rocon...@theorem.ca het volgende geschreven: Okay, I tried: SRC_HC_OPTS= -H64m -Rghc-timing -optc-mfloat-abi=hard -optc-march=armv6 -optc-mfpu=vfp -optlc=-mattr=+vfp2 GhcStage1HcOpts= -O -fllvm

Re: Error building ghc on raspberry pi.

2013-01-15 Thread roconnor
In theory we could try a couple variations of builds at the same time. But at the moment, I'm running low on ideas on what to try. I just got the, extensive, raspbian patches for 7.4.1 and I'm going to browse through them when I get time (apt-get source ghc). On Tue, 15 Jan 2013, Neil Davies

Re: Error building ghc on raspberry pi.

2013-01-14 Thread roconnor
On Thu, 10 Jan 2013, Karel Gardas wrote: Hmm, are you using Raspbian? I.e. hard-float abi caught my eye in case of ARMv6/ARM11 chip here... I'm afraid LLVM is not well guided in your case so could you be so kind and test if adding -optlc=-mattr=+vfp2 helps? You need to add it to your

Re: Building ghc on raspberry pi.

2013-01-13 Thread roconnor
On Sun, 13 Jan 2013, Neil Davies wrote: Sounds like we're close - I must admit I've slightly lost track of the things that need to be done. Can we start collecting the pre-conditionds and steps, when each complete build takes best part of a day, its difficult to keep the context. So -

Re: Error building ghc on raspberry pi.

2013-01-12 Thread roconnor
I've tried to build 6.12.3, 7.4.1, 7.4.2, and 7.6.1, with a few various patches, and I'm stuck in the final stage with errors like: /usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/debug.o uses VFP register arguments, libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o

Re: Error building ghc on raspberry pi.

2013-01-12 Thread roconnor
On Thu, 10 Jan 2013, Karel Gardas wrote: Hmm, are you using Raspbian? I.e. hard-float abi caught my eye in case of ARMv6/ARM11 chip here... I'm afraid LLVM is not well guided in your case so could you be so kind and test if adding -optlc=-mattr=+vfp2 helps? You need to add it to your

Re: Error building ghc on raspberry pi.

2013-01-12 Thread roconnor
On Sat, 12 Jan 2013, rocon...@theorem.ca wrote: On Thu, 10 Jan 2013, Karel Gardas wrote: Hmm, are you using Raspbian? I.e. hard-float abi caught my eye in case of ARMv6/ARM11 chip here... I'm afraid LLVM is not well guided in your case so could you be so kind and test if adding

Re: Error building ghc on raspberry pi.

2013-01-12 Thread roconnor
What version of GHC did you build? On Sat, 12 Jan 2013, Ben Gamari wrote: Karel Gardas karel.gar...@centrum.cz writes: On 01/11/13 09:25 PM, rocon...@theorem.ca wrote: On Thu, 10 Jan 2013, Karel Gardas wrote: Hmm, are you using Raspbian? I.e. hard-float abi caught my eye in case of

Re: Error building ghc on raspberry pi.

2013-01-12 Thread roconnor
On Sat, 12 Jan 2013, Ben Gamari wrote: rocon...@theorem.ca writes: What version of GHC did you build? This was building from the ghc-7.4 branch. That being said, after this build finished I noticed that the resulting stage 2 compiler wasn't invoking llc with the correct parameters,

Re: Error building ghc on raspberry pi.

2013-01-11 Thread roconnor
On Thu, 10 Jan 2013, Karel Gardas wrote: Hmm, are you using Raspbian? I.e. hard-float abi caught my eye in case of ARMv6/ARM11 chip here... I'm afraid LLVM is not well guided in your case so could you be so kind and test if adding -optlc=-mattr=+vfp2 helps? You need to add it to your

Re: Error building ghc on raspberry pi.

2013-01-09 Thread roconnor
Thanks for the advice; However, it had little effect. I now have the errors: ===--- building final phase make -r --no-print-directory -f ghc.mk phase=final all LD libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o /usr/bin/ld: error:

Re: Error building ghc on raspberry pi.

2013-01-09 Thread roconnor
This is the settingings file: $ cat settings [(GCC extra via C opts, -fwrapv), (C compiler command, /usr/bin/gcc), (C compiler flags, -fno-stack-protector -Wl,--hash-size=31 -Wl,--reduce-memory-overheads), (ar command, /usr/bin/ar), (ar flags, q), (ar supports at file, YES), (touch

Re: Error building ghc on raspberry pi.

2013-01-07 Thread roconnor
On Thu, 3 Jan 2013, Thijs Alkemade wrote: I believe I had the same problem, which disappeared after upgrading llvm from 3.0 to 3.1, and using that instead for ./configure. Hope this helps, Thijs Thanks, using LLVM 3.1 seems to have improved the siutation, but I'm running into a new error.

Error building ghc on raspberry pi.

2013-01-02 Thread roconnor
I'm trying to build ghc-7.4.1 using ghc-7.4.1 on my raspberry pi (armv6l) and I get the following error: inplace/bin/ghc-stage1 -H32m -O-package-name ghc-prim-0.2.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build

Re: Error building ghc on raspberry pi.

2013-01-02 Thread roconnor
Thanks for your help, but unfortunately this isn't the issue Filesystem Size Used Avail Use% Mounted on /dev/sda2 924G 584G 294G 67% /tmp So there is pleanty of room on temp. BTW, I also tried building it twice and I got the same error at the same place. On Wed, 2 Jan 2013,

Re: Error building ghc on raspberry pi.

2013-01-02 Thread roconnor
Some further information it seems that llc is segfaulting: pi@raspberrypi /tmp/ghc-7.4.1 $ llc -O3 -relocation-model=static /tmp/ghc7189_0/ghc7189_0.bc -o /tmp/ghc7189_0/ghc7189_0.lm_s Stack dump: 0. Program arguments: llc -O3 -relocation-model=static /tmp/ghc7189_0/ghc7189_0.bc -o

Re: How to describe this bug?

2012-07-10 Thread roconnor
On Tue, 10 Jul 2012, Sönke Hahn wrote: Hi! I've discovered a strange bug that violates simple equational reasoning. Basically, something similar to this: let a = f x in a == f x While this code as it stands doesn't quite illustrate the referential transparency error, since == isn't

Re: [Haskell] [Haskell-cafe] ANNOUNCE: lens-family-th 0.1.0.0

2012-07-07 Thread roconnor
On Fri, 6 Jul 2012, Dan Burton wrote: Following the announcement of lens-family, I'm pleased to announce lens-family-th 0.1.0.0, a Template Haskell library supplying macros to generate lens-family lenses for fields of data types declared with record syntax. Be warned that currently, type

Re: [Haskell-cafe] ANNOUNCE: lens-family-th 0.1.0.0

2012-07-07 Thread roconnor
On Fri, 6 Jul 2012, Dan Burton wrote: Following the announcement of lens-family, I'm pleased to announce lens-family-th 0.1.0.0, a Template Haskell library supplying macros to generate lens-family lenses for fields of data types declared with record syntax. Be warned that currently, type

Re: [Haskell-cafe] [Haskell] ANNOUNCE: lens-family-th 0.1.0.0

2012-07-07 Thread roconnor
I don't know if it is possible to add haddock to functions whose type signatures are generated by template haskell. Could the documentation be an argument of mkLenses? Does haddock run on the template-haskell expanded code? -- Russell O'Connor

[Haskell] ANNOUNCE: lens-family 0.0.0

2012-07-06 Thread roconnor
I'm pleased to announce the first release of lens-family-core and lens-family. This package provide first class(†) functional references. In addition to the usual operations of getting, setting and composition, plus integration with the state monad, lens families provide some unique features:

[Haskell-cafe] ANNOUNCE: lens-family 0.0.0

2012-07-06 Thread roconnor
I'm pleased to announce the first release of lens-family-core and lens-family. This package provide first class(†) functional references. In addition to the usual operations of getting, setting and composition, plus integration with the state monad, lens families provide some unique features:

Re: [Haskell-cafe] Haskell showcase in 5 minutes

2012-02-27 Thread roconnor
In less than 5 minutes I can solve NP-Complete problems in restaurant orders: http://www.reddit.com/comments/24p2c/xkcd_does_anyone_else_feel_compelled_to_solve_this/c24pc5 On Mon, 27 Feb 2012, Arnaud Bailly wrote: Hello Cafe, I will be (re)presenting Haskell in a Batlle Language event

Re: [Haskell-cafe] ANNOUNCE: partial-lens 0.0.1

2011-12-21 Thread roconnor
On Wed, 21 Dec 2011, Erik Hesselink wrote: How does this relate to the Maybe lenses in fclabels [1]? Erik [1] http://hackage.haskell.org/packages/archive/fclabels/1.0.4/doc/html/Data-Label-Maybe.html It appears to be somewhere between similar and the same. *** Comparison of API

[Haskell] ANNOUNCE: partial-lens 0.0.1

2011-12-20 Thread roconnor
Do you miss null references from your old imperative programming days? Wish that the worlds best imperative language had null references? Now your wishes have come true with the new partial-lens package! partial-lens augment edwardk's data-lens package with partial lens. Partial lenses are

[Haskell-cafe] ANNOUNCE: partial-lens 0.0.1

2011-12-20 Thread roconnor
Do you miss null references from your old imperative programming days? Wish that the worlds best imperative language had null references? Now your wishes have come true with the new partial-lens package! partial-lens augment edwardk's data-lens package with partial lens. Partial lenses are

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-20 Thread roconnor
On Tue, 20 Sep 2011, Alexander Solla wrote: On Tue, Sep 20, 2011 at 1:22 PM, Jake McArthur jake.mcart...@gmail.com wrote: On Tue, Sep 20, 2011 at 3:48 PM, Chris Smith cdsm...@gmail.com wrote: But it would be the *wrong* thing to use as a desugaring for list range notation.

Re: [Haskell-cafe] Pointed, but not Applicative

2011-08-31 Thread roconnor
On Sat, 27 Aug 2011, Sönke Hahn wrote: Hi! I was reading through the Typeclassopedia ([1]) and I was wondering which type could be an instance of Pointed, but not of Applicative. But I can't think of one. Any ideas? (Identity :+: Store s) is a comonad that is also instance of Pointed, but

Re: [Haskell-cafe] Pointed, but not Applicative

2011-08-31 Thread roconnor
On Wed, 31 Aug 2011, rocon...@theorem.ca wrote: On Sat, 27 Aug 2011, Sönke Hahn wrote: Hi! I was reading through the Typeclassopedia ([1]) and I was wondering which type could be an instance of Pointed, but not of Applicative. But I can't think of one. Any ideas? (Identity :+: Store s)

Re: RFC: migrating to git

2011-01-11 Thread roconnor
On Tue, 11 Jan 2011, Simon Marlow wrote: Thanks for this. I distilled your example into a shell script that uses git, and demonstrates that git gets the merge wrong: http://hpaste.org/42953/git_mismerge I've posted an annotation at

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread roconnor
On Thu, 2 Dec 2010, Petr Pudlak wrote: Hi, recently, I was studying how cartesian closed categories can be used to describe typed functional languages. Types are objects and morphisms are functions from one type to another. Since I'm also interested in systems with dependent types, I

[Haskell-cafe] ANNOUNCE: Multiplate 0.0.1

2010-11-19 Thread roconnor
Multiplate is a lightweight generic library for mutually recursive data types that won't make Conor lose his lunch. Multiplate is an alternative extension of the Uniplate/Compos core design to support mutually recursive datatypes in a way that is as powerful as Compos, almost as easy to use

Re: [Haskell-cafe] Serialization of (a - b) and IO a

2010-11-12 Thread roconnor
On Thu, 11 Nov 2010, Dan Doel wrote: intensional equality: two values are provably equal if they evaluate to the same normal form extensional equality: this incorporates non-computational rules, like the point-wise equality of functions. Now, in a type theory where equality is

Re: [Haskell-cafe] an evil type hangs GHC

2010-11-12 Thread roconnor
See http://www.haskell.org/pipermail/haskell/2006-September/018497.html On Fri, 12 Nov 2010, Petr Pudlak wrote: On Fri, Nov 12, 2010 at 07:52:53PM +0100, Petr Pudlak wrote: Hi, I was playing with the following example I found in D.A.Turner's paper Total Functional Programming: data Bad a =

Re: [Haskell-cafe] What do you call Applicative Functor Morphism?

2010-11-06 Thread roconnor
On Sat, 6 Nov 2010, Sebastian Fischer wrote: Hello, I'm curious and go a bit off topic triggered by your statement: On Nov 6, 2010, at 12:49 PM, rocon...@theorem.ca wrote: An applicative functor morphism is a polymorphic function, eta : forall a. A1 a - A2 a between two applicative functors

[Haskell-cafe] What do you call Applicative Functor Morphism?

2010-11-05 Thread roconnor
An applicative functor morphism is a polymorphic function, eta : forall a. A1 a - A2 a between two applicative functors A1 and A2 that preserve pure and *: eta (pure c) = pure c eta (f * x) = eta f * eta x What do you guys call such a thing? My leading candidate is idomatic transformation.

Re: [Haskell-cafe] Problem with haskell types

2010-07-30 Thread roconnor
I was one of the people on #haskell discussing this with Anupam. Note that that when you remove the signature of d, the result complies and ghci will state the inferred type of d is exactly the signature that you are not allowed to write. In my opinion, this is a bug in the Haskell 98 report

Re: [Haskell-cafe] Speed of Error handling with Continuations vs. Eithers

2010-05-16 Thread roconnor
On Fri, 14 May 2010, Derek Elkins wrote: You did it wrong. All you did was Church encode the Either type. Your bind is still doing a case-analysis. All you have to do is use ContT r (Either e). The bind implementation for ContT is completely independent of the underlying monad. It doesn't

Re: [Haskell-cafe] Re: US Patent for the idea ...

2010-04-17 Thread roconnor
On Fri, 16 Apr 2010, jerzy.karczmarc...@info.unicaen.fr wrote: Somebody finally decided to ridiculise the system. If you want a good laugh, see the patent 6,368,227. The search site is here: As I recall some (patent?) laywer was simply teaching his kid how the patent process worked, so the

Re: [Haskell-cafe] Re: instance Eq (a - b)

2010-04-15 Thread roconnor
On Thu, 15 Apr 2010, Maciej Piechotka wrote: Are f 0 = 1 f n = f (n - 1) + f (n - 2) and g 0 = 1 g n | n 0 = g (n - 1) + g (n - 2) | n 0 = g (n + 2) - g (n + 1) The same (morally) function? Are: f x = 2*x and f x = undefined The same function Try using the (x == y) == (f x = g

[Haskell-cafe] Re: instance Eq (a - b)

2010-04-15 Thread roconnor
On Wed, 14 Apr 2010, Ashley Yakeley wrote: On 2010-04-14 14:58, Ashley Yakeley wrote: On 2010-04-14 13:59, rocon...@theorem.ca wrote: There is some notion of value, let's call it proper value, such that bottom is not one. In other words bottom is not a proper value. Define a proper value

Re: [Haskell-cafe] Re: instance Eq (a - b)

2010-04-14 Thread roconnor
On Wed, 14 Apr 2010, Ashley Yakeley wrote: Joe Fredette wrote: this is bounded, enumerable, but infinite. The question is whether there are types like this. If so, we would need a new class: class Finite a where allValues :: [a] instance (Finite a,Eq b) = Eq (a - b) where p == q

[Haskell-cafe] Re: instance Eq (a - b)

2010-04-14 Thread roconnor
On Wed, 14 Apr 2010, Ashley Yakeley wrote: On 2010-04-14 03:41, rocon...@theorem.ca wrote: For example (Int - Bool) is a perfectly fine Compact set that isn't finite Did you mean Integer - Bool? Int - Bool is finite, but large. Yes, I meant Integer - Bool. -- Russell O'Connor

Re: [Haskell-cafe] Re: instance Eq (a - b)

2010-04-14 Thread roconnor
On Wed, 14 Apr 2010, Ashley Yakeley wrote: On 2010-04-14 13:03, Alexander Solla wrote: If you're willing to accept that distinct functions can represent the same moral function, you should be willing to accept that different bottoms represent the same moral value. Bottoms should not be

Re: [Haskell-cafe] Re: DDC compiler and effects; better than Haskell?

2009-08-13 Thread roconnor
On Thu, 13 Aug 2009, rocon...@theorem.ca wrote: Actually you need five versions: The pure version, the pre-order traversal, the post-order traversal, the in-order traversal, and the reverse in-order traversal. And that is just looking at syntax. If you care about your semantics you could

[Haskell-cafe] Re: DDC compiler and effects; better than Haskell?

2009-08-12 Thread roconnor
On Wed, 12 Aug 2009, Peter Verswyvelen wrote: I kind of agree with the DDC authors here; in Haskell as soon as a function has a side effect, and you want to pass that function to a pure higher order function, you're stuck, you need to pick the monadic version of the higher order function, if it

Re: [Haskell-cafe] Looking to check on some capabilities of Data.Colour

2009-08-06 Thread roconnor
On Thu, 6 Aug 2009, Jeff Heard wrote: I was wondering if Data.Colour supported Double-valued colour components 1.0 or less than 0. I'm looking to create an HDR image processing library, and Haskell has one of the most extensive and correct colour models around, thanks to Russell. With 16bpcc

Re: [Haskell-cafe] Looking to check on some capabilities of Data.Colour

2009-08-06 Thread roconnor
On Thu, 6 Aug 2009, rocon...@theorem.ca wrote: On Thu, 6 Aug 2009, Jeff Heard wrote: I was wondering if Data.Colour supported Double-valued colour components 1.0 or less than 0. I'm looking to create an HDR image processing library, and Haskell has one of the most extensive and correct

[Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-09 Thread roconnor
Max Rabkin wrote: On Sat, Jul 4, 2009 at 8:38 PM, Andrew Coppinandrewcoppin at btinternet.com wrote: A few reasons: 1. I never knew it existed. ;-) A good reason. However, it's good to do a quick search over Hackage before uploading (or before writing) so you know what's out there. Also,

[Haskell-cafe] Colour tutorial (Was: AC-Vector, AC-Colour and AC-EasyRaster-GTK)

2009-07-09 Thread roconnor
On Thu, 9 Jul 2009, rocon...@theorem.ca wrote: You can use by lib without worrying about the CIE. You can use my library without ever importing or using the word CIE. However, the CIE stuff is there for those who need it. Perhaps I (maybe with some help) need to make a tutorial on the

[Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-12 Thread roconnor
I wanted to pass this idea around the cafe to get some thoughts before submitting a trac on this topic. I'd like to see the mtl removed from the Haskell Platform. The mtl was a tremendous step forward when it was developed. However, we have learned a few things about monad transformers since

mapM as a Space Leak (Was: [Haskell-cafe] about Haskell code written to be too smart)

2009-03-26 Thread roconnor
On Wed, 25 Mar 2009, Thomas Hartman wrote: With the state version, there's a lot of behind-the-scenes magic, and as we've seen, things can go wrong. Also, the issue isn't infinite lists, but lists that are longer than the sum of the partitions provided. The state monad partition version goes

Re: [Haskell-cafe] IO semantics and evaluation - summary

2009-02-13 Thread roconnor
I also recommend reading http://www.haskell.org/haskellwiki/IO_Semantics (mostly because I wrote it). Feel free to improve upon it. -- Russell O'Connor http://r6.ca/ ``All talk about `theft,''' the general counsel of the American Graphophone Company wrote,

Re: Laws and partial values (was: [Haskell-cafe] mapM_ - Monoid.Monad.map)

2009-01-24 Thread roconnor
On Fri, 23 Jan 2009, Luke Palmer wrote: For example, it is possible to prove that foldr mappend mempty (x:xs) = foldr1 mappend (x:xs).  Which means that anywhere in the source where we see the former, we can clean it up to the latter.  However, if monad laws don't apply to partial values, then

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-24 Thread roconnor
On Sat, 24 Jan 2009, Lennart Augustsson wrote: You can dream up any semantics you like about bottom, like it has to be () for the unit type. But it's simply not true. I suggest you do some cursory study of denotational semantics and domain theory. Ordinary programming languages include

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-24 Thread roconnor
On Sat, 24 Jan 2009, Jake McArthur wrote: What you said makes little sense to me either. ;) But I will try to fit the pieces together as best I can. It appears to me that you may be talking about isomorphisms between the concepts we try to map to data types and the data representations

Re: Laws and partial values (was: [Haskell-cafe] mapM_ - Monoid.Monad.map)

2009-01-24 Thread roconnor
On Sun, 25 Jan 2009, Lauri Alanko wrote: On Fri, Jan 23, 2009 at 08:10:38PM -0500, rocon...@theorem.ca wrote: I'd like to argue that laws, such as monoid laws, do not apply to partial values. But I haven't thought my position through yet. Before you do, you may want to read Fast and Loose

Laws and partial values (was: [Haskell-cafe] mapM_ - Monoid.Monad.map)

2009-01-23 Thread roconnor
On Fri, 23 Jan 2009, Derek Elkins wrote: mempty `mappend` undefined = undefined (left identity monoid law) The above definition doesn't meet this, similarly for the right identity monoid law. That only leaves one definition, () `mappend` () = () which does indeed satisfy the monoid laws. So

Re: Laws and partial values (was: [Haskell-cafe] mapM_ - Monoid.Monad.map)

2009-01-23 Thread roconnor
Thanks for letting me reflect on this. I assume that my final program (my final value) is always a total value. Anything else is an error. Therefore, if we required relaxed monoid laws of the form x `mappend` mzero = x then we could safely substitute (x `mappend` mzero) by x without

Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread roconnor
On Sun, 18 Jan 2009, Ross Paterson wrote: Anyone can check out the darcs repos for the libraries, and post suggested improvements to the documentation to librar...@haskell.org (though you have to subscribe). It doesn't even have to be a patch. Sure, it could be smoother, but there's hardly a

Re: [Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread roconnor
On Sat, 17 Jan 2009, David Menendez wrote: instance Applicative f = Applicative (Backwards f) where pure = B . pure f * x = B (unB f ** unB x) probably should be f * x = B (unB x ** unB f) anyhow, this should be part of Control.Applicative. This may be terminological confusion. I

Names in Haskell (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-15 Thread roconnor
What I don't understand is why Monoid and Monad are objectionable, while Hash, Vector, Boolean, and Integer are (presumably) not objectionable. They all appear equally technical to me. -- Russell O'Connor http://r6.ca/ ``All talk about `theft,''' the

Re: [Haskell-cafe] Re: unsafeInterleaveIO respecting order of actions

2009-01-01 Thread roconnor
On Fri, 2 Jan 2009, Achim Schneider wrote: There are no lazy monads. Monads imply explicit sequencing... writing I think this is an extremely bad thing to say and is a source of misunderstanding about monads and evaluation. Most monads _are_ lazy, and it is important to understand that

Re: [Haskell] ANNOUNCE: colour 0.0.0

2008-10-24 Thread roconnor
On Fri, 24 Oct 2008, Sebastian Sylvan wrote: It would be nice if we could customize the gamma curve. Different devices have different gamma. Some hardware even approximates the gamma curve with piecewise linear functions. This can make a massive difference if you, e.g. degamma the image

[Haskell-cafe] Re: [Haskell] ANNOUNCE: colour 0.0.0

2008-10-24 Thread roconnor
On Fri, 24 Oct 2008, Sebastian Sylvan wrote: Another useful predefined space which I didn't see is the YCoCg space, which is used in lots of compression schemes (like H.264 IIRC). YCoCg, like HLS and HSV, seems to not really be a colour space because it isn't well specified. A

[Haskell] ANNOUNCE: colour 0.0.0

2008-10-21 Thread roconnor
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/colour-0.0.0 I hope for this library to become the standard colour library for Haskell. Most software does not properly blend colours because they fail to gamma-correct the colours before blending. Hopefully by using this library,

Re: [Haskell] Expecting more inlining for bit shifting

2006-10-18 Thread roconnor
On Tue, 17 Oct 2006, John Meacham wrote: On Mon, Oct 09, 2006 at 03:54:41PM +0100, Ian Lynagh wrote: It might be possible, but it sounds tricky. I guess it would have to go something like try inlining this, run the simplifier, see if it got small enough, if not back out, which could waste a

Re: foldl laziness support. Reply

2006-10-17 Thread roconnor
Although this doesn't answer your question, I think it is releated. When implementing SHA, I need to create a recursive function to append the length of a string to the string. This function needed to be strict, because it needed to accumulted the length of the string, and it needed to be

Re: Compiling GHC disabling the type checker

2006-10-16 Thread roconnor
On Mon, 16 Oct 2006, Simon Marlow wrote: There's one restriction that I know of: you should be careful not to cast a function value to a non-function type (except a polymorphic type), because the two have incompatible representations when it comes to seq and case. And of course, you should

RE: [Haskell] Expecting more inlining for bit shifting

2006-10-11 Thread roconnor
On Wed, 11 Oct 2006, Simon Peyton-Jones wrote: Correct. GHC generates case (x# =# 0#) of { True - ...; False - ... } But the argument discount only applies when we have case y of { ... } So you really want a discount for the args of a primop. Do you think it should be that

RE: [Haskell] Expecting more inlining for bit shifting

2006-10-11 Thread roconnor
On Wed, 11 Oct 2006, Simon Peyton-Jones wrote: The constant-folding rules for the primops are all in prelude/PrelRules.lhs in function primOpRules. Please add more rules. For example, I see that x +# 0 = x is not in there! It is in libraries/base/GHC/Base.lhs x# +# 0#

Re: [Haskell] Expecting more inlining for bit shifting

2006-10-11 Thread roconnor
On Wed, 11 Oct 2006, Samuel Bronson wrote: branch. I've got a patch that seems like it ought to do a bettter job, but it doesn't seem to give the $wrotate functions any discount (the $wshift functions having been tagged by the {-# INLINE shift #-} pragmas I added all over). Unfortunately I

RE: [Haskell] Expecting more inlining for bit shifting

2006-10-10 Thread roconnor
On Tue, 10 Oct 2006, Simon Peyton-Jones wrote: That's precisely what GHC does. My explanation before was too brief, sorry. The algorithm is described in Secrets of the GHC inliner http://research.microsoft.com/%7Esimonpj/Papers/inlining/index.htm But it still only makes a specialised copy if

RE: [Haskell] Expecting more inlining for bit shifting

2006-10-09 Thread roconnor
On Mon, 9 Oct 2006, Simon Peyton-Jones wrote: Turns out that 'shift' is just too big to be inlined. (It's only called once, but you have exported it too.) You can see GHC's inlining decisions by saying -ddump-inlinings. To make GHC keener to inline, use an INLINE pragma, or increase the

Re: [Haskell] Expecting more inlining for bit shifting

2006-10-09 Thread roconnor
Okay, when I force inlining for shift, (and I even need to do it for shiftR!) then the code is inlined in C. However this isn't the behaviour I want. Ideally the inlining should only happen when/because the second argument of shift is constant and the system knows that it can evaluate the case

[Haskell] Expecting more inlining for bit shifting

2006-10-08 Thread roconnor
Consider the following GHC code: module Main where import GHC.Word import GHC.Base import GHC.Prim import Random a `shiftRLT` b | b =# 32# = int2Word# 0# | otherwise = a `uncheckedShiftRL#` b (W32# x#) `shift` (I# i#) | i# =# 0#= W32# (narrow32Word# (x#

Re: [Haskell] Performance, Optimization and Code Generation

2006-09-23 Thread roconnor
according to http://darcs.haskell.org/packages/base/GHC/Word.hs, GHC's rotate is implemented as (W32# x#) `rotate` (I# i#) | i'# ==# 0# = W32# x# | otherwise = W32# ((x# `shiftL32#` i'#) `or32#` (x# `shiftRL32#` (32# -# i'#))) where

Re: [Haskell] semantice of seq

2006-07-20 Thread roconnor
On Tue, 18 Jul 2006, Duncan Coutts wrote: On Tue, 2006-07-18 at 09:44 -0400, [EMAIL PROTECTED] wrote: Would the problematic semantics of seq be resolved if seq did nothing on function types? That is to say seq (\x - undefined `asTypeOf` x) y reduced to y and seq (undefined `asTypeOf` id) y

Re: [Haskell] semantice of seq

2006-07-20 Thread roconnor
On Wed, 19 Jul 2006, Duncan Coutts wrote: Ah ok, I misunderstood. Well that'd be a bit odd too. No other function behaves differently on different types except by use of type classes. I agree it is quite odd, but the seq we have is already quite odd. Furthermore, the fact is that seq on

[Haskell] semantice of seq

2006-07-18 Thread roconnor
Would the problematic semantics of seq be resolved if seq did nothing on function types? That is to say seq (\x - undefined `asTypeOf` x) y reduced to y and seq (undefined `asTypeOf` id) y also reduced to y -- Russell O'Connor http://r6.ca/ ``All talk

RE: Haskell 98 - Standard Prelude - Floating Class

2001-10-23 Thread roconnor
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 How about making default method for asin asin x = atan(x/sqrt(1-x^2)) Can't be worse than the default for (**) ;-) - -- Russell O'Connor[EMAIL PROTECTED] http://www.math.berkeley.edu/~roconnor

RE: Haskell 98 - Standard Prelude - Floating Class

2001-10-15 Thread roconnor
)) That's a good idea too. Is there a reason for defining acosh as above instead of acosh x = log(x + sqrt(x*x-1)) - -- Russell O'Connor[EMAIL PROTECTED] http://www.math.berkeley.edu/~roconnor/ ``This is not a time, as it is never a time, to seek vengeance, but a time