Re: [Haskell-cafe] Instantiation problem

2011-01-31 Thread Tom Nielsen
Patrick, I find Andrew Frank's work on axiomatic specifications of GIS systems -- which the paper you cite is built on -- very confusing, or indeed, confused. They have a bunch of example like data Car = Car Color class Car a where carColor :: a - Color instance Car Car where carColor

Re: [Haskell-cafe] Cabal ignores ld-options? - 2011 remix

2011-01-31 Thread Duncan Coutts
On Mon, 2011-01-31 at 01:13 -0500, Ryan Newton wrote: Ok, I've made some progress in the direction Duncan suggested. I can filter out the extra library before the postConf hook gets it. And calling make from the hooks is pretty easy. I've got a hack working that does allow full

Re: [Haskell-cafe] ANNOUNCE: genprog-0.1

2011-01-31 Thread grzegorz.nowak
Jan, great, great work. Although I'm quite new to the Haskell (but experienced in a dozen of imperative languages and GP), I had no difficulties with adopting your example to my initial needs. Now I'm facing new problem: is it possible to create recursive program structures with your library

Re: [Haskell-cafe] Yesod and concurrency

2011-01-31 Thread Ertugrul Soeylemez
Michael Snoyman mich...@snoyman.com wrote: On Mon, Jan 31, 2011 at 1:09 PM, Ertugrul Soeylemez e...@ertes.de wrote: Hello everybody, how well do WAI, Yesod and the 'persistent' package play with concurrency?  For example, I'd like to write a program, which concurrently provides two

Re: [Haskell-cafe] Yesod and concurrency

2011-01-31 Thread Michael Snoyman
On Mon, Jan 31, 2011 at 2:28 PM, Ertugrul Soeylemez e...@ertes.de wrote: Michael Snoyman mich...@snoyman.com wrote: On Mon, Jan 31, 2011 at 1:09 PM, Ertugrul Soeylemez e...@ertes.de wrote: Hello everybody, how well do WAI, Yesod and the 'persistent' package play with concurrency?  For

Re: [Haskell-cafe] Loading bitmap with xlib

2011-01-31 Thread Francesco Mazzoli
Francesco Mazzoli f at mazzo.li writes: At the end I gave up and I wrote the function myself: http://hpaste.org/43464/readbitmapfile ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] The implementation of Control.Exception.bracket

2011-01-31 Thread Leon Smith
There is a common idiom used in Control.Concurrent libraries, as embodied in the implementation of bracket: http://www.haskell.org/ghc/docs/7.0-latest/html/libraries/base-4.3.0.0/src/Control-Exception-Base.html#bracket bracket before after thing = mask $ \restore - do a - before r -

Re: [Haskell-cafe] The implementation of Control.Exception.bracket

2011-01-31 Thread Max Bolingbroke
On 31 January 2011 14:17, Leon Smith leon.p.sm...@gmail.com wrote: Is there some subtle semantic difference?   Is there a performance difference?   It seems like a trivial thing,  but I am genuinely curious. According to my understanding the two should have equivalent semantics. As for

[Haskell-cafe] Typing problem

2011-01-31 Thread michael rice
I'm mapping a function over a list of data, where the mapping function is determined from the data. g f l = map (g l) l So g serialize prolog  -  [4,5,3,2,3,1] But I'm having typing problems trying to do a similar thing with a function that statistically normalizes data. See:

Re: [Haskell-cafe] Typing problem

2011-01-31 Thread Daniel Fischer
On Monday 31 January 2011 18:29:59, michael rice wrote: I'm mapping a function over a list of data, where the mapping function is determined from the data. g f l = map (g l) l g f l = map (f l) l probably So g serialize prolog  -  [4,5,3,2,3,1] But I'm having typing problems trying to

Re: [Haskell-cafe] Typing problem

2011-01-31 Thread Steffen Schuldenzucker
Michael, just leaving out the type declaration for 'normalize', your module complies fine and ghc infers the following type: normalize :: (Integral a, Floating a) = [a] - a - a Note that the context (Integral a, Floating a) cannot be met by any of the standard types. (try in ghci: :i

Re: [Haskell-cafe] Haskell for children? Any experience?

2011-01-31 Thread Tim Chevalier
On Thu, Jan 27, 2011 at 7:28 AM, aditya siram aditya.si...@gmail.com wrote: Ye gods! A B D [1] language for kids? At least give them a fighting chance [2] at becoming future developers. Haskell's immutability is good for mathematics but doing anything else takes a great deal of up-front

[Haskell-cafe] Haskell WalkSat algorithm implementation

2011-01-31 Thread Manolache Andrei-Ionut
I need some help if possible with the following problem.The WalkSat algorithm takes a formula, a probability 0 = p = 1, and a boundary of maximum flips maxflips and returns a model that satisfies the formula or failure. The algorithm begins by assigning truth values to the atoms randomly,

[Haskell-cafe] plugins and internal error: stg_ap_v_ret

2011-01-31 Thread Michael Snoyman
Hi all, I'm trying to convert wai-handler-devel to use plugins instead of hint, but cannot even get some basic usages to work properly. I've put together a minimal example that loads a WAI application from a separate file and runs it, but this immediately causes the program to crash saying:

Re: [Haskell-cafe] Haskell WalkSat algorithm implementation

2011-01-31 Thread Mihai Maruseac
On Mon, Jan 31, 2011 at 9:11 PM, Manolache Andrei-Ionut andressocrate...@yahoo.com wrote: I need some help if possible with the following problem.The WalkSat algorithm takes a formula, a probability 0 = p = 1, and a boundary of maximum flips maxflips and returns a model that satisfies

Re: [Haskell-cafe] Typing problem

2011-01-31 Thread michael rice
I hadn't considered the types of the functions I call in the function I'm trying to write, something not usually needed in loosely typed languages with coercion, but something I'm going to have to make a habit of doing. One more thing to add to the check list. Also, I had considered the

Re: [Haskell-cafe] Haskell WalkSat algorithm implementation

2011-01-31 Thread Houdini
thank you -- View this message in context: http://haskell.1045720.n5.nabble.com/Haskell-WalkSat-algorithm-implementation-tp3365064p3365124.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list

[Haskell-cafe] Inheritance and Wrappers

2011-01-31 Thread MattMan
tldr: Can I make arbitrary instances of one class instantiate another without using wrappers? I'm new to Haskell, and am trying to implement some simple typeclasses for doing algebra. For example I have type class (simplified for the sake of argument) class AbGroup a where add :: a - a - a

Re: [Haskell-cafe] Inheritance and Wrappers

2011-01-31 Thread Steffen Schuldenzucker
On 01/31/2011 08:58 PM, MattMan wrote: [...] data Wrapper a = Wrap a instance (Num a) = AbGroup (Wrapper a) where add (Wrap i) (Wrap j) = Wrap(i+j) However, this is clumsy. Is there something else I can do? Thanks This is the normal approach. You can do funny things with the

Re: [Haskell-cafe] Inheritance and Wrappers

2011-01-31 Thread Daniel Fischer
On Monday 31 January 2011 20:58:02, MattMan wrote: tldr: Can I make arbitrary instances of one class instantiate another without using wrappers? I'm new to Haskell, and am trying to implement some simple typeclasses for doing algebra. For example I have type class (simplified for the sake

Re: [Haskell-cafe] Inheritance and Wrappers

2011-01-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 1/31/11 15:24 , Daniel Fischer wrote: want. You could then also enable OverlappingInstances, which would allow you to write other instances, but that extension is widely regarded as dangerous (have to confess, I forgot what the dangers were,

Re: [Haskell-cafe] Inheritance and Wrappers

2011-01-31 Thread Henning Thielemann
On Mon, 31 Jan 2011, MattMan wrote: I'm new to Haskell, and am trying to implement some simple typeclasses for doing algebra. For example I have type class (simplified for the sake of argument) class AbGroup a where add :: a - a - a I would like any type instantiating Num to also be an

Re: [Haskell-cafe] Inheritance and Wrappers

2011-01-31 Thread Henning Thielemann
On Mon, 31 Jan 2011, Brandon S Allbery KF8NH wrote: On 1/31/11 15:24 , Daniel Fischer wrote: want. You could then also enable OverlappingInstances, which would allow you to write other instances, but that extension is widely regarded as dangerous (have to confess, I forgot what the dangers

[Haskell-cafe] companies using Haskell or other FP languages near Rochester?

2011-01-31 Thread Edward Amsden
I'm an undergraduate CS student (4th year status) looking for an co-op or internship in the Rochester area. I'd really like to do something with functional programming or Haskell specifically, but I'm not sure if anyone in this area does that. Staying near Rochester is important because I'd also

[Haskell-cafe] Packages all screwed up

2011-01-31 Thread Arnaud Bailly
Hello, I recently tried to upgrade some package (eg. yesod) and it seems that, in the process, I screwed up my Haskell packages setup. When I am trying to do a simple: ghc --make Crete1941 It fails with message: Loader\Communication.hs:14:7: Could not find module `System.Process': Use

Re: [Haskell-cafe] Packages all screwed up

2011-01-31 Thread Daniel Fischer
On Monday 31 January 2011 23:59:57, Arnaud Bailly wrote: Hello, I recently tried to upgrade some package (eg. yesod) and it seems that, in the process, I screwed up my Haskell packages setup. Big time. When I am trying to do a simple: ghc --make Crete1941 It fails with message:

Re: [Haskell-cafe] Packages all screwed up

2011-01-31 Thread Antoine Latter
On Mon, Jan 31, 2011 at 4:59 PM, Arnaud Bailly arnaud.oq...@gmail.com wrote: Hello, I recently tried to upgrade some package (eg. yesod) and it seems that, in the process, I screwed up my Haskell packages setup. When I am trying to do a simple: ghc --make Crete1941 What command(s) did you

Re: [Haskell-cafe] Inheritance and Wrappers

2011-01-31 Thread MattMan
\quote Henning Thielemann wrote: If all methods of AbGroup can be defined for all Num types - why do you want an AbGroup at all? You could simply write functions with Num constraint. Well, I'd rather not have to implement (*), abs, etc on every abelian group. You may be also

Re: [Haskell-cafe] plugins and internal error: stg_ap_v_ret

2011-01-31 Thread Andy Stewart
Hi Michael, plugins use it's own function instead GHC API, so it's easy to break with new version GHC. -- Andy Michael Snoyman mich...@snoyman.com writes: Hi all, I'm trying to convert wai-handler-devel to use plugins instead of hint, but cannot even get some basic usages to work

Re: [Haskell-cafe] Loading bitmap with xlib

2011-01-31 Thread Conrad Parker
On 31 January 2011 21:40, Francesco Mazzoli f...@mazzo.li wrote: Francesco Mazzoli f at mazzo.li writes: At the end I gave up and I wrote the function myself: http://hpaste.org/43464/readbitmapfile cool ... the listed maintainer for the Xlib bindings is librar...@haskell.org. Perhaps you

[Haskell-cafe] Automatically move cursor focus in split window in haskell-mode in emacs on load (C-c C-l) command?

2011-01-31 Thread Steven Collins
I'm using haskell-mode-2.8.0 and emacs 22.2.1 on Ubuntu 9.10 The following elisp code works for me to change the focus to the GHCi buffer (window) after the C-c C-l command in Haskell Mode. Try this in your .emacs file. (defadvice inferior-haskell-load-file (after change-focus-after-load)

Re: [Haskell-cafe] Cabal ignores ld-options? - 2011 remix

2011-01-31 Thread Ryan Newton
Oops, I guess I misinterpreted package description. It did sound a little dangerous ;-). What you suggested also worked. I'm in good shape now. Thanks again, -Ryan On Mon, Jan 31, 2011 at 11:24 AM, Duncan Coutts duncan.cou...@googlemail.com wrote: On Mon, 2011-01-31 at 09:52 -0500, Ryan

Re: [Haskell-cafe] Splittable random numbers

2011-01-31 Thread Ryan Newton
Small update: I got the first results from the hardware accelerated version on a 3.33 ghz westmere machine. Right now it does twice as well as the Gladman software version, which is also twice as well as the System.Random stdgen, and 1000 times faster than a the Haskell implementation of AES

Re: [Haskell-cafe] Packages all screwed up

2011-01-31 Thread Arnaud Bailly
Hi, Thanks for your answers. I did cabal upgrade yesod As for the user/global issue, I think I tried a user install, this is default isn't it? Looks like I will have to reinstall everything :-( Arnaud On Tue, Feb 1, 2011 at 1:34 AM, Antoine Latter aslat...@gmail.com wrote: On Mon, Jan 31,