On Mon, 12 Jan 2009, Duncan Coutts wrote:
On Mon, 2009-01-12 at 15:06 +0100, Henning Thielemann wrote:
It has to be manually transformed into a version that is not recursive
at the top level:
map :: (a - b) - [a] - [b]
map f = go
where
go [] = []
go (x:xs) = f x : go xs
Then
On Sun, 11 Jan 2009, Neil Mitchell wrote:
I am pleased to announce HLint version 1.2. HLint is a lint-like tool
for Haskell that detects and suggests improvements for your code.
HLint is compatible with most GHC extensions, and supports a wide
variety of suggestions, and can be extended with
Hi Henning,
To install: cabal update cabal install hlint
Fails for me, because of the base-4 dependency. - I'm still using GHC-6.8.2.
Can HLint suggest view-pattern-free expressions, such that the program also
runs on GHC-6.8 ? :-)
HLint is written using view-patterns so requires GHC 6.10
On Thu, 15 Jan 2009, Neil Mitchell wrote:
Hi Henning,
To install: cabal update cabal install hlint
Fails for me, because of the base-4 dependency. - I'm still using GHC-6.8.2.
Can HLint suggest view-pattern-free expressions, such that the program also
runs on GHC-6.8 ? :-)
HLint is
Hi
My question was, whether HLint can help translating HLint to code without
view patterns.
Ah, I misunderstood. Yes, it could (in theory), but it can't
automatically apply the hints it generates. Upgrading to GHC 6.10 is
probably easier :-)
Thanks
Neil
On Thu, 15 Jan 2009, Neil Mitchell wrote:
Hi
My question was, whether HLint can help translating HLint to code without
view patterns.
Ah, I misunderstood. Yes, it could (in theory), but it can't
automatically apply the hints it generates. Upgrading to GHC 6.10 is
probably easier :-)
Also
Ah, I misunderstood. Yes, it could (in theory), but it can't
automatically apply the hints it generates. Upgrading to GHC 6.10 is
probably easier :-)
Also throwing away Hugs ... (YHC too ?)
Yes :-(
I normally develop in Hugs, for a change I wanted to try GHCi. It's
also a project that has
On Thu, 15 Jan 2009, Neil Mitchell wrote:
I normally develop in Hugs, for a change I wanted to try GHCi. It's
also a project that has loads of pattern matching at a fairly complex
level, so the benefits offered by view-patterns and pattern-guards
were just too hard to pass up.
Are you sure
Are you sure that you can't come up with some nice functions like 'maybe' to
replace those view patterns by function calls? Did you really try? I
remember the recent discussion on pattern combinators here on Haskell Cafe.
I could, but it would look more ugly - and I want my code to be
Neil Mitchell wrote:
I can't really be blamed for making mistakes before HLint ;-)
Don't worry - self-programming computers are just around the corner... ;-)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hi
Does GHC specialize map? If it doesn't, then hand crafted version
could be faster.
GHC doesn't specialize map, and a hand-crafted one could be faster -
but you then wouldn't get foldr/build fusion. In general HLint tries
to make the code prettier, but sometimes you will need to deviate
On Mon, 2009-01-12 at 01:02 +0100, Lennart Augustsson wrote:
Does GHC specialize map? If it doesn't, then hand crafted version
could be faster.
No because the current definition are recursive and ghc cannot inline
recursive functions.
map :: (a - b) - [a] - [b]
map _ [] = []
map f (x:xs)
On Mon, 12 Jan 2009, Duncan Coutts wrote:
On Mon, 2009-01-12 at 01:02 +0100, Lennart Augustsson wrote:
Does GHC specialize map? If it doesn't, then hand crafted version
could be faster.
No because the current definition are recursive and ghc cannot inline
recursive functions.
map :: (a -
Hi
No because the current definition are recursive and ghc cannot inline
recursive functions.
map :: (a - b) - [a] - [b]
map f = go
where
go [] = []
go (x:xs) = f x : go xs
Then the map can be inlined at the call site and the 'f' inlined into
the body of 'go'.
Maybe HLint
On Mon, 2009-01-12 at 15:06 +0100, Henning Thielemann wrote:
It has to be manually transformed into a version that is not recursive
at the top level:
map :: (a - b) - [a] - [b]
map f = go
where
go [] = []
go (x:xs) = f x : go xs
Then the map can be inlined at the
On Mon, 12 Jan 2009, Neil Mitchell wrote:
Hi
No because the current definition are recursive and ghc cannot inline
recursive functions.
map :: (a - b) - [a] - [b]
map f = go
where
go [] = []
go (x:xs) = f x : go xs
Then the map can be inlined at the call site and the 'f' inlined
On Jan 12, 2009, at 9:01 AM, Duncan Coutts wrote:
No because the current definition are recursive and ghc cannot inline
recursive functions.
map :: (a - b) - [a] - [b]
map _ [] = []
map f (x:xs) = f x : map f xs
It has to be manually transformed into a version that is not recursive
at
2009/1/12 Jan-Willem Maessen jmaes...@alum.mit.edu:
On Jan 12, 2009, at 9:01 AM, Duncan Coutts wrote:
No because the current definition are recursive and ghc cannot inline
recursive functions.
Then the map can be inlined at the call site and the 'f' inlined into
the body of 'go'.
ndmitchell:
Hi
Does GHC specialize map? If it doesn't, then hand crafted version
could be faster.
GHC doesn't specialize map, and a hand-crafted one could be faster -
but you then wouldn't get foldr/build fusion. In general HLint tries
to make the code prettier, but sometimes you will
dons:
ndmitchell:
Hi
Does GHC specialize map? If it doesn't, then hand crafted version
could be faster.
GHC doesn't specialize map, and a hand-crafted one could be faster -
but you then wouldn't get foldr/build fusion. In general HLint tries
to make the code prettier, but
On Mon, Jan 12, 2009 at 6:47 PM, Max Bolingbroke
batterseapo...@hotmail.com wrote:
GHC should indeed be doing so. I'm working (on and off) to work out
some suitable heuristics and put the transformation into ghc -O2.
There are a few wrinkles that still need sorting out, but preliminary
On Jan 12, 2009, at 12:47 PM, Max Bolingbroke wrote:
2009/1/12 Jan-Willem Maessen jmaes...@alum.mit.edu:
On Jan 12, 2009, at 9:01 AM, Duncan Coutts wrote:
No because the current definition are recursive and ghc cannot
inline
recursive functions.
Then the map can be inlined at the
On Mon, 12 Jan 2009 19:43:00 +0100
Bas van Dijk v.dijk@gmail.com wrote:
On Mon, Jan 12, 2009 at 6:47 PM, Max Bolingbroke
batterseapo...@hotmail.com wrote:
GHC should indeed be doing so. I'm working (on and off) to work out
some suitable heuristics and put the transformation into ghc
On Mon, 12 Jan 2009, Robin Green wrote:
I tend to use Control.Monad.Fix.fix (which actually has nothing to do
with monads, despite the package name)
That's why it is also available from Data.Function now:
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Function.html
On Mon, Jan 12, 2009 at 6:06 PM, Robin Green gree...@greenrd.org wrote:
The fix-style equivalent to your repeat above, would be something like
this:
repeat x = fix $ \me - x ::: me
Interesting.
Your repeat and mine are compiled to the same code:
Data.Stream.repeat :: forall a_aVi.
On Mon, 2009-01-12 at 19:43 +0100, Bas van Dijk wrote:
On Mon, Jan 12, 2009 at 6:47 PM, Max Bolingbroke
batterseapo...@hotmail.com wrote:
GHC should indeed be doing so. I'm working (on and off) to work out
some suitable heuristics and put the transformation into ghc -O2.
There are a few
On Mon, 2009-01-12 at 20:23 +0100, Bas van Dijk wrote:
On Mon, Jan 12, 2009 at 6:06 PM, Robin Green gree...@greenrd.org wrote:
The fix-style equivalent to your repeat above, would be something like
this:
repeat x = fix $ \me - x ::: me
Interesting.
The definition of fix is small and
Hi,
I am pleased to announce HLint version 1.2. HLint is a lint-like tool
for Haskell that detects and suggests improvements for your code.
HLint is compatible with most GHC extensions, and supports a wide
variety of suggestions, and can be extended with additional user
suggestions.
To install:
ndmitchell:
Hi,
I am pleased to announce HLint version 1.2. HLint is a lint-like tool
for Haskell that detects and suggests improvements for your code.
HLint is compatible with most GHC extensions, and supports a wide
variety of suggestions, and can be extended with additional user
On Sun, 11 Jan 2009, Neil Mitchell wrote:
HLint will automatically detect if you should have used a map, a foldr
or a foldl and suggest how to change your code. In the GHC, darcs and
Hoogle code bases there are no obvious map-like functions, which is a
good sign :-)
I found so many 'map'
Does GHC specialize map? If it doesn't, then hand crafted version
could be faster.
On Sun, Jan 11, 2009 at 11:44 PM, Henning Thielemann
lemm...@henning-thielemann.de wrote:
On Sun, 11 Jan 2009, Neil Mitchell wrote:
HLint will automatically detect if you should have used a map, a foldr
or a
31 matches
Mail list logo