Re: [Haskell-cafe] Why is it so different between 6.12.1 and 6.10.4_1 ?

2010-03-27 Thread Yusaku Hashimoto
`Monad ((-) a) ` . Would you mind expplain it ? Yusaku Hashimoto wrote: Did you import the module includes the instance of Monad ((-) e) somewhere in your code loaded in ghci? I tried this on a fresh ghci 6.12, but I got No instance error. -nwn On Sat, Mar 27, 2010 at 9:20 AM, zaxis z_a

Re: [Haskell-cafe] Why is it so different between 6.12.1 and 6.10.4_1 ?

2010-03-26 Thread Yusaku Hashimoto
Did you import the module includes the instance of Monad ((-) e) somewhere in your code loaded in ghci? I tried this on a fresh ghci 6.12, but I got No instance error. -nwn On Sat, Mar 27, 2010 at 9:20 AM, zaxis z_a...@163.com wrote: In 6.12.1 under archlinux let f x y z = x + y + z :t f f

Re: [Haskell-cafe] Why is it so different between 6.12.1 and 6.10.4_1 ?

2010-03-26 Thread Yusaku Hashimoto
fac n = let {  f = foldr (*) 1 [1..n] } in f Why do you bother with the interior definition of f in there? fac = product . enumFromTo 1 let fac = do is_zero - (==0); if is_zero then return 1 else liftM2 (*) id (fac . pred) -nwn On Sat, Mar 27, 2010 at 9:59 AM, Ivan Lazar Miljenovic

Re: [Haskell-cafe] Re: Books for advanced Haskell

2010-03-08 Thread Yusaku Hashimoto
On Sun, Mar 7, 2010 at 10:53 PM, Stephen Tetley stephen.tet...@gmail.com wrote: Hi All What is the state-of-the-practice in type-level programming? I know Günther started this thread about monads, but I seem to remember him having a long running problem with typeful database programming,

Re: [Haskell-cafe] Two GET HTTP requests

2010-02-08 Thread Yusaku Hashimoto
GHC to 6.12, hopefully that'll solve it. -chris On 7 feb 2010, at 16:07, Yusaku Hashimoto wrote: Hello, On Sat, Feb 6, 2010 at 2:51 AM, Chris Eidhof ch...@eidhof.nl wrote: Approach 3: I used the simpleHTTP function from the HTTP package. This crashed, after I dug a little deeper

Re: [Haskell-cafe] Two GET HTTP requests

2010-02-07 Thread Yusaku Hashimoto
Hello, On Sat, Feb 6, 2010 at 2:51 AM, Chris Eidhof ch...@eidhof.nl wrote: Approach 3: I used the simpleHTTP function from the HTTP package. This crashed, after I dug a little deeper into the code, it threw an error on calling the parseURI function (openFile: no such file exists). I

Re: [Haskell-cafe] poor perfomance of indexU in uvector package

2009-11-15 Thread Yusaku Hashimoto
Also, I would recomend using criterion. I tried to do so.. But it depends on gtk2hs and it is too difficult to install You can install with the flag to skip gtk2hs installation. i.e. Try `cabal install criterion -f-chart` -~nwn ___ Haskell-Cafe

[Haskell-cafe] Applicative but not Monad

2009-10-30 Thread Yusaku Hashimoto
Hello cafe, Do you know any data-type which is Applicative but not Monad? Cheers, -~nwn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Applicative but not Monad

2009-10-30 Thread Yusaku Hashimoto
Thanks for fast replies! Examples you gave explain why all Applicatives are not Monads to me. And I tried to rewrite Bob's Monad instance for ZipList with (=). import Control.Applicative instance Monad ZipList where return = ZipList . return (ZipList []) = _ = ZipList [] (ZipList (a:as))

Re: [Haskell-cafe] Applicative but not Monad

2009-10-30 Thread Yusaku Hashimoto
Thank you for your correction. I tried your (=) and replaced return's definition with return = ZipList . repeat then as you said this works fine for infinite lists. Cheers, -~nwn On Sat, Oct 31, 2009 at 2:39 AM, David Menendez d...@zednenem.com wrote: On Fri, Oct 30, 2009 at 1:33 PM, Yusaku

Re: [Haskell-cafe] Applicative but not Monad

2009-10-30 Thread Yusaku Hashimoto
: Yusaku Hashimoto wrote: Hello cafe, Do you know any data-type which is Applicative but not Monad? The Except datatype defined in the Applicative paper. Some parsers are not monads, allowing for optimizations. Martijn. ___ Haskell-Cafe mailing

Re: [Haskell-cafe] How do I uninstall GHC on a Mac running Snow Leopard?

2009-10-24 Thread Yusaku Hashimoto
Invoke uninstaller with sudo from Terminal as: sudo Library/Frameworks/GHC.framework/Tools/Uninstaller HTH -nwn 2009/10/24 R J rj248...@hotmail.com: What's the cleanest way to fully uninstall GHC on a Mac running Snow Leopard? Running Library/Frameworks/GHC.framework/Tools/Uninstaller

Re: [Haskell-cafe] Real World Haskell Chapter 19 and GHC 6.10

2009-10-21 Thread Yusaku Hashimoto
To deal with amigous type variable 'e', I often write the codes like: handle (\...@someexception{} - print e) (5 `div` 0) and IIRC, the base-4.0 initially released with GHC 6.10.1, introduced this exceptions. It enables us to specify which exception should be caught and define types of

Re: [Haskell-cafe] QuickCheck Questions

2009-09-28 Thread Yusaku Hashimoto
After a few more investigations, I can say QuickCheck does: - make easy to finding couter-cases and refactoring codes - make easy to test some functions if they have good mathematical properties - generate random test cases But QuickCheck does *not*: - help us to find good properties So what I

[Haskell-cafe] QuickCheck Questions

2009-09-27 Thread Yusaku Hashimoto
Hello, I recently worked with QuickCheck for a while, But I still can't handle it well, And a few questions come to my mind. 1. How to find properties In QuickCheck examples on the codes or the papers, they find good properties easily. How did they find these properties? What property can make

Re: [Haskell-cafe] QuickCheck Questions

2009-09-27 Thread Yusaku Hashimoto
On Mon, Sep 28, 2009 at 4:42 AM, Gwern Branwen gwe...@gmail.com wrote: On Sun, Sep 27, 2009 at 3:19 PM, Yusaku Hashimoto nonow...@gmail.com wrote: ... Do you think I wasted times? Have you ever tried PDD? And has it worked? If you have experience with TDD, how do you think about PDD

Re: [Haskell-cafe] Averting QuickCheck Madness

2009-09-06 Thread Yusaku Hashimoto
I think using the runTests hook and the test flag make sense, described at http://www.haskell.org/pipermail/haskell-cafe/2008-September/047223.html. I released some libraries in this way, AFAIK it works well. On Sun, Sep 6, 2009 at 4:57 PM, Christopher Lane Hinsonl...@downstairspeople.org wrote:

[Haskell-cafe] ANN: tkhs-0.1.* Presentation Utility

2009-07-31 Thread Yusaku Hashimoto
Hi, I'm pleased to announce the release of tkhs-0.1.*, Simple presentation utility. If you are thinking PowerPoint is overkill for your presentation, Tkhs may fit the purpose. See screenshot of running tkhs in my terminal: http://nonowarn.tumblr.com/post/152324109 When you invoke tkhs with

Re: [Haskell-cafe] Convert IO Int to Int

2009-06-09 Thread Yusaku Hashimoto
On 2009/06/09, at 19:33, Tobias Olausson wrote: You can not convert an IO Int to Int, or at least, you shouldn't. However, you can do as follows: test :: IO () test = do int - randomRIO -- or whatever it is called print $ useInt int useInt :: Int - Int useInt x = x+10 Or, you can

Re: [Haskell-cafe] No VerboseCheck in QuickCheck 2?

2009-05-26 Thread Yusaku Hashimoto
Hi, I don't think I am familiar enough with QuickCheck 2. But there seems to be no verboseCheck like function, and sample and sample' is useful to printing test cases. ghci sample (arbitrary :: Gen Int) 1 0 1 -2 -2 -5 -16 -9 -57 -115 -94 ghci

[Haskell-cafe] Generating arbitrary function in QuickCheck

2009-04-06 Thread Yusaku Hashimoto
Then, I want to ask two questions. 1. Is my guessing in function generated by arbitrary right? 2. If so, How do I generate right function? Thanks, Yusaku Hashimoto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

[Haskell-cafe] ANN: io-capture-0.2 capturing std(out|err) in IO action

2009-03-26 Thread Yusaku Hashimoto
, Yusaku Hashimoto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-16 Thread Yusaku Hashimoto
Hi, On 2009/03/16, at 10:04, wren ng thornton wrote: next r = do n - readIORef r writeIORef r (n+1) return n Now, if I use unsafeInterleaveIO: main = do r - newIORef 0 x - do a - unsafeInterleaveIO (next r) b - unsafeInterleaveIO

[Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-15 Thread Yusaku Hashimoto
Hello, I was studying about what unsafeInterleaveIO is.I understood unsafeInterleaveIO takes an IO action, and delays it. But I couldn't find any reason why unsafeInterleaveIO is unsafe. I have already read an example in http://www.haskell.org/pipermail/haskell-cafe/2009-March/057101.html says

[Haskell-cafe] ANNOUNCE: torch-0.1

2009-03-10 Thread Yusaku Hashimoto
Hello, I have wrote and uploaded my unit test library (or framework) torch-0.1 on Hackage. With torch, We can write simple unit test and run like this: import Test.Torch main = run $ do ok (odd 1) assertion is 42 (7*6) equality assertion isBottom (error undefined) check whether

[Haskell-cafe] Re: ANNOUNCE: torch-0.1

2009-03-10 Thread Yusaku Hashimoto
On Wed, Mar 11, 2009 at 1:06 AM, Yusaku Hashimoto nonow...@gmail.com wrote: import Test.Torch main = run $ do   ok (odd 1) assertion   is 42 (7*6) equality assertion   isBottom (error undefined) check whether value is bottom   ans - liftIO (putStr \n5 + 7 = readLn)   is ans 12 sanity