Re: Operational semantics. Was: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-17 Thread Bernie Pope


On 17/03/2009, at 1:13 PM, Jonathan Cast wrote:

[Totally OT tangent: How did operational semantics come to get its  
noun?

The more I think about it, the more it seems like a precís of the
implementation, rather than a truly semantic part of a language
specification.]


I haven't followed the whole thread, so perhaps I'm missing some  
important context to this question.


It is true that operational semantics are often used to summarise or  
explain an _implementation_ of a language feature, but I wouldn't say  
that they are always used in this way. An operational semantics may be  
used to define a behaviour function: (program x input) - outcome.  
The big-step style of operational semantics style tends to be less  
like an implementation, and more like a specification. Perhaps the  
more crucial part of operational semantics is that it just deals with  
syntactic terms as its values.


Apologies if this has nothing to do with your question.

Cheers,
Bernie.___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Has anybody replicated =~ s/../../ or even something more basic for doing replacements with pcre haskell regexen?

2009-03-17 Thread Cristiano Paris
On Fri, Mar 13, 2009 at 1:19 AM, ChrisK hask...@list.mightyreason.com wrote:
 
 At the cost of writing your own routine you get exactly what you want in a
 screen or less of code, see
 http://hackage.haskell.org/packages/archive/regex-compat/0.92/doc/html/src/Text-Regex.html#subRegex
 for subRegex which is 30 lines of code.

WTF!

Cristiano
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell, OpenGL on Windows

2009-03-17 Thread Mark Spezzano
Hi,

Can someone PLEASE help me to understand exactly how to configure
OpenGL on Window using Haskell. I'm using Eclipse IDE.

When I try to run the file Test1.hs in GHCi then I get the following
error:
Loading package syb ... linking ... done.
Loading package base-3.0.3.0 ... linking ... done.
Loading package array-0.2.0.0 ... linking ... done.
Loading package containers-0.2.0.0 ... linking ... done.
Loading package OpenGL-2.2.1.1 ... can't load .so/.DLL for: GL
(addDLL: could not load DLL)
Prelude Main

I've copied the GLUT dll into Windows/System32.

Is there some flag or option that I need to enable to tell Haskell
where to go to link in the library. What do I do with the other .h
and .lib files from GLUT?

Thanks

Mark
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell, OpenGL on Windows

2009-03-17 Thread Artyom Shalkhakov

Hello Mark,

Mark Spezzano valh...@chariot.net.au писал(а) в своём письме Tue, 17 Mar  
2009 13:49:50 +0600:



Can someone PLEASE help me to understand exactly how to configure
OpenGL on Window using Haskell. I'm using Eclipse IDE.

When I try to run the file Test1.hs in GHCi then I get the following
error:
Loading package syb ... linking ... done.
Loading package base-3.0.3.0 ... linking ... done.
Loading package array-0.2.0.0 ... linking ... done.
Loading package containers-0.2.0.0 ... linking ... done.
Loading package OpenGL-2.2.1.1 ... can't load .so/.DLL for: GL
(addDLL: could not load DLL)
Prelude Main


Have you tried running GHCi with the -v flag?


I've copied the GLUT dll into Windows/System32.


I think it's better to leave GLUT dll in your application directory,
next to the executable.

--
Cheers,
Artyom Shalkhakov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Design Patterns by Gamma or equivalent

2009-03-17 Thread Wolfgang Jeltsch
Am Dienstag, 17. März 2009 05:09 schrieb wren ng thornton:
 a...@spamcop.net wrote:
  Or to put it another way, category theory is the pattern language of
  mathematics.

 Indeed. Though, IMO, there's a distinction between fairly banal things
 (e.g. monoids),

Monoids aren’t a concept of category theory. There are a generalization of 
groups. So they more belong to group theory.

By the way, the documentation of Control.Category says that a category is a 
monoid (as far as I remember). This is wrong. Category laws correspond to 
monoid laws but monoid composition is total while category composition has 
the restriction that the domain of the first argument must match the codomain 
of the second.

Best wishes,
Wolfgang
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Design Patterns by Gamma or equivalent

2009-03-17 Thread Colin Paul Adams
 Wolfgang == Wolfgang Jeltsch g9ks1...@acme.softbase.org writes:

Wolfgang By the way, the documentation of Control.Category says
Wolfgang that a category is a monoid (as far as I remember). This
Wolfgang is wrong. Category laws correspond to monoid laws but
Wolfgang monoid composition is total while category composition
Wolfgang has the restriction that the domain of the first
Wolfgang argument must match the codomain of the second.

I'm reading the Barr/Wells slides at the moment, and they say the
following:

Thus a category can be regarded as a generalized monoid, or a
'monoid with many objects'
-- 
Colin Adams
Preston Lancashire
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Type equality proof

2009-03-17 Thread Martijn van Steenbergen

Olá café,

With the recent generic programming work and influences from 
type-dependent languages such as Agda, the following data type seems to 
come up often:



data (a :=: a') where
  Refl :: a :=: a


Everyone who needs it writes their own version; I'd like to compile a 
package with this data type and related utilities, if such a package 
doesn't exist already (I couldn't find one). Below is what I have so 
far; I'd much appreciate it if you added your ideas of what else the 
package should contain.



{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeOperators #-}

module Eq where

data (a :=: a') where
  Refl :: a :=: a

class Eq1 f where
  eq1 :: f a - f a' - Maybe (a :=: a')

class Eq2 f where
  eq2 :: f a b - f a' b' - Maybe (a :=: a', b :=: b')

class Eq3 f where
  eq3 :: f a b c - f a' b' c' - Maybe (a :=: a', b :=: b', c :=: c')


Thank you,

Martijn.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] GHC Core - technical document

2009-03-17 Thread Peter Verswyvelen
Does an up-to-date technical document exist describing GHC Core?
Google found http://www.haskell.org/ghc/docs/papers/core.ps.gz

I'm not sure this document reflects the current state of art.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Yandex

data (a :=: a') where
 Refl :: a :=: a
 Comm :: (a :=: a') - (a' :=: a)
 Trans :: (a :=: a') - (a' :=: a'') - (a :=: a'')


Martijn van Steenbergen wrote:

Olá café,

With the recent generic programming work and influences from 
type-dependent languages such as Agda, the following data type seems 
to come up often:



data (a :=: a') where
  Refl :: a :=: a


Everyone who needs it writes their own version; I'd like to compile a 
package with this data type and related utilities, if such a package 
doesn't exist already (I couldn't find one). Below is what I have so 
far; I'd much appreciate it if you added your ideas of what else the 
package should contain.



{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeOperators #-}

module Eq where

data (a :=: a') where
  Refl :: a :=: a

class Eq1 f where
  eq1 :: f a - f a' - Maybe (a :=: a')

class Eq2 f where
  eq2 :: f a b - f a' b' - Maybe (a :=: a', b :=: b')

class Eq3 f where
  eq3 :: f a b c - f a' b' c' - Maybe (a :=: a', b :=: b', c :=: c')


Thank you,

Martijn.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC Core - technical document

2009-03-17 Thread Bas van Dijk
2009/3/17 Peter Verswyvelen bugf...@gmail.com:
 Does an up-to-date technical document exist describing GHC Core?

It's not really a paper, but the GHC developer wiki contains some
useful info about GHC core:

http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/CoreSynType

regards,

Bas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] random shuffle and random list partition

2009-03-17 Thread Yitzchak Gale
Hi Manlio,

Manlio Perillo wrote:
 For my Netflix Prize project I have implemented two reusable modules.
 The first module implements a random shuffle on immutable lists...
 The second module implements a function used to partition a list into n
 sublists of random length.

Very nice!

 If someone is interested (and if Oleg give me permission), I can release
 them as a package on Hackage.

Please do that.

While I think Oleg's tree method is beautiful, in practice
it may be re-inventing the wheel. I haven't tested it, but
I doubt that this implementation is much better than
using the classical shuffle algorithm on an IntMap.
It's essentially the same tree inside. That's what I
usually use for this, and it works fine.

 In future I can add an implementation of the random
 shuffle algorithm on mutable arrays in the ST monad.

I've tried that in the past. Surprisingly, it wasn't faster
than using trees. Perhaps I did something wrong. Or
perhaps the difference only becomes apparent for
huge lists.

As you point out, your partition algorithm is not fair.
Using your Random.Shuffle and a well-know trick
from combinatorics, you can easily get a fair
partitions function:

http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2485#a2495

Regards,
Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-17 Thread Ketil Malde
Duncan Coutts duncan.cou...@worc.ox.ac.uk writes:

 [..] I have a sneaking suspicion [exceptions] actually *is* `unsafe'.  Or, at
 least, incapable of being given a compositional, continuous semantics.

 Basically if we can only catch exceptions in IO then it doesn't matter,
 it's just a little extra non-determinism and IO has plenty of that
 already.

Couldn't you just substitute catch exceptions with unsafePerformIO
here, and make the same argument?

Similarly, can't you emulate unsafePerformIO with concurrency?

Further, couldn't you, from IO, FFI into a function that examines the
source code of some pure function, thus being able to differentiate
funcitions that are normally indistinguishable?

I've tried to follow this discussion, but I don't quite understand
what's so bad about unsafeInterleaveIO - or rather, what's so uniquely
bad about it.  It seems the same issues can be found in every corner
of IO. 

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


categories and monoids (was: Re: [Haskell-cafe] Design Patterns by Gamma or equivalent)

2009-03-17 Thread Wolfgang Jeltsch
Am Dienstag, 17. März 2009 10:54 schrieben Sie:
 Wolfgang Jeltsch g9ks1...@acme.softbase.org writes:
  By the way, the documentation of Control.Category says that a category is
  a monoid (as far as I remember). This is wrong. Category laws correspond
  to monoid laws but monoid composition is total while category composition
  has the restriction that the domain of the first argument must match the
  codomain of the second. 

 I'm reading the Barr/Wells slides at the moment, and they say the
 following:

 Thus a category can be regarded as a generalized monoid,

What is a “generalized monoid”? According to the grammatical construction 
(adjective plus noun), it should be a special kind of monoid, like a 
commutative monoid is a special kind of monoid. But then, monoids would be 
the more general concept and categories the special case, quite the opposite 
of how it really is.

A category is not a “generalized monoid” but categories (as a concept) are a 
generalization of monoids. Each category is a monoid, but not the other way 
round.

A monoid is clearly defined as a pair of a set M and a (total) binary 
operation over M that is associative and has a neutral element. So, for 
example, the category of sets and functions is not a monoid. First, function 
composition is not total if you allow arbitrary functions as its arguments. 
Second, the collection of all sets is not itself a set (but a true class) 
which conflicts with the above definition which says that M has to be a set.

 or a 'monoid with many objects'

What is a monoid with many objects?

Best wishes,
Wolfgang
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Wolfgang Jeltsch
Am Dienstag, 17. März 2009 11:49 schrieb Yandex:
 data (a :=: a') where
   Refl :: a :=: a
   Comm :: (a :=: a') - (a' :=: a)
   Trans :: (a :=: a') - (a' :=: a'') - (a :=: a'')

I don’t think, Comm and Trans should go into the data type. They are not 
axioms but can be proven. Refl says that each type equals itself. Since GADTs 
are closed, Martijn’s definition also says that two types can *only* be equal 
if they are actually the same.

Here are the original definition and the proofs of comm and trans. Compiles 
fine with GHC 6.10.1.

data (a :=: a') where

Refl :: a :=: a

comm :: (a :=: a') - (a' :=: a)
comm Refl = Refl

trans :: (a :=: a') - (a' :=: a'') - (a :=: a'')
trans Refl Refl = Refl

Best wishes,
Wolfgang
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] DLL Hell: OpenGL

2009-03-17 Thread Mark Spezzano
Hi all,

 

I’m trying to make the Teapot OpenGL example in Haskell on Windows. It keeps
coming up with this:

 

 

C:\Users\Mark\workspace2\OpenGLPractice\srcghc --make Teapot

Linking Teapot.exe ...

C:\ghc\ghc-6.10.1\gcc-lib\ld.exe: cannot find -lSM

collect2: ld returned 1 exit status

 

As far as I know, -lSM is to do with XWindows (not windows Vista).How do I
fix this ? What’s going on? I’ve been on this problem now for hours, and all
I wanted to do was get a window up on the screen. Sigh

 

Mark Spezzano


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.557 / Virus Database: 270.11.15/2004 - Release Date: 16/03/2009
7:04 AM
 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] random shuffle and random list partition

2009-03-17 Thread Manlio Perillo

Yitzchak Gale ha scritto:

[...]
While I think Oleg's tree method is beautiful, in practice
it may be re-inventing the wheel. I haven't tested it, but
I doubt that this implementation is much better than
using the classical shuffle algorithm on an IntMap.


Do you have a working implementation?


It's essentially the same tree inside. That's what I
usually use for this, and it works fine.



Oleg implementation is rather efficient, but it requires a lot of memory 
for huge lists.


Here, as an example, two programs, one in Python and one in Haskell.
The default Python generator in Python use the Mersenne Twister, but 
returning floats number in the range [0, 1].



# Python version
from random import shuffle

n = 1000
m = 10
l = range(1, n + 1)

shuffle(l)
print l[:m]


-- Haskell version
module Main where

import Random.Shuffle
import System.Random.Mersenne.Pure64 (newPureMT)

n = 1000
m = 10
l = [1 .. n]

main = do
  gen - newPureMT
  print $ take m $ shuffle' l n gen



The Python version performances are:

real0m16.812s
user0m16.469s
sys 0m0.280s

150 MB memory usage


The Haskell version performances are:

real0m8.757s
user0m7.920s
sys 0m0.792s

800 MB memory usage



In future I can add an implementation of the random
shuffle algorithm on mutable arrays in the ST monad.


I've tried that in the past. Surprisingly, it wasn't faster
than using trees. Perhaps I did something wrong. Or
perhaps the difference only becomes apparent for
huge lists.



Can you try it on the list I have posted above?



As you point out, your partition algorithm is not fair.
Using your Random.Shuffle and a well-know trick
from combinatorics, you can easily get a fair
partitions function:

http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2485#a2495



Thanks, this is very nice.
I have to run some benchmarks to see if it is efficient.


Regards  Manlio
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] How can I check which thunks are piling up on the stack?

2009-03-17 Thread Gü?nther Schmidt

Hi,

How can I check which thunks are piling up on the stack?

Günther

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-17 Thread Claus Reinke

So that first step already relies on IO (where the two are equivalent).

Come again?


The first step in your implication chain was (without the return)

 throw (ErrorCall urk!) = 1
 == evaluate (throw (ErrorCall urk!)) = evaluate 1

but, using evaluation only (no context-sensitive IO), we have


throw (ErrorCall urk) = evaluate (throw (ErrorCall urk))

Sure enough.


meaning that first step replaced a smaller with a bigger item on the
smaller side of the inequation. Unless the reasoning includes context-
sensitive IO rules, in which case the IO rule for evaluate brings the
throw to the top (evaluate (throw ..) - (throw ..)), making the two
terms equivalent (modulo IO), and hence the step valid (modulo IO).

Unless you just rely on


But throwIO (ErrorCall urk) /= _|_:
   Control.Exception throwIO (ErrorCall urk!) `seq` ()
   ()


in which case that step relies on not invoking IO, so it can't be
mixed with the later step involving IO for catch (I think).


This is very delicate territory. For instance, one might think that
this 'f' seems to define a negation function of information content



f x = Control.Exception.catch (evaluate x  let x = x in x) (\(ErrorCall 
_)-return 0) =
print

and hence violates monotonicity

(_|_ = ()) = (f _|_ = f ())

since

*Main f undefined
0
*Main f ()
Interrupted.

But that is really mixing context-free expression evaluation and
context-sensitive execution of io operations. Most of our favourite
context-free equivalences only hold within the expression evaluation
part, while IO operations are subject to additional, context-sensitive
rules.


Could you elaborate on this?  It sounds suspiciously like you're saying
Haskell's axiomatic semantics is unsound :: IO.


Not really unsound, if the separation is observed. One could probably
construct a non-separated semantics (everything denotational), but at
the cost of mapping everything to computations rather than values.

Then computations like that 'f' above would, eg, take an extra context
argument (representing the world, or at least aspects of the machine
running the computation), and the missing information needed to take
'f _|_'[world] to '()'[world'] would come from that context parameter
(somewhere in the computational context, there is a representation of
the computation, which allows the context to read certain kinds of '_|_'
as exceptions; the IO rule for 'catch' takes that external information and
injects it back from the computational context into the functional program,
as data structure representations of exceptions).

That price is too high, though, as we'd now have to do all reasoning
in context-sensitive terms which, while more accurate, would bury
us in irrelevant details. Hence we usually try to use context-free
reasoning whenever we can get away with it (the non-IO portions
of Haskell program runs), resorting to context-sensitive reasoning
only when necessary (the IO steps of Haskell program runs).

This gives us convenience when the context is irrelevant as well
as accuracy when the context does matter - we just have to be
careful when combining the two kinds of reasoning.


For instance, without execution

*Main f () `seq` ()
()
*Main f undefined `seq` ()
()

but if we include execution (and the context-sensitive equivalence
that implies, lets call it ~),


So

  a ~ b = `The observable effects of $(x) and $(y) are equal'

?


Observational equivalence is one possibility, there are various forms
of equivalences/bi-similarities, with different ratios of convenience and
discriminatory powers (the folks studying concurrent languages and
process calculi have been fighting with this kind of situation for a long
time, and have built up a wealth of experience in terms of reasoning).

The main distinction I wanted to make here was that '=' was
a context-free equivalence (valid in all contexts, involving only
context-free evaluation rules) while '~' was a context-sensitive
equivalence (valid only in IO contexts, involving both context-free
and context-sensitive rules).


we have

f () ~ _|_ = return 0 ~ f _|_

so 'f' shows that wrapping both sides of an inequality in 'catch' need
not preserve the ordering (modulo ~)


If f _|_ = f (), then it seems that (=) is not a (pre-) order w.r.t.
(~).  So taking the quotient of IO Int over (~) gives you a set on which
(=) is not an ordering (and may not be a relation).


As I said, mixing '=' and '~', without accounting for the special nature of
the latter, is dangerous. If we want to mix the two, we have to shift all
reasoning into the context-sensitive domain, so we'd have something like

   f () [world] ~ _|_ [world''] = return 0 [world'] ~ f _|_ [world]

(assuming that '=' is lifted to compare values in contexts). And now the
issue goes away, because 'f' doesn't look at the '_|_', but at the 
representation
of '_|_' in the 'world' (the representation of '_|_' in GHC's runtime system, 
say).


 - its whole purpose is to 

[Haskell-cafe] Need an overview of FP-related research topics

2009-03-17 Thread Yitzchak Gale
I spoke to a faculty member in a decent Computer Science
department in which no one has ever done anything
related to FP. (You may say that is an inherent contradiction,
but what can I do, the department does have a good
reputation. I am withholding names to protect the
innocent.)

This faculty member happens to be the one who was
forced to teach the single programming languages
course offered by the department, due to his having
the least seniority in the department. As such, he is
now actually starting to become a bit interested in
FP and Haskell.

I gave him a few links to Haskell resources, which
he appreciated. But coming from more of a pragmatic
non-research point of view, I didn't really know what
to say. The best I could do was to point him to the
Haskell Wikibook, and to the Why FP Matters paper.

I would like some links that would give such a person
a nice overview of the various active areas of
FP-related research these days, leaning towards
Haskell. I want to give him a fairly broad view of what
is interesting and exciting, why various topics are
important, where to find ideas for collaboration and
applications to other areas, etc.

I actually know about a few departments like that.
This could be a good strategy for drumming up
more research interest in Haskell. In some cases,
the person in question has already been influenced
somewhat by the lisp fanatics, so I would like some
help in how to deal with that also.

Thanks,
Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Eelco Lempsink

Hi there!

I updated a couple of logo versions and ungrouped and regrouped the  
(former) number 31.  Other than that, there was nothing standing in  
the way of the voting to begin imho, so I started up the competition.


By now, I suppose everybody should have received their ballot.  If you  
think you should have received it but didn't, please report it, I can  
resend the invitation.  Also, for people not directly subscribed to  
the haskell-cafe mailing list, you can still send ballot requests  
until the end of the competition (March 24, 12:00 UTC).  Make sure the  
message contains 'haskell logo voting ballot request' (e.g. in the  
subject).


Depending on the winner of this voting round we can decide whether we  
need to continue with variations.  Jared Updike already offered to  
donate a bit of time to help create several variations.  But for now,  
good luck with sorting those options! :)


--
Regards,

Eelco Lempsink



PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANNOUNCE: libffi 0.1 released

2009-03-17 Thread Remi Turk
I am happy to announce libffi 0.1, binding to the C library
libffi, allowing C functions to be called whose types are not
known before run-time.

Why?

Sometimes you can't use the haskell foreign function interface
because you parse the type of the function from somewhere else,
i.e. you're writing an interpreter for a language that has an FFI
itself.

What?

The main function it exports is:

  callFFI :: FunPtr a - RetType b - [Arg] - IO b

And because code is worth a thousand words, here a small program
that uses C to write a 1Gb buffer of random garbage to a file:

 import System.Posix.DynamicLinker
 import Foreign.LibFFI
 
 main = do
 malloc - dlsym Default malloc
 creat  - dlsym Default creat
 write  - dlsym Default write
 let sz = 2 ^ 30
 buf - callFFI malloc (retPtr retVoid) [argCSize sz]
 fd  - callFFI creat  retCInt  [argString /tmp/test, argCUInt 
 0o644]
 n   - callFFI write  retCSize [argCInt fd, argPtr buf, argCSize 
 sz]
 putStrLn $ show n ++  bytes written

It should work on any 32/64bits machine on which libffi works,
but has been primarily tested on linux x86_64.
The current libffi is not exception-safe (exception = memory leak)
and callFFI has quite some overhead that would be unnecessary
with another api. 
It is, however, very easy to use :)

More interesting examples are included in examples/ in the
package.

Where?
Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/libffi
Module docs: http://www.science.uva.nl/~rturk/doc/libffi-0.1

Cheers, Remi
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Heinrich Apfelmus
Eelco Lempsink wrote:
 Hi there!
 
 I updated a couple of logo versions and ungrouped and regrouped the
 (former) number 31.  Other than that, there was nothing standing in the
 way of the voting to begin imho, so I started up the competition.
 
 By now, I suppose everybody should have received their ballot.  If you
 think you should have received it but didn't, please report it, I can
 resend the invitation.  Also, for people not directly subscribed to the
 haskell-cafe mailing list, you can still send ballot requests until the
 end of the competition (March 24, 12:00 UTC).  Make sure the message
 contains 'haskell logo voting ballot request' (e.g. in the subject).
 
 Depending on the winner of this voting round we can decide whether we
 need to continue with variations.  Jared Updike already offered to
 donate a bit of time to help create several variations.  But for now,
 good luck with sorting those options! :)

Thanks for organizing this, finally I can choose ... Oh my god! How am I
supposed to make a vote?


I can barely remember 3 of the 113 logos, let alone memorize that #106
is the narwhal. There are lots of very good or just good candidates and
I would like to order them all to my liking, but without instant visual
feedback on the voting ballot, this is a hopeless task.

Since I have about 10 minutes to spare for voting, I'm just going to
pick 5 candidates at random and order these? Actually, I think I prefer
to be completely paralyzed by the overwhelming choice instead and not
vote at all.

Alternatively, it seems that it's possible to upload rankings from a
file. But which format? And is there a zip file with the logo proposals
so I can try to arrange them via dragdrop in some picture gallery
application?


A simple majority vote is clearly inadequate for this vote, but I'm
afraid that without assisting technology (instant and visual feedback),
the voting process will more or less deteriorate to that due to the
difficulty of creating quality input votes.


Regards,
apfelmus

--
http://apfelmus.nfshost.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] SQL Parsers in Haskell

2009-03-17 Thread Mads Lindstrøm
Hi Haskelleers

Has anybody written a SQL parser in Haskell (and is willing to share the
code) ?


Greetings,

Mads Lindstrøm



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Apologies for spamming Planet Haskell

2009-03-17 Thread Bjorn Buckwalter
Dear Planet Haskell readers,

Just want to apologize for spamming Planet Haskell. I did some minor
formatting edits of old posts and it seems Planet Haskell picked them
up and republished them. I didn't expect this to happen (Google Reader
doesn't do that) and will be more careful about gratuitously editing
old posts in the future.

Thanks,
Bjorn Buckwalter
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Need an overview of FP-related research topics

2009-03-17 Thread Bernie Pope


On 17/03/2009, at 10:59 PM, Yitzchak Gale wrote:


I would like some links that would give such a person
a nice overview of the various active areas of
FP-related research these days, leaning towards
Haskell. I want to give him a fairly broad view of what
is interesting and exciting, why various topics are
important, where to find ideas for collaboration and
applications to other areas, etc.


Some ideas off the top of my head:

- Lambda the Ultimate (not Haskell or fp specific) 
http://lambda-the-ultimate.org/
- Browse recent editions of the Journal of Functional Programming  
(perhaps they even subscribe to it at the Uni in question) and perhaps  
TOPLAS.
- Browse the recent proceedings of various conferences and workshops  
such as International Conference on Functional Programming, Trends in  
Functional Programming, the Haskell Symposium, Practical Aspects of  
Declarative Languages, Principles and Practice of Declarative  
Programming, International Summer School on Advanced Functional  
Programming (and many others).
- Check the home pages and blogs of well-known and active researchers  
(I won't list them).
- Maybe http://www.readscheme.org/, though not Haskell specific. (not  
sure if http://haskell.readscheme.org/ is working anymore).
- There's quite a list of papers on haskell.org, under http://www.haskell.org/haskellwiki/Research_papers 
.


Cheers,
Bernie.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Need an overview of FP-related research topics

2009-03-17 Thread Sean Leather
 I would like some links that would give such a person
 a nice overview of the various active areas of
 FP-related research these days, leaning towards
 Haskell.


It seems the History of Haskell paper would be useful for background and
pointers to further reading on the research that has led Haskell to its
current status. Of course, it is long (55 pages, two columns), but perhaps
it's a nice read, nonetheless.

http://research.microsoft.com/en-us/um/people/simonpj/papers/history-of-haskell/index.htm

Regards,
Sean
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] RE: SQL Parsers in Haskell

2009-03-17 Thread Larry Coleman
 Hi Haskelleers

 Has anybody written a SQL parser in Haskell (and is willing to share the
 code) ?

 Greetings,

 Mads Lindstrøm

I have a mostly-working SQL parser that I wrote to help with DBA tasks
at work. I'm under one of the standard employment IP agreements,
however, so my employer owns the code. I have asked about having it
released, but that process will take some time. I'll post to the group
if/when it ever happens.

Larry Coleman
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Robin Green
On Tue, 17 Mar 2009 15:24:28 +0100
Heinrich Apfelmus apfel...@quantentunnel.de wrote:

 A simple majority vote is clearly inadequate for this vote, but I'm
 afraid that without assisting technology (instant and visual
 feedback), the voting process will more or less deteriorate to that
 due to the difficulty of creating quality input votes.

Even worse, the buttons for moving items up and down are buggy - at
least on my browser (Firefox 3.1 beta 2 on Linux). They sometimes
reorder my other votes! Even assuming that the list box code is not
buggy (which I now doubt), not being able to use the buttons makes this
form almost unusable!

-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Thomas Davie


On 17 Mar 2009, at 15:24, Heinrich Apfelmus wrote:


Eelco Lempsink wrote:

Hi there!

I updated a couple of logo versions and ungrouped and regrouped the
(former) number 31.  Other than that, there was nothing standing in  
the

way of the voting to begin imho, so I started up the competition.

By now, I suppose everybody should have received their ballot.  If  
you

think you should have received it but didn't, please report it, I can
resend the invitation.  Also, for people not directly subscribed to  
the
haskell-cafe mailing list, you can still send ballot requests until  
the

end of the competition (March 24, 12:00 UTC).  Make sure the message
contains 'haskell logo voting ballot request' (e.g. in the subject).

Depending on the winner of this voting round we can decide whether we
need to continue with variations.  Jared Updike already offered to
donate a bit of time to help create several variations.  But for now,
good luck with sorting those options! :)


Thanks for organizing this, finally I can choose ... Oh my god! How  
am I

supposed to make a vote?


I can barely remember 3 of the 113 logos, let alone memorize that #106
is the narwhal. There are lots of very good or just good candidates  
and
I would like to order them all to my liking, but without instant  
visual

feedback on the voting ballot, this is a hopeless task.

Since I have about 10 minutes to spare for voting, I'm just going to
pick 5 candidates at random and order these? Actually, I think I  
prefer

to be completely paralyzed by the overwhelming choice instead and not
vote at all.

Alternatively, it seems that it's possible to upload rankings from a
file. But which format? And is there a zip file with the logo  
proposals

so I can try to arrange them via dragdrop in some picture gallery
application?


A simple majority vote is clearly inadequate for this vote, but I'm
afraid that without assisting technology (instant and visual  
feedback),

the voting process will more or less deteriorate to that due to the
difficulty of creating quality input votes.


I have to agree that the UI for voting is not the best I've ever  
seen.  On the other hand, it's pretty easy to select the few logos  
that you like, and push them all to the top, select the ones you'd  
accept, and push them up just below, and finally select the ones you  
absolutely don't like and push them all the way down.


That at least is what I did.

Bob
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Robin Green
On Tue, 17 Mar 2009 16:11:54 +0100
Thomas Davie tom.da...@gmail.com wrote:

 I have to agree that the UI for voting is not the best I've ever  
 seen.  On the other hand, it's pretty easy to select the few logos  
 that you like, and push them all to the top, select the ones you'd  
 accept, and push them up just below, and finally select the ones you  
 absolutely don't like and push them all the way down.
 
 That at least is what I did.

Did you check that code bugs hadn't reordered your votes? I am worried
about this destroying the validity of the election.
-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Robin Green
I am also concerned that the default behaviour of the buttons will
lead to arbitrary preference rankings favouring those with entries
that start more towards the top or bottom of the list. You shouldn't
have to go to a lot of extra effort to create a tie between several
entries, if you can't decide (or don't want to decide) between them.

However, this isn't as significant as the buggy reordering behaviour
I'm seeing.
-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: categories and monoids (was: Re: [Haskell-cafe] Design Patterns by Gamma or equivalent)

2009-03-17 Thread Jonathan Cast
On Tue, 2009-03-17 at 13:06 +0100, Wolfgang Jeltsch wrote:
 Am Dienstag, 17. März 2009 10:54 schrieben Sie:
  Wolfgang Jeltsch g9ks1...@acme.softbase.org writes:
   By the way, the documentation of Control.Category says that a category is
   a monoid (as far as I remember). This is wrong. Category laws correspond
   to monoid laws but monoid composition is total while category composition
   has the restriction that the domain of the first argument must match the
   codomain of the second. 
 
  I'm reading the Barr/Wells slides at the moment, and they say the
  following:
 
  Thus a category can be regarded as a generalized monoid,
 
 What is a “generalized monoid”? According to the grammatical construction 
 (adjective plus noun), it should be a special kind of monoid, like a 
 commutative monoid is a special kind of monoid. But then, monoids would be 
 the more general concept and categories the special case, quite the opposite 
 of how it really is.
 
 A category is not a “generalized monoid” but categories (as a concept) are a 
 generalization of monoids. Each category is a monoid, but not the other way 
 round.

You mean ``each monoid is a category, but not the other way round''.

 A monoid is clearly defined as a pair of a set M and a (total) binary 
 operation over M that is associative and has a neutral element. So, for 
 example, the category of sets and functions is not a monoid. First, function 
 composition is not total if you allow arbitrary functions as its arguments. 
 Second, the collection of all sets is not itself a set (but a true class) 
 which conflicts with the above definition which says that M has to be a set.
 
  or a 'monoid with many objects'
 
 What is a monoid with many objects?

A categorical definition of a monoid (that is, a plain old boring monoid
in Set) is that it is a category with a single object.  A category is
thus a monoid with the restriction to a single object lifted :)

jcc


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Rick R
And we thought butterfly ballots were bad.

I just went through the logo page and wrote down my favorite 20 logos in one
column, and gave them a rank in the other. Then translated that into the
voting list using the combo boxes (not the buttons).  The total process took
20 minutes.

I am on FF3 on windows and didn't notice any reordering aside the
(un?)expected reordering by rank.


On Tue, Mar 17, 2009 at 12:12 AM, Robin Green gree...@greenrd.org wrote:

 On Tue, 17 Mar 2009 16:11:54 +0100
 Thomas Davie tom.da...@gmail.com wrote:

  I have to agree that the UI for voting is not the best I've ever
  seen.  On the other hand, it's pretty easy to select the few logos
  that you like, and push them all to the top, select the ones you'd
  accept, and push them up just below, and finally select the ones you
  absolutely don't like and push them all the way down.
 
  That at least is what I did.

 Did you check that code bugs hadn't reordered your votes? I am worried
 about this destroying the validity of the election.
 --
 Robin
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
We can't solve problems by using the same kind of thinking we used when we
created them.
   - A. Einstein
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Gwern Branwen
2009/3/17 Eelco Lempsink ee...@lempsink.nl:
 Hi there!

 I updated a couple of logo versions and ungrouped and regrouped the (former)
 number 31.  Other than that, there was nothing standing in the way of the
 voting to begin imho, so I started up the competition.

 By now, I suppose everybody should have received their ballot.  If you think
 you should have received it but didn't, please report it, I can resend the
 invitation.  Also, for people not directly subscribed to the haskell-cafe
 mailing list, you can still send ballot requests until the end of the
 competition (March 24, 12:00 UTC).  Make sure the message contains 'haskell
 logo voting ballot request' (e.g. in the subject).

 Depending on the winner of this voting round we can decide whether we need
 to continue with variations.  Jared Updike already offered to donate a bit
 of time to help create several variations.  But for now, good luck with
 sorting those options! :)

 --
 Regards,

 Eelco Lempsink

I've personally voted, but it's true that 113 logos is a bit much even
if you only vote on about 20 of them!

Can we assume that the next round will be more like 10?

Also, what is the plan if one of the joke logos (like the boobies one)
makes it into the final round? Will it just be quietly removed?

Finally, I'd like to make a suggestion as to the final results.
Typically there's a tension between a Free  trademarked logo and a
just Free logo. ie. see how Debian does it:
http://www.debian.org/logos/ Although Debian can be obtained for free
and will always remain that way, events such as the problem with the
ownership of the term “Linux” have shown that Debian needs to protect
its property from any use which could hurt its reputation. Debian has
decided to create two logos: one logo is for official Debian use; the
other logo falls under an open use type license.

We could have the top result be the official logo, and the second
result be unofficial. In this way, both logos win: the former will
appear in all the official high-prestige locations, but the latter
will likely get reused more.

Admittedly, it's unlikely the two top finishers will have quite the
same thematic unity as the two Debian logos, but I think it's a
suggestion worth entertaining.

-- 
gwern
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Design Patterns by Gamma or equivalent

2009-03-17 Thread Gregg Reynolds
2009/3/11 Mark Spezzano mark.spezz...@chariot.net.au:
 I’m very familiar with the concept of Design Patterns for OOP in Java and
 C++. They’re basically a way of fitting components of a program so that
 objects/classes fit together nicely like Lego blocks and it’s useful because
 it also provides a common “language” to talk about concepts, like Abstract
 Factory, or an Observer to other programmers. In this way one programmer can
 instantly get a feel what another programmer is talking about even though
 the concepts are fundamentally abstract.

 Because Haskell is not OO, it is functional, I was wondering if there is
 some kind of analogous “design pattern”/”template” type concept that
 describe commonly used functions that can be “factored out” in a general
 sense to provide the same kind of usefulness that Design Patterns do for
 OOP. Basically I’m asking if there are any kinds of “common denominator”
  function compositions that are used again and again to solve problems. If
 so, what are they called?


You might find it useful to read the original works upon which the
whole design pattern economy is based, namely Christopher
Alexander's books
(http://www.patternlanguage.com/leveltwo/booksframe.htm?/leveltwo/../bookstore/bookstore.htm).
 I liked Notes on the Synthesis of Form, which predates his pattern
language stuff.

My $0.02:  design patterns became popular in the imperative language
community precisely because such languages lack the formal discipline
of functional languages.  Alexander came up with the notion of a
pattern language in order to bring some kind of discipline and
abstraction to observed regularities in architecture, urban design,
etc.  By definition such a language cannot have anything close to
formal semantics, any more than a natural language lexicon can have
formal semantics.  Alexander's writing is very interesting and thought
provoking, but I'm not sure it has much to offer the world of
functional programming.

Programmers used Alexander's ideas to try to bring some order to both
specifications and programs.  A pattern language is a natural for
trying to describe a real-world problem one is trying to solve.
Imperative programmers also used it to describe programming patterns.
Implementations of things like Observer/VIsitor etc. are ad-hoc,
informal constructions; the equivalent in a functional language is a
mathematical structure (feel free to fix my terminology).  I don't
think one needs design patterns for Haskell; it has mathematics and
more-or-less formal semantics.  Who needs Visitor when you have For
All?  Although design patterns may still be useful for describing a
real-world problems I suspect one would be better off dumping the
notion of design pattern, the better to avoid cognitive dissonance
when trying to think in purely functional terms.

Cheers,
-gregg
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Eelco Lempsink

On 17 mrt 2009, at 15:24, Heinrich Apfelmus wrote:

Eelco Lempsink wrote:

I updated a couple of logo versions and ungrouped and regrouped the
(former) number 31.  Other than that, there was nothing standing in  
the

way of the voting to begin imho, so I started up the competition.


Thanks for organizing this, finally I can choose ... Oh my god! How  
am I

supposed to make a vote?

I can barely remember 3 of the 113 logos, let alone memorize that #106
is the narwhal. There are lots of very good or just good candidates  
and
I would like to order them all to my liking, but without instant  
visual

feedback on the voting ballot, this is a hopeless task.

Since I have about 10 minutes to spare for voting, I'm just going to
pick 5 candidates at random and order these? Actually, I think I  
prefer

to be completely paralyzed by the overwhelming choice instead and not
vote at all.


I can imagine that, it's a daunting and (optionally) time consuming  
task.  The burden of democracy ;)



Alternatively, it seems that it's possible to upload rankings from a
file. But which format?


Good question.  I don't know and couldn't find it in the CIVS FAQ  
either.



And is there a zip file with the logo proposals
so I can try to arrange them via dragdrop in some picture gallery
application?


Well, actually, there is, since the files were moved to the main  
Haskell server after the community server couldn't bear the load  
anymore (Igloo saving the day! ;).  You can get all the files from http://haskell.org/logos/logos.tar.gz 
.  Note that there are probably a couple of files in there that are  
not in the competition, but artifacts from before (re)grouping some of  
the logos.



A simple majority vote is clearly inadequate for this vote, but I'm
afraid that without assisting technology (instant and visual  
feedback),

the voting process will more or less deteriorate to that due to the
difficulty of creating quality input votes.


We'll see.  Worst case: nobody votes (with 123 votes at this moment, I  
don't think that will be the problem).  Second worst case: most people  
don't have/take the time to order a bit, so it turns into a majority  
vote.


That said, you're absolutely right the visual feedback of the voting  
system is suboptimal.  I'd be very interested in seeing a good UI for  
this sort of task.  I imagine it'd be pretty close to printing  
everything on small pieces of paper and ordering them by hand ;)


--
Regards,

Eelco Lempsink


PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Eelco Lempsink

On 17 mrt 2009, at 16:33, Rick R wrote:
I just went through the logo page and wrote down my favorite 20  
logos in one column, and gave them a rank in the other. Then  
translated that into the voting list using the combo boxes (not the  
buttons).  The total process took 20 minutes.



Yeah, the combo boxes are terribly slow.  I tried them with a smaller  
poll, and there seems to be a bit of exponential behavior.  If you  
want to do it this way (pick x, rank them), I suggest you start with  
putting the ones you ranked lowest on top first, using the 'to top'  
button, and then move the up your list to put the next one on top  
until you reached the top one.


--
Regards,

Eelco Lempsink



PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] Design Patterns by Gamma or equivalent

2009-03-17 Thread Bayley, Alistair
  Because Haskell is not OO, it is functional, I was 
 wondering if there is
  some kind of analogous design pattern/template type concept that
  describe commonly used functions that can be factored out 
 in a general
  sense to provide the same kind of usefulness that Design 
 Patterns do for
  OOP. Basically I'm asking if there are any kinds of common 
 denominator
   function compositions that are used again and again to 
 solve problems. If
  so, what are they called?

Not about Haskell, but Peter Norvig has a presentation about patterns in 
more-or-less functional languages:
  http://norvig.com/design-patterns/

Alistair
*
Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
*

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Eelco Lempsink

On 17 mrt 2009, at 16:34, Gwern Branwen wrote:

Can we assume that the next round will be more like 10?


Depends a bit on the outcome.  There will be one winner, and depending  
on the winner there might be a number of variations we want to vote  
about.  Only if it's a really really close call multiple logos will  
win.  We have to choose at one point ;)



Also, what is the plan if one of the joke logos (like the boobies one)
makes it into the final round? Will it just be quietly removed?


We'll see.  I expect the community is grown up enough and things will  
sort out itself.


--
Regards,

Eelco Lempsink



PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] can GHC build an executable from a C source file?

2009-03-17 Thread Manlio Perillo

Hi.

I'm checking if it possible to build an executable from C source files only.

As an example:

#include stdio.h

int main () {
printf(hello world\n);
return 0;
}


$ghc --make foo.c


However this only produces the object file, foo.o; it does not build the 
executable file.



What is the reason for this behaviour?
I have tested with GHC 6.8.2.



Thanks  Manlio
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] can GHC build an executable from a C source file?

2009-03-17 Thread Anton Tayanovskyy
Works for me without the --make, as `ghc foo.c`

--A

On Tue, Mar 17, 2009 at 6:32 PM, Manlio Perillo
manlio_peri...@libero.it wrote:
 Hi.

 I'm checking if it possible to build an executable from C source files only.

 As an example:

 #include stdio.h

 int main () {
    printf(hello world\n);
    return 0;
 }


 $ghc --make foo.c


 However this only produces the object file, foo.o; it does not build the
 executable file.


 What is the reason for this behaviour?
 I have tested with GHC 6.8.2.



 Thanks  Manlio
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] can GHC build an executable from a C source file?

2009-03-17 Thread Manlio Perillo

Anton Tayanovskyy ha scritto:

Works for me without the --make, as `ghc foo.c`



For me, too, thanks.



Manlio
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] can GHC build an executable from a C source file?

2009-03-17 Thread Joe Fredette
You know, I hear theres this brilliant program for compiling C code -- 
gcd? ccg? gcc, yah gcc... Anyone tried it?


In all seriousness though, why do you need to compile c with ghc? I'm 
curious, it seems a bit pointless...



/Joe

Manlio Perillo wrote:

Anton Tayanovskyy ha scritto:

Works for me without the --make, as `ghc foo.c`



For me, too, thanks.



Manlio
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

begin:vcard
fn:Joseph Fredette
n:Fredette;Joseph
adr:Apartment #3;;6 Dean Street;Worcester;Massachusetts;01609;United States of America
email;internet:jfred...@gmail.com
tel;home:1-508-966-9889
tel;cell:1-508-254-9901
x-mozilla-html:FALSE
url:lowlymath.net, humbuggery.net
version:2.1
end:vcard

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Data.Binary

2009-03-17 Thread Galchin, Vasili
Hello,

 I installed ghci on my work Windows machine. If I do a :m +Data.Word,
everything is OK. If I a :m +Data.Binary, can't be found. Why?

Regards, Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Data.Binary

2009-03-17 Thread John Schaeffer
Do you have Data.Binary installed?  If not, it is available from
Hackage at:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/binary

Hopefully this will help.

-John

2009/3/17 Galchin, Vasili vigalc...@gmail.com

 Hello,

  I installed ghci on my work Windows machine. If I do a :m
 +Data.Word, everything is OK. If I a :m +Data.Binary, can't be found.
 Why?

 Regards, Vasili



 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Brent Yorgey
On Tue, Mar 17, 2009 at 11:39:05AM +0100, Martijn van Steenbergen wrote:

 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE TypeOperators #-}
 module Eq where
 data (a :=: a') where
   Refl :: a :=: a
 class Eq1 f where
   eq1 :: f a - f a' - Maybe (a :=: a')
 class Eq2 f where
   eq2 :: f a b - f a' b' - Maybe (a :=: a', b :=: b')
 class Eq3 f where
   eq3 :: f a b c - f a' b' c' - Maybe (a :=: a', b :=: b', c :=: c')


I don't understand your classes Eq1, Eq2, and Eq3.  How would you make
an instance of Eq1 for, say, [] ?

  instance Eq1 [] where
eq1 xs ys = ???

It seems you are confusing _value_ equality with _type_ equality?  A
value of type a :=: a' is a proof that a and a' are the same type.
But given values of type f a and f a', there is no way to decide
whether a and a' are the same type (no matter what f is), since types
are erased at runtime.

Maybe you mean for eq1 to have a type like 

  eq1 :: (f a :=: f a') - (a :=: a')  ?

But actually, you don't need a type class for that either; 

  eq1 :: (f a :=: f a') - (a :=: a')
  eq1 Refl = Refl

type checks just fine.

-Brent
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] can GHC build an executable from a C source file?

2009-03-17 Thread Neil Mitchell
Yhc used to do this (when you could still build it). Turns out that on
Windows using gcc that gets installed with ghc isn't particularly fun,
while ghc makes a very pleasant build experience. Something to do with
directory layouts, head file searching, and what is on the %PATH% by
default.

Thanks

Neil

2009/3/17 Joe Fredette jfred...@gmail.com:
 You know, I hear theres this brilliant program for compiling C code -- gcd?
 ccg? gcc, yah gcc... Anyone tried it?

 In all seriousness though, why do you need to compile c with ghc? I'm
 curious, it seems a bit pointless...


 /Joe

 Manlio Perillo wrote:

 Anton Tayanovskyy ha scritto:

 Works for me without the --make, as `ghc foo.c`


 For me, too, thanks.



 Manlio
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] can GHC build an executable from a C source file?

2009-03-17 Thread Manlio Perillo

Joe Fredette ha scritto:
You know, I hear theres this brilliant program for compiling C code -- 
gcd? ccg? gcc, yah gcc... Anyone tried it?


In all seriousness though, why do you need to compile c with ghc? I'm 
curious, it seems a bit pointless...




It's for a possible extension I'm planning for Cabal.

The idea is to add support for configuration features.
A configuration feature is similar to a configuration flag, but with 
some important differences.



data Feature = Bool | String


A feature block:

Feature HaveURandom
action: execute
include-dirs: ...
c-sources: features/urandom.c
-- other possible properties, as listed in
-- Build information chapter, excluding `buildable` and
-- `other-modules`
-- The `action` property can have values `compile` (default`)
-- or `execute`

This means that I'm testing for a feature named HaveURandom, and the 
testing requires to compile/build and then execute some code.


In this case there is only a C source file that needs to be compiled; 
this is the reason why I have asked if GHC supports compilation for C 
source files only, and the creation of an executable.



Here I'm asking Cabal to execute the generated program.
If the executable returns 0, then HaveURandom will have value
`Feature True`; if it returns 1, then HaveURandom will have value 
`Feature False`.


If the executable write something on stdout, then HaveURandom will have 
value `Feature string`.


If compilation fails, HaveURandom will have value `Feature False`.
If `action` property is compile, then a successful compilation will 
result in HaveURandom having a value of `Feature True`.




Regards  Manlio
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: categories and monoids (was: Re: [Haskell-cafe] Design Patterns by Gamma or equivalent)

2009-03-17 Thread Dan Piponi
On Tue, Mar 17, 2009 at 5:06 AM, Wolfgang Jeltsch
g9ks1...@acme.softbase.org wrote:

 What is a “generalized monoid”? According to the grammatical construction
 (adjective plus noun), it should be a special kind of monoid

There's no such implication in English. The standard example used by
linguists is fake gun.
--
Dan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Ryan Ingram
On Tue, Mar 17, 2009 at 10:30 AM, Brent Yorgey byor...@seas.upenn.edu wrote:
 I don't understand your classes Eq1, Eq2, and Eq3.  How would you make
 an instance of Eq1 for, say, [] ?

You don't.

 It seems you are confusing _value_ equality with _type_ equality?  A
 value of type a :=: a' is a proof that a and a' are the same type.
 But given values of type f a and f a', there is no way to decide
 whether a and a' are the same type (no matter what f is), since types
 are erased at runtime.

Not necessarily.  Consider this example:

data U a where
   UInt :: U Integer
   UBool :: U Bool

instance Eq1 U where
eq1 UInt UInt = Just Refl
eq1 UBool UBool = Just Refl
eq1 _ _ = Nothing

data Expr a where
   EPrim :: U a - a - Expr a
   EIf :: Expr Bool - Expr a - Expr a - Expr a
   EPlus :: Expr Integer - Expr Integer - Expr Integer
   ELess :: Expr Integer - Expr Integer - Expr Bool

typeOf :: Expr a - U a
typeOf (EPrim u _) = u
typeOf (EIf _ t _) = typeOf t
typeOf (EPlus _ _) = UInt
typeOf (ELess _ _) = UBool

instance Eq1 Expr where
eq1 lhs rhs = eq1 (typeOf lhs) (typeOf rhs)

These types are very useful for construction of type-safe interpreters
and compilers.

  -- ryan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Miguel Mitrofanov
The first glimpse of this vote scared me so much that I've closed the  
page, stopped the browser and shut my computer down.


On 17 Mar 2009, at 16:06, Eelco Lempsink wrote:


Hi there!

I updated a couple of logo versions and ungrouped and regrouped the  
(former) number 31.  Other than that, there was nothing standing in  
the way of the voting to begin imho, so I started up the competition.


By now, I suppose everybody should have received their ballot.  If  
you think you should have received it but didn't, please report it,  
I can resend the invitation.  Also, for people not directly  
subscribed to the haskell-cafe mailing list, you can still send  
ballot requests until the end of the competition (March 24, 12:00  
UTC).  Make sure the message contains 'haskell logo voting ballot  
request' (e.g. in the subject).


Depending on the winner of this voting round we can decide whether  
we need to continue with variations.  Jared Updike already offered  
to donate a bit of time to help create several variations.  But for  
now, good luck with sorting those options! :)


--
Regards,

Eelco Lempsink

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Has anybody replicated =~ s/../../ or even something more basic for doing replacements with pcre haskell regexen?

2009-03-17 Thread Thomas Hartman
2009/3/16 ChrisK hask...@list.mightyreason.com:

 Let me open the discussion with all the questions I can quickly ask:

  What should the subRegex function do, exactly?
  (Single replacement,global replacement,once per line,...)

Try to do the same thing as =~ s/../../ in perl.

For a version 1: Global replacements, don't treat newlines separately,
^ and $ anchor at start and end of string.

There could be a Bool option to support multiline replacement modes.


  What should the replacement template be able to specify?
  (Can it refer to all text before a match or all text after?)
  (Can it access the start/stop offsets as numbers?)

Again, follow =~ s/../../

I'm not sure what =~ allows in this dimension though.

My instinct is

 (Can it refer to all text before a match or all text after?)

no

  (Can it access the start/stop offsets as numbers?)

no

But maybe that's just because I've never needed the above functionality.

I basically think of =~ s as quick cleanup for dirty text solution,
nothing approaching full-fledged parsing.

  Should the replacement template be specif~ied in a String?

Sure, just like it is in Text.Regex.subRegex now. No combinators,
\numbered capture references are fine.

 As an abstract
 data type or syntax tree?  With combinators?

Just a string I think.

  What happens if the referenced capture was not made?  Empty text?

Return the original string. Isn't that what subRegex already does?

  How will syntax errors in the template be handled (e.g. referring to a
 capture that does not exist in the regular expression)?

runtime error

  Will the output text be String? ByteString? ByteString.Lazy? Seq Char?
  Note: String and Strict Bytestrings are poor with concatenation.

String. Add support for others if users holler for it


  Can the output text type differ from the input text type?

Nah.

My 2c.


 --
 Chris

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Daniel Schüssler
Hi,

 Even worse, the buttons for moving items up and down are buggy - at
 least on my browser (Firefox 3.1 beta 2 on Linux). They sometimes
 reorder my other votes! Even assuming that the list box code is not
 buggy (which I now doubt), not being able to use the buttons makes this
 form almost unusable!

I guess it works like this:

Move down on an element X will make the /smallest/ change (with respect to 
the abstract ordering) that makes X worse than it's current value. This may 
require changing more than one number, for example if we have:

(105:  ) (106: A) (107: X,B) (108: C,D) (109: E  ) (110:  )

moving down X will result in either

(105: A) (106: B) (107: X  ) (108: C,D) (109: D  ) (110:  )

or equivalently

(105:  ) (106: A) (107: B  ) (108: X  ) (109: C,D) (110: D)

of course, maybe you already know that but you're saying that it is doing this 
wrongly ;)

Btw, I really think the logos should be on the same page as the voting form. 
Hotkeys for the buttons would be good too.

It's usable though if you (incorrectly) consider the numbers as a sort of 
reverse star rating to make a O(n) pass, possibly finetuning later.


Greetings,
Daniel
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Daniel Schüssler
(correction of the example)

(105:  ) (106: A) (107: X,B) (108: C,D) (109: E  ) (110:  )

moving down X will result in either

(105: A) (106: B) (107: X  ) (108: C,D) (109: E  ) (110:  )

or equivalently

(105:  ) (106: A) (107: B  ) (108: X  ) (109: C,D) (110: E)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Rick R
QED

2009/3/17 Daniel Schüssler anotheraddr...@gmx.de

 (correction of the example)

 (105:  ) (106: A) (107: X,B) (108: C,D) (109: E  ) (110:  )

 moving down X will result in either

 (105: A) (106: B) (107: X  ) (108: C,D) (109: E  ) (110:  )

 or equivalently

 (105:  ) (106: A) (107: B  ) (108: X  ) (109: C,D) (110: E)
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
We can't solve problems by using the same kind of thinking we used when we
created them.
   - A. Einstein
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Daniel Schüssler
On Tuesday 17 March 2009 21:03:21 Rick R wrote:
 QED

Hmm? Maybe if confusingness was to be demonstrated, but not bugginess. Both 
possibilities will result in the same total preordering (defined by (x 
`betterThanOrEq` y) iff (numberInCombobox x = numberInCombobox y)), and 
(AFAIK) only this ordering matters for condorcet.


Greetings,
Daniel
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell and the Cell Processor

2009-03-17 Thread Galchin, Vasili
Hello,

 http://www.power.org/resources/devcorner/cellcorner    Is there
project to port GHC to the Cell? Seems like a really cool challenge.

Regards, Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Luke Palmer
On Tue, Mar 17, 2009 at 6:14 AM, Wolfgang Jeltsch 
g9ks1...@acme.softbase.org wrote:

 Am Dienstag, 17. März 2009 11:49 schrieb Yandex:
  data (a :=: a') where
Refl :: a :=: a
Comm :: (a :=: a') - (a' :=: a)
Trans :: (a :=: a') - (a' :=: a'') - (a :=: a'')

 I don’t think, Comm and Trans should go into the data type. They are not
 axioms but can be proven. Refl says that each type equals itself. Since
 GADTs
 are closed, Martijn’s definition also says that two types can *only* be
 equal
 if they are actually the same.

 Here are the original definition and the proofs of comm and trans. Compiles
 fine with GHC 6.10.1.

data (a :=: a') where

Refl :: a :=: a

 comm :: (a :=: a') - (a' :=: a)
comm Refl = Refl

trans :: (a :=: a') - (a' :=: a'') - (a :=: a'')
 trans Refl Refl = Refl


These two theorems should be in the package.




 Best wishes,
 Wolfgang
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Ian Lynagh
On Tue, Mar 17, 2009 at 04:03:21PM -0400, Rick R wrote:
 QED

Only relative ordering matters for condorcet, not the absolute rank.

e.g., ranking A, B and C rank 1, and
  D, E and F rank 6
is exactly the same as ranking
e.g., ranking A, B and C rank 2, and
  D, E and F rank 3.

In both cases below, moving X down is moving X from the same rank as B
to a new rank between B and C,D. Presumably moving it down a second time
would merge the X and C,D ranks.

Personally, I found assigning ranks with the dropdown list to be
easiest. I first sorted them into approx 8 buckets (using ranks like
10,20,40,60,80,100 as buckets, although some ended up between two
buckets), and then sorted my highly ranked buckets (where high is the
end near 10).

 2009/3/17 Daniel Schüssler anotheraddr...@gmx.de
 
  (correction of the example)
 
  (105:  ) (106: A) (107: X,B) (108: C,D) (109: E  ) (110:  )
 
  moving down X will result in either
 
  (105: A) (106: B) (107: X  ) (108: C,D) (109: E  ) (110:  )
 
  or equivalently
 
  (105:  ) (106: A) (107: B  ) (108: X  ) (109: C,D) (110: E)


Thanks
Ian

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Robin Green
On Tue, 17 Mar 2009 20:34:12 +0100
Daniel Schüssler anotheraddr...@gmx.de wrote:

 Hi,
 
  Even worse, the buttons for moving items up and down are buggy - at
  least on my browser (Firefox 3.1 beta 2 on Linux). They sometimes
  reorder my other votes! Even assuming that the list box code is not
  buggy (which I now doubt), not being able to use the buttons makes
  this form almost unusable!
 
 I guess it works like this:
 
 Move down on an element X will make the /smallest/ change (with
 respect to the abstract ordering) that makes X worse than it's
 current value. This may require changing more than one number, for
 example if we have:
 
 (105:  ) (106: A) (107: X,B) (108: C,D) (109: E  ) (110:  )
 
 moving down X will result in either
 
 (105: A) (106: B) (107: X  ) (108: C,D) (109: D  ) (110:  )
 
 or equivalently
 
 (105:  ) (106: A) (107: B  ) (108: X  ) (109: C,D) (110: D)
 
 of course, maybe you already know that but you're saying that it is
 doing this wrongly ;)

Yes, I am saying that. To be more specific: I saw the current Haskell
logo get put back in the top position even though I had pushed it down,
and I saw three of my choices which I ranked quite highly, pushed
down to the bottom. Scarily bad.

However, I am now hacking together a quick-and-dirty utility for
ranking things which I will put on hackage. I'm not sure that anyone
other than myself will use it, but it's fun hacking it up.

-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Karel Gardas

Sorry for newcomer silly question, but where is the voting page located?

Thanks,
Karel
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Robin Green
On Tue, 17 Mar 2009 20:34:12 +0100
Daniel Schüssler anotheraddr...@gmx.de wrote:

 Hi,
 
  Even worse, the buttons for moving items up and down are buggy - at
  least on my browser (Firefox 3.1 beta 2 on Linux). They sometimes
  reorder my other votes! Even assuming that the list box code is not
  buggy (which I now doubt), not being able to use the buttons makes
  this form almost unusable!
 
 I guess it works like this:
 
 Move down on an element X will make the /smallest/ change (with
 respect to the abstract ordering) that makes X worse than it's
 current value. This may require changing more than one number, for
 example if we have:
 
 (105:  ) (106: A) (107: X,B) (108: C,D) (109: E  ) (110:  )
 
 moving down X will result in either
 
 (105: A) (106: B) (107: X  ) (108: C,D) (109: D  ) (110:  )
 
 or equivalently
 
 (105:  ) (106: A) (107: B  ) (108: X  ) (109: C,D) (110: D)
 
 of course, maybe you already know that but you're saying that it is
 doing this wrongly ;)

Yes, I am saying that. To be more specific: I saw the current Haskell
logo get put back in the top position even though I had pushed it down,
and I saw three of my choices which I ranked quite highly, pushed
down to the bottom. Scarily bad.

However, I am now hacking together a quick-and-dirty utility for
ranking things which I will put on hackage. I'm not sure that anyone
other than myself will use it, but it's fun hacking it up.

-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Robin Green
On Tue, 17 Mar 2009 20:34:12 +0100
Daniel Schüssler anotheraddr...@gmx.de wrote:

 Hi,
 
  Even worse, the buttons for moving items up and down are buggy - at
  least on my browser (Firefox 3.1 beta 2 on Linux). They sometimes
  reorder my other votes! Even assuming that the list box code is not
  buggy (which I now doubt), not being able to use the buttons makes
  this form almost unusable!
 
 I guess it works like this:
 
 Move down on an element X will make the /smallest/ change (with
 respect to the abstract ordering) that makes X worse than it's
 current value. This may require changing more than one number, for
 example if we have:
 
 (105:  ) (106: A) (107: X,B) (108: C,D) (109: E  ) (110:  )
 
 moving down X will result in either
 
 (105: A) (106: B) (107: X  ) (108: C,D) (109: D  ) (110:  )
 
 or equivalently
 
 (105:  ) (106: A) (107: B  ) (108: X  ) (109: C,D) (110: D)
 
 of course, maybe you already know that but you're saying that it is
 doing this wrongly ;)

Yes, I am saying that. To be more specific: I saw the current Haskell
logo get put back in the top position even though I had pushed it down,
and I saw three of my choices which I ranked quite highly, pushed
down to the bottom. Scarily bad.

However, I am now hacking together a quick-and-dirty utility for
ranking things which I will put on hackage. I'm not sure that anyone
other than myself will use it, but it's fun hacking it up.

-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Robin Green
On Tue, 17 Mar 2009 20:34:12 +0100
Daniel Schüssler anotheraddr...@gmx.de wrote:

 Hi,
 
  Even worse, the buttons for moving items up and down are buggy - at
  least on my browser (Firefox 3.1 beta 2 on Linux). They sometimes
  reorder my other votes! Even assuming that the list box code is not
  buggy (which I now doubt), not being able to use the buttons makes
  this form almost unusable!
 
 I guess it works like this:
 
 Move down on an element X will make the /smallest/ change (with
 respect to the abstract ordering) that makes X worse than it's
 current value. This may require changing more than one number, for
 example if we have:
 
 (105:  ) (106: A) (107: X,B) (108: C,D) (109: E  ) (110:  )
 
 moving down X will result in either
 
 (105: A) (106: B) (107: X  ) (108: C,D) (109: D  ) (110:  )
 
 or equivalently
 
 (105:  ) (106: A) (107: B  ) (108: X  ) (109: C,D) (110: D)
 
 of course, maybe you already know that but you're saying that it is
 doing this wrongly ;)

Yes, I am saying that. To be more specific: I saw the current Haskell
logo get put back in the top position even though I had pushed it down,
and I saw three of my choices which I ranked quite highly, pushed
down to the bottom. Scarily bad.

However, I am now hacking together a quick-and-dirty utility for
ranking things which I will put on hackage. I'm not sure that anyone
other than myself will use it, but it's fun hacking it up.

-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-17 Thread Jonathan Cast
On Tue, 2009-03-17 at 12:40 +, Claus Reinke wrote:
  So that first step already relies on IO (where the two are equivalent).
  Come again?
 
 The first step in your implication chain was (without the return)
 
   throw (ErrorCall urk!) = 1
   == evaluate (throw (ErrorCall urk!)) = evaluate 1
 
 but, using evaluation only (no context-sensitive IO), we have
 
  throw (ErrorCall urk) = evaluate (throw (ErrorCall urk))
  Sure enough.
 
 meaning that first step replaced a smaller with a bigger item on the
 smaller side of the inequation.

And the larger side!  I'm trying to determine whether there can exist a
denotational semantics for IO, which treats it as a functor from (D)CPOs
to (D)CPOs, for which the corresponding denotational semantics for the
IO operations satisfies the requirement that they are both monotone and
continuous.  So I assumed monotonicity of evaluate.

 Unless the reasoning includes context-
 sensitive IO rules,

What does this mean again?  I'm working on the assumption that
`context-sensitive' means `under some (not necessarily compositional
and/or continuous and/or monotonic) equivalence relation/

 in which case the IO rule for evaluate brings the
 throw to the top (evaluate (throw ..) - (throw ..)), making the two
 terms equivalent (modulo IO), and hence the step valid (modulo IO).
 
 Unless you just rely on
 
 But throwIO (ErrorCall urk) /= _|_:
 Control.Exception throwIO (ErrorCall urk!) `seq` ()
 ()
 
 in which case that step relies on not invoking IO, so it can't be
 mixed with the later step involving IO for catch (I think).

The IO monad is still a part of Haskell's denotational semantics, right?
Otherwise, I don't think we can really claim Haskell, as a language that
includes IO in its specification, is truly `purely functional'.  It's a
language that integrates two sub-languages, one purely functional and
one side-effectful and imperative.  Which is a nice accomplishment, but
less that what Haskell originally aimed to achieve.

  This is very delicate territory. For instance, one might think that
  this 'f' seems to define a negation function of information content
 
  f x = Control.Exception.catch (evaluate x  let x = x in x) 
  (\(ErrorCall _)-return 0) =
  print
 
  and hence violates monotonicity
 
  (_|_ = ()) = (f _|_ = f ())
 
  since
 
  *Main f undefined
  0
  *Main f ()
  Interrupted.
 
  But that is really mixing context-free expression evaluation and
  context-sensitive execution of io operations. Most of our favourite
  context-free equivalences only hold within the expression evaluation
  part, while IO operations are subject to additional, context-sensitive
  rules.
 
  Could you elaborate on this?  It sounds suspiciously like you're saying
  Haskell's axiomatic semantics is unsound :: IO.
 
 Not really unsound, if the separation is observed.

I still don't understand what you're separating.  Are you saying the
semantics of terms of type IO need to be separated from the semantics of
terms of non-IO type?

 One could probably
 construct a non-separated semantics (everything denotational), but at
 the cost of mapping everything to computations rather than values.

So as long as Haskell is no longer pure (modulo lifting everything) it
works?

 Then computations like that 'f' above would, eg, take an extra context
 argument (representing the world, or at least aspects of the machine
 running the computation), and the missing information needed to take
 'f _|_'[world] to '()'[world'] would come from that context parameter
 (somewhere in the computational context, there is a representation of
 the computation, which allows the context to read certain kinds of '_|_'
 as exceptions; the IO rule for 'catch' takes that external information and
 injects it back from the computational context into the functional program,
 as data structure representations of exceptions).

 That price is too high, though, as we'd now have to do all reasoning
 in context-sensitive terms which, while more accurate, would bury
 us in irrelevant details. Hence we usually try to use context-free
 reasoning whenever we can get away with it (the non-IO portions
 of Haskell program runs), resorting to context-sensitive reasoning
 only when necessary (the IO steps of Haskell program runs).

So I can't use normal Haskell semantics to reason about IO.  That's
*precisely* what I'm trying to problematize.

 This gives us convenience when the context is irrelevant as well
 as accuracy when the context does matter - we just have to be
 careful when combining the two kinds of reasoning.
 
  For instance, without execution
 
  *Main f () `seq` ()
  ()
  *Main f undefined `seq` ()
  ()
 
  but if we include execution (and the context-sensitive equivalence
  that implies, lets call it ~),
 
  So
 
a ~ b = `The observable effects of $(x) and $(y) are equal'
 
  ?
 
 Observational equivalence is one possibility, there are various forms
 of 

Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread David Menendez
2009/3/17 Luke Palmer lrpal...@gmail.com:
 Here are the original definition and the proofs of comm and trans.
 Compiles
 fine with GHC 6.10.1.

    data (a :=: a') where

        Refl :: a :=: a

    comm :: (a :=: a') - (a' :=: a)
    comm Refl = Refl

    trans :: (a :=: a') - (a' :=: a'') - (a :=: a'')
    trans Refl Refl = Refl

 These two theorems should be in the package.

How about this?

instance Category (:=:) where
id = Refl
Refl . Refl = Refl

-- 
Dave Menendez d...@zednenem.com
http://www.eyrie.org/~zednenem/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell and the Cell Processor

2009-03-17 Thread Kazuya Sakakihara
Glad to see others are interested in this topic.

2009/3/18 Galchin, Vasili vigalc...@gmail.com:
  http://www.power.org/resources/devcorner/cellcorner    Is there
 project to port GHC to the Cell? Seems like a really cool challenge.

I am no GHC expert but...

Likely no as far as I searched back in a couple of months.  There is
(or was?) a SPU code generator written in Haskell, though.

The single most problem I guess is SPU can access only 256KB unless
you utilize DMA operations to transfer data to/from the main memory.
No idea how this can be supported in RTS.  This limitation might not
mesh well with GHC's heavy reliance on garbage collection.

Or if you take it as extreme software controllable cache memory, it
can be exploited for optimization.

Other parts of SPU than that can be handled in the same way as common
processors if you don't care optimization.

Kazuya
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Sebastian Sylvan
On Tue, Mar 17, 2009 at 2:24 PM, Heinrich Apfelmus 
apfel...@quantentunnel.de wrote:

 Eelco Lempsink wrote:
  Hi there!
 
  I updated a couple of logo versions and ungrouped and regrouped the
  (former) number 31.  Other than that, there was nothing standing in the
  way of the voting to begin imho, so I started up the competition.
 
  By now, I suppose everybody should have received their ballot.  If you
  think you should have received it but didn't, please report it, I can
  resend the invitation.  Also, for people not directly subscribed to the
  haskell-cafe mailing list, you can still send ballot requests until the
  end of the competition (March 24, 12:00 UTC).  Make sure the message
  contains 'haskell logo voting ballot request' (e.g. in the subject).
 
  Depending on the winner of this voting round we can decide whether we
  need to continue with variations.  Jared Updike already offered to
  donate a bit of time to help create several variations.  But for now,
  good luck with sorting those options! :)

 Thanks for organizing this, finally I can choose ... Oh my god! How am I
 supposed to make a vote?


 I can barely remember 3 of the 113 logos, let alone memorize that #106
 is the narwhal. There are lots of very good or just good candidates and
 I would like to order them all to my liking, but without instant visual
 feedback on the voting ballot, this is a hopeless task.


Indeed, I thought each entry would contain a thumbnail for the logo itself,
but I guess it doesn't support HTML? This is pretty arduous...

-- 
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Robin Green
On Tue, 17 Mar 2009 20:34:12 +0100
Daniel Schüssler anotheraddr...@gmx.de wrote:

 Hi,
 
  Even worse, the buttons for moving items up and down are buggy - at
  least on my browser (Firefox 3.1 beta 2 on Linux). They sometimes
  reorder my other votes! Even assuming that the list box code is not
  buggy (which I now doubt), not being able to use the buttons makes
  this form almost unusable!
 
 I guess it works like this:
 
 Move down on an element X will make the /smallest/ change (with
 respect to the abstract ordering) that makes X worse than it's
 current value. This may require changing more than one number, for
 example if we have:
 
 (105:  ) (106: A) (107: X,B) (108: C,D) (109: E  ) (110:  )
 
 moving down X will result in either
 
 (105: A) (106: B) (107: X  ) (108: C,D) (109: D  ) (110:  )
 
 or equivalently
 
 (105:  ) (106: A) (107: B  ) (108: X  ) (109: C,D) (110: D)
 
 of course, maybe you already know that but you're saying that it is
 doing this wrongly ;)

Yes, I am saying that. To be more specific: I saw the current Haskell
logo get put back in the top position even though I had pushed it down,
and I saw three of my choices which I ranked quite highly, pushed
down to the bottom. Scarily bad.

However, I am now hacking together a quick-and-dirty utility for
ranking things which I will put on hackage. I'm not sure that anyone
other than myself will use it, but it's fun hacking it up.

-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Conor McBride

Hi

On 17 Mar 2009, at 21:06, David Menendez wrote:


2009/3/17 Luke Palmer lrpal...@gmail.com:

Here are the original definition and the proofs of comm and trans.
Compiles
fine with GHC 6.10.1.

   data (a :=: a') where

   Refl :: a :=: a

   comm :: (a :=: a') - (a' :=: a)
   comm Refl = Refl

   trans :: (a :=: a') - (a' :=: a'') - (a :=: a'')
   trans Refl Refl = Refl


These two theorems should be in the package.


How about this?

instance Category (:=:) where
   id = Refl
   Refl . Refl = Refl


That and the identity-on-objects functor to sets and
functions.

Mutter mutter Leibniz

Conor

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread John Meacham
May I recommend 'approval voting' as an alternative? It doesn't require
ordering, has nice theoretial properties, and is dead simple to
implement. everyone just votes yes on the ones they approve of, you add
up the numbers and the highest one wins. Voting yes on everything
doesn't help since then all your votes cancel out. 

John
-- 
John Meacham - ⑆repetae.net⑆john⑈
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Martijn van Steenbergen

Ryan Ingram wrote:

These types are very useful for construction of type-safe interpreters
and compilers.


That's exactly what I have in mind.

In my specific case I want to compare the constructors of the GADT 
representing a datatype family in the multirec package:



data AST a where
  Stmt :: AST Stmt
  Expr :: AST Expr


Martijn.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Martijn van Steenbergen

Conor McBride wrote:

instance Category (:=:) where
   id = Refl
   Refl . Refl = Refl


That and the identity-on-objects functor to sets and
functions.


Not sure what you mean by this, Conor. Can you please express this in 
Haskell code?


Thanks,

Martijn.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Sebastian Sylvan
On Tue, Mar 17, 2009 at 9:35 PM, John Meacham j...@repetae.net wrote:

 May I recommend 'approval voting' as an alternative? It doesn't require
 ordering, has nice theoretial properties, and is dead simple to
 implement. everyone just votes yes on the ones they approve of, you add
 up the numbers and the highest one wins. Voting yes on everything
 doesn't help since then all your votes cancel out.


You can do that with condorcet by just selecting the ones you approve of and
making them tied for first...



-- 
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Martijn van Steenbergen

Martijn van Steenbergen wrote:

class Eq2 f where
  eq2 :: f a b - f a' b' - Maybe (a :=: a', b :=: b')


Is that right, or does the following make more sense?


class Eq2 f where
  eq2 :: f a b - f a' b' - (Maybe (a :=: a'), Maybe (b :=: b'))


Thanks,

Martijn.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type equality proof

2009-03-17 Thread Conor McBride


On 17 Mar 2009, at 21:44, Martijn van Steenbergen wrote:


Conor McBride wrote:

instance Category (:=:) where
  id = Refl
  Refl . Refl = Refl

That and the identity-on-objects functor to sets and
functions.


Not sure what you mean by this, Conor. Can you please express this  
in Haskell code?


Apologies for being glib and elliptic: filthy habit.

That would be

  coerce :: (a :=: b) - (a - b)
  coerce Refl a = a

taking arrows in the :=: category (aka the discrete
category on *) to arrows in the - category, preserving
the objects involved.

It captures the main useful consequence of an equation
between types. I guess the other thing you need is

  resp :: (a :=: b) - (f a :=: f b)
  resp Refl = Refl

(any type constructor gives you a functor from the :=:
category to itself).

If you compose the two, you get Leibniz's characterization
of equality -- that it's substitutive:

  subst :: a :=: b - (f a - f b)
  subst = coerce . resp

Or you can start from subst and build the other two by
careful instantiation of f.

By the way, I see the motivation for your Eq1 class, which
seems useful for the singleton GADTs which get used to
give value-level representations to type-level stuff
(combine with fmap coerce to get SYB-style cast), but
I'm not quite sure where Eq2, etc, come in. Have you
motivating examples for these?

It's well worth striving for some sort of standard kit
here. I should add that mentioning equality is the
best way to start a fight at a gathering of more than
zero type theorists. But perhaps there are fewer things
to cause trouble in Haskell.

So thanks for this,

Conor



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Jared Updike
Wow, I had a nice list of all the numbers of my favorites ranked
before voting began (like a week ago), and here they are all
re-numbered, rendering all that waste of time... even more of a waste
of time...

  Jared.

On 3/17/09, Eelco Lempsink ee...@lempsink.nl wrote:
 Hi there!

  I updated a couple of logo versions and ungrouped and regrouped the
 (former) number 31.  Other than that, there was nothing standing in the way
 of the voting to begin imho, so I started up the competition.

  By now, I suppose everybody should have received their ballot.  If you
 think you should have received it but didn't, please report it, I can resend
 the invitation.  Also, for people not directly subscribed to the
 haskell-cafe mailing list, you can still send ballot requests until the end
 of the competition (March 24, 12:00 UTC).  Make sure the message contains
 'haskell logo voting ballot request' (e.g. in the subject).

  Depending on the winner of this voting round we can decide whether we need
 to continue with variations.  Jared Updike already offered to donate a bit
 of time to help create several variations.  But for now, good luck with
 sorting those options! :)

  --
  Regards,

  Eelco Lempsink


 ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Richard O'Keefe

The main problems I had with the voting system were
(1) In order to choose a rank, I had to scroll *up* over
100+ unwanted ranks.  If only the scrolling started
at the *top* -- for the simple reason that few people
will want to rank all 113 choices, so almost all of
the ranks people want will be near the top -- it would
have taken a lot less time.  It would have taken FAR
less time to just type the numbers of the things I
liked in the order I wanted them.
(2) Whenever I chose something, the browser spun its wheels
for a *long* time.  Why is moving something in a list
so hard?
(3) It would have been *much* easier for me to just shuffle
the pictures.  I had to constantly flick between two
windows *and* scroll each of them differently to see
what I was choosing.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] encoding for least fixpoint

2009-03-17 Thread ben
Hello,

I am trying to understand the definition of (co)inductive types in
Haskell. After reading the beginning of Vene's thesis [1] I was happy,
because I understood the definition of the least fixpoint:

newtype Mu f = In (f (Mu f)).

But this definition coincides with his definition of the greatest fixpoint

newtype Nu f = Wrap (f (Nu f)),

which in reality is not true
(e. g. for
f x = a * x-- the 'stream functor'
the type Mu f should be empty, isn't it?).

Then I stumbled over a blog entry of Shin-Cheng Mu [2] and from there
over an article of Wadler [3], where the least fixpoint is encoded as

Lfix X. F X  =  All X. (F X - X) - X.

and the greatest fixpoint as

Gfix X. F X  =  Exists X. (X - F X) * X.

I would like to understand these definitions, or get an intuition about
their meaning.
Could somebody give some explanation or a pointer to a place where I can
find one?

Thanks a lot in advance,
ben


[1] http://www.cs.ut.ee/~varmo/papers/thesis.pdf
[2]
http://www.iis.sinica.edu.tw/~scm/2007/encoding-inductive-and-coinductive-types-in-polymorphic-lambda-calculus/
[3]http://homepages.inf.ed.ac.uk/wadler/papers/free-rectypes/free-rectypes.txt
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Henning Thielemann


On Tue, 17 Mar 2009, John Meacham wrote:


May I recommend 'approval voting' as an alternative? It doesn't require
ordering, has nice theoretial properties, and is dead simple to
implement. everyone just votes yes on the ones they approve of, you add
up the numbers and the highest one wins. Voting yes on everything
doesn't help since then all your votes cancel out.


That's similar to what I suggested. I also think it is superior to 
sorting both in usage and in evaluation.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Darcs or Perforce

2009-03-17 Thread Aaron Denney
On 2009-03-01, Erik de Castro Lopo mle...@mega-nerd.com wrote:
 Colin Paul Adams wrote:

 Any advantages over Perforce?

 I have used Bzr, CVS, Darcs, Git, Hg (Mercurial), Perforce and SVN.

 While Perforce is definitely better than CVS (anything is better than
 CVS), Perforce's client workspace concept is a bad idea for complex
 projects (it bit my group of 4 developers time after time).

There are far far more vile version control systems than CVS out there.
I'll say to beware of InterCapped product names, and leave it at that.

-- 
Aaron Denney
--

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Fernando Henrique Sanches
Voting among 100+ options took a while (15-20 minutes?), but I had no
problems. The system may be suboptimal, but it works nicely. It probably
won't make people vote in wrong options (at least not too often, mistakes
always happen), so it is doing a fine job.

Thanks for organizing the voting for us.

Fernando Henrique Sanches


2009/3/17 Eelco Lempsink ee...@lempsink.nl

 Hi there!

 I updated a couple of logo versions and ungrouped and regrouped the
 (former) number 31.  Other than that, there was nothing standing in the way
 of the voting to begin imho, so I started up the competition.

 By now, I suppose everybody should have received their ballot.  If you
 think you should have received it but didn't, please report it, I can resend
 the invitation.  Also, for people not directly subscribed to the
 haskell-cafe mailing list, you can still send ballot requests until the end
 of the competition (March 24, 12:00 UTC).  Make sure the message contains
 'haskell logo voting ballot request' (e.g. in the subject).

 Depending on the winner of this voting round we can decide whether we need
 to continue with variations.  Jared Updike already offered to donate a bit
 of time to help create several variations.  But for now, good luck with
 sorting those options! :)

 --
 Regards,

 Eelco Lempsink


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] .hi inconsistency bug.

2009-03-17 Thread Joe Fredette

List,

I've got this project, source on patch-tag here[1]

It's a nice little project, I've got the whole thing roughly working, it 
compiles okay, everything seems to work, until I try to run it, 
specifically when I run it in ghci, or when I run the main executable 
(which uses hint), and look at any type involving my Email type, it 
gives me the following error:


   Type syonym HackMail.Data.MainTypes.Filter:
 Can't find interface-file declaration for type constructor or 
class HackMail.Data.ParseEmail.Email

   Probable cause: bug in .hi-boot file, or inconsistent .hi file
   Use -ddump-if-trace to get an idea of which file caused the error

As far as I understand, it wants to find the interface-file declaration 
for a specific type (Email) exported by the ParseEmail module, all of 
the exports (I think) are in order. I've tried mucking around with it a 
bit, but I don't fully understand what the error even means, much less 
how to fix it.


Other relevant info, Email is exported in a roundabout way, namely by 
importing a module MainTypes, which exports a module Email, which 
exports a the ParseEmail Module, which exports the datatype Email.


The Filter delcaration it _actually_ complains about (it's just the 
first place the email type is invoked) is:


   type Filter a = ReaderT (Config, Email) IO a

nothing particularly special.

Any help fixing this is greatly appreciated, I did find this bug 
report[2] which seems like it might be relevant.


But trying to unregister - cabal clean - cabal install doesn't fix it. 
I've also tried manually removing the dist/ folder, and also 
unregistering the package.


Thanks again.

/Joe

[1] http://patch-tag.com/repo/Hackmail/browse
[2] http://hackage.haskell.org/trac/ghc/ticket/2057
begin:vcard
fn:Joseph Fredette
n:Fredette;Joseph
adr:Apartment #3;;6 Dean Street;Worcester;Massachusetts;01609;United States of America
email;internet:jfred...@gmail.com
tel;home:1-508-966-9889
tel;cell:1-508-254-9901
x-mozilla-html:FALSE
url:lowlymath.net, humbuggery.net
version:2.1
end:vcard

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] symbolic evaluator for Haskell?

2009-03-17 Thread Tim Newsham

Is there a symbolic evaluator for Haskell that will perform all
applications except on specified functions?  Ie. I would love
something that would take

foldr (+) (6 `div` 5) [1,2,3*4]

and (+) (*) and return

   1 + (2 + (3*4 + 1))

by performing all the applications except for (+) and (*).
(Something that supports ghc extensions is preferred :)

Tim Newsham
http://www.thenewsh.com/~newsham/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] OpenGL and Cabal installation

2009-03-17 Thread Mark Spezzano
Hi all,

 

I’m trying desperately to get OpenGL up and running. 

 

I type 

cabal.exe configure and get the following

 

...

checking GL/glut.h usability... no

checking GL/glut.h presence... no

checking for GL/glut.h... no

checking for GLUT library... no

checking for GL/glut.h... (cached) no

checking GLUT/glut.h usability... no

checking GLUT/glut.h presence... no

checking for GLUT/glut.h... no

configure: error: no GLUT header found, so this package cannot be built

See `config.log' for more details.

 

Where is it looking for these glut.h files? I’ve tried putting them
everywhere in my PATH but msys won’t find them.

 

Cheers,

 

Mark Spezzano 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.557 / Virus Database: 270.11.18/2008 - Release Date: 17/03/2009
4:25 PM
 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How can I check which thunks are piling up on the stack?

2009-03-17 Thread Denis Bueno
On Tue, Mar 17, 2009 at 06:37, Gü?nther Schmidt gue.schm...@web.de wrote:
 Hi,

 How can I check which thunks are piling up on the stack?

Check out the section on retainer profiling in the Profiling memory
usage section of the GHC manual:

http://www.haskell.org/ghc/docs/latest/html/users_guide/prof-heap.html

   Denis
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] libgmp for GHC 6.10.1 on Mac OS X 10.5

2009-03-17 Thread David Leimbach
Did you get past this point?  I'm hitting:
== make way=dyn -f GNUmakefile all;
/Users/dave/Downloads/ghc-6.10.1/ghc/stage1-inplace/ghc -package-name
ghc-prim-0.1.0.0 -hide-all-packages -no-user-package-conf -split-objs -i
-idist/build -i. -idist/build/autogen -Idist/build/autogen -Idist/build
-optP-include -optPdist/build/autogen/cabal_macros.h -odir dist/build -hidir
dist/build -stubdir dist/build -package rts-1.0 -O -package-name ghc-prim
-XCPP -XMagicHash -XForeignFunctionInterface -XUnliftedFFITypes
-XUnboxedTuples -XEmptyDataDecls -XNoImplicitPrelude -fPIC -dynamic -hisuf
dyn_hi -hcsuf dyn_hc -osuf dyn_o -idist/build  -H32m -O -O2 -Rghc-timing
-XGenerics -Wall -fno-warn-deprecated-flags -c GHC/PrimopWrappers.hs -o
dist/build/GHC/PrimopWrappers.dyn_o  -ohi
dist/build/GHC/PrimopWrappers.dyn_hi
/var/folders/+U/+U7M7S-rGmSi8lNlphaibU+++TI/-Tmp-//ghc36177_0/ghc36177_0.split__54.s:unknown:missing
indirect symbols for section (__DATA,__nl_symbol_ptr)
ghc: 105811188 bytes, 9 GCs, 606208/1093632 avg/max bytes residency (2
samples), 32M in use, 0.00 INIT (0.00 elapsed), 0.27 MUT (1.97 elapsed),
0.04 GC (0.05 elapsed) :ghc
make[3]: *** [dist/build/GHC/PrimopWrappers.dyn_o] Error 1
make[2]: *** [all] Error 1
make[1]: *** [make.library.ghc-prim] Error 2
make: *** [stage1] Error 2

I would really like to have a ghc that doesn't statically link GMP ;-)

Dave

On Sun, Mar 15, 2009 at 9:03 PM, Alan Mock docm...@gmail.com wrote:

 By default GMP builds for x86_64.  Do ./configure ABI=32 to build 32-bit
 libraries for GHC.


 On Mar 15, 2009, at 10:54 PM, Dean Herington wrote:

  I'm trying to install GHC 6.10.1 on Mac OS X 10.5 (PowerPC).  I installed
 Xcode 3.1.2.  I built libgmp 4.2.4 and installed it in /usr/local/lib.  When
 I do ./configure in GHC's dist directory, however, I get:

 bash-3.2$ ./configure
 checking build system type... powerpc-apple-darwin9.6.0
 checking host system type... powerpc-apple-darwin9.6.0
 checking target system type... powerpc-apple-darwin9.6.0
 Which we'll further canonicalise into: powerpc-apple-darwin
 checking for path to top of build tree... dyld: Library not loaded:
 /usr/local/lib/libgmp.3.dylib
  Referenced from:
 /Users/family/Desktop/Downloads/ghc-6.10.1/dist/utils/pwd/pwd
  Reason: no suitable image found.  Did find:
/usr/local/lib/libgmp.3.dylib: mach-o, but wrong architecture
/usr/local/lib/libgmp.3.dylib: mach-o, but wrong architecture
 configure: error: cannot determine current directory

 Any ideas what I'm doing wrong?

 Thanks.
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] libgmp for GHC 6.10.1 on Mac OS X 10.5

2009-03-17 Thread Dean Herington

At 8:56 PM -0700 3/17/09, David Leimbach wrote:

Did you get past this point?  I'm hitting:

== make way=dyn -f GNUmakefile all;
/Users/dave/Downloads/ghc-6.10.1/ghc/stage1-inplace/ghc 
-package-name ghc-prim-0.1.0.0 -hide-all-packages 
-no-user-package-conf -split-objs -i -idist/build -i. 
-idist/build/autogen -Idist/build/autogen -Idist/build -optP-include 
-optPdist/build/autogen/cabal_macros.h -odir dist/build -hidir 
dist/build -stubdir dist/build -package rts-1.0 -O -package-name 
ghc-prim -XCPP -XMagicHash -XForeignFunctionInterface 
-XUnliftedFFITypes -XUnboxedTuples -XEmptyDataDecls 
-XNoImplicitPrelude -fPIC -dynamic -hisuf dyn_hi -hcsuf dyn_hc -osuf 
dyn_o -idist/build  -H32m -O -O2 -Rghc-timing -XGenerics -Wall 
-fno-warn-deprecated-flags -c GHC/PrimopWrappers.hs -o 
dist/build/GHC/PrimopWrappers.dyn_o  -ohi 
dist/build/GHC/PrimopWrappers.dyn_hi
/var/folders/+U/+U7M7S-rGmSi8lNlphaibU+++TI/-Tmp-//ghc36177_0/ghc36177_0.split__54.s:unknown:missing 
indirect symbols for section (__DATA,__nl_symbol_ptr)
ghc: 105811188 bytes, 9 GCs, 606208/1093632 avg/max bytes 
residency (2 samples), 32M in use, 0.00 INIT (0.00 elapsed), 0.27 
MUT (1.97 elapsed), 0.04 GC (0.05 elapsed) :ghc

make[3]: *** [dist/build/GHC/PrimopWrappers.dyn_o] Error 1
make[2]: *** [all] Error 1
make[1]: *** [make.library.ghc-prim] Error 2
make: *** [stage1] Error 2


I installed a pre-built GHC, which seems to work with the libgmp I 
built (with ABI=32) and installed.  I haven't tried building GHC 
itself.




I would really like to have a ghc that doesn't statically link GMP ;-)

Dave

On Sun, Mar 15, 2009 at 9:03 PM, Alan Mock 
mailto:docm...@gmail.comdocm...@gmail.com wrote:


By default GMP builds for x86_64.  Do ./configure ABI=32 to build 
32-bit libraries for GHC.



On Mar 15, 2009, at 10:54 PM, Dean Herington wrote:

I'm trying to install GHC 6.10.1 on Mac OS X 10.5 (PowerPC).  I 
installed Xcode 3.1.2.  I built libgmp 4.2.4 and installed it in 
/usr/local/lib.  When I do ./configure in GHC's dist directory, 
however, I get:


bash-3.2$ ./configure
checking build system type... powerpc-apple-darwin9.6.0
checking host system type... powerpc-apple-darwin9.6.0
checking target system type... powerpc-apple-darwin9.6.0
Which we'll further canonicalise into: powerpc-apple-darwin
checking for path to top of build tree... dyld: Library not loaded: 
/usr/local/lib/libgmp.3.dylib
 Referenced from: 
/Users/family/Desktop/Downloads/ghc-6.10.1/dist/utils/pwd/pwd

 Reason: no suitable image found.  Did find:
   /usr/local/lib/libgmp.3.dylib: mach-o, but wrong architecture
   /usr/local/lib/libgmp.3.dylib: mach-o, but wrong architecture
configure: error: cannot determine current directory

Any ideas what I'm doing wrong?

Thanks.
___
Haskell-Cafe mailing list
mailto:Haskell-Cafe@haskell.orgHaskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafehttp://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
mailto:Haskell-Cafe@haskell.orgHaskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafehttp://www.haskell.org/mailman/listinfo/haskell-cafe



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] .hi inconsistency bug.

2009-03-17 Thread Daniel Gorín

Hi

Just a wild guess but maybe the interpreter is recompiling (in  
runtime) code that has already been compiled to build your application  
(in compile-time). This may lead to inconsistencies since a type such  
as HackMail.Data.Main.Types.Filter may refer to two different (and  
incompatible) types.


To see if this is the case, make sure your dynamic code is not  
located together with your base code (i.e., move it to another  
directory, and set the src file directory for the interpreter  
accordingly). Now you may get another runtime error, something along  
the lines of Module not found: HackMail.Data.MainTypes. This  
basically means that you need to make your (already compiled) types  
available to the interpreter. I think the simplest way is to put all  
your support types in a package, register it with ghc, link your  
application to it, and ask the interpreter to use this package (with a  
-package  flag).


Hope this helps!

Daniel

On Mar 17, 2009, at 11:52 PM, Joe Fredette wrote:


List,

I've got this project, source on patch-tag here[1]

It's a nice little project, I've got the whole thing roughly  
working, it compiles okay, everything seems to work, until I try to  
run it, specifically when I run it in ghci, or when I run the main  
executable (which uses hint), and look at any type involving my  
Email type, it gives me the following error:


  Type syonym HackMail.Data.MainTypes.Filter:
Can't find interface-file declaration for type constructor or  
class HackMail.Data.ParseEmail.Email

  Probable cause: bug in .hi-boot file, or inconsistent .hi file
  Use -ddump-if-trace to get an idea of which file caused the  
error


As far as I understand, it wants to find the interface-file  
declaration for a specific type (Email) exported by the ParseEmail  
module, all of the exports (I think) are in order. I've tried  
mucking around with it a bit, but I don't fully understand what the  
error even means, much less how to fix it.


Other relevant info, Email is exported in a roundabout way, namely  
by importing a module MainTypes, which exports a module Email, which  
exports a the ParseEmail Module, which exports the datatype Email.


The Filter delcaration it _actually_ complains about (it's just  
the first place the email type is invoked) is:


  type Filter a = ReaderT (Config, Email) IO a

nothing particularly special.

Any help fixing this is greatly appreciated, I did find this bug  
report[2] which seems like it might be relevant.


But trying to unregister - cabal clean - cabal install doesn't fix  
it. I've also tried manually removing the dist/ folder, and also  
unregistering the package.


Thanks again.

/Joe

[1] http://patch-tag.com/repo/Hackmail/browse
[2] http://hackage.haskell.org/trac/ghc/ticket/2057
jfredett.vcf___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] .hi inconsistency bug.

2009-03-17 Thread Daniel Gorín

Hi

Just a wild guess but maybe the interpreter is recompiling (in  
runtime) code that has already been compiled to build your application  
(in compile-time). This may lead to inconsistencies since a type such  
as HackMail.Data.Main.Types.Filter may refer to two different (and  
incompatible) types.


To see if this is the case, make sure your dynamic code is not  
located together with your base code (i.e., move it to another  
directory, and set the src file directory for the interpreter  
accordingly). Now you may get another runtime error, something along  
the lines of Module not found: HackMail.Data.MainTypes. This  
basically means that you need to make your (already compiled) types  
available to the interpreter. I think the simplest way is to put all  
your support types in a package, register it with ghc, link your  
application to it, and ask the interpreter to use this package (with a  
-package  flag).


Hope this helps!

Daniel

On Mar 17, 2009, at 11:52 PM, Joe Fredette wrote:


List,

I've got this project, source on patch-tag here[1]

It's a nice little project, I've got the whole thing roughly  
working, it compiles okay, everything seems to work, until I try to  
run it, specifically when I run it in ghci, or when I run the main  
executable (which uses hint), and look at any type involving my  
Email type, it gives me the following error:


 Type syonym HackMail.Data.MainTypes.Filter:
   Can't find interface-file declaration for type constructor or  
class HackMail.Data.ParseEmail.Email

 Probable cause: bug in .hi-boot file, or inconsistent .hi file
 Use -ddump-if-trace to get an idea of which file caused the error

As far as I understand, it wants to find the interface-file  
declaration for a specific type (Email) exported by the ParseEmail  
module, all of the exports (I think) are in order. I've tried  
mucking around with it a bit, but I don't fully understand what the  
error even means, much less how to fix it.


Other relevant info, Email is exported in a roundabout way, namely  
by importing a module MainTypes, which exports a module Email, which  
exports a the ParseEmail Module, which exports the datatype Email.


The Filter delcaration it _actually_ complains about (it's just  
the first place the email type is invoked) is:


 type Filter a = ReaderT (Config, Email) IO a

nothing particularly special.

Any help fixing this is greatly appreciated, I did find this bug  
report[2] which seems like it might be relevant.


But trying to unregister - cabal clean - cabal install doesn't fix  
it. I've also tried manually removing the dist/ folder, and also  
unregistering the package.


Thanks again.

/Joe

[1] http://patch-tag.com/repo/Hackmail/browse
[2] http://hackage.haskell.org/trac/ghc/ticket/2057
jfredett.vcf___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] symbolic evaluator for Haskell?

2009-03-17 Thread Eugene Kirpichov
Coq (coq.inria.fr) can do that, and its language has a resemblance to
Haskell. However, by dealing with Coq, you are heavily risking your
brain, so beware.

2009/3/18 Tim Newsham news...@lava.net:
 Is there a symbolic evaluator for Haskell that will perform all
 applications except on specified functions?  Ie. I would love
 something that would take

    foldr (+) (6 `div` 5) [1,2,3*4]

 and (+) (*) and return

   1 + (2 + (3*4 + 1))

 by performing all the applications except for (+) and (*).
 (Something that supports ghc extensions is preferred :)

 Tim Newsham
 http://www.thenewsh.com/~newsham/
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
Eugene Kirpichov
Web IR developer, market.yandex.ru
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: categories and monoids

2009-03-17 Thread wren ng thornton

Wolfgang Jeltsch wrote:

Am Dienstag, 17. März 2009 10:54 schrieben Sie:
 I'm reading the Barr/Wells slides at the moment, and they say the
 following:

 Thus a category can be regarded as a generalized monoid,

What is a “generalized monoid”? According to the grammatical construction 
(adjective plus noun), it should be a special kind of monoid, like a 
commutative monoid is a special kind of monoid. But then, monoids would be 
the more general concept and categories the special case, quite the opposite 
of how it really is.


Usually in math texts a Y is a generalized X means exactly Ys are a 
generalization of Xs, and thus Y is the larger class of objects got by 
relaxing some law in X. It's a description, not a name. E.g. Hilbert 
space is a generalized Euclidean space, Heyting algebras are generalized 
Boolean algebras, modules are generalized vector spaces, etc.


The compounding adjective+name=name scheme used for commutative X and 
such doesn't apply when the adjective happens to be generalized. That 
scheme isn't a general rule of English anyways (only a common rule of 
mathematics), as with Dan Piponi's fake gun.


--
Live well,
~wren
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] .hi inconsistency bug.

2009-03-17 Thread Joe Fredette
So, if I understand correctly, the interpreter is compiling MainTypes 
twice?


Could this be a result of having two outputs (one executable and one 
library) in my .cabal file? it _does_ compile those things twice... If I 
create a second cabal file which separates these two different packages, 
would that fix it?


The issue is, the (dynamic) interpreter part of my code is part of the 
main loop of the program, and is (as far as I can see) inseparable from 
the rest of the code.


I'll give the cabal thing a try, given the incredible triviality of 
doing everything with cabal, I should be done testing the solution 
before I hit the send button... Cabal guys, you rock.


Thanks again, Dan.

/Joe

Daniel Gorín wrote:

Hi

Just a wild guess but maybe the interpreter is recompiling (in 
runtime) code that has already been compiled to build your application 
(in compile-time). This may lead to inconsistencies since a type such 
as HackMail.Data.Main.Types.Filter may refer to two different (and 
incompatible) types.


To see if this is the case, make sure your dynamic code is not 
located together with your base code (i.e., move it to another 
directory, and set the src file directory for the interpreter 
accordingly). Now you may get another runtime error, something along 
the lines of Module not found: HackMail.Data.MainTypes. This 
basically means that you need to make your (already compiled) types 
available to the interpreter. I think the simplest way is to put all 
your support types in a package, register it with ghc, link your 
application to it, and ask the interpreter to use this package (with a 
-package  flag).


Hope this helps!

Daniel

On Mar 17, 2009, at 11:52 PM, Joe Fredette wrote:


List,

I've got this project, source on patch-tag here[1]

It's a nice little project, I've got the whole thing roughly working, 
it compiles okay, everything seems to work, until I try to run it, 
specifically when I run it in ghci, or when I run the main executable 
(which uses hint), and look at any type involving my Email type, it 
gives me the following error:


 Type syonym HackMail.Data.MainTypes.Filter:
   Can't find interface-file declaration for type constructor or 
class HackMail.Data.ParseEmail.Email

 Probable cause: bug in .hi-boot file, or inconsistent .hi file
 Use -ddump-if-trace to get an idea of which file caused the error

As far as I understand, it wants to find the interface-file 
declaration for a specific type (Email) exported by the ParseEmail 
module, all of the exports (I think) are in order. I've tried mucking 
around with it a bit, but I don't fully understand what the error 
even means, much less how to fix it.


Other relevant info, Email is exported in a roundabout way, namely by 
importing a module MainTypes, which exports a module Email, which 
exports a the ParseEmail Module, which exports the datatype Email.


The Filter delcaration it _actually_ complains about (it's just the 
first place the email type is invoked) is:


 type Filter a = ReaderT (Config, Email) IO a

nothing particularly special.

Any help fixing this is greatly appreciated, I did find this bug 
report[2] which seems like it might be relevant.


But trying to unregister - cabal clean - cabal install doesn't fix 
it. I've also tried manually removing the dist/ folder, and also 
unregistering the package.


Thanks again.

/Joe

[1] http://patch-tag.com/repo/Hackmail/browse
[2] http://hackage.haskell.org/trac/ghc/ticket/2057
jfredett.vcf___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



begin:vcard
fn:Joseph Fredette
n:Fredette;Joseph
adr:Apartment #3;;6 Dean Street;Worcester;Massachusetts;01609;United States of America
email;internet:jfred...@gmail.com
tel;home:1-508-966-9889
tel;cell:1-508-254-9901
x-mozilla-html:FALSE
url:lowlymath.net, humbuggery.net
version:2.1
end:vcard

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Design Patterns by Gamma or equivalent

2009-03-17 Thread wren ng thornton

Gregg Reynolds wrote:

Imperative programmers also used it to describe programming patterns.
Implementations of things like Observer/VIsitor etc. are ad-hoc,
informal constructions; the equivalent in a functional language is a
mathematical structure (feel free to fix my terminology).  I don't
think one needs design patterns for Haskell; it has mathematics and
more-or-less formal semantics.  Who needs Visitor when you have For
All?


In broad strokes I agree with the thesis, but this example is precisely 
one where functional languages run into the same issues as OO languages.


The Visitor pattern is obviated in functional languages if and only if 
you construct your recursive types as a fixed-point on a functor 
representing the open recursive form of your type. Given this you can 
invoke category-extras or similar libraries[1] to tie everything 
together for you. Otherwise you end up writing boilerplate functions 
which are groundings of cata and other recursion schemes.


In the Visitor pattern the visitor itself is your F-algebra, and each 
subtype of \mu F defines its piece of cata (in order to reflect the 
algebra back on itself and to tell it where to recurse). The algebra has 
to be written no matter what, since it's the one that does the real 
work. With category-extras you can define a single implementation of 
cata which works for all F; without it you write boilerplate groundings 
of cata for your specific F, exactly as in the Visitor pattern.


With a sufficiently expressive reflection system in OO you can do the 
same CT trick and use introspection to determine the pieces of cata. The 
functional CT version is generally cleaner, more efficient, and safer, 
but it still requires taking the steps toward CT as a templating 
language since functional programming by itself doesn't obviate the 
Visitor problem.


[1] Similar to OO reflection, you could instead use Template Haskell to 
crack open fixed-recursion types into their open-recursion variants and 
generate an instance of some Cata class, but once more it's the same 
trick all over again.


--
Live well,
~wren
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Ashley Yakeley

There are larger versions of most of them here:
http://www.haskell.org/haskellwiki/Haskell_logos/New_logo_ideas

30 should probably have been split up by typeface.

My votes: 68, 58, 59, 30, 6, 61, 3, 37, 34, 36, rest.

I had trouble choosing between my top four.

Note that votes cannot be modified after being cast.

Probably I'll be the one to update most appearances on haskell.org once 
we have a winner, though I think the logo appears in a number of places 
around the web.


--
Ashley Yakeley
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] symbolic evaluator for Haskell?

2009-03-17 Thread wren ng thornton

Tim Newsham wrote:

Is there a symbolic evaluator for Haskell that will perform all
applications except on specified functions?  Ie. I would love
something that would take

foldr (+) (6 `div` 5) [1,2,3*4]

and (+) (*) and return

   1 + (2 + (3*4 + 1))

by performing all the applications except for (+) and (*).
(Something that supports ghc extensions is preferred :)


Lambdabot (on #haskell) has something similar using a type, Expr, to 
overload certain names, e.g.


koninkjefoldr f z [1..5]
lambdabot  f 1 (f 2 (f 3 (f 4 (f 5 z

It's a complete hack and isn't as sophisticated as what you're after, 
but it could serve as a basis for implementation ideas.


--
Live well,
~wren
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe