Re: [Haskell-cafe] implementing a text editor swap file

2012-01-18 Thread Gracjan Polak
Erik de Castro Lopo mega-nerd.com> writes: > > Matthew Farkas-Dyck wrote: > > > http://hackage.haskell.org/package/bytestring-mmap > > Since he's editing text, its a pity there isn't a text-mmap > package . Well, this one: http://hackage.haskell.org/package/mmap works not only for Text but

Re: [Haskell-cafe] implementing a text editor swap file

2012-01-17 Thread Erik de Castro Lopo
Martin DeMello wrote: > Just plain String, mostly because it's what Gtk.Entry works with. I'll > take a look at Text. Ah, maybe not. If your output representation *has* to be String its probably not worth using Text as an internal representation. I suspect that Gtk should really be updated to al

Re: [Haskell-cafe] implementing a text editor swap file

2012-01-17 Thread Martin DeMello
On Tue, Jan 17, 2012 at 6:24 PM, Erik de Castro Lopo wrote: > Martin DeMello wrote: > >> Further question - my internal data representation is a vector of >> strings (it's a line-based editor). > > String or ByteString or Text? > > If its either of the first two, I think you should definitely look

Re: [Haskell-cafe] implementing a text editor swap file

2012-01-17 Thread Erik de Castro Lopo
Martin DeMello wrote: > Further question - my internal data representation is a vector of > strings (it's a line-based editor). String or ByteString or Text? If its either of the first two, I think you should definitely look at Text. > Is there a more efficient strategy > to keep an mmap buffer

Re: [Haskell-cafe] implementing a text editor swap file

2012-01-17 Thread Martin DeMello
On Tue, Jan 17, 2012 at 5:49 PM, Erik de Castro Lopo wrote: > Matthew Farkas-Dyck wrote: > >> http://hackage.haskell.org/package/bytestring-mmap > > Since he's editing text, its a pity there isn't a text-mmap > package :-). Further question - my internal data representation is a vector of strings

Re: [Haskell-cafe] implementing a text editor swap file

2012-01-17 Thread Matthew Farkas-Dyck
On 17/01/2012, Erik de Castro Lopo wrote: > Matthew Farkas-Dyck wrote: > >> http://hackage.haskell.org/package/bytestring-mmap > > Since he's editing text, its a pity there isn't a text-mmap > package :-). Yeah, I had the same thought. > Erik > -- > --

Re: [Haskell-cafe] implementing a text editor swap file

2012-01-17 Thread Martin DeMello
Says posix only. But googling for it brought up System.IO.MMap, which does seem to be cross-platform. martin On Tue, Jan 17, 2012 at 5:46 PM, Matthew Farkas-Dyck wrote: > http://hackage.haskell.org/package/bytestring-mmap > > > On 17/01/2012, Martin DeMello wrote: >> I'm writing a gtk2hs-based

Re: [Haskell-cafe] implementing a text editor swap file

2012-01-17 Thread Erik de Castro Lopo
Matthew Farkas-Dyck wrote: > http://hackage.haskell.org/package/bytestring-mmap Since he's editing text, its a pity there isn't a text-mmap package :-). Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/

Re: [Haskell-cafe] implementing a text editor swap file

2012-01-17 Thread Matthew Farkas-Dyck
http://hackage.haskell.org/package/bytestring-mmap On 17/01/2012, Martin DeMello wrote: > I'm writing a gtk2hs-based text editor, and would like to implement > continuous (swap-file based) autosave the way vim and emacs do it. Any > suggestions for how to implement this in a cross-platform manne