se. In fact, i really donot
> know `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
>> 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
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 wrote:
>
> In 6.12.1 under archlinux
>>let f x y z = x + y + z
>> :t f
> f :: (N
On Sun, Mar 7, 2010 at 10:53 PM, Stephen Tetley
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, and I wonder if so
ustrates me is that
> it's quite hard to debug. I guess I'll upgrade my 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
Hello,
On Sat, Feb 6, 2010 at 2:51 AM, Chris Eidhof 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 installed
> the late
>> 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
> Some parsers are not monads, allowing for optimizations.
Could you elaborate on them or give me some pointers? I think I heard
about it two or three times, but I couldn't find any resource of them.
-~nwn
On Sat, Oct 31, 2009 at 5:35 AM, Martijn van Steenbergen
wrote:
> Yusaku Hash
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 wrote:
> On Fri, Oct 30, 2009 at 1:33 PM, Yu
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
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
Invoke uninstaller with sudo from Terminal as:
sudo Library/Frameworks/GHC.framework/Tools/Uninstaller
HTH
-nwn
2009/10/24 R J :
> What's the cleanest way to fully uninstall GHC on a Mac running Snow
> Leopard?
> Running Library/Frameworks/GHC.framework/Tools/Uninstaller from an account
> wi
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 exc
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 w
On Mon, Sep 28, 2009 at 4:42 AM, Gwern Branwen wrote:
> On Sun, Sep 27, 2009 at 3:19 PM, Yusaku Hashimoto
> 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?
>&
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 u
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
Hinson wrote:
>
> There are some librar
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 s
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 li
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>
On 2009/04/10, at 20:32, Bas van Dijk wrote:
So I rewrote it using type families which I find much easier to
understand:
Cool. Type family version is easier to read and understand for me.
This seems useful. Does this exists somewhere on hackage?
I glanced at Monad category in package list
Now I'm wondering if the derive_* functions can be overloaded using
something like this. Note that the following doesn't typecheck:
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE F
ts own
type.
Reference:
- [Theorem for free!](http://citeseerx.ist.psu.edu/viewdoc/summary?
doi=10.1.1.38.9875)
- [ftshell](http://hackage.haskell.org/cgi-bin/hackage-scripts/
package/ftshell-0.3)
Thanks,
Yusaku Hashimoto
On 2009/04/07, at 15:19, Janis Voigtlaender wrote:
Jason Dagit wrote:
On
.
arb_compare 0 1 = GT
arb_compare 1 0 = GT
arb_compare _ _ = EQ
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 m
f you find it, feel free to report it and
any feedbacks are welcome.
Thanks for reading,
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 <- unsafeInter
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 la
On Wed, Mar 11, 2009 at 1:06 AM, Yusaku Hashimoto 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"
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) "chec
29 matches
Mail list logo