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

[Haskell] [ANN] shapely-data v0.1

2013-12-23 Thread Brandon Simmons
This is the first *real* release `shapely-data`, a haskell library up here on hackage: http://hackage.haskell.org/package/shapely-data for working with algebraic datatypes in a simple generic form made up of haskell's primitive product, sum and unit types: `(,)`, `Either`, and `()`. You can

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

[Haskell-cafe] ANNOUNCE: simple-actors 0.1.0 - an eDSL library for actor model concurrency

2011-10-11 Thread Brandon Simmons
I'm happy to announce the release of my library 'simple-actors', a DSL-style library for more structured concurrent programs based on the Actor Model. It offers an alternative to ad-hoc use of Chans that allows for tight control of side-effects and message passing, and is especially suited to

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

[Haskell] ANNOUNCE: PEZ, the Potentially Excellent Zipper library

2011-04-22 Thread Brandon Simmons
(show . fst) $ getLeftmost tree You can also experiment with zipping through computations. It's as simple as defining a new fclabel lens for a reversible computation, e.g.: reversible :: (Show b, Read b) = b :- String reversible = lens show (const . read) Thanks, Brandon Simmons http

Re: [Haskell-cafe] Help defining a Typeable polymorphic-state monad transformer

2010-12-07 Thread Brandon Simmons
this existed. Looks perfect. Thanks so much, Brandon On Mon, Dec 6, 2010 at 9:09 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: Hi all, I gave myself until this evening to figure this out on my own, and time is up! Hopefully this makes for a good discussion, though the idea could be dumb

[Haskell-cafe] Help defining a Typeable polymorphic-state monad transformer

2010-12-06 Thread Brandon Simmons
with the Typeable class? Any thoughts on this are appreciated. Sincerely, Brandon Simmons http://coder.bsimmons.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] [ANNOUNCE] (and request for review): directory-tree v0.9.0

2010-08-10 Thread Brandon Simmons
On Tue, Aug 10, 2010 at 4:34 PM, Jason Dagit da...@codersbase.com wrote: On Mon, Aug 9, 2010 at 10:48 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: Greetings Haskellers! directory-tree is a module providing a directory-tree-like datatype along with Foldable and Traversable

[Haskell-cafe] [ANNOUNCE] (and request for review): directory-tree v0.9.0

2010-08-09 Thread Brandon Simmons
and for any input, especially performance suggestions or opinions on my unsafe function usage. I hope this is useful to someone. SIncerely, Brandon Simmons http://coder.bsimmons.name/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] An experimental Zipper using Thrists and first-class Labels. Help or thoughts?

2010-07-27 Thread Brandon Simmons
On Tue, Jul 27, 2010 at 1:59 AM, Jason Dagit da...@codersbase.com wrote: On Mon, Jul 26, 2010 at 9:00 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: I had the idea for a simple generic Zipper data structure that I thought would be possible to implement using type-threaded lists

[Haskell-cafe] An experimental Zipper using Thrists and first-class Labels. Help or thoughts?

2010-07-26 Thread Brandon Simmons
) -- close zipper unzipper :: Zipper t c - t unzipper (Z(thr,c)) = undefined --foldThrist ($) id thr c -- END CODE --- Thanks, Brandon Simmons http://coder.bsimmons.name/blog/ ___ Haskell

[Haskell-cafe] Help debugging code broken after upgrading debian to GHC 6.12: invalid argument

2010-05-15 Thread Brandon Simmons
On May 14, 2010, at 20:24 , Brandon Simmons wrote: The other baffling thing is this: if the debugging line 426 is uncommented, then even running: $ runghc Befunge.hs --quiet mycology.b98 ...will fail. But all we're doing is a call to `putStr`! Why would that trigger an error?! Maybe

[Haskell-cafe] Help debugging code broken after upgrading debian to GHC 6.12: invalid argument

2010-05-15 Thread Brandon Simmons
GHC 6.12's runtime handles input and output encoding, instead of simply truncating Chars; my guess is it's locale-related. And sure enough, I see several non-ASCII characters in mycology.b98 which are likely to do the wrong thing if the runtime doesn't know which character set to use.

[Haskell-cafe] Can't get Regions to show up in HGL

2010-03-13 Thread Brandon Simmons
using it correctly? If I am, then any other help is greatly appreciated. I am on Debian Squeeze using GHC 6.12.1 (thanks debian maintainers!), and using HGL-3.2.0.2 Thanks, Brandon Simmons http://coder.bsimmons.name ___ Haskell-Cafe mailing list Haskell

Re: [Haskell-cafe] Why can't we make an instance declaration on a type synonym?

2010-01-04 Thread Brandon Simmons
On Sun, Jan 3, 2010 at 2:22 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: jberryman brandon.m.simm...@gmail.com writes: This may be a dumb question, but why can we not declare a Monad instance of a type synonym? This question came to me while working with the State monad recently

Re: [Haskell-cafe] Why can't we make an instance declaration on a type synonym?

2010-01-04 Thread Brandon Simmons
On Mon, Jan 4, 2010 at 12:11 PM, Reid Barton rwbar...@math.harvard.edu wrote: On Mon, Jan 04, 2010 at 11:50:57AM -0500, Brandon Simmons wrote: On Sun, Jan 3, 2010 at 2:22 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: jberryman brandon.m.simm...@gmail.com writes: This may