Re: [Haskell-cafe] Re: FW: Haskell

2008-04-02 Thread Janis Voigtlaender
apfelmus wrote: Janis Voigtlaender wrote: Loup Vaillant wrote: Thanks to some geniuses (could someone name them?), we have type classes and higher order types in Haskell (and even more). As far as names go: for type classes, of course Wadler, but also Blott and Kaes. for high

Re: [Haskell-cafe] Re: FW: Haskell

2008-04-02 Thread Loup Vaillant
2008/4/2, Janis Voigtlaender <[EMAIL PROTECTED]>: > apfelmus wrote: > > > Janis Voigtlaender wrote: > > > > > Loup Vaillant wrote: > > > > Thanks to some geniuses (could someone name them?), we have type > > > > classes and higher order types in Haskell (and even more). > > > > > > As far as names

Re: [Haskell-cafe] Re: FW: Haskell

2008-04-02 Thread Janis Voigtlaender
Loup Vaillant wrote: By "higher order types", I meant the type of runST (ST monad), or dpSwich (in yampa). I meant things like "(forall a, a-> b) -> a -> b" That's then usually called "higher-rank polymorphic types", just in case you need more keywords for literature search ;-) -- Dr. Janis Vo

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Hans Aberg
On 2 Apr 2008, at 11:22, Henning Thielemann wrote: It seems me it may come from an alteration of math conventions: Normally (x) = x, and function application is written as f(x), except for a few traditional names, like for example sin x. So if one reasons that f(x) can be simplified to f x, then

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Henning Thielemann
On Tue, 1 Apr 2008, Hans Aberg wrote: > On 1 Apr 2008, at 12:40, PR Stanley wrote: > > Why can't we have function application implemented outwardly > > (inside-out). So > > f g x would be applied with > > gx first followed by its return value passed to f instead of > > putting g x in brackets. >

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread jerzy . karczmarczuk
Hans Aberg writes: ... But one should also be able to write (f+g)(x). - This does not work in Haskell, because Num requires an instance of Eq and Show. So, declare them, even if they are vacuous. I did it several times, I am still alive, so no need to say "this does not work". Jerzy Karczm

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Hans Aberg
On 2 Apr 2008, at 13:51, [EMAIL PROTECTED] wrote: But one should also be able to write (f+g)(x). - This does not work in Haskell, because Num requires an instance of Eq and Show. So, declare them, even if they are vacuous. I did it several times, I am still alive, so no need to say "this d

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread jerzy . karczmarczuk
Hans Aberg comments my remark to his observation: But one should also be able to write (f+g)(x). - This does not work in Haskell, because Num requires an instance of Eq and Show. So, declare them, even if they are vacuous. I did it several times, I am still alive, so no need to say "this do

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Hans Aberg
On 2 Apr 2008, at 14:27, [EMAIL PROTECTED] wrote: That is possible, of course - I did that, too. But it means that the syntax and semantics do not work together; an invitation to pitfalls. So this ought to be avoided, except if there are no other workarounds. I am more tolerant. The pr

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Hans Aberg
On 2 Apr 2008, at 14:27, [EMAIL PROTECTED] wrote: It would be better to write a new Prelude. :-) Oh, yes, our common dream... One may not need to write a wholly new Prelude, by something like: module NewPrelude where import Prelude hiding -- Num, (+). class AdditiveSemiMonoid a where (+

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Loup Vaillant
2008/4/2, Hans Aberg <[EMAIL PROTECTED]>: > On 2 Apr 2008, at 14:27, [EMAIL PROTECTED] > wrote: > > > > It would be better to write a new Prelude. :-) > > > > Oh, yes, our common dream... > > One may not need to write a wholly new Prelude, by something like: > > module NewPrelude where > > impor

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Hans Aberg
On 2 Apr 2008, at 16:20, Loup Vaillant wrote: class AdditiveSemiMonoid a where (+) :: a -> a -> a Err, why *semi* monoid? Plain "monoid" would not be accurate? A monoid has a unit: class (AdditiveSemiMonoid a) => AdditiveMonoid a where o :: a The semimonoid is also called semigroup,

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Brandon S. Allbery KF8NH
On Apr 2, 2008, at 10:27 , Hans Aberg wrote: On 2 Apr 2008, at 16:20, Loup Vaillant wrote: While we're at it, what about adding even more classes, like "group" or "ring"? Algebra in a whole class hierachy. :-) Only ambition required :-). http://www.haskell.org/haskellwiki/Mathematical_pre

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Hans Aberg
On 2 Apr 2008, at 16:30, Brandon S. Allbery KF8NH wrote: While we're at it, what about adding even more classes, like "group" or "ring"? Algebra in a whole class hierachy. :-) Only ambition required :-). http://www.haskell.org/haskellwiki/Mathematical_prelude_discussion --- go nuts. There

Re: [Haskell-cafe] FW: Haskell

2008-04-02 Thread Martin DeMello
On Tue, Apr 1, 2008 at 3:41 PM, Dan Weston <[EMAIL PROTECTED]> wrote: > Nor did I use to take > perfectly working code and refactor it until it cried for mercy, and then > stay awake wondering if there was some abstraction out there I was missing > that would really make it sing. I find myself doi

Re: [Haskell-cafe] Re: Function Precedence

2008-04-02 Thread Dan Piponi
On Tue, Apr 1, 2008 at 2:07 PM, PR Stanley <[EMAIL PROTECTED]> wrote: > All you'd have to do is to give the inner most function the highest > precdence What's the innermost function in "f g x" here? test :: (a -> b -> c) -> a -> b -> c test f g x = f g x -- Dan __

Re: [Haskell-cafe] Re: Function Precedence

2008-04-02 Thread Loup Vaillant
2008/4/2, Dan Piponi <[EMAIL PROTECTED]>: > On Tue, Apr 1, 2008 at 2:07 PM, PR Stanley <[EMAIL PROTECTED]> wrote: > > All you'd have to do is to give the inner most function the highest > > precdence > > > What's the innermost function in "f g x" here? > > test :: (a -> b -> c) -> a -> b -> c >

RE: [Haskell-cafe] Template Haskell -- when are things evaluated?

2008-04-02 Thread Simon Peyton-Jones
| > I'm reading the following rule from your answer: | > | > [|exp|] normally returns the unevaluated AST of exp. However, if exp | contains | > local variables, these are lifted using Language.Haskell.TH.lift (i.e. | evaluated | > before lifting). | > | > Is that correct? | > | > | > / Emil |

[Haskell-cafe] Role based access control via monads or arrows or... something

2008-04-02 Thread porrifolius
Hello. I've been playing around trying to write a framework to support/enforce access control to resources. So far my efforts have yielded little but bruised forehead and compressed plaster-board. What I'd like is a solution that: (1) prevents access to resources except via a fine-grained pe

Re: [Haskell-cafe] SYB with class: Bug in Derive.hs module

2008-04-02 Thread Ian Lynagh
On Mon, Mar 31, 2008 at 03:47:04PM +0200, Alexey Rodriguez Yakushev wrote: > > The Data instance that Derive generates is as follows: > > > instance (Data ctx a, > > Data ctx (BinTree a), > > Sat (ctx (BinTree a))) => > > Data ctx (BinTree a)

[Haskell-cafe] installing ghc-6.8.2

2008-04-02 Thread michael
It seems there is no ghc 6.8.2 for my version of debian. So I am compiling from source. I ran config with no problem. make generated some errors. I omit all output except the end. Let me know if Ileft something important out please. make all /usr/bin/ghc -H16m -O -w -I. -Iinclude -Rghc-timing -

Re: [Haskell-cafe] installing ghc-6.8.2

2008-04-02 Thread Ian Lynagh
On Wed, Apr 02, 2008 at 07:12:16PM -0400, [EMAIL PROTECTED] wrote: > > so it's this line that seems of the most interesting > > cc1: error: unrecognized option `-fno-unit-at-a-time' It looks like your version of ghc isn't designed to be used with the version of gcc you have. Putting this in mk/

Re: [Haskell-cafe] Re: FW: Haskell

2008-04-02 Thread Lennart Augustsson
Mark Jones brought higher order polymorphism to Haskell. On Wed, Apr 2, 2008 at 8:08 AM, Janis Voigtlaender < [EMAIL PROTECTED]> wrote: > apfelmus wrote: > > > Janis Voigtlaender wrote: > > > > Loup Vaillant wrote: > > > > > > Thanks to some geniuses (could someone name them?), we have type >

Re: [Haskell-cafe] installing ghc-6.8.2

2008-04-02 Thread michael
Apologies to Ian, I think I sent him direct mail on my first attempt to reply. Adding those lines to mk/build.mk did not work. I hope Idon't have to build a newer gcc. This is what I have right now. [EMAIL PROTECTED]:~/src/gcc$ gcc -v Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs Conf

Re: [Haskell-cafe] Role based access control via monads or arrows or... something

2008-04-02 Thread Luke Palmer
2008/4/2 porrifolius <[EMAIL PROTECTED]>: > (7) ideally required permissions would appear (and accumulate) in type > signatures via inference so application code knows which are required and > type checker can reject static/dynamic role constraint violations If you mean what I think you mean b

[Haskell-cafe] ANN: hdbc-odbc 1.1.4.1

2008-04-02 Thread John Goerzen
Hi folks, HDBC-ODBC 1.1.4.1 has been uploaded to http://software.complete.org/hdbc-odbc and to Hackage. Bryn Keller reported a build problem on Windows with GHC 6.8.x, which has been fixed. -- John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.o

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Henning Thielemann
On Wed, 2 Apr 2008, Hans Aberg wrote: But one should also be able to write (f+g)(x). - This does not work in Haskell, because Num requires an instance of Eq and Show. You could define these instances with undefined function implementations anyway. But also in a more cleaner type hierarchy li

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Henning Thielemann
On Wed, 2 Apr 2008, Hans Aberg wrote: Show could be implemented by writing out the function closures, but I think the reason it is not there is that it would create overhead in compiled code. It would also not give referential transparent answers, because the same function can be implemente