Re: [Haskell-cafe] Re: cabal install HaXml installs wrong version unless I specify the version number

2008-11-16 Thread Stephan Friedrichs
Don Stewart wrote:
 [...]
 
 Note that packages that depend on the 'experimental' versions of things
 (in particular Haxml 1.19.* can't be packaged for Arch either, as we can
 only install one version of the haskell-haxml package).

In this case we definetely need haxml-1.19. IIRC we even committed
patches to the haxml repository, when we were developing Barracuda a
year ago :)

//Stephan

-- 

Früher hieß es ja: Ich denke, also bin ich.
Heute weiß man: Es geht auch so.

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


[Haskell-cafe] HAPPS on a major hosting provider?

2008-11-16 Thread Jefferson Heard
I was wondering if anyone's ever tried to run Haaps on a major hosting
provider, like oh, say Site5?  I have an app I'd otherwise use Rails
for and I thought I'd give Haaps a try...

-- Jeff


I try to take things like a crow; war and chaos don't always ruin a
picnic, they just mean you have to be careful what you swallow.

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


Re: [Haskell-cafe] Find unused exports

2008-11-16 Thread Jason Dagit
On Sun, Nov 16, 2008 at 5:35 AM, Thomas Schilling [EMAIL PROTECTED]
wrote:
 The relevant flag is: -ddump-minimal-imports

 See
http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html#id2630684

The documentation says this:

 -ddump-minimal-imports

Dump to the file M.imports (where M is the module being compiled) a
 minimal set of import declarations. You can safely replace all the import
 declarations in M.hs with those found in M.imports. Why would you want
 to do that? Because the minimal imports (a) import everything explicitly,
 by name, and (b) import nothing that is not required. It can be quite
 painful to maintain this property by hand, so this flag is intended to
 reduce the labour.


I already know the minimal set of import for the modules.  That's why I
mentioned using -Wall; ghc will complain if you import something and don't
use it.

The problem is that you can export names that never get used in other
modules.  I would like a tool that can look over a project and tell me which
exported names are never imported.  These names correspond to things that
can be removed from the project.

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


[Haskell-cafe] Type question in instance of a class

2008-11-16 Thread Maurí­cio

Hi,

Why is this wrong?


class MyClass r where function :: r - s

data MyData u = MyData u

instance MyClass (MyData v) where function (MyData a) = a


GHC says that the type of the result of 'function' is both determined by
the rigid type from MyClass and  the rigid type from MyData. But why
can't both be the same?

What am I doing wrong?

Thanks for your help,
Maurício

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


Re: [Haskell-cafe] Type question in instance of a class

2008-11-16 Thread Bulat Ziganshin
Hello Maurí­cio,

Monday, November 17, 2008, 12:32:11 AM, you wrote:

 class MyClass r where function :: r - s

this tells that f may return value of any type requested at the call
site, i.e. one can write

main = do print (f (Mydata 1) :: String)
  print (f (Mydata 1) :: [Bool])
  print (f (Mydata 1) :: Either Double Float)
  

 instance MyClass (MyData v) where function (MyData a) = a

this definition can return value of only one type, so it can't serve
all the calls i mentioned above

 GHC says that the type of the result of 'function' is both determined by
 the rigid type from MyClass and  the rigid type from MyData. But why
 can't both be the same?

are you OOPer? :)


ps: GHC error messages should be fired :)

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


Re: [Haskell-cafe] Type question in instance of a class

2008-11-16 Thread J. Garrett Morris
On Sun, Nov 16, 2008 at 1:32 PM, Maurí­cio [EMAIL PROTECTED] wrote:
 Hi,

 Why is this wrong?

 
 class MyClass r where function :: r - s

 data MyData u = MyData u

 instance MyClass (MyData v) where function (MyData a) = a
 

 GHC says that the type of the result of 'function' is both determined by
 the rigid type from MyClass and  the rigid type from MyData. But why
 can't both be the same?

As Bulat said, your type signature is equivalent to:

function :: forall r s. r - s

whereas the result you're producing can't produce any s, but only
particular s's.  In essence, the result type is determined by the
input type.  One way to code this would be to use functional
dependencies:

class MyClass r s | r - s where function :: r - s
data MyData u = MyData u
instance MyClass (MyData v) v where function (MyData a) = a

 /g

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


Re: [Haskell-cafe] Type question in instance of a class

2008-11-16 Thread Claude Heiland-Allen

Maurí­cio wrote:

Hi,

Why is this wrong?


class MyClass r where function :: r - s

data MyData u = MyData u

instance MyClass (MyData v) where function (MyData a) = a


GHC says that the type of the result of 'function' is both determined by
the rigid type from MyClass and  the rigid type from MyData. But why
can't both be the same?


particular instances can't add extra restrictions (eg: both types are 
the same) to the interface declared by the class (eg: both types are 
arbitrary).



Compare this version:

8
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
module Test where
class MyClass r s where function :: r - s
data MyData u = MyData u
instance MyClass (MyData v) v where function (MyData a) = a
8

And ghci session:

8
*Test function (MyData hello)

interactive:1:0:
No instance for (MyClass (MyData [Char]) s)
  arising from a use of `function' at interactive:1:0-24
Possible fix:
  add an instance declaration for (MyClass (MyData [Char]) s)
In the expression: function (MyData hello)
In the definition of `it': it = function (MyData hello)
*Test :t function (MyData hello)
function (MyData hello) :: (MyClass (MyData [Char]) s) = s
*Test function (MyData hello) :: String
hello
8

I don't know how evil those language extensions are, though - I just 
fiddled until it worked...



What am I doing wrong?



Claude
--
http://claudiusmaximus.goto10.org/

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


Re[2]: [Haskell-cafe] Type question in instance of a class

2008-11-16 Thread Bulat Ziganshin
Hello J.,

Monday, November 17, 2008, 12:56:02 AM, you wrote:

 class MyClass r where function :: r - s
 As Bulat said, your type signature is equivalent to:

 function :: forall r s. r - s

only

function :: forall s. r - s

(r is fixed in class header)



-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


Re: [Haskell-cafe] Type question in instance of a class

2008-11-16 Thread Jason Dagit
On Sun, Nov 16, 2008 at 2:01 PM, Claude Heiland-Allen 
[EMAIL PROTECTED] wrote:


 I don't know how evil those language extensions are, though - I just
 fiddled until it worked...


The only part of FlexibleInstances that you've used here is the ability to
mention a type variable more than once in the instance.  I really wish this
came with MultiParamTypeClasses.  My reasoning is this, FlexibleInstances
turns on a lot of extra stuff, as do functional dependencies.  And yet, once
you have multiparam type classes one of the natural things you want is the
ability to mention a type variable more than once but currently you have to
enable a lot of extra baggage to get that ability.

I'm not an expert, the way you've used them together seems quite sane and by
using those extensions instead of some of the more powerful ones you've
probably done yourself a favor :)

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


Re: [Haskell-cafe] HAPPS on a major hosting provider?

2008-11-16 Thread Jeremy Shaw
Hello,

I have run HAppS applications on VPSs from vpslink.com and
rimuhosting.com. 

If you want shared hosting, then you would need to get FastCGI support
working again (I assume it has bitrotted somewhat). Because of HAppS's
preference for storing everything in RAM, it is not really a
shared-host friendly architecture. 

A $14.95/month 128MB VPS from vpslink seems to work fine as a
entry-level solution though.

- jeremy

At Sun, 16 Nov 2008 14:04:51 -0500,
Jefferson Heard wrote:
 
 I was wondering if anyone's ever tried to run Haaps on a major hosting
 provider, like oh, say Site5?  I have an app I'd otherwise use Rails
 for and I thought I'd give Haaps a try...
 
 -- Jeff
 
 
 I try to take things like a crow; war and chaos don't always ruin a
 picnic, they just mean you have to be careful what you swallow.
 
 -- Jessica Edwards
 ___
 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] Re: Type question in instance of a class

2008-11-16 Thread Peter Hercek

Bulat Ziganshin wrote:

Hello J.,

Monday, November 17, 2008, 12:56:02 AM, you wrote:


class MyClass r where function :: r - s

As Bulat said, your type signature is equivalent to:



function :: forall r s. r - s


only

function :: forall s. r - s

(r is fixed in class header)



... and the only value the function can return is bottom.
Is there any type system which would have more than
 one value which inhabits all types?

Peter.

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


Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-16 Thread Luke Palmer
On Sun, Nov 16, 2008 at 5:06 PM, Peter Hercek [EMAIL PROTECTED] wrote:
 ... and the only value the function can return is bottom.
 Is there any type system which would have more than
  one value which inhabits all types?

Well something like lazy C# might; i.e. every value has a _|_
(nontermination) and null (termination but undefined).

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


Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-16 Thread David Menendez
On Sun, Nov 16, 2008 at 7:09 PM, Luke Palmer [EMAIL PROTECTED] wrote:
 On Sun, Nov 16, 2008 at 5:06 PM, Peter Hercek [EMAIL PROTECTED] wrote:
 ... and the only value the function can return is bottom.
 Is there any type system which would have more than
  one value which inhabits all types?

 Well something like lazy C# might; i.e. every value has a _|_
 (nontermination) and null (termination but undefined).

For that matter, Control.Exception allows you to distinguish
exceptional values from each other.

-- 
Dave Menendez [EMAIL PROTECTED]
http://www.eyrie.org/~zednenem/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Haskell Weekly News: Issue 93 - November 15, 2008

2008-11-16 Thread Neal Alexander

Brent Yorgey wrote:

---
ANN: OpenGL with extra type safety. Neal Alexander
Hopefully the code will be uploaded to Hackage as a separate package soon.


http://hackage.haskell.org/cgi-bin/hackage-scripts/package/OGL-0.0.0
http://haskell.org/haskellwiki/OGL

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


Re: [Haskell-cafe] Find unused exports

2008-11-16 Thread Michael D. Adams
Within a set of modules, the minimal imports also give you the minimal
exports since each minimal export is required because it is imported
somewhere.  Just compile all your modules with -ddump-minimal-imports,
then cat all your *.import files together and sort the result.  The
minimal exports for module Foo will be listed as several lines of the
form import Foo(x,y,z), etc.  From there on it's just a bit of text
munging to get it into your export list code (about two lines of
perl).

Michael D. Adams

2008/11/16 Jason Dagit [EMAIL PROTECTED]:


 On Sun, Nov 16, 2008 at 5:35 AM, Thomas Schilling [EMAIL PROTECTED]
 wrote:
 The relevant flag is: -ddump-minimal-imports

 See
 http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html#id2630684

 The documentation says this:

 -ddump-minimal-imports

Dump to the file M.imports (where M is the module being compiled) a
 minimal set of import declarations. You can safely replace all the import
 declarations in M.hs with those found in M.imports. Why would you want
 to do that? Because the minimal imports (a) import everything explicitly,
 by name, and (b) import nothing that is not required. It can be quite
 painful to maintain this property by hand, so this flag is intended to
 reduce the labour.

 I already know the minimal set of import for the modules.  That's why I
 mentioned using -Wall; ghc will complain if you import something and don't
 use it.

 The problem is that you can export names that never get used in other
 modules.  I would like a tool that can look over a project and tell me which
 exported names are never imported.  These names correspond to things that
 can be removed from the project.

 Thanks,
 Jason

 ___
 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] Find unused exports

2008-11-16 Thread Jason Dagit
On Sun, Nov 16, 2008 at 5:10 PM, Michael D. Adams [EMAIL PROTECTED]wrote:

 Within a set of modules, the minimal imports also give you the minimal
 exports since each minimal export is required because it is imported
 somewhere.  Just compile all your modules with -ddump-minimal-imports,
 then cat all your *.import files together and sort the result.  The
 minimal exports for module Foo will be listed as several lines of the
 form import Foo(x,y,z), etc.  From there on it's just a bit of text
 munging to get it into your export list code (about two lines of
 perl).


Alright, that's the same manual process I do now.  I didn't use
-ddump-minimal-imports before because I didn't know about it and we maintain
sufficiently minimal imports already.  That and I used emacs macros instead
of perl because I already know how to use emacs :)

If I take the time to automate this I wonder if it's a worthwhile tool to
upload to hackage.  Sounds like others have been doing this sort of thing.

Now if I just had a round touit...

Thanks everyone!

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