Re: [Haskell-cafe] Intuitive function given type signature

2010-05-20 Thread Tom Davies
On 20/05/2010, at 9:53 AM, Richard O'Keefe wrote: > > The key point is the 'that would NATURALLY have', which I take > to mean "as a result of type inference without any forcibly > imposed type signatures". In my second edition of Bird, the question just says: "Give examples of functions with t

Re: [Haskell-cafe] Intuitive function given type signature

2010-05-20 Thread Richard O'Keefe
On May 21, 2010, at 3:51 AM, Brent Yorgey wrote: On Thu, May 20, 2010 at 11:53:09AM +1200, Richard O'Keefe wrote: On May 20, 2010, at 3:18 AM, Brent Yorgey wrote: On Wed, May 19, 2010 at 04:27:14AM +, R J wrote: What are some simple functions that would naturally have the following

Re: [Haskell-cafe] Intuitive function given type signature

2010-05-20 Thread Brent Yorgey
On Thu, May 20, 2010 at 11:53:09AM +1200, Richard O'Keefe wrote: > > On May 20, 2010, at 3:18 AM, Brent Yorgey wrote: > >> On Wed, May 19, 2010 at 04:27:14AM +, R J wrote: >>> >>> What are some simple functions that would naturally have the following >>> type signatures: >>> f :: (Integer -> I

Re: [Haskell-cafe] Intuitive function given type signature

2010-05-19 Thread Richard O'Keefe
On May 20, 2010, at 3:18 AM, Brent Yorgey wrote: On Wed, May 19, 2010 at 04:27:14AM +, R J wrote: What are some simple functions that would naturally have the following type signatures: f :: (Integer -> Integer) -> Integer Well, this means f is given a function from Integer to Intege

Re: [Haskell-cafe] Intuitive function given type signature

2010-05-19 Thread Brent Yorgey
On Wed, May 19, 2010 at 04:27:14AM +, R J wrote: > > What are some simple functions that would naturally have the following type > signatures: > f :: (Integer -> Integer) -> Integer Well, this means f is given a function from Integer to Integer, and it has to somehow return an Integer, (poss

Re: [Haskell-cafe] Intuitive function given type signature

2010-05-18 Thread Ivan Miljenovic
2010/5/19 Miguel Mitrofanov : > > On 19 May 2010, at 08:35, Ivan Miljenovic wrote: >> >> 2010/5/19 R J : >>> >>> What are some simple functions that would naturally have the following >>> type >>> signatures: >>> f :: (Integer -> Integer) -> Integer >> >> I can only think of one solution to this bu

Re: [Haskell-cafe] Intuitive function given type signature

2010-05-18 Thread Miguel Mitrofanov
On 19 May 2010, at 08:35, Ivan Miljenovic wrote: This looks suspiciously like homework... 2010/5/19 R J : What are some simple functions that would naturally have the following type signatures: f :: (Integer -> Integer) -> Integer I can only think of one solution to this but it doesn't gu

Re: [Haskell-cafe] Intuitive function given type signature

2010-05-18 Thread Ivan Miljenovic
This looks suspiciously like homework... 2010/5/19 R J : > What are some simple functions that would naturally have the following type > signatures: > f :: (Integer -> Integer) -> Integer I can only think of one solution to this but it doesn't guarantee that it returns a value... > g :: (Integer

[Haskell-cafe] Intuitive function given type signature

2010-05-18 Thread R J
What are some simple functions that would naturally have the following type signatures: f :: (Integer -> Integer) -> Integer g :: (Integer -> Integer) -> (Integer -> Integer) (Bird problem 1.4.5) __