`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
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
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
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,
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
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
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
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
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))
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
:
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
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
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
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
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
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
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:
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
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
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
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
,
Yusaku Hashimoto
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
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
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
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
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
26 matches
Mail list logo