Re: [Haskell-cafe] Haskell and symbolic references

2009-05-31 Thread Matt Morrow
(i always forget to reply-to-all) If you'd like to reference C functions with Strings, one possible way is to use System.Posix.DynamicLinker and the wrapper over libffi that's been uploaded to hackage recently: [...@monire asdf]$ ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for

[Haskell-cafe] Question on kind inference

2009-05-31 Thread Vladimir Reshetnikov
Hi, Consider this Haskell code: --- class A a where foo :: a b class B a class (A a, B a) = C a --- GHC compiles it without errors, but Hugs rejects it: Illegal type in class constraint. What is the

[Haskell-cafe] Which type variables are allowed in a context?

2009-05-31 Thread Vladimir Reshetnikov
Hi, Consider this (a bit pathological) Haskell code: -- class A a where foo :: A (b d) = a (c b) -- GHC compiles it successfully, but Hugs rejects it: Ambiguous type signature in class declaration *** ambiguous type : (A

[Haskell-cafe] (no subject)

2009-05-31 Thread Vladimir Reshetnikov
Hi, Seems that Haskell allows to specify dummy type variables in a declaration of a type synonym, which do not appear in its right-hand side. This can lead to interesting effects, which appears differently in GHC and Hugs. I would like to know, what behavior is correct according to the haskell 98

[Haskell-cafe] GHCi vs. Hugs (record syntax)

2009-05-31 Thread Vladimir Reshetnikov
Hi, I tried to evaluate this expression: head[[]{}] GHCi: [] Hugs: ERROR - Empty field list in update What is the correct behavior? Thanks, Vladimir ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] GHCi vs. Hugs (record syntax)

2009-05-31 Thread Ryan Ingram
Hi Vladimir, I don't have any answers for your questions, but what are you trying to do that's causing you to play with the edges of the parser/type system? -- ryan On Sun, May 31, 2009 at 12:41 AM, Vladimir Reshetnikov v.reshetni...@gmail.com wrote: Hi, I tried to evaluate this

Re: [Haskell-cafe] Parsing command lines

2009-05-31 Thread Kalman Noel
Patai Gergely schrieb: is there a function that can safely split a command line into a FilePath to the executable and its parameters? In the yi source code, in HConf.Utils, there's a function that does part of what you want, but maybe incorrectly (because I wrote it, and it traverses the

Re: [Haskell-cafe] Question on kind inference

2009-05-31 Thread Claus Reinke
--- class A a where foo :: a b class B a class (A a, B a) = C a --- GHC compiles it without errors, but Hugs rejects it: Illegal type in class constraint. The error message is horribly uninformative.

Re: [Haskell-cafe] Which type variables are allowed in a context?

2009-05-31 Thread Claus Reinke
-- class A a where foo :: A (b d) = a (c b) -- GHC compiles it successfully, but Hugs rejects it: Ambiguous type signature in class declaration *** ambiguous type : (A a, A (b c)) = a (d b) *** assigned to: foo 'd'

Re: [Haskell-cafe] (no subject)

2009-05-31 Thread Claus Reinke
-- type F a = Int class A a where foo :: A b = a (F b) -- GHC - OK Hugs - Illegal type F b in constructor application This time, I'd say Hugs is wrong (though eliminating that initial complaint leads back to an

Re: [Haskell-cafe] GHCi vs. Hugs (record syntax)

2009-05-31 Thread Claus Reinke
head[[]{}] GHCi: [] Hugs: ERROR - Empty field list in update What is the correct behavior? Seems as if GHC interprets []{} as labelled construction instead of labelled update - 3 Expressions (the grammar productions): | qcon { fbind1 , ... , fbindn } (labeled construction, n=0) |

Re: [Haskell-cafe] Re: Lazy Parsing

2009-05-31 Thread Stephen Tetley
Hi Günther The code below should work for your simple example, provided it hasn't lost formatting when I pasted it in to the email. I was a bit surprised that there is no pSatisfy in this library, but there are parsers for digits, lower case, upper case letters etc. in the Examples module that

Re: [Haskell-cafe] (no subject)

2009-05-31 Thread Claus Reinke
-- type F a = Int class A a where foo :: A b = a (F b) -- GHC - OK Hugs - Illegal type F b in constructor application This time, I'd say Hugs is wrong (though eliminating that initial complaint leads back to an

Re: [Haskell-cafe] Type families in export lists

2009-05-31 Thread Manuel M T Chakravarty
Lee Duhem: On Sat, May 30, 2009 at 7:35 PM, Maurí cio briqueabra...@yahoo.com wrote: Hi, How do I include type families (used as associated types) in a module export list? E.g.: class MyClass a where type T a :: * coolFunction :: Ta - a (...) If I just include MyClass and its

Re: [Haskell-cafe] Type families in export lists

2009-05-31 Thread Lee Duhem
On Sun, May 31, 2009 at 7:10 PM, Manuel M T Chakravarty c...@cse.unsw.edu.au wrote: Lee Duhem: On Sat, May 30, 2009 at 7:35 PM, Maurí cio briqueabra...@yahoo.com wrote: Hi, How do I include type families (used as associated types) in a module export list? E.g.: class MyClass a where  

Re: [Haskell-cafe] Re: Lazy Parsing

2009-05-31 Thread Malcolm Wallace
It is my pleasure to announce that after 5 days of experimenting with uu-parsinglib I have absolutely no clue, whatsoever, on how to use it. I do not even manage to write a parser for even a mere digit or a simple character. I don't know whether you will be willing to change over to

[Haskell-cafe] Re: Lazy Parsing

2009-05-31 Thread Guenther Schmidt
Dear Doaitse, thank you very much for your help. I am curious to know what made you go wrong with the tutorial, and caused that you could not find the solution below? Well let's first agree that I'm not very bright. I hate to admit it, but it's a simple fact ;-). Second let's agree that

[Haskell-cafe] Re: Lazy Parsing

2009-05-31 Thread Gü?nther Schmidt
Dear Malcom, thanks for helping. I had actually come to Haskell originally because of a parsing problem. I had been using Smalltalk until I started a project which required parsing files. Until then I had not done any RW parsing. Well the route was more a Parsec - Haskell, wtf is Haskell?

Re: [Haskell-cafe] Re: Lazy Parsing

2009-05-31 Thread Stephen Tetley
Hi Günther I suspect the problem you were having is that there are various 'parsers' (more correctly 'parser types') defined in Text.ParserCombinators.UU.Parsing and the code you had in your running example didn't always have enough information to allow GHC to pick a particular one. The /test/

[Haskell-cafe] ANN: new version of uu-parsinglib

2009-05-31 Thread S. Doaitse Swierstra
A new version of the uu-parsinglib has been uploaded to hackage. It is now based on Control.Applicative where possible. Be warned that functions like some and many will be redefined in the future. Doaitse Swierstra ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] ANN: new version of uu-parsinglib

2009-05-31 Thread Conor McBride
On 31 May 2009, at 20:40, S. Doaitse Swierstra wrote: A new version of the uu-parsinglib has been uploaded to hackage. It is now based on Control.Applicative where possible. It's mutual. Cheers Conor ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: Lazy Parsing

2009-05-31 Thread S . Doaitse Swierstra
Dear Gunther, I am providing my solution, on which one can of course specialise in making sure that a valid date is parsed, which would be a bit more cumbersome; how should e.g. error correction be done. I prefer to test afterwards in such situations. Best, Doaitse module Guenther

Re: [Haskell-cafe] Re: Error message reform

2009-05-31 Thread wren ng thornton
Tillmann Rendel wrote: wren ng thornton wrote: (Though it doesn't necessarily generalize to cover similar messages like: Prelude :t (\x - x) :: a - b interactive:1:7: Couldn't match expected type `b' against inferred type `a' `b' is a rigid type variable bound by

Re[2]: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-31 Thread Henning Thielemann
On Thu, 28 May 2009, Bulat Ziganshin wrote: i use another approach which imho is somewhat closer to interpretation of logical operations in dynamic languages (lua, ruby, perl): a ||| b | isDefaultValue a = b | otherwise= a a b | isDefaultValue a = defaultValue |

Re: [Haskell-cafe] Parsec float

2009-05-31 Thread wren ng thornton
Jason Dusek wrote: 2009/05/30 Bartosz Wójcik bar...@sudety.it: ...reading RWH I could not memorize what those liftM funtions meant. The basic one, `liftM`, means `fmap`, though specialized for functors that are monads. Prelude Control.Monad :t liftM liftM :: forall a b (m :: * -

Re: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-31 Thread Henning Thielemann
On Thu, 28 May 2009, Claus Reinke wrote: Just, please, keep in mind that there is no one-size-fits-all: improving a message for one group of users might well make it less useful for another group. I once thought, that error messages must be configurable by libraries, too. This would be

Re: [Haskell-cafe] ANN: new version of uu-parsinglib

2009-05-31 Thread Ross Paterson
On Sun, May 31, 2009 at 09:40:38PM +0200, S. Doaitse Swierstra wrote: A new version of the uu-parsinglib has been uploaded to hackage. It is now based on Control.Applicative where possible. Be warned that functions like some and many will be redefined in the future. Perhaps we should

Re: [Haskell-cafe] How to implement this? A case for scoped record labels?

2009-05-31 Thread Brandon S. Allbery KF8NH
On May 25, 2009, at 08:20 , ntu...@googlemail.com wrote: data HandshakeRequest = HandshakeRequest { channel :: String , ... } data HandshakeResponse = HandshakeResponse { channel :: String, successful :: Bool, ... } ... data BayeuxMessage = HSReq HandshakeRequest | HSRes HandshakeResponse

[Haskell-cafe] Umlauts in command line arguments

2009-05-31 Thread GüŸnther Schmidt
Hi all, When a command line argument contains an umlaut that argument gets garbled. I'm using ghc 6.10.2 on Win XP. Are there any known solutions for this problem? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Umlauts in command line arguments

2009-05-31 Thread Gwern Branwen
On Sun, May 31, 2009 at 8:24 PM, GüŸnther Schmidt gue.schm...@web.de wrote: Hi all, When a command line argument contains an umlaut that argument gets garbled. I'm using ghc 6.10.2 on Win XP. Are there any known solutions for this problem? Günther GHC mangles UTF by default. You probably

Re: [Haskell-cafe] How to implement this? A case for scoped record labels?

2009-05-31 Thread Iavor Diatchki
Hi, Using a type class in the way Wren suggests seems to be the right way to do this in Haskell, as it is at the moment. I don't think that this an inappropriate use of type classes at all---in fact, it is exactly what type classes were designed to do (i.e., allow you to reuse the same name at