Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-12 Thread Matthew Pocock
x - take_while some_condition some_list and x - takeWhile someCondition someList x - take-while some-condition some-list As someone who is dyslexic, I find both camelCase and dashes far easier to read than underscores. I find it hard to count the words in the underscore version - the

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-03 Thread Matthew Pocock
Perhaps what you are looking for is a more powerful defining semantics? newtype MyFoo = Foo defining (Foo(..)) -- all class instances that Foo has are delegated through from MyFoo Matthew not sure if this is what you are thinking at, but everytime I wrap a type Foo in a newtype MyFoo to

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-03 Thread Matthew Pocock
Of course, I meand 'deriving', not 'defining' /me embarsed 2009/12/3 Matthew Pocock matthew.poc...@ncl.ac.uk Perhaps what you are looking for is a more powerful defining semantics? newtype MyFoo = Foo defining (Foo(..)) -- all class instances that Foo has are delegated through from MyFoo

Re: [Haskell-cafe] Graph drawing library for Haskell

2009-11-20 Thread Matthew Pocock
I have had some luck with the graphviz (dotter) bindings for drawing node/ark graphs. It's not an ideal solution, and will require some wrappers to bind to your data structures, but it does work. Matthew 2009/11/20 Victor Mateus Oliveira rhapso...@gmail.com Hi, Anyone knows a good library

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-12 Thread Matthew Pocock
2009/11/12 Heinrich Apfelmus apfel...@quantentunnel.de Interestingly, this is different from Control.Monad.State.Strict . The latter never forces the state itself, just the pair constructor of the (result,state) pair. Yes. This bit me the first time I came across it. I think we need a

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-12 Thread Matthew Pocock
2009/11/12 Heinrich Apfelmus apfel...@quantentunnel.de Interestingly, this is different from Control.Monad.State.Strict . The latter never forces the state itself, just the pair constructor of the (result,state) pair. Yes. This bit me the first time I came across it. I think we need a

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-12 Thread Matthew Pocock
How about: instance (Monad m) = MonadState s (SStateT s m) where get = S get put s = S (put $ using s $ strategy m) where our state monad has a strategy field? Matthew ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Long running Haskell program

2009-11-11 Thread Matthew Pocock
Is there a state monad that is strict on the state but lazy on the computation? Of course, strictness in the state will force a portion of the computation to be run, but there may be significant portions of it which are not run. Would there be a way to write a state monad such that it is entirely

[Haskell] string type class

2009-03-06 Thread Matthew Pocock
Hi, It seems every time I look at hackage there is yet another stringy datatype. For lots of apps, the particular stringy datatype you use matters for performance but not algorithmic reasons. Perhaps this is a good time for someone to propose a stringy class? Matthew

Re: [Haskell-cafe] Re: Libraries need a new owner

2008-03-24 Thread Matthew Pocock
On Monday 24 March 2008, Don Stewart wrote: Let's get a new faster Data.Map and other containers ready to go by the end of the northern summer? And while we are visiting this, can I put in a vote for a seperation between the default Data.* container concrete implementations and associated

[Haskell-cafe] Random Monad

2008-03-24 Thread Matthew Pocock
Hi, Who currently maintains the Random monad code? I have some patches to contribute. Matthew ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Random Monad

2008-03-24 Thread Matthew Pocock
On Monday 24 March 2008, Henning Thielemann wrote: On Mon, 24 Mar 2008, Matthew Pocock wrote: Who currently maintains the Random monad code? I have some patches to contribute. Do you refer to the code on the wiki? No, to the code in darcs at http://code.haskell.org/monadrandom Matthew

[Haskell-cafe] hoisting as well as lifting and returning

2008-03-23 Thread Matthew Pocock
Hi, Happy Easter! I've been using monad transformers for the first time in anger this week. They certainly do the job. However, there's an operation that I keep defining over and over again. It is sort of like lift and return in that it's glue to get operations and values into the monad from

Re: [Haskell-cafe] hoisting as well as lifting and returning

2008-03-23 Thread Matthew Pocock
Hi Yitz, I was thinking along the lines of a class linking the monad transformer with the base monad: class (MonadTrans mt, Monad b) = MonadTForm mt b | mt - b where hoist :: (Monad m) = b a - mt m a This is to restrict it directly between the base monad and the transformed version. If

RE: Optimization beyond the Module Border

2008-03-20 Thread Matthew Pocock
| I'd be interested in any progress here -- we noticed issues with | optimisations in the stream fusion package across module boundaries | that we never tracked down. If there's some key things not firing, | that would be good to know. | | I suspect that if all modules are compiled -O0,

[Haskell-cafe] classes for data structures

2008-02-06 Thread Matthew Pocock
Hi, I've been working a lot with maps, sets and lists. While the process of getting things out of them is abstracted by foldable, traversable and friends, the process of building one up is not. Would it be possible to have something like: class Buildable b where empty :: b a --makes an

Re: [Haskell-cafe] Signature for non-empty filter

2008-02-06 Thread Matthew Pocock
On Wednesday 06 February 2008, Henning Thielemann wrote: If the type checker does not terminate because the checked function does not terminate on the example input, then the function does not pass the type check and as a compromise this would be ok. Can't fault this logic. The problem is

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Matthew Pocock
On Monday 04 February 2008, Adrian Hey wrote: Yikes! Also, I can't help thinking that the common justification for the current limit (that it helps find alleged bugs) is a little lame. It only helps find bugs if one expects ones program to use less than 8M of stack (hence if it's using more,

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Matthew Pocock
On Monday 04 February 2008, Neil Mitchell wrote: Hi That would be nice. But its only beneficial if there are programs which takes large amounts of stack at some point, but then shrink down to very little stack and continue for a reasonable amount of time. From the 'when I was a lad'

Re: [Haskell-cafe] Re: Re: hxt memory useage

2008-01-28 Thread Matthew Pocock
On Monday 28 January 2008, Rene de Visser wrote: It would be nice if HXT was incremental even when you are processing the whole tree. If I remember correctly, the data type of the tree in HXT is something like data Tree = Tree NodeData [Tree] which means that already processed parts of the

Re: [Haskell-cafe] hxt memory useage

2008-01-26 Thread Matthew Pocock
On Saturday 26 January 2008, Keith Fahlgren wrote: Perhaps a more modern approach would be StAX[1]-like rather than SAX-like? In either case, streaming, non-DOM. I am concerned by the number of people expressing willingness to abandon namespace support, but perhaps I'm being too much of a

[Haskell-cafe] hxt memory useage

2008-01-24 Thread Matthew Pocock
Hi, I've been using hxt to process xml files. Now that my files are getting a bit bigger (30m) I'm finding that hxt uses inordinate amounts of memory. I have 8g on my box, and it's running out. As far as I can tell, this memory is getting used up while parsing the text, rather than in any

Re: [Haskell-cafe] hxt memory useage

2008-01-24 Thread Matthew Pocock
On Thursday 24 January 2008, Albert Y. C. Lai wrote: Matthew Pocock wrote: I've been using hxt to process xml files. Now that my files are getting a bit bigger (30m) I'm finding that hxt uses inordinate amounts of memory. I have 8g on my box, and it's running out. As far as I can tell

Re: [Haskell-cafe] parsec and bytestring; was: hxt memory useage

2008-01-24 Thread Matthew Pocock
Would a bytestring-backed implementation of parsec solve my problems? Is there such a beast out there? Matthew ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: kind error

2007-10-23 Thread Matthew Pocock
Hi, Hello, data DecoratedFormula = DF{formula :: Formula, iformula :: IFormula} type FastClause = MH.Min US.Set DecoratedFormula FastClause.hs:71:25: `US.Set' is not applied to enough type arguments Expected kind `*', but `US.Set' has kind `* - *'

Re: [Haskell-cafe] Using GADTs

2007-07-29 Thread Matthew Pocock
On Sunday 29 July 2007, Jim Apple wrote: The way I would do this would be to encode as much of the value as I cared to in the constructors for concepts, rather than just encoding the top-level constructor. data Named data Equal a b data Negation a data Top data Concept t where

[Haskell-cafe] Using GADTs

2007-07-27 Thread Matthew Pocock
Hi, I'm trying to get to grips with GADTs, and my first attempt was to convert a simple logic language into negative normal form, while attempting to push the knowledge about what consitutes negative normal form into the types. My code is below. I'm not entirely happy with it, and would

[Haskell-cafe] partial kinds and instances

2007-04-16 Thread Matthew Pocock
Hi, I saw that it's possible to peal off kinds from the right-hand side when instantiating classes. Is it possible to peel them off from the left-hand side? Or in any order? I have been told in #haskell by people who seems to know that Very Bad Things happen if you do this without also making

Re: UTF-8 decoding error

2006-09-27 Thread Matthew Pocock
Fortress (sun's possibly-not-vaporware hpc language) supports arbitrary unicode chars in code, and has an escape syntax for commonly used things. Similarly, proof-general/isabelle supports tex-style escapes for symbols greek. It seems to me that a pre-processor that turns human-friendly

[Haskell-cafe] haskell - fpga

2006-08-30 Thread Matthew Pocock
Hi, Does anybody know of any compilers that can compile portions of a haskell program to an FPGA? I have found a few domain-specific languages implemented in haskell for FPGAs, but so far no back-ends for compilers like ghc. Thanks, Matthew ___

Re: [Haskell] problem building syb-generics

2006-07-11 Thread Matthew Pocock
On Tuesday 04 July 2006 13:20, Simon Peyton-Jones wrote: Lexically-scoped type variables are undergoing a slight upheaval in GHC 6.6 that has not quite settled, and that is what you are running into. Thanks for the help. After a lot of trial error, and reading and stuff I've got past the

[Haskell] problem building syb-generics

2006-07-04 Thread Matthew Pocock
Hi, I had some trouble getting syb-generics 2.9 to compile with ghc 6.5 (don't ask - I should probably be waiting for a stable release). I fixed the first problem by replacing a definition with in-line type info by splitting the type out, although I am not sure that I have done it right. Can