Re: [Haskell-cafe] prettyprint with IO

2012-04-12 Thread Stephen Tetley
Haskell-src-exts has had a monadic wrapper over HughesPJ for a long time. It is just a Reader (not a transformer) so it can handle user supplied spacing widths, etc. On 13 April 2012 06:02, Warren Harris wrote: > > Thanks for the suggestions. No sooner did I send my message than I came to > the

Re: [Haskell-cafe] prettyprint with IO

2012-04-12 Thread Warren Harris
Antoine, Thanks for the suggestions. No sooner did I send my message than I came to the same conclusion of creating a monadic version of the combinators to simplify the migration. It actually worked out fairly well -- most of the code ported over to the monadic version unaltered. The only excep

Re: [Haskell-cafe] prettyprint with IO

2012-04-12 Thread Evan Laforge
On Thu, Apr 12, 2012 at 6:22 PM, Antoine Latter wrote: > Hi Warren, > > On Thu, Apr 12, 2012 at 6:31 PM, Warren Harris > wrote: >> I wrote a parsec parser that does symbols lookups during the parsing process >> (ParsecT String Store IO a). Now I'd like to write a pretty printer that >> does th

Re: [Haskell-cafe] prettyprint with IO

2012-04-12 Thread Antoine Latter
Hi Warren, On Thu, Apr 12, 2012 at 6:31 PM, Warren Harris wrote: > I wrote a parsec parser that does symbols lookups during the parsing process > (ParsecT String Store IO a). Now I'd like to write a pretty printer that does > the reverse. Unfortunately there doesn't appear to be a transformer v

Re: [Haskell-cafe] I Need a Better Functional Language!

2012-04-12 Thread Conal Elliott
Agreed. The original note confuses programs (syntax) with functions (semantics). -- Conal On Thu, Apr 5, 2012 at 8:52 AM, Dan Doel wrote: > On Thu, Apr 5, 2012 at 10:14 AM, Grigory Sarnitskiy > wrote: > > First, what are 'functions' we are interested at? It can't be the usual > set-theoretic d

[Haskell-cafe] prettyprint with IO

2012-04-12 Thread Warren Harris
I wrote a parsec parser that does symbols lookups during the parsing process (ParsecT String Store IO a). Now I'd like to write a pretty printer that does the reverse. Unfortunately there doesn't appear to be a transformer version of Text.PrettyPrint.HughesPJ. Can anyone suggest a way to do this

Re: [Haskell-cafe] Is type class 'Addressable' already exists.

2012-04-12 Thread Michael Sloan
I think this is the result of a bit of a dilemma: 1) We want to express the fact that any Indexable thing also has a straightforward definition for lookup. 2) Not all things supporting lookup support index, hence the direction of the class hierarchy. This is an ugly part of the default methods s

Re: [Haskell-cafe] open source project for student

2012-04-12 Thread Jeremy O'Donoghue
Hi Dan, I am the maintainer of wxHaskell, but please don't let that worry you, as I'm actually not going to go on and recommend wxHaskell as an Open Source project for a relative beginner - it is architecturally complex, and you need to know as much C++ as you do Haskell. You might choose to *use*

Re: [Haskell-cafe] Is type class 'Addressable' already exists.

2012-04-12 Thread 陈文龙
The Indexable class is declared as class Lookup f => Indexable f where index :: f a -> Key f -> a Why f must be instance of Lookup? 2012/4/12 Michael Sloan > Hello! > > Yes, classes of that variety exist in a few packages. This is a > particularly good treatment of it: > > http://hackage.ha

Re: [Haskell-cafe] Is type class 'Addressable' already exists.

2012-04-12 Thread Michael Sloan
Hello! Yes, classes of that variety exist in a few packages. This is a particularly good treatment of it: http://hackage.haskell.org/package/keys Here are some classes from a very WIP implementation of a few "Commutative Replicated Data Types": https://github.com/mgsloan/crdt/blob/master/src/