Compiling a cabal project with LLVM on GHC 7.10 RC1

2015-01-07 Thread Brandon Simmons
I've tried: $ cabal install --only-dependencies -w /usr/local/bin/ghc-7.10.0.20141222 --enable-tests --enable-benchmarks --ghc-option=-fllvm --ghc-option=-static $ cabal configure -w /usr/local/bin/ghc-7.10.0.20141222 --enable-tests --enable-benchmarks --ghc-option=-fllvm

Behavior of touch#

2014-12-15 Thread Brandon Simmons
The `primitive` package exports a lifted version of the undocumented `touch#` http://hackage.haskell.org/package/ghc-prim-0.3.1.0/docs/GHC-Prim.html which has type: touch :: PrimMonad m = a - m () I'd like to know if this works correctly in general, or will it suffer from the same

Defining a custom newByteArray primop that uses calloc?

2014-11-25 Thread Brandon Simmons
In my tests, using calloc from: https://hackage.haskell.org/package/missing-foreign-0.1.1/docs/Foreign-Marshal-MissingAlloc.html was about twice as fast as allocating and zeroing the same amount of memory with `newByteArray` + any of `copy/set/fillMutableByteArray` (all three were nearly

Avoiding BlockedIndefinitelyOnSTM exceptions

2014-07-18 Thread Brandon Simmons
I have what may sound like an unusual request: I would like to automatically avoid `BlockedIndefinitelyOnSTM` exceptions with a primitive that looks something like this: Have you seen ezyang's post here? Lots of hairy details that are probably relevant

Re: Why no `instance (Monoid a, Applicative f)= Monoid (f a)` for IO?

2014-07-15 Thread Brandon Simmons
)' won't fly for overlap reasons though. -Edward On Mon, Jul 14, 2014 at 6:55 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: It seems to me that this should be true for all `f a` like: instance (Monoid a, Applicative f)= Monoid (f a) where mappend = liftA2 mappend

Why no `instance (Monoid a, Applicative f)= Monoid (f a)` for IO?

2014-07-14 Thread Brandon Simmons
It seems to me that this should be true for all `f a` like: instance (Monoid a, Applicative f)= Monoid (f a) where mappend = liftA2 mappend mempty = pure mempty But I can't seem to find the particular `instance (Monoid a)= Monoid (IO a)` anywhere. Would that instance be incorrect,

Re: Using mutable array after an unsafeFreezeArray, and GC details

2014-05-12 Thread Brandon Simmons
On Mon, May 12, 2014 at 4:32 AM, Simon Marlow marlo...@gmail.com wrote: On 09/05/2014 19:21, Brandon Simmons wrote: A couple of updates: Edward Yang responded here, confirming the sort of track I was thinking on: http://blog.ezyang.com/2014/05/ghc-and-mutable-arrays-a-dirty-little-secret

Using mutable array after an unsafeFreezeArray, and GC details

2014-05-09 Thread Brandon Simmons
A couple of updates: Edward Yang responded here, confirming the sort of track I was thinking on: http://blog.ezyang.com/2014/05/ghc-and-mutable-arrays-a-dirty-little-secret/ And I can report that: 1) cloning a frozen array doesn't provide the benefits of creating a new array and freezing

Re: Using mutable array after an unsafeFreezeArray, and GC details

2014-05-09 Thread Brandon Simmons
On May 9, 2014 5:13 PM, Edward Z. Yang ezy...@mit.edu wrote: Hello Brandon, Excerpts from Brandon Simmons's message of 2014-05-08 16:18:48 -0700: I have an unusual application with some unusual performance problems and I'm trying to understand how I might use unsafeFreezeArray to help

Using mutable array after an unsafeFreezeArray, and GC details

2014-05-08 Thread Brandon Simmons
I have an unusual application with some unusual performance problems and I'm trying to understand how I might use unsafeFreezeArray to help me, as well as understand in detail what's going on with boxed mutable arrays and GC. I'm using the interface from 'primitive' below. First some basic

Re: New INLINE pragma syntax idea, and some questions

2012-08-04 Thread Brandon Simmons
On Sat, Aug 4, 2012 at 6:22 AM, Dan Doel dan.d...@gmail.com wrote: On Aug 3, 2012 11:13 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: In particular I don't fully understand why these sorts of contortions... http://hackage.haskell.org/packages/archive/base/latest/doc/html/src/GHC

New INLINE pragma syntax idea, and some questions

2012-08-03 Thread Brandon Simmons
I've been wondering for some time about the details of how GHC uses syntax with inlining, and how other transformations come into play in the process (I recently asked a question on SO if anyone wants some karma: http://stackoverflow.com/q/11690146/176841). I know this is a big topic and there's

Re: Understanding behavior of BlockedIndefinitelyOnMVar exception

2011-07-26 Thread Brandon Simmons
On Tue, Jul 26, 2011 at 1:25 AM, Edward Z. Yang ezy...@mit.edu wrote: Hello Brandon, The answer is subtle, and has to do with what references are kept in code, which make an object considered reachable.  Essentially, the main thread itself keeps the MVar live while it still has forking to do,

Re: Understanding behavior of BlockedIndefinitelyOnMVar exception

2011-07-25 Thread Brandon Simmons
On Sun, Jul 24, 2011 at 10:02 PM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Sun, Jul 24, 2011 at 7:56 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: What I think I've learned here is that the BlockedIndefinitelyOnMVar exception is raised in all the blocked threads at once

Re: Understanding behavior of BlockedIndefinitelyOnMVar exception

2011-07-25 Thread Brandon Simmons
On Sun, Jul 24, 2011 at 10:07 PM, Edward Z. Yang ezy...@mit.edu wrote: Excerpts from Felipe Almeida Lessa's message of Sun Jul 24 22:02:36 -0400 2011: Does anything change if you somehow force a GC sometime after good2?  Perhaps with some calculation generating garbage, perhaps with

Understanding behavior of BlockedIndefinitelyOnMVar exception

2011-07-24 Thread Brandon Simmons
anyone comment on the two conclusions above? FWIW, this was an interesting related thread: http://comments.gmane.org/gmane.comp.lang.haskell.glasgow.user/18667 Thanks, Brandon Simmons http://coder.bsimmons.name ___ Glasgow-haskell-users mailing list