Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guards loops]

2013-07-11 Thread oleg
I'd like to emphasize that there is a precedent to non-recursive let in the world of (relatively pure) lazy functional programming. The programming language Clean has such non-recursive let and uses it and the shadowing extensively. They consider shadowing a virtue, for uniquely typed data.

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-11 Thread AntC
oleg at okmij.org writes: ... In Haskell I'll have to uniquely number the s's: let (x,s1) = foo 1 [] in let (y,s2) = bar x s1 in let (z,s3) = baz x y s2 in ... and re-number them if I insert a new statement. I once wrote about 50-100 lines of code with the

[Haskell-cafe] Problem with pipes interpretation of Lazy MapM program.

2013-07-11 Thread Lyndon Maydwell
Hi café. I've come up with a little version of 'uniq' that should take into account md5 sums of the file changes... In essence, this: main :: IO () main = getContents = mapM check . lines -- PROBLEM = mapM_ (putStrLn . ( -- ++ )) . strip check :: String - IO (String, ABCD) check s =

Re: [Haskell-cafe] Music / MIDI help

2013-07-11 Thread Heinrich Apfelmus
Mark Lentczner wrote: I'm a little lost in the bewildering array of music packages for Haskell, and need some help. I'm looking to recreate one of my algorithmic music compositions from the 1980s. I can easily code the logic in Haskell. I'm looking for a the right set of packages and SW so

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-11 Thread Edward Kmett
On Wed, Jul 10, 2013 at 3:47 AM, o...@okmij.org wrote: Jon Fairbairn wrote: It just changes forgetting to use different variable names because of recursion (which is currently uniform throughout the language) to forgetting to use non recursive let instead of let. Let me bring to the

Re: [Haskell-cafe] Non-recursive let

2013-07-11 Thread Doug McIlroy
By analogy to ML, which has let and let rec, where the latter corresponds to Haskell's let, one is led to let nonrec. I would definitely not like shadow, for it means that new variable does NOT cast a shadow on its definining expression. I fear also that let nonrec by any name would introduce

[Haskell-cafe] How to use cabal-dev ghci and multiple targets/build-depends from cabal file?

2013-07-11 Thread Kirill Zaborsky
Currently I'm creating a small library and I wanted to create tests for it. So I have a library section in cabal file and also a test-suite section. Everything goes well but when I tried to load file with tests into ghci (actually it was a REPL in emacs) I received errors stating that GHCi can

Re: [Haskell-cafe] How to use cabal-dev ghci and multiple targets/build-depends from cabal file?

2013-07-11 Thread Kirill Zaborsky
The onlys solution I see at the moment is to get rid of cabal-dev and install dependencies globally (which works quite OK with gentoo-haskell) Kind regards, Kirill Zaborsky четверг, 11 июля 2013 г., 15:55:15 UTC+4 пользователь Kirill Zaborsky написал: Currently I'm creating a small library

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-11 Thread Michael Snoyman
On Thu, Jul 11, 2013 at 3:44 AM, John Lato jwl...@gmail.com wrote: Hi Michael, I don't think those are particularly niche cases, but I still think this is a bad approach to solving the problem. My reply to Erik explicitly covers the worker thread case, and for running arbitrary user code

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-11 Thread Felipe Almeida Lessa
On Thu, Jul 11, 2013 at 10:56 AM, Michael Snoyman mich...@snoyman.com wrote: The only approach that handles the situation correctly is John's separate thread approach (tryAll3). I think you meant tryAll2 here. Got me confused for some time =). Cheers, -- Felipe.

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-11 Thread Carter Schonwald
Yup. Nested cases *are* non recursive lets. (Can't believe I forgot about that ) On Thursday, July 11, 2013, Edward Kmett wrote: On Wed, Jul 10, 2013 at 3:47 AM, o...@okmij.org javascript:_e({}, 'cvml', 'o...@okmij.org'); wrote: Jon Fairbairn wrote: It just changes forgetting to use

Re: [Haskell-cafe] Netwire bouncing ball

2013-07-11 Thread Just
On 07/10/2013 11:44 PM, Ertugrul Söylemez wrote: A very simple way to do this is to use integralLim_ instead of integral_. It allows the ball itself to handle the bouncing. A less invasive way (i.e. you can add it to your example) is to use the (--) combinator: ball = integral_ 0 .

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-11 Thread Michael Snoyman
On Thu, Jul 11, 2013 at 6:07 PM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Thu, Jul 11, 2013 at 10:56 AM, Michael Snoyman mich...@snoyman.com wrote: The only approach that handles the situation correctly is John's separate thread approach (tryAll3). I think you meant

[Haskell-cafe] Comparing functions

2013-07-11 Thread Vlatko Basic
Hello Cafe, I have data CmpFunction a = CF (a - a - Bool) that contains comparing functions, like ==, , ..., and I'm trying to declare the Show instance for it like this instance Show (CmpFunction a) where show (CF (==)) = ==-- no good show f = case

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Brandon Allbery
On Thu, Jul 11, 2013 at 1:33 PM, Vlatko Basic vlatko.ba...@gmail.comwrote: data CmpFunction a = CF (a - a - Bool) that contains comparing functions, like ==, , ..., and I'm trying to declare the Show instance for it like this instance Show (CmpFunction a) where show (CF

[Haskell-cafe] Well-Typed are hiring: Haskell developer

2013-07-11 Thread Duncan Coutts
Fellow Haskellers, We are looking to hire a Haskell expert to work with us at Well-Typed as a Haskell developer. This is an exciting opportunity for someone who is passionate about Haskell and who is keen to improve and promote Haskell in a professional context. The role is quite general and

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Timon Gehr
On 07/11/2013 07:33 PM, Vlatko Basic wrote: Hello Cafe, I have data CmpFunction a = CF (a - a - Bool) that contains comparing functions, like ==, , ..., and I'm trying to declare the Show instance for it like this instance Show (CmpFunction a) where show (CF (==)) = ==

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Vlatko Basic
Original Message Subject: Re: [Haskell-cafe] Comparing functions From: Brandon Allbery allber...@gmail.com To: Vlatko Bašić vlatko.ba...@gmail.com Cc: Haskell-Cafe haskell-cafe@haskell.org Date:

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Roman Cheplyaka
* Vlatko Basic vlatko.ba...@gmail.com [2013-07-11 19:33:38+0200] Hello Cafe, I have data CmpFunction a = CF (a - a - Bool) that contains comparing functions, like ==, , ..., and I'm trying to declare the Show instance for it like this instance Show (CmpFunction a) where

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread David Thomas
On Thu, Jul 11, 2013 at 10:50 AM, Brandon Allbery allber...@gmail.comwrote: ... but functions don't have an Eq instance, and *can't* have one. Not a general one that's interesting. There are two Eq instances that'll compile for all functions (not that it's advisable): instance Eq ((-) a b)

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Brandon Allbery
On Thu, Jul 11, 2013 at 2:11 PM, Vlatko Basic vlatko.ba...@gmail.comwrote: The problem here isn't quite what you think it is; (==) is not a constructor, therefore it is a *variable*. It's exactly the same problem as a = 5 -- ... foo a = 3 -- this does NOT compare with the

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Vlatko Basic
Original Message Subject: Re: [Haskell-cafe] Comparing functions From: Brandon Allbery allber...@gmail.com To: Vlatko Bašić vlatko.ba...@gmail.com Cc: Haskell-Cafe haskell-cafe@haskell.org Date:

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Brandon Allbery
On Thu, Jul 11, 2013 at 2:58 PM, Vlatko Basic vlatko.ba...@gmail.comwrote: Hm, I thought it is a pattern match with constant, as in f ('a':xs) == I wonder what you'd make of this definition, then? (*) `on` f = \x y - f x * f y According to the enlightenment above, I'd say (*) is a

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Vlatko Basic
Original Message Subject: Re: [Haskell-cafe] Comparing functions From: Brandon Allbery allber...@gmail.com To: Vlatko Bašić vlatko.ba...@gmail.com Cc: Haskell-Cafe haskell-cafe@haskell.org Date:

Re: [Haskell-cafe] Non-recursive let

2013-07-11 Thread Andreas Abel
Note that for non-recursive lets let' x1 = e1 x2 = e2 is sequential and *not* the same as the parallel let' (x1, x2) = (e1, e2) The first is (\ x1 - (\x2 - ...) e2) e1 and the second is (\ (x1,x2) - ...) (e1, e2) On 11.07.2013 13:36, Doug McIlroy wrote: By analogy to ML,

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-11 Thread Andreas Abel
I can do this without extra indentation: (|) = flip ($) f = 5 | \ x - 6 | \ y - x + y Non-recursive let is as superfluous as the do-notation. On 11.07.2013 17:40, Carter Schonwald wrote: Yup. Nested cases *are* non recursive lets. (Can't believe I forgot about that ) On

Re: [Haskell-cafe] Netwire bouncing ball

2013-07-11 Thread Oliver Charles
On 07/11/2013 05:52 PM, Just wrote: On 07/10/2013 11:44 PM, Ertugrul Söylemez wrote: A very simple way to do this is to use integralLim_ instead of integral_. It allows the ball itself to handle the bouncing. A less invasive way (i.e. you can add it to your example) is to use the (--)

[Haskell-cafe] There was someone here going to use REPA and a functional way to find eigenvalues :)

2013-07-11 Thread KC
Have you succeeded? In general, is there a functional way to do matrix manipulations? Linear algebra? Linear programming? Integer Programming? Numerical Analysis? Casey -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Do combinatorial algorithms have a matroid strucutre XOR non-matroid structure?

2013-07-11 Thread KC
I ask this on this mailing list because there are quite a few mathematically oriented people here. Casey -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Netwire bouncing ball

2013-07-11 Thread Ertugrul Söylemez
Just hask...@justnothing.org wrote: Thank you very much, this works as expected and is easy to understand. However a complete example of a bouncing ball would be super awesome since I have trouble to get it work with integralLim_. My first try was to use object_ from Control.Wire.Prefab.Move

Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guards loops]

2013-07-11 Thread Richard A. O'Keefe
On 11/07/2013, at 6:16 PM, o...@okmij.org wrote: I'd like to emphasize that there is a precedent to non-recursive let in the world of (relatively pure) lazy functional programming. So what? You can find precedents for almost anything. I could even point you to a lazy mostly-functional

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-11 Thread John Lato
I agree that how the exception was thrown is more interesting than the type. I feel like there should be a way to express the necessary information via the type system, but I'm not convinced it's easy (or even possible). Another issue to be aware of is that exceptions can be thrown from pure

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-11 Thread Edward Kmett
Lens even supplies this as () On Thu, Jul 11, 2013 at 5:18 PM, Andreas Abel andreas.a...@ifi.lmu.dewrote: I can do this without extra indentation: (|) = flip ($) f = 5 | \ x - 6 | \ y - x + y Non-recursive let is as superfluous as the do-notation. On 11.07.2013 17:40,

[Haskell-cafe] OS X ghci problem

2013-07-11 Thread Brian Lewis
Here's a problem variations of which have been plaguing the Haskell community for as long as I can remember. To see it for yourself: 1.) Be running OS X 2.) install GLFW-b-1.0.0 (you may need to cabal update) [1] 3.) ghci -package GLFW-b 4.) import Graphics.UI.GLFW as GLFW 5.) GLFW.init Security