Re: [GHC] #3676: realToFrac doesn't sanely convert between floating types

2010-02-10 Thread GHC
#3676: realToFrac doesn't sanely convert between floating types
--+-
Reporter:  draconx|Owner:  
Type:  bug|   Status:  new 
Priority:  normal |Milestone:  6.12.2  
   Component:  libraries (other)  |  Version:  6.12.1  
Keywords: |   Difficulty:  
  Os:  Unknown/Multiple   | Testcase:  
Architecture:  x86_64 (amd64) |  Failure:  None/Unknown
--+-

Comment(by simonpj):

 Yes, that's because the library `GHC.Float` contains the (clearly
 incorrect) RULE
 {{{
 realToFrac/Double-Double realToFrac   = id :: Double - Double
 }}}
 This ticket really really needs someone who knows and cares about numbers
 to figure out what the Right Thing is.  It's a library issue involving
 only Haskell source code.  Would someone like to help?

 Thanks

 Simon

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3676#comment:5
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3866: Constr Eq instance should have better documentation or semantics

2010-02-10 Thread GHC
#3866: Constr Eq instance should have better documentation or semantics
-+--
Reporter:  batterseapower|   Owner:  dreixel  
Type:  bug   |  Status:  assigned 
Priority:  normal|   Component:  libraries (other)
 Version:  6.12.1|Keywords:  syb  
  Os:  Unknown/Multiple  |Testcase:   
Architecture:  Unknown/Multiple  | Failure:  None/Unknown 
-+--

Comment(by NeilMitchell):

 dreixel: Thanks for doing and patch and writing some better documentation.
 However, wouldn't it be better to avoid details of the implementation,
 skip the bug report link, and just document the API. How about:

 {{{
 -- | Representation of constructors. Note that equality on constructors
 with different types may not work -- i.e. the constructors for 'False' and
 'Nothing' may compare equal.
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3866#comment:3
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #3872: New way to make the simplifier diverge

2010-02-10 Thread GHC
#3872: New way to make the simplifier diverge
-+--
Reporter:  simonpj   |Owner:  
Type:  bug   |   Status:  new 
Priority:  normal|Milestone:  _|_ 
   Component:  Compiler  |  Version:  6.12.1  
Keywords:|   Difficulty:  
  Os:  Unknown/Multiple  | Testcase:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--
 GHC's simplifier can go into a loop if you use fixpoints in a funny way,
 as documented here
 http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs.html#bugs-ghc
 (12.2.1, third bullet). But GADTs provide new opportunities.  This ticket
 records one, thanks to Ryan Ingram and Matthieu Sozeau:
 {{{
 {-# LANGUAGE GADTs #-}
 module Contr where

 newtype I f = I (f ())
 data R o a where R :: (a (I a) - o) - R o (I a)

 run :: R o (I (R o)) - R o (I (R o)) - o
 run x (R f) = f x
 rir :: (R o) (I (R o))
 rir = R (\x - run x x)

 absurd :: a
 absurd = run rir rir
 }}}
 Now the simplifier can loop.  Look:
 {{{
 run rir rir

 = {inline run}
   case rir of R f - f rir

 = {case of known constructor}
   let { f = \x - run x x } in f rir

 = {inline f}
   run rir rir
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3872
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3845: compiling template haskell internal error: ... not in scope during type checking, but it passed the renamer

2010-02-10 Thread GHC
#3845: compiling template haskell internal error: ... not in scope during type
checking, but it passed the renamer
-+--
Reporter:  JakeWheat |Owner:  
Type:  bug   |   Status:  new 
Priority:  normal|Milestone:  
   Component:  Compiler  |  Version:  6.12.1  
Keywords:|   Difficulty:  
  Os:  Unknown/Multiple  | Testcase:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--

Comment(by simonpj):

 Fixed in the HEAD by
 {{{
 Wed Feb 10 06:51:55 PST 2010  simo...@microsoft.com
   * Keep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845

   To print HsTypes correctly we should remember whether the Kind on
   a HsTyVarBndr came from type inference, or was put there by the
   user.  See Note [Printing KindedTyVars] in HsTypes.  So instead of
   changing a UserTyVar to a KindedTyVar during kind checking, we
   simply add a PostTcKind to the UserTyVar.

   The change was provoked by Trac #3830, although other changes
   mean that #3830 gets a diferent and better error message now.
   So this patch is simply doing the Right Thing for the future.

   This patch also fixes Trac #3845, which was caused by a *type splice*
   not remembering the free *term variables* mentioned in it.  Result
   was that we build a 'let' when it should have been 'letrec'.
   Hence a new FreeVars field in HsSpliceTy.

   While I was at it, I got rid of HsSpliceTyOut and use a PostTcKind
   on HsSpliceTy instead, just like on the UserTyVar.

 M ./compiler/deSugar/DsMeta.hs -6 +7
 M ./compiler/hsSyn/Convert.lhs -1 +1
 M ./compiler/hsSyn/HsDecls.lhs -1 +1
 M ./compiler/hsSyn/HsTypes.lhs -31 +53
 M ./compiler/hsSyn/HsUtils.lhs -1 +5
 M ./compiler/parser/Parser.y.pp -8 +6
 M ./compiler/parser/RdrHsSyn.lhs -4 +2
 M ./compiler/rename/RnHsSyn.lhs -3 +2
 M ./compiler/rename/RnTypes.lhs -5 +4
 M ./compiler/typecheck/TcClassDcl.lhs -1 +2
 M ./compiler/typecheck/TcEnv.lhs -6 +3
 M ./compiler/typecheck/TcGenDeriv.lhs -1 +2
 M ./compiler/typecheck/TcHsType.lhs -45 +14
 M ./compiler/typecheck/TcSplice.lhs -7 +5
 M ./compiler/typecheck/TcSplice.lhs-boot -1 +2
 M ./compiler/typecheck/TcTyClsDecls.lhs -16 +16
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3845#comment:2
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3676: realToFrac doesn't sanely convert between floating types

2010-02-10 Thread GHC
#3676: realToFrac doesn't sanely convert between floating types
--+-
Reporter:  draconx|Owner:  
Type:  bug|   Status:  new 
Priority:  normal |Milestone:  6.12.2  
   Component:  libraries (other)  |  Version:  6.12.1  
Keywords: |   Difficulty:  
  Os:  Unknown/Multiple   | Testcase:  
Architecture:  x86_64 (amd64) |  Failure:  None/Unknown
--+-

Comment(by isaacdupree):

 my gut feeling has been there should be a function or functions
 specifically to convert between different floating types.  I think this is
 something that needs to be invented and proposed on libraries@ .  (I'm not
 volunteering to do it this week because I'm going to a conference, but I'm
 willing to get the conversation started next week)

 -Isaac Dupree

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3676#comment:6
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3845: compiling template haskell internal error: ... not in scope during type checking, but it passed the renamer

2010-02-10 Thread GHC
#3845: compiling template haskell internal error: ... not in scope during type
checking, but it passed the renamer
-+--
Reporter:  JakeWheat |Owner:  
Type:  bug   |   Status:  new 
Priority:  normal|Milestone:  
   Component:  Compiler  |  Version:  6.12.1  
Keywords:|   Difficulty:  
  Os:  Unknown/Multiple  | Testcase:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--

Comment(by JakeWheat):

 Replying to [comment:1 simonpj]:
   So we have two alternatives
* Fix it in the HEAD, but not 6.12
* Fix it in 6.12, but thereby change the 6.12 API a bit
 
  Any opinions?  Can you use the HEAD?
 
  The default is the first alternative.

 The default is fine for me.

 Thanks.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3845#comment:3
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #3873: template haskell: incorrect Warning: defined but not used

2010-02-10 Thread GHC
#3873: template haskell: incorrect Warning: defined but not used
-+--
Reporter:  JakeWheat |   Owner: 
  
Type:  bug   |  Status:  new
  
Priority:  normal|   Component:  Compiler   
  
 Version:  6.12.1|Keywords: 
  
  Os:  Unknown/Multiple  |Testcase: 
  
Architecture:  Unknown/Multiple  | Failure:  Incorrect warning at 
compile-time
-+--
 example code:
 {{{
 {-# LANGUAGE TemplateHaskell #-}

 module THWarnBug where

 import Language.Haskell.TH

 mhlt :: Q Type
 mhlt = do
   let u = [t| String |]
   [t| $u |]

 }}}

 compiling gives:

 {{{
 $ ghc -c -Wall THWarnBug.hs

 THWarnBug.hs:9:6: Warning: Defined but not used: `u'
 }}}

 but obviously u is used.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3873
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #3874: GHC.Exts.traceEvent segfaults

2010-02-10 Thread GHC
#3874: GHC.Exts.traceEvent segfaults
---+
Reporter:  cjs |   Owner: 
Type:  bug |  Status:  new
Priority:  normal  |   Component:  Runtime System 
 Version:  6.12.1  |Keywords:  event, eventlog
  Os:  Linux   |Testcase: 
Architecture:  x86_64 (amd64)  | Failure:  None/Unknown   
---+
 When I call the GC.Exts.traceEvent function (argument: hello) with event
 logging enabled (i.e., compiled with -eventlog and run with -ls) my
 program generates a segmentation fault. Here is the gdb backtrace:
 {{{
 #0  0x7f3ad6744a2f in vfprintf () from /lib/libc.so.6
 #1  0x7f3ad677039a in vsnprintf () from /lib/libc.so.6
 #2  0x004476c4 in postLogMsg (eb=0x8160d0, type=19,
 msg=0x7f3ad5d7e010 hello, ap=0x0) at rts/eventlog/EventLog.c:403
 #3  0x00447853 in postUserMsg (cap=0x69b780,
 msg=0x7f3ad5d7e010 hello) at rts/eventlog/EventLog.c:433
 #4  0x0043b012 in traceUserMsg (cap=0x69b780,
 msg=0x7f3ad5d7e010 hello) at rts/Trace.c:290
 #5  0x0044e237 in stg_traceEventzh ()
 #6  0x in ?? ()
 }}}
 It's not at all clear to me what could be going wrong here.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3874
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3874: GHC.Exts.traceEvent segfaults

2010-02-10 Thread GHC
#3874: GHC.Exts.traceEvent segfaults
---+
Reporter:  cjs |   Owner: 
Type:  bug |  Status:  new
Priority:  normal  |   Component:  Runtime System 
 Version:  6.12.1  |Keywords:  event, eventlog
  Os:  Linux   |Testcase: 
Architecture:  x86_64 (amd64)  | Failure:  None/Unknown   
---+

Comment(by cjs):

 Oh, and for further fun, I've walked through the calls from traceMessage
 down, and I don't see anywhere where we check for format specifiers in the
 string the user passes in. I think we want to change this function:
 {{{
 void postUserMsg(Capability *cap, char *msg)
 {
 postLogMsg(capEventBuf[cap-no], EVENT_USER_MSG, msg, NULL);
 }
 }}}
 to have the body
 {{{
 postLogMsg(capEventBuf[cap-no], EVENT_USER_MSG, %s, msg, NULL);
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3874#comment:1
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3874: GHC.Exts.traceEvent segfaults

2010-02-10 Thread GHC
#3874: GHC.Exts.traceEvent segfaults
---+
Reporter:  cjs |   Owner: 
Type:  bug |  Status:  new
Priority:  normal  |   Component:  Runtime System 
 Version:  6.12.1  |Keywords:  event, eventlog
  Os:  Linux   |Testcase: 
Architecture:  x86_64 (amd64)  | Failure:  None/Unknown   
---+

Comment(by cjs):

 You can't call varargs functions like that, at least not on this system.
 Also, we need to fix that printf format args issue. So here's your new
 code:
 {{{
 void postUserMsg(Capability *cap, char *msg)
 {
 postFormatUserMsg(cap, %s, msg);
 }

 static void postSafeuserMsg(Capability *cap, char *format, ...)
 {
 va_list ap;
 va_start(ap, format);
 postLogMsg(capEventBuf[cap-no], EVENT_USER_MSG, format, ap);
 va_end(ap);
 }
 }}}
 Note that there are a few other places in the code where you'll have to do
 similar things, such as in rts/Trace.c the call to traceCap_stderr in
 traceUserMsg.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3874#comment:2
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


RE: Overlapping Instances + Existentials = Incoherent Instances

2010-02-10 Thread Simon Peyton-Jones
This is a tricky one.  The motivating example is this:

  -- Overlapping instances
  instance Show a = Show [a] where ...
  instance Show Char where ...

  data T where
   MkT :: Show a = [a] - T

  f :: T - String
  f (MkT xs) = show xs ++ \n

Here it's clear that the only way to discharge the (Show [a]) constraint on 'x' 
is with the (Show a) dictionary stored inside the MkT.   Yet doing so means 
ignoring the possibility that a=Char.  So, for example, if we go

  h = case MkT boo of MkT xs - show xs ++ \n

we'll get the output string ['b','o','o'], not boo.

So yes, that's incoherent, in the sense that if we did the case-elimination 
we'd get (show boo ++ \n), and that would give a different result.   

Why does GHC have this behaviour?  Because in the case of type signature, such 
as

   g :: [a] - String
   g xs = show xs ++ \n

we can change g's type signature to make it compile without having to choose 
which instance to use:

   g :: Show [a] = [a] - String

But with an existential type there is no way we can alter 'f' to make it work; 
it's the definition of T that would have to change.


So I can't say it's perfect, but it seems too much of a Big Hammer to say 
IncoherentInstances for f.  Anyway, that's the rationale.

Simon


| -Original Message-
| From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-users-
| boun...@haskell.org] On Behalf Of Dan Doel
| Sent: 03 February 2010 03:08
| To: glasgow-haskell-users@haskell.org
| Subject: Overlapping Instances + Existentials = Incoherent Instances
| 
| Greetings,
| 
| I've actually known about this for a while, but while discussing it, it
| occurred to me that perhaps it's something I should report to the proper
| authorities, as I've never seen a discussion of it. But, I thought I'd start
| here rather than file a bug, since I'm not sure it isn't intended. Anyhow,
| here's the example:
| 
|   class C a where
| foo :: a - String
| 
|   instance C a where
| foo _ = universal
| 
|   instance C Int where
| foo _ = Int
| 
|   bar :: a - String
|   bar x = foo x
| 
| Now, normally bar generates a complaint, but if you enable
| IncoherentInstances, it's accepted, and it always generates universal, even
| if called with an Int. Adding a 'C a' constraint to the type makes it give
| Int in the case of an Int.
| 
| Now, IncoherentInstances is something most people would suggest you don't use
| (even people who are cool with OverlappingInstances). However, it turns out
| that ExistentialQuantification does the same thing, because we can write:
| 
|   data Ex = forall a. Ex a
| 
|   baz :: a - String
|   baz x = case Ex x of
|Ex x' - foo x'
| 
| and this is accepted, and always yields universal, just like bar. So, things
| that you get out of an existential are allowed to make use of the general
| versions of overlapping instances if any fit.
| 
| So, I never really regarded this as anything more than an oddity that's
| unlikely to come up. And it might be working as intended. But I thought
| perhaps I should ask: is this intended? One could probably build a case that
| baz should only be accepted if IncoherentInstances are enabled, since it's
| doing about the same thing.
| 
| I'm not really sure how far back this behavior goes. I've probably known about
| it for several 6.X releases without mentioning it except as a fun party fact
| (apologies). Is this the way things are supposed to work? (And sorry if I just
| missed the discussion somewhere. I searched the trac and didn't see anything
| very promising.)
| 
| Cheers,
| -- Dan
| ___
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


[Haskell] Fun in the Afternoon, London, 17th Feb (next Wednesday)

2010-02-10 Thread Neil Mitchell
Dear functional programmers,

Standard Chartered Bank in London will be hosting the next Fun In The
Afternoon event on Wednesday the 17th of February. The program of
talks, with abstracts, is at the bottom of this email. Everyone is
welcome!

If you would like to come, please email me (ndmitchell -AT- gmail
-DOT- com) with your name and affiliation by the 15th of Feb (late
registrations will probably be accommodated, but we do need to print
out name badges).

Address:
1 Basinghall Avenue, London EC2V 5DD
http://maps.google.co.uk/maps?q=standard+chartered+bankie=UTF8hl=enhq=standard+chartered+bankhnear=London,+UKll=51.517796,-0.091581spn=0.007023,0.01929z=16iwloc=A

Moorgate is the nearest tube station, but London Liverpool Street
train/tube station and Bank tube station are easily walkable.

Time:

The event starts at 1:10pm and finishes at 4:30pm. As traditional,
there will be beer/food afterwards.

Schedule:

12:00-1:10, arrive at Standard Chartered. We'll find lunch somewhere
nearby. Tell the reception you are attending Fun in the Afternoon.
If you have any difficulties getting there, or can't find anyone when
you arrive, phone me on 07876 126 574

1:10-1:15, Introduction

1:15-2:00, Invited talk, TBC

2:00-2:15, break

2:15-2:45, Zhaohui Luo, On Subtyping for Type Theories with Canonical Objects

2:45-3:15, George Giorgidze, Declarative Hybrid Modelling and
Simulation in Haskell

3:15-3:30, break

3:30-4:00, Dominic Orchard, Haskell Type Constraints Unleashed

4:00-4:30, Malcolm Wallace, Pointless fusion for pointwise application

4:30-6:00, Pub

6:00, Dinner

Abstracts:

== Zhaohui Luo, On Subtyping for Type Theories with Canonical Objects

Two different notions of subtyping have been studied in the
literature: subsumptive subtyping that employs the subsumption rule
and coercive subtyping that uses implicit coercions. They are suitable
for different kinds of type systems: subsumptive subtyping for type
assignment systems such as the polymorphic calculi in programming
languages and coercive subtyping for the type theories with canonical
objects such as Martin-Lof's type theory implemented in proof
assistants.

In this talk, we explain that subsumptive subtyping is incompatible
with the idea of canonical object and cannot be employed to reflect,
for example, structural subtyping for inductive types in a type theory
with canonical objects. Coercive subtyping, on the other hand, can be
used in such type theories to deal with structural and non-structural
subtyping relations satisfactorily and has interesting and useful
applications.

If time permits, we shall show how the formal relationship between
these two notions of subtyping can be studied by demonstrating how a
type system of dependent types with subsumptive subtyping can be
transformed faithfully into one with coercive subtyping.

== George Giorgidze, Declarative Hybrid Modelling and Simulation in Haskell

Mathematical modelling and simulation of physical systems plays an
important role in design, implementation and analysis of systems in
numerous areas of science and engineering, e.g., electrical
engineering, astronomy, particle physics, biology, climatology,
automotive industry and finance (to mention just few). To cope with
ever increasing size and complexity of real-world systems, a number of
declarative domain specific languages (DSLs) have been developed for
mathematical modelling and simulation.

In the first half of the talk, I will give a brief overview of the
state-of-the-art languages for modelling and simulation and identify
their shortcomings with respect to reusability, composability and
hybrid (mixed discrete and continuous time) simulation. Next, I will
introduce a Haskell-embedded DSL for declarative modelling and
simulation that addresses some of these shortcomings. The DSL features
first-class implicitly formulated equational constrains allowing for
higher-order modelling and simulation of highly structurally dynamic,
hybrid systems that goes beyond what current languages can simulate.
In particular, it allows repeated generation and just-in-time (JIT)
compilation of updated equational constrains during the simulation,
depending on the results thus far.

The embedding approach that we use should be of general interest and
usable in other domains as well. In the second half of the talk, I
will describe the embedding approach in detail. I will show how to use
mixed-level (combination of deep and shallow) embedding and LLVM JIT
compiler to implement an iteratively staged DSL (characterised by
repeated program generation, compilation and execution) efficiently in
a host language that does not provide built-in multi-stage programming
capabilities.

== Dominic Orchard, Haskell Type Constraints Unleashed

The popular Glasgow Haskell Compiler extends the Haskell 98 type system with
several powerful features, leading to an expressive language of type terms. In
contrast, constraints over types have received much less attention,
creating 

Re: Negation

2010-02-10 Thread Sebastian Fischer


On Feb 9, 2010, at 10:43 PM, S. Doaitse Swierstra wrote:

-- but if we now unfold the definition of one we get a parser error  
in GHC

increment' = ( let x=1 in x  +  )

The GHC and Hugs parsers are trying so hard to adhere to the meta  
rule that bodies of let-expressions
extend as far as possible when needed in order to avoid ambiguity,  
that they even apply that rule when there is no ambiguity;
here we have  only a single possible parse, i.e. interpreting the  
offending expression as ((let x = 1 in ) +).


Despite the fact that there is a typo (second  x  is missing), I can  
think of two possible parses. Actually, my mental parser produced the  
second one:


((let x=1 in x)+)
let x=1 in (x+)

The Haskell report may exclude my mental parse because operator  
sections need to be parenthesised.


Or are you arguing that in your example different possible parses have  
the same semantics for an arguably obvious reason and that this fact  
is relevant?


Sebastian


--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



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


Re: [Haskell-cafe] Two GET HTTP requests

2010-02-10 Thread Chris Eidhof
Hi nwn,

I had the following error:

Run: Network/Socket/Internal.hsc:(298,2)-(314,60): Non-exhaustive patterns in 
case. The code for those lines look like this:

 peekSockAddr p = do
   family - (#peek struct sockaddr, sa_family) p
   case family :: CSaFamily of
 #if defined(DOMAIN_SOCKET_SUPPORT)
 (#const AF_UNIX) - do
 str - peekCString ((#ptr struct sockaddr_un, sun_path) p)
 return (SockAddrUnix str)
 #endif
 (#const AF_INET) - do
 addr - (#peek struct sockaddr_in, sin_addr) p
 port - (#peek struct sockaddr_in, sin_port) p
 return (SockAddrInet (PortNum port) addr)
 #if defined(IPV6_SOCKET_SUPPORT)
 (#const AF_INET6) - do
 port - (#peek struct sockaddr_in6, sin6_port) p
 flow - (#peek struct sockaddr_in6, sin6_flowinfo) p
 addr - (#peek struct sockaddr_in6, sin6_addr) p
 scope - (#peek struct sockaddr_in6, sin6_scope_id) p
 return (SockAddrInet6 (PortNum port) flow addr scope)
 #endif


Thanks for all your help. I'll first upgrade to a new GHC and then try again.

-chris

On 9 feb 2010, at 06:41, Yusaku Hashimoto wrote:

 Try to reinstall HTTP package also. I think your HTTP package is still
 linked with old broken network package.
 
 HTTP depends on network. And network is a binding for network API of
 OS. These API is for C-language. When ghc builds such binding
 packages, It runs gcc for some purpose. gcc thinks you need 64bit
 binary (from SL, I believe.) and works for 64bit environment. But ghc
 on Mac can only build 32bit binaries. So it causes the problem.
 
 You can check if network package was correctly built by running this.
 This takes a host name, and gets the root document of the host via
 HTTP using a socket. Build and try `./this_program haskell.org`
 
 import Network.Socket
 import System.IO
 import System.Environment
 
 getAddr :: HostName - IO AddrInfo
 getAddr host = head `fmap`
   (getAddrInfo (Just defaultHints { addrSocketType = Stream })
(Just host)
(Just http))
 
 connected :: HostName - IO Socket
 connected host = do
addrinfo - getAddr host
sock - socket (addrFamily addrinfo)
   (addrSocketType addrinfo)
   (addrProtocol addrinfo)
connect sock (addrAddress addrinfo)
return sock
 
 httpGet :: HostName - IO String
 httpGet host = do
h - flip socketToHandle ReadWriteMode = connected host
hSetBuffering h NoBuffering
hPutStr h GET / HTTP/1.0\r\n\r\n
hGetContents h
 
 main = fmap head getArgs = httpGet = putStr
 
 I should have mentioned them in my last mail. Sorry.
 
 By the way, ghc-6.12 on Mac still can not build 64bit binaries. So
 upgrading ghc won't solve it.
 
 --nwn
 
 On Mon, Feb 8, 2010 at 12:50 AM, Chris Eidhof ch...@eidhof.nl wrote:
 Thanks. Unfortunately, it didn't help. The thing that frustrates me is that 
 it's quite hard to debug. I guess I'll upgrade my GHC to 6.12, hopefully 
 that'll solve it.
 
 -chris
 
 On 7 feb 2010, at 16:07, Yusaku Hashimoto wrote:
 
 Hello,
 
 On Sat, Feb 6, 2010 at 2:51 AM, Chris Eidhof ch...@eidhof.nl wrote:
 Approach 3: I used the simpleHTTP function from the HTTP package. This 
 crashed, after I dug a little deeper into the code, it threw an error on 
 calling the parseURI function (openFile: no such file exists). I installed 
 the latest network package and upgraded my HTTP package, and the parseURI 
 error went away. I felt like I was almost there, and tried the following:
 
 simpleHTTP (getRequest http://haskell.org;)
 
 This failed with just the text Bus error. I searched the HTTPBis git 
 repository, but couldn't find the text Bus error. I don't have a clue of 
 how to fix this.
 
 Try reinstall network package with `cabal install --reinstall
 --hsc2hs-options=--cflag=-m32 --lflag=-m32`.
 
 See also: http://hackage.haskell.org/trac/ghc/ticket/3681
 
 Hope this helps.
 --nwn
 
 

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


Re: [Haskell-cafe] Generate random UArray in constant memory space.

2010-02-10 Thread Vasyl Pasternak
Hi all,

To summarize everything in this thread I've tested mwc-random,
System.Random and mersenne random numbers (mersenne-random-pure64).
Here the score table:

[THIRD PLACE] Generic Random Number Generator. Is the slowest and
allocates too much memory in the heap. The total memory usage is
constant and very low.

[SECOND PLACE] MWC-RANDOM. The fastest random number generator ever.
But it uses O(n) memory for generate random numbers. Thought it isn't
possible to calculate a really large set of random numbers (my PC
stuck with calculating 500 millions random numbers with memory usage
above 3,5Gb). The memory usage for me is more important than time,
because I can easily wait additional 5-10-15 mins, but I cant so
easily put additional memory to my PC. Thus this is only second place.

[FIRST PLACE] Mercenne Random number generator. Approx 10 times faster
than generic and two times slower than mwc. But it works in constant
memory space, so theoretically it could generate infinite list of
numbers. It also uses 6 time less total allocations, than generic RNG.

NOTE: These tests didn't test the quality of the random sequences,
only speed/memory.

Thanks to everyone, who helped me with this code, it seems, that now I
understand optimizations much better, than a day ago.

Best regards,
Vasyl

2010/2/10 Felipe Lessa felipe.le...@gmail.com:
 On Tue, Feb 09, 2010 at 04:27:57PM -0800, Bryan O'Sullivan wrote:
 It creates and returns a vector, so if you ask it to give you a billion
 items, it's going to require north of 8 gigabytes of memory. This should not
 come as a surprise, I'd hope :-)  Assuming that's not what you actually
 want, you should look at other entry points in the API, which you can use to
 generate a single value at a time in constant space.

 He thought the vector would be fused away by the library, which
 is one of the selling points of uvector.  Sadly the
 implementation of uniformArray wasn't done with this purpose in
 mind.

 --
 Felipe.
 ___
 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] Using Cabal during development

2010-02-10 Thread Neil Brown
Don't you simply need to do what the error message says, and add (*in 
the Executable section*, at the end of the file):


build-depends: SFML

?

Limestraël wrote:

I think I must be dumb or something.
I did my SFML.cabal exactly the way the packager of vty-ui did vty-ui.cabal,
and I still have got the error when building:
hs_src/SFML/Direct/Graphics.hs:51:7:
Could not find module `SFML.Direct.Types.Enums':
  It is a member of the hidden package `SFML-1.5'.
  Perhaps you need to add `SFML' to the build-depends in your .cabal
file.
  it is a hidden module in the package `SFML-1.5'
  Use -v to see a list of the files searched for.

My cabal file is  http://old.nabble.com/file/p27522604/SFML.cabal here . Il
you get to know why it doesn't work, please tell me, because I'm lost...
I have a hs_src directory, which contains an SFML directory (the lib) and a
demo.hs file. (the simple main)
It's the way vty-ui package is done.


Jonathan Daugherty-4 wrote:
  

Then how does the 'Executable' section of your .cabal look like?
That's what I can't get working.
  

  Executable vty-ui-demo
Hs-Source-Dirs:  src
Main-is: Demo.hs
Build-Depends:
  mtl = 1.1   1.2

The Main-is refers to src/Demo.hs.  This example is from:

  http://hackage.haskell.org/packages/archive/vty-ui/0.2/vty-ui.cabal

The package description link on any Hackage package page will link
to the release's cabal file, so you can see how other folks have
written their Executable sections.

Hope that helps,

--
  Jonathan Daugherty
___
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: sendfile leaking descriptors on Linux?

2010-02-10 Thread Jeremy Shaw

On Feb 9, 2010, at 6:47 PM, Thomas Hartman wrote:


Matt, have you seen this thread?

Jeremy, are you saying this a bug in the sendfile library on hackage,
or something underlying?


I'm saying that the behavior of the sendfile library is buggy. But it  
could be due to something underlying..


Either threadWaitWrite is buggy and should be fixed. Or  
threadWaitWrite is doing the right thing, and sendfile needs to be  
modified some how to account for the behavior. But I don't know which  
is the case or how to implement a solution to either option.


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


[Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Jason Dusek
  Although I'm fond of Haskell, in practice I am not a
  Haskell programmer -- I'm paid for Ruby and Bourne shell
  programming.

  Many of the jobs posted on this list end up being jobs
  for people who appreciate Haskell but will work in C# or
  O'Caml or some-such.

  I wonder how many people actually write Haskell,
  principally or exclusively, at work?

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


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Pavel Perikov
I do.

On Feb 10, 2010, at 6:59 PM, Jason Dusek wrote:

  Although I'm fond of Haskell, in practice I am not a
  Haskell programmer -- I'm paid for Ruby and Bourne shell
  programming.
 
  Many of the jobs posted on this list end up being jobs
  for people who appreciate Haskell but will work in C# or
  O'Caml or some-such.
 
  I wonder how many people actually write Haskell,
  principally or exclusively, at work?
 
 --
 Jason Dusek
 ___
 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] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Tom Tobin
On Wed, Feb 10, 2010 at 9:59 AM, Jason Dusek jason.du...@gmail.com wrote:
  I wonder how many people actually write Haskell,
  principally or exclusively, at work?

While I don't suspect the number is large at the moment, the same
thing could have been said several years ago of the language I use at
my current job and used at my last job: Python.  I get the same
industrial incubation period vibe (for lack of a better term) from
Haskell that I once got from Python -- although perhaps I'm biased in
that I simply *like* these languages, too.  :p
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Matthias Görgens
I used Haskell for some Research  Development work at Deutsche Bahn,
earlier.  (But my program was not integrated with their other
systems.)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread John Van Enk
Not using it yet, but there's been a large amount of interest and
willingness to work with it from management. We're contractors, so it
depends on us finding some one who will allow us to use the language or asks
for it explicitly.

On Wed, Feb 10, 2010 at 10:59 AM, Jason Dusek jason.du...@gmail.com wrote:

  Although I'm fond of Haskell, in practice I am not a
  Haskell programmer -- I'm paid for Ruby and Bourne shell
  programming.

  Many of the jobs posted on this list end up being jobs
  for people who appreciate Haskell but will work in C# or
  O'Caml or some-such.

  I wonder how many people actually write Haskell,
  principally or exclusively, at work?

 --
 Jason Dusek
 ___
 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] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread David Leimbach
Using it at the day job currently... like I need to get back to it.

On Wed, Feb 10, 2010 at 8:22 AM, John Van Enk vane...@gmail.com wrote:

 Not using it yet, but there's been a large amount of interest and
 willingness to work with it from management. We're contractors, so it
 depends on us finding some one who will allow us to use the language or asks
 for it explicitly.


 On Wed, Feb 10, 2010 at 10:59 AM, Jason Dusek jason.du...@gmail.comwrote:

  Although I'm fond of Haskell, in practice I am not a
  Haskell programmer -- I'm paid for Ruby and Bourne shell
  programming.

  Many of the jobs posted on this list end up being jobs
  for people who appreciate Haskell but will work in C# or
  O'Caml or some-such.

  I wonder how many people actually write Haskell,
  principally or exclusively, at work?

 --
 Jason Dusek
 ___
 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] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Sean Leather
  I wonder how many people actually write Haskell,
  principally or exclusively, at work?


I suppose you're implying non-academic jobs by that statement, but most of
the people in my research group develop programs in Haskell on a daily
basis. You'll find a number of libraries on Hackage from us.

  http://www.cs.uu.nl/staff/cur/IDX/sds.html

As a shameless plug, I will also add that we have a great master's program
in which you can get your fill of Haskell and compilers, among other things.

  http://www.cs.uu.nl/wiki/Master/

As second (but related) shameless plug, we also have a two-week-long summer
school which is an excellent way to jump-start the above master's program or
to get quickly up to speed on Haskell for business or pleasure. The course
is in August, and the deadline is May 1.

  http://www.utrechtsummerschool.nl/index.php?type=coursescode=H9

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


Re: [Haskell-cafe] Using Cabal during development

2010-02-10 Thread Limestraël


Neil Brown-7 wrote:
 
 Don't you simply need to do what the error message says, and add (*in 
 the Executable section*, at the end of the file):
 

Nope, just check my previous message (my issue (2)):


Limestrael wrote:
 
 (2) well, then, when building, if I don't specify that my executable
 depends on my lib, I got:
 SFML/Direct/Graphics.hs:51:7:
 Could not find module `SFML.Direct.Types.Enums':
   It is a member of the hidden package `HSFML-1.5'.
   Perhaps you need to add `HSFML' to the build-depends in your .cabal
 file.
   it is a hidden module in the package `HSFML-1.5'
   Use -v to see a list of the files searched for.
 
 and if I do what it asks me to do (to add the line 'Build-Depends:  HSFML'
 in the 'Executable' section of my .cabal file), I'm told when 'cabal
 build'ing:
 cabal: internal error: could not construct a valid install plan.
 The proposed (invalid) plan contained the following problems:
 The following packages are involved in a dependency cycle HSFML-1.5
 
-- 
View this message in context: 
http://old.nabble.com/Using-Cabal-during-development-tp27515446p27534455.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

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


[Haskell-cafe] vector to uvector and back again

2010-02-10 Thread stefan kersten
hi,

i've been using the vector [1] library for implementing some signal processing
algorithms, but now i'd like to use the statistics [2] package on my data, which
is based on the uvector [3] library. is there a (straightforward) way of
converting between vectors and uvectors, preferrably O(1)?

thanks,
sk

[1] http://hackage.haskell.org/package/vector
[2] http://hackage.haskell.org/package/statistics
[3] http://hackage.haskell.org/package/uvector
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] vector to uvector and back again

2010-02-10 Thread Bryan O'Sullivan
I'm thinking of switching the statistics library over to using vector.
uvector is pretty bit-rotted in comparison to vector at this point, and it's
really seeing no development, while vector is The Shiny Future. Roman, would
you call the vector library good enough to use in production at the moment?


On Wed, Feb 10, 2010 at 9:59 AM, stefan kersten s...@k-hornz.de wrote:

 hi,

 i've been using the vector [1] library for implementing some signal
 processing
 algorithms, but now i'd like to use the statistics [2] package on my data,
 which
 is based on the uvector [3] library. is there a (straightforward) way of
 converting between vectors and uvectors, preferrably O(1)?

 thanks,
 sk

 [1] http://hackage.haskell.org/package/vector
 [2] http://hackage.haskell.org/package/statistics
 [3] http://hackage.haskell.org/package/uvector
 ___
 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] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Bulat Ziganshin
Hello Jason,

Wednesday, February 10, 2010, 6:59:42 PM, you wrote:

   I wonder how many people actually write Haskell,
   principally or exclusively, at work?

i work on commercial program. once it will start selling, i will
publish here the story 

-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

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


Re: [Haskell-cafe] Using Cabal during development

2010-02-10 Thread Daniel Fischer
Am Mittwoch 10 Februar 2010 18:16:42 schrieb Limestraël:
 Neil Brown-7 wrote:
  Don't you simply need to do what the error message says, and add (*in
  the Executable section*, at the end of the file):

 Nope, just check my previous message (my issue (2)):

I think http://www.haskell.org/ghc/docs/latest/html/Cabal/authors.html 
might help, example 3, a package containing a library and executable 
programs

Name:TestPackage
Version: 0.0
Cabal-Version:   = 1.2
License: BSD3
Author:  Angela Author
Synopsis:Package with library and two programs
Build-Type:  Simple

Library
  Build-Depends:   HUnit
  Exposed-Modules: A, B, C

Executable program1
  Main-Is: Main.hs
  Hs-Source-Dirs:  prog1
  Other-Modules:   A, B

Executable program2
  Main-Is: Main.hs
  Hs-Source-Dirs:  prog2
  Other-Modules:   A, C, Utils


For the executable, you have to specify the source dirs and the modules 
*from the library you are developing* it needs.
A little inconvenient, admittedly.


 Limestrael wrote:
  (2) well, then, when building, if I don't specify that my executable
  depends on my lib, I got:
  SFML/Direct/Graphics.hs:51:7:
  Could not find module `SFML.Direct.Types.Enums':
It is a member of the hidden package `HSFML-1.5'.
Perhaps you need to add `HSFML' to the build-depends in your
  .cabal file.
it is a hidden module in the package `HSFML-1.5'
Use -v to see a list of the files searched for.
 
  and if I do what it asks me to do (to add the line 'Build-Depends: 
  HSFML' in the 'Executable' section of my .cabal file), I'm told when
  'cabal build'ing:
  cabal: internal error: could not construct a valid install plan.
  The proposed (invalid) plan contained the following problems:
  The following packages are involved in a dependency cycle HSFML-1.5

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


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Jason Dusek
2010/02/10 Tom Tobin korp...@korpios.com:
 On Wed, Feb 10, 2010 at 9:59 AM, Jason Dusek jason.du...@gmail.com wrote:
  I wonder how many people actually write Haskell,
  principally or exclusively, at work?

 While I don't suspect the number is large at the moment, the
 same thing could have been said several years ago of the
 language I use at my current job and used at my last job:
 Python.  I get the same industrial incubation period vibe
 (for lack of a better term) from Haskell that I once got from
 Python -- although perhaps I'm biased in that I simply *like*
 these languages, too.  :p

  I completely agree. I'm just trying to figure out where on the
  growth curve we are :) I am also interested in what industries
  tend to aggregate Haskell programmers. Within the Bay Area
  webosphere, Haskell is not much liked though Scala is gaining
  some traction. I think this has a lot to do with the fact that
  web programming is very much a let's go shopping kind of
  discipline -- no point in troubling oneself over correctness
  when the users haven't weighed in on the worth of your site.
  Of course this attitude leads to a long maintenance phase of
  Crazy Stuff®, like writing a PHP compiler; but by then you
  have piles of money to throw at the problem! Such is the
  theory, anyways.

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


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Matthias Görgens
  I think this has a lot to do with the fact that
  web programming is very much a let's go shopping kind of
  discipline -- no point in troubling oneself over correctness
  when the users haven't weighed in on the worth of your site.
  Of course this attitude leads to a long maintenance phase of
  Crazy Stuff®, like writing a PHP compiler; but by then you
  have piles of money to throw at the problem! Such is the
  theory, anyways.

Or have sold your startup to some other company.

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


[Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-10 Thread Bardur Arantsson

Jeremy Shaw wrote:

On Feb 9, 2010, at 6:47 PM, Thomas Hartman wrote:


Matt, have you seen this thread?

Jeremy, are you saying this a bug in the sendfile library on hackage,
or something underlying?


I'm saying that the behavior of the sendfile library is buggy. But it 
could be due to something underlying..


Either threadWaitWrite is buggy and should be fixed. Or threadWaitWrite 
is doing the right thing, and sendfile needs to be modified some how to 
account for the behavior. But I don't know which is the case or how to 
implement a solution to either option.


IMO, in the interests of correctness over speed, an interim release of 
sendfile which simply uses the portable code on Linux should be put 
out. The CPU overhead of the portable method doesn't matter that much 
for servers which aren't extremely busy.


I've also been contemplating some solutions, but I cannot see any 
solutions to this problem which could reasonably be implemented outside 
of GHC itself. GHC lacks a threadWaitError, so there's no way to 
detect the problem except by timeout or polling. Solutions involving 
timeouts and polling are bad in this case because they arbitrarily 
restrict the client connection rate.


Cheers,

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


Re: [Haskell-cafe] vector to uvector and back again

2010-02-10 Thread Johan Tibell
On Wed, Feb 10, 2010 at 10:03 AM, Bryan O'Sullivan b...@serpentine.comwrote:

 I'm thinking of switching the statistics library over to using vector.
 uvector is pretty bit-rotted in comparison to vector at this point, and it's
 really seeing no development, while vector is The Shiny Future. Roman, would
 you call the vector library good enough to use in production at the moment?


I like the vector API much better than the uvector one.

* no U suffixes on functions (go namespaces!) and
* no cryptic names (what's an UAE?).

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


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Andrew Coppin

Jason Dusek wrote:

  Although I'm fond of Haskell, in practice I am not a
  Haskell programmer -- I'm paid for Ruby and Bourne shell
  programming.

  Many of the jobs posted on this list end up being jobs
  for people who appreciate Haskell but will work in C# or
  O'Caml or some-such.

  I wonder how many people actually write Haskell,
  principally or exclusively, at work?
  


I usually estimate the answer to this question by looking up how many 
employees WellTyped.com and Galois.com have between them, under the 
simplifying assumption that the number of other people using Haskell is 
probably so utterly insignificant that it doesn't matter.


I'd love to see Haskell become popular, but it doesn't seem to be in any 
rush to happen just yet. (Then again, I gather 10 years ago things were 
far, far worse than they are today...)


Some people (especially C programmers) have tried to tell me that 
Haskell is too slow. Others have claimed it's too incomprehensible. 
People inherantly thing sequentially, not set-theoretically they say. 
(Last time I checked, nobody's complaining about SQL being 
unintuitive...) People don't think recursively is another 
commonly-sited objection. Still others point out that Haskell is a 
*pure* functional language, and all the most popular languages are 
hybrids. Eiffel is a pure-OO language, but the hybrids like Java and C++ 
far vastly more popular. I myself might point out the comparative 
immaturity of things on Windows (the single biggest target platform on 
the market), and the rough edges on tools like Darcs, Haddock and Cabal. 
If enough people become interested, all these things could (and 
hopefully would) be fixed. It's a question of whether we reach the 
necessary critical mass or not...


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


[Haskell-cafe] Type arithmetic with ATs

2010-02-10 Thread Andrew Coppin

OK, so I sat down today and tried this, but I can't figure out how.

There are various examples of type-level arithmetic around the place. 
For example,


http://www.haskell.org/haskellwiki/Type_arithmetic

(This is THE first hit on Google, by the way. Haskell is apparently THAT 
popular!) But this does type arithmetic using functional dependencies; 
what I'm trying to figure out is how to do that with associated types.


Any hints?

(I know for a fact that other people have done this - rule 34 requires it.)

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


[Haskell-cafe] lazy'foldl

2010-02-10 Thread Sebastian Fischer

Hello,

I have implemented the following function:

lazy'foldl :: (a - b - Maybe a) - Maybe a - [b] - Maybe a
lazy'foldl _ Nothing  _  = Nothing
lazy'foldl _ m[] = m
lazy'foldl f (Just y) (x:xs) = lazy'foldl f (f y x) xs

After hoogling its type, I found that

Control.Monad.foldM :: (a - b - Maybe a) - a - [b] - Maybe a

seems like a perfect replacement because

lazy'foldl f (Just x) xs  ==  foldM f x xs

holds for all finite lists xs. Here is an inductive proof:

lazy'foldl f (Just x) []  ==  Just x
  ==  foldM f x []

lazy'foldl f (Just x) (y:ys)  ==  lazy'foldl f (f x y) ys
(if  f x y == Nothing)==  lazy'foldl f Nothing ys
  ==  Nothing
  ==  Nothing = \z - foldM f z ys
  ==  f x y   = \z - foldM f z ys
  ==  foldM f x (y:ys)

lazy'foldl f (Just x) (y:ys)  ==  lazy'foldl f (f x y) ys
(if  f x y == Just z) ==  lazy'foldl f (Just z) ys
(induction)   ==  foldM f z ys
  ==  Just z = \z - foldM f z ys
  ==  f x y  = \z - foldM f z ys
  ==  foldM f x (y:ys)

I think the above equation holds even for infinite lists xs. Both  
functions terminate on infinite lists, if the accumulator is  
eventually Nothing.


Do you see any differences in terms of strictness, i.e., a counter  
example to the above equation that involves bottom? I don't.


Sebastian





--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



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


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Bas van Dijk
On Wed, Feb 10, 2010 at 4:59 PM, Jason Dusek jason.du...@gmail.com wrote:
  I wonder how many people actually write Haskell,
  principally or exclusively, at work?

Roel and I use Haskell at work.

We develop embedded software in Haskell (not real-time) that controls
a scientific instrument.

We will probably write something more detailed about this project some
time from now.

regards,

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


Re: [Haskell-cafe] lazy'foldl

2010-02-10 Thread Miguel Mitrofanov

For the reference: foldM is defined as
foldM :: Monad m = (a - b - m a) - a - [b] - ma
foldM _ a [] = return a
foldM f a (x:xs) = f a x = \fax - foldM f fax xs

Let's define

foldM' f x xs = lazy'foldl f (Just x) xs

We can check that foldM' satisfies the same equations as foldM:

foldM' f a [] = lazy'foldl f (Just a) [] = Just a = return a
f a x = \fax - foldM' f fax xs = case f a x of {Nothing - Nothing;  
Just fax - foldM' f fax xs} =
  case f a x of {Nothing - Nothing; Just fax - lazy'foldl f (Just  
fax) xs} =
  case f a x of {Nothing - lazy'foldl f Nothing xs; Just fax -  
lazy'foldl f (Just fax) xs} = (*)
  lazy'foldl f (f a x) xs = lazy'foldl f (Just a) (x:xs) = foldM' f a  
(x:xs)


(*) this holds, because lazy'foldl actually does pattern match on it's  
second argument


This means, that foldM' as at least as defined as foldM (meaning,  
roughly, that if foldM gives a meaningful, non-undefined value, foldM'  
produces the same value; if foldM gives (_|_), foldM' is free to  
produce anything). Therefore, lazy'foldl f (Just x) xs is at least as  
defined as foldM f x xs.


On the other hand, let's define

lazyf f mx xs = case mx of {Nothing - Nothing, Just x - foldM f x xs}

lazyf satisfies the same equations as lazy'foldl:

lazyf f Nothing xs = Nothing
lazyf f (Just y) (x:xs) = foldM f y (x:xs) = f y x = \fyx - foldM f  
fyx xs =

  f y x = \fyx - lazyf f (Just fyx) xs =
  case f y x of {Nothing - Nothing; Just fyx - lazyf f (Just fyx)  
xs} =
  case f y x of {Nothing - lazyf f Nothing xs; Just fyx - lazyf f  
(Just fyx) xs} = (*)

  lazyf f (f y x) xs

(*) again, lazyf does pattern-match on it's second argument, so this  
is valid


lazyf f mx [] = case mx of {Nothing - Nothing, Just x - foldM f x  
[]} =

  case mx of {Nothing - Nothing, Just x - return x} =
  case mx of {Nothing - Nothing, Just x - Just x} = mx

The last equality holds because there are only three kinds of values  
mx can have: Nothing, Just x, or (_|_); in all three cases pattern- 
matching produces the same value.


That means, that lazyf is at least as defined as lasy'foldl, so foldM  
f x xs = lazyf f (Just x) xs is at least as defined as lazyfoldl' f  
(Just x) xs.


All this means that lazy'foldl f (Just x) xs coincides with foldM f x  
xs exactly, for all possible f, x, and xs.



On 10 Feb 2010, at 22:35, Sebastian Fischer wrote:


Hello,

I have implemented the following function:

   lazy'foldl :: (a - b - Maybe a) - Maybe a - [b] - Maybe a
   lazy'foldl _ Nothing  _  = Nothing
   lazy'foldl _ m[] = m
   lazy'foldl f (Just y) (x:xs) = lazy'foldl f (f y x) xs

After hoogling its type, I found that

   Control.Monad.foldM :: (a - b - Maybe a) - a - [b] - Maybe a

seems like a perfect replacement because

   lazy'foldl f (Just x) xs  ==  foldM f x xs

holds for all finite lists xs. Here is an inductive proof:

   lazy'foldl f (Just x) []  ==  Just x
 ==  foldM f x []

   lazy'foldl f (Just x) (y:ys)  ==  lazy'foldl f (f x y) ys
   (if  f x y == Nothing)==  lazy'foldl f Nothing ys
 ==  Nothing
 ==  Nothing = \z - foldM f z ys
 ==  f x y   = \z - foldM f z ys
 ==  foldM f x (y:ys)

   lazy'foldl f (Just x) (y:ys)  ==  lazy'foldl f (f x y) ys
   (if  f x y == Just z) ==  lazy'foldl f (Just z) ys
   (induction)   ==  foldM f z ys
 ==  Just z = \z - foldM f z ys
 ==  f x y  = \z - foldM f z ys
 ==  foldM f x (y:ys)

I think the above equation holds even for infinite lists xs. Both  
functions terminate on infinite lists, if the accumulator is  
eventually Nothing.


Do you see any differences in terms of strictness, i.e., a counter  
example to the above equation that involves bottom? I don't.


Sebastian





--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



___
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] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread James Russell
In my previous job, which recently ended, we used Haskell for
at least half of our code, and most of our core stuff.
I ended up writing a lot of Java, too, but you take the good,
you take the bad.

-James

On Wed, Feb 10, 2010 at 10:59 AM, Jason Dusek jason.du...@gmail.com wrote:
  Although I'm fond of Haskell, in practice I am not a
  Haskell programmer -- I'm paid for Ruby and Bourne shell
  programming.

  Many of the jobs posted on this list end up being jobs
  for people who appreciate Haskell but will work in C# or
  O'Caml or some-such.

  I wonder how many people actually write Haskell,
  principally or exclusively, at work?

 --
 Jason Dusek
 ___
 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 arithmetic with ATs

2010-02-10 Thread Robert Greayer
On Wed, Feb 10, 2010 at 2:29 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
 OK, so I sat down today and tried this, but I can't figure out how.

 There are various examples of type-level arithmetic around the place. For
 example,

 http://www.haskell.org/haskellwiki/Type_arithmetic

 (This is THE first hit on Google, by the way. Haskell is apparently THAT
 popular!) But this does type arithmetic using functional dependencies; what
 I'm trying to figure out is how to do that with associated types.

 Any hints?

 (I know for a fact that other people have done this - rule 34 requires it.)

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


With type families, something like:

type family Add m n
type instance Add (Succ n) (Succ m) = Succ (Succ (Add n m))
type instance Add Zero (Succ m) = (Succ m)
type instance Add (Succ m) Zero = (Succ m)
type instance Add Zero Zero = Zero

is this what you are after?

There's also the tfp library on hackage which has much more type level
arithmetic, using type families.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Don Stewart
jason.dusek:
   Although I'm fond of Haskell, in practice I am not a
   Haskell programmer -- I'm paid for Ruby and Bourne shell
   programming.
 
   Many of the jobs posted on this list end up being jobs
   for people who appreciate Haskell but will work in C# or
   O'Caml or some-such.
 
   I wonder how many people actually write Haskell,
   principally or exclusively, at work?

Galois is a 100% Haskell shop, and we're around 40 people now - not all
are engineers though.

At the Commercial Users of FP workshop this year, when asked to raise
their hands what FP languages people used at work, the majority of the
room (60 people? / 120 in the room -- check the video) said they'd used
Haskell at work. More than any of the other FP langs present (we also
asked about Erlang, OCaml, Scheme, F#).

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


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Don Stewart
v.dijk.bas:
 On Wed, Feb 10, 2010 at 4:59 PM, Jason Dusek jason.du...@gmail.com wrote:
   I wonder how many people actually write Haskell,
   principally or exclusively, at work?
 
 Roel and I use Haskell at work.
 
 We develop embedded software in Haskell (not real-time) that controls
 a scientific instrument.
 
 We will probably write something more detailed about this project some
 time from now.
 

This is a great thread. Perhaps more users could add their details to

http://haskell.org/haskellwiki/Haskell_in_industry

and consider presenting at CUFP this year. http://cufp.galois.com
(new website to be launched soon!)

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


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Bas van Dijk
On Wed, Feb 10, 2010 at 9:50 PM, Don Stewart d...@galois.com wrote:
 ... Perhaps more users could add their details to
 http://haskell.org/haskellwiki/Haskell_in_industry ...

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


RE: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Roderick Ford

We could/should probably all just start our own collective (corporate) entity 
to produce software, based on the premises that 

1) software built with Haskell will be more robust, and 

2) software built by developers who have an affinity and aptitude for this 
language will tend to write better software.

 

When the products themselves gain a positive reputation with the general 
public, then the corporation itself and those invested will benefit.  

 

 cheers heard across the world 

 

A U.S. president would probably subsidize such a job-creating endeavor too!

 

Nay-sayers are probably predominately composed of those who do not understand 
it or its benefits.

 


 
 Date: Wed, 10 Feb 2010 19:26:22 +
 From: andrewcop...@btinternet.com
 To: haskell-cafe@haskell.org
 Subject: Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?
 
 Jason Dusek wrote:
  Although I'm fond of Haskell, in practice I am not a
  Haskell programmer -- I'm paid for Ruby and Bourne shell
  programming.
 
  Many of the jobs posted on this list end up being jobs
  for people who appreciate Haskell but will work in C# or
  O'Caml or some-such.
 
  I wonder how many people actually write Haskell,
  principally or exclusively, at work?
  
 
 I usually estimate the answer to this question by looking up how many 
 employees WellTyped.com and Galois.com have between them, under the 
 simplifying assumption that the number of other people using Haskell is 
 probably so utterly insignificant that it doesn't matter.
 
 I'd love to see Haskell become popular, but it doesn't seem to be in any 
 rush to happen just yet. (Then again, I gather 10 years ago things were 
 far, far worse than they are today...)
 
 Some people (especially C programmers) have tried to tell me that 
 Haskell is too slow. Others have claimed it's too incomprehensible. 
 People inherantly thing sequentially, not set-theoretically they say. 
 (Last time I checked, nobody's complaining about SQL being 
 unintuitive...) People don't think recursively is another 
 commonly-sited objection. Still others point out that Haskell is a 
 *pure* functional language, and all the most popular languages are 
 hybrids. Eiffel is a pure-OO language, but the hybrids like Java and C++ 
 far vastly more popular. I myself might point out the comparative 
 immaturity of things on Windows (the single biggest target platform on 
 the market), and the rough edges on tools like Darcs, Haddock and Cabal. 
 If enough people become interested, all these things could (and 
 hopefully would) be fixed. It's a question of whether we reach the 
 necessary critical mass or not...
 
 ___
 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] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread John Van Enk
 consider presenting at CUFP this year

Any word on when this will be?

On Wed, Feb 10, 2010 at 3:50 PM, Don Stewart d...@galois.com wrote:

 v.dijk.bas:
  On Wed, Feb 10, 2010 at 4:59 PM, Jason Dusek jason.du...@gmail.com
 wrote:
I wonder how many people actually write Haskell,
principally or exclusively, at work?
 
  Roel and I use Haskell at work.
 
  We develop embedded software in Haskell (not real-time) that controls
  a scientific instrument.
 
  We will probably write something more detailed about this project some
  time from now.
 

 This is a great thread. Perhaps more users could add their details to

http://haskell.org/haskellwiki/Haskell_in_industry

 and consider presenting at CUFP this year. http://cufp.galois.com
 (new website to be launched soon!)

 -- Don
 ___
 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] If monads are single/linearly threaded, doesn't that reduce parallelism?

2010-02-10 Thread Casey Hawthorne
On Tue, 9 Feb 2010 21:56:49 +, you wrote:

Monads are not commutative.  A structure that would tell the compiler
that it's commutative, would give it more leeway for optimization (and
parallel execution).

Thank you.

Not commutative was the phrase I was looking for.
--
Regards,
Casey
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] vector to uvector and back again

2010-02-10 Thread Roman Leshchinskiy
On 11/02/2010, at 05:03, Bryan O'Sullivan wrote:

 I'm thinking of switching the statistics library over to using vector. 
 uvector is pretty bit-rotted in comparison to vector at this point, and it's 
 really seeing no development, while vector is The Shiny Future. Roman, would 
 you call the vector library good enough to use in production at the moment?

Yes, with the caveat that I haven't really used it in production code (I have 
tested and benchmarked it, though). BTW, I'll release version 0.5 as soon as 
get a code.haskell.org account and move the repo there.

Roman

 
 
 On Wed, Feb 10, 2010 at 9:59 AM, stefan kersten s...@k-hornz.de wrote:
 hi,
 
 i've been using the vector [1] library for implementing some signal processing
 algorithms, but now i'd like to use the statistics [2] package on my data, 
 which
 is based on the uvector [3] library. is there a (straightforward) way of
 converting between vectors and uvectors, preferrably O(1)?
 
 thanks,
 sk
 
 [1] http://hackage.haskell.org/package/vector
 [2] http://hackage.haskell.org/package/statistics
 [3] http://hackage.haskell.org/package/uvector
 ___
 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] Using Cabal during development

2010-02-10 Thread John D. Ramsdell
On Tue, Feb 9, 2010 at 8:48 AM, Limestraël limestr...@gmail.com wrote:
 Cabal/cabal-install are good tools for distribution and installation, but I
 was wondering -- as I was starting to learn how to use Cabal -- how do
 usually Haskell developpers build their softwares

I add the enclosed Makefile to the directory that contains the .cabal
file, and then in emacs, run M-x compile.  To move to location of an
error, type C-x `.  I bind compile to M-C-y in my .emacs.el file with:

   (global-set-key \M-\C-y 'compile)

--- Makefile 
# Haskell/Cabal Makefile
# Requires GNU Make
# The all target creates a default configuration if need be.

PACKAGE := $(wildcard *.cabal)
CONFIG  = dist/setup-config
SETUP   = runhaskell Setup.hs

all:$(CONFIG)
$(SETUP) build

Makefile:
@echo make $@

$(PACKAGE):
@echo make $@

$(CONFIG):  $(PACKAGE)
$(SETUP) configure --ghc --user --prefix=${HOME}

%:  force
$(SETUP) $@

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


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Jason Dusek
2010/02/10 Roderick Ford develo...@live.com:
 A U.S. president would probably subsidize such a job-creating endeavor too!

  The US government generally subsidizes these kinds of things
  through DoD spending (and a few NSF grants). That is probably
  hard to get into.

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


Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Manuel M T Chakravarty
John Van Enk:
  consider presenting at CUFP this year
 
 Any word on when this will be?

It'll be before or after (I suspect the later) ICFP 
http://www.icfpconference.org/icfp2010/, which is September 27-29 in 
Baltimore, Maryland.

Manuel

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


[Haskell-cafe] Re: Using Cabal during development

2010-02-10 Thread Simon Michael
Another great thread. I'm another who uses both make and cabal. I try to automate a lot of things and find a makefile 
easier for quick scripting. Perhaps at some point I'll get by with just cabal. Here's an example:


http://joyful.com/repos/hledger/Makefile

An unusual feature, I think, is the use of the little-known sp tool for auto-recompiling (see ci rule). Typically I 
leave make ci running in an emacs shell window, where I can watch the errors as I edit and save source. I don't have 
clickable errors currently, I get by with linum-mode. When I need to explore I'll run ghci in another shell window. 
After reading this thread, I'm going to try using C-c C-l more.



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


[Haskell-cafe] trouble with HDBC-mysql on Mac OS X

2010-02-10 Thread Mark Lentczner
I'm having trouble with HDBC-mysql on Mac OS X (10.6, Snow Leopard). It 
compiles and builds fine, but when loaded (into ghci), the dynamic loader 
complains about not being able to find libmygcc.dylib. The issue is, MySQL's 
libmygcc is a static lib, not a dynamic one, so of course it won't find it. 

I've checked the build sequence that HDBC-mysql uses, and it calls upon 
mysql_config to generate the lib options. I've checked those and they are 
correct, expressly listing libmygcc statically (!). I've tried building against 
both the 64bit and 32bit versions of MySQL libs. (Suspect that only the 32bit 
should work.)

Anyone have HDBC-mysql running on 10.6? Any ideas for me to try would be 
appreciated.

- Mark


Mark Lentczner
http://www.ozonehouse.com/mark/
IRC: mtnviewmark



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