Re: [Haskell-cafe] PrefixMap: code review request

2006-02-27 Thread Robert Dockins
On Feb 27, 2006, at 2:30 PM, David F.Place wrote: Hi, I'm a newish Haskell hacker with way too much experience hacking Lisp.At first, I found my Haskell code looking very lisp-y. I think my code is becoming more idiomatic haskell. I would be very grateful to anyone who would take

Re: [Haskell-cafe] PrefixMap: code review request

2006-02-27 Thread David F. Place
On Feb 27, 2006, at 3:11 PM, Robert Dockins wrote: -- Nested tuple and lists types are pretty hard to read. In your code [([k],v)] appears a lot. Consider defining a type alias for it. Funny, of course as an inveterate lisp hacker, I am completely insensitive to nesting depth. :-)

Re: [Haskell-cafe] PrefixMap: code review request

2006-02-27 Thread Brian Hulley
David F.Place wrote: [snip] partList :: Ord k = [([k],v)]-[k]-[(k,[([k],v)])] partList pairs alphabet = reverse . fst $ foldl' f ([],pairs) alphabet where f (result,pairs) l = (result',rest) where (part,rest) = span ((==l) . head . fst) pairs result' = if null part

Re: [Haskell-cafe] PrefixMap: code review request

2006-02-27 Thread David F. Place
On Feb 27, 2006, at 5:54 PM, Brian Hulley wrote: there is a parse error (using ghc) at the line beginning with result'. This binding doesn't line up with anything. Also the second 'where' is dangerously close to the column started by the 'f' after the first 'where' (may not be noticeable

Re: [Haskell-cafe] PrefixMap: code review request

2006-02-27 Thread Brian Hulley
David F. Place wrote: On Feb 27, 2006, at 5:54 PM, Brian Hulley wrote: there is a parse error (using ghc) at the line beginning with result'. This binding doesn't line up with anything. Also the second 'where' is dangerously close to the column started by the 'f' after the first 'where' (may

Re: [Haskell-cafe] PrefixMap: code review request

2006-02-27 Thread Lennart Augustsson
David F.Place wrote: partList :: Ord k = [([k],v)]-[k]-[(k,[([k],v)])] partList pairs alphabet = reverse . fst $ foldl' f ([],pairs) alphabet where f (result,pairs) l = (result',rest) where (part,rest) = span ((==l) . head . fst) pairs result' = if null part

Re: [Haskell-cafe] PrefixMap: code review request

2006-02-27 Thread Cale Gibbard
On 27/02/06, David F. Place [EMAIL PROTECTED] wrote: On Feb 27, 2006, at 5:54 PM, Brian Hulley wrote: there is a parse error (using ghc) at the line beginning with result'. This binding doesn't line up with anything. Also the second 'where' is dangerously close to the column started by