Re: [Haskell-cafe] Re: Math questions

2010-05-28 Thread Yitzchak Gale
Richard O'Keefe wrote: If one is giving a *serious* answer, it has to be an answer a beginner (who has almost certainly never heard of Traversable) can make sense of, and if it uses functions that are pretty much certain not to be in said beginner's text book, said beginner has to be told

Re: [Haskell-cafe] Re: Math questions

2010-05-28 Thread Ivan Lazar Miljenovic
Yitzchak Gale g...@sefer.org writes: My for function was indeed flip map. Perhaps it's not in any library, but it's often seen on the #haskell IRC channel. :) Hmmm, I had never heard of this but going back through my logs I do indeed find nornagon, jethr0 and jmcarthur all either stating this

Re: [Haskell-cafe] Re: Math questions

2010-05-28 Thread Mujtaba Boori
* sure I did enjoy the discussion here Yitzchak Gale. I have already submitted several questions ,and you guys were very helpful. However , I am not sure how I will use Haskell other than my Haskell course that has just finished. * On 28 May 2010 14:52, Ivan Lazar Miljenovic

Re: [Haskell-cafe] Re: Math questions

2010-05-27 Thread Mujtaba Boori
*Pete Chown and Dan Doel. Thank you for your solution. I actually It was not homework . It was just a a past exam question trying to answer . * **but your solution is very long , so I don't think he wants answer this long in the exams. I think this answer agree100 f g = map f xs == map g xs where

Re: [Haskell-cafe] Re: Math questions

2010-05-27 Thread Yitzchak Gale
Mujtaba Boori wrote: I think this answer agree100 f g = map f xs == map g xs where xs = [1..100] from  Richard O'Keefe is do the job. agree100 = (==) `on` for [1..100] Regards, Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Math questions

2010-05-27 Thread Richard O'Keefe
On May 27, 2010, at 11:50 PM, Yitzchak Gale wrote: Mujtaba Boori wrote: I think this answer agree100 f g = map f xs == map g xs where xs = [1..100] from Richard O'Keefe is do the job. agree100 = (==) `on` for [1..100] Search for on and for in the Haskell 98 Report and you will not find

Re: [Haskell-cafe] Re: Math questions

2010-05-27 Thread Ivan Miljenovic
On 28 May 2010 09:37, Richard O'Keefe o...@cs.otago.ac.nz wrote: On May 27, 2010, at 11:50 PM, Yitzchak Gale wrote: agree100 = (==) `on` for [1..100] Search for on and for in the Haskell 98 Report and you will not find them.  If you want to tell someone to use them, you ought to tell them

Re: [Haskell-cafe] Re: Math questions

2010-05-27 Thread Richard O'Keefe
On May 28, 2010, at 1:05 PM, Ivan Miljenovic wrote: On 28 May 2010 09:37, Richard O'Keefe o...@cs.otago.ac.nz wrote: On May 27, 2010, at 11:50 PM, Yitzchak Gale wrote: agree100 = (==) `on` for [1..100] Search for on and for in the Haskell 98 Report and you will not find them. If you

Re: [Haskell-cafe] Re: Math questions

2010-05-27 Thread Ivan Miljenovic
On 28 May 2010 14:52, Richard O'Keefe o...@cs.otago.ac.nz wrote: Yes, that kind of thing. Remember, this was a BEGINNER-type question. If one is giving a *serious* answer, it has to be an answer a beginner (who has almost certainly never heard of Traversable) can make sense of, and if it uses

Re: [Haskell-cafe] Re: Math questions

2010-05-27 Thread Casey Hawthorne
This is an effect with any language that offers a very high degree of abstraction. I think this is an example of the Haskell effect (more typically seen on #haskell), which can be categorised as follows: 1) Someone asks a (usually rather simple) question. 2) People discuss this and provide

Re: [Haskell-cafe] Re: Math questions

2010-05-27 Thread Dan Doel
On Thursday 27 May 2010 9:05:40 pm Ivan Miljenovic wrote: On 28 May 2010 09:37, Richard O'Keefe o...@cs.otago.ac.nz wrote: On May 27, 2010, at 11:50 PM, Yitzchak Gale wrote: agree100 = (==) `on` for [1..100] Search for on and for in the Haskell 98 Report and you will not find them. If

Re: [Haskell-cafe] Re: Math questions

2010-05-26 Thread Dan Doel
On Wednesday 26 May 2010 5:38:57 pm Pete Chown wrote: test :: (Eq a) = (Int - a) - (Int - a) - Bool test f1 f2 = unsafePerformIO $ do goodSoFar - newIORef True forLoop 1 100 $ \i - when (f1 i /= f2 i) $ writeIORef goodSoFar False readIORef goodSoFar The problem with