Re: Re[2]: [Haskell-cafe] Linking to third party libraries in windows

2006-05-28 Thread Brian Hulley
Bulat Ziganshin wrote: Hello Brian, Sunday, May 28, 2006, 1:06:06 AM, you wrote: how best to understand IO but certainly before trying to do so, a state monad is *infinitely* easier to understand and then provides a good basis for understanding IO) The first monad I understood was the

Re: [Haskell-cafe] Linking to third party libraries in windows

2006-05-27 Thread Matthew Bromberg
That's an interesting statement that bears further scrutiny. I've been viewing monads as a kind of encapsulation in a quasi-hidden world state. Yes a monad is a function that would give you an output if you had access to the input world. That is the picture drawn in Simon Peyton Jones'

Re: [Haskell-cafe] Linking to third party libraries in windows

2006-05-27 Thread Brian Hulley
Matthew Bromberg wrote: That's an interesting statement that bears further scrutiny. I've been viewing monads as a kind of encapsulation in a quasi-hidden world state. The IO monad can be viewed as encapsulating a function from a world state to a pair consisting of an updated world state and

Re: [Haskell-cafe] Linking to third party libraries in windows

2006-05-27 Thread Brian Hulley
Brian Hulley wrote: If I write: do let n = newListArray a l p - n q - n two separate arrays will be created, because n is the action of creating a new array, and this action is executed twice in the body of the do. However, if I instead wrote: do x

Re[2]: [Haskell-cafe] Linking to third party libraries in windows

2006-05-27 Thread Bulat Ziganshin
Hello Brian, Sunday, May 28, 2006, 1:06:06 AM, you wrote: how best to understand IO but certainly before trying to do so, a state monad is *infinitely* easier to understand and then provides a good basis for understanding IO) The first monad I understood was the state monad on page 261 of

Re: [Haskell-cafe] Linking to third party libraries in windows

2006-05-26 Thread Matthew Bromberg
Not only does your suggestion make more sense than what I was doing, but also it causes the 'matrices' to behave as expected, namely to have the side effects incorporated into their array values. I can't say I fully understand why this is true. In both cases I was wrapping Rmatrix in a monad

Re[2]: [Haskell-cafe] Linking to third party libraries in windows

2006-05-26 Thread Bulat Ziganshin
Hello Matthew, Friday, May 26, 2006, 11:50:28 AM, you wrote: I can't say I fully understand why this is true. In both cases I was wrapping Rmatrix in a monad after every computation. The difference is that the array component had an additional monad wrapper around and now it doesn't.

Re: [Haskell-cafe] Linking to third party libraries in windows

2006-05-26 Thread Brian Hulley
Dear friends - I must have clicked reply instead of reply all so here is the reply haskell cafe would have received: Matthew Bromberg wrote: Not only does your suggestion make more sense than what I was doing, but also it causes the 'matrices' to behave as expected, namely to have the side

[Haskell-cafe] Linking to third party libraries in windows

2006-05-25 Thread SevenThunders
Has anyone actually seen ghc link successfully to third party libraries on windows? While I have been able to link to C object code compiled by ghc (and thus gcc by proxy), I have not been able to actually link against any substantial third party library or dll in windows. I am currently

Re: [Haskell-cafe] Linking to third party libraries in windows

2006-05-25 Thread Brian Hulley
SevenThunders wrote: Has anyone actually seen ghc link successfully to third party libraries on windows? Yes - I'm currently writing a Haskell app that uses a Visual C++ DLL that I'm also writing. It is quite complicated to link Haskell to Windows DLLs, so I made a page describing how to do

Re: [Haskell-cafe] Linking to third party libraries in windows

2006-05-25 Thread Matthew Bromberg
OK I'm punting on the AMD libraries for now and will just use the Atlas libraries until I can get to the bottom of this. However, for me, it seems the rabbit hole goes a little deeper on the issue of array copies. Consider this code snippet import Matrix main = do print Matrices let