I'm no expert at all, but I would say no.
guard type is:
guard :: MonadPlus m = Bool - m ()
and MonadPlus is a monad plus (ehm...) mzero and mplus
(http://en.wikibooks.org/wiki/Haskell/MonadPlus).
On the other hand Applicative is less than a monad
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
--
Lorenzo Bolla
http://lbolla.info
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
of awkward.
I know the details of StableNames are probably implementation-dependent,
but I'm still wondering about how to detect / restrict this situation.
Thanks
2012/6/26 Lorenzo Bolla lbo...@gmail.com
From StableName docs:
The reverse is not necessarily true: if two stable names are not equal
, Ismael Figueroa Palet ifiguer...@gmail.com
wrote:
2012/6/26 Lorenzo Bolla lbo...@gmail.com
The point I was making is that StableName might be what you want. You are
using it to check if two functions are the same by comparing their
stablehash. But from StableName documentation
.
On Tue, Jun 26, 2012 at 3:42 PM, Lorenzo Bolla lbo...@gmail.com wrote:
I think about StableName like the operator in C, that returns you the
memory address of a variable. It's not the same for many reasons, but by
analogy, if x == y then x == y, but x != y does not imply x != y.
So, values
.
On Tue, Jun 26, 2012 at 4:50 PM, Ismael Figueroa Palet ifiguer...@gmail.com
wrote:
thanks again for your comments, any idea on how to implement Equivalence
for functions?
2012/6/26 Lorenzo Bolla lbo...@gmail.com
In other words there is a difference between Identity and Equivalence.
What you
I wonder why this performs really badly, though (I would expect it to be
the same as s2):
s3 :: Int - Int
s3 n = sum [gcd x y | x - [ 0 .. n-1 ], y - [ 0 .. n-1 ]]
From the links posted by Dmitry, it might be that the code generated is
made of 2 recursive calls: in fact, what I observe is a
test it works ~20% faster than s2 and ~20% slower than s1.
Did you use -O2 flag?
2012/6/25 Lorenzo Bolla lbo...@gmail.com
I wonder why this performs really badly, though (I would expect it to be
the same as s2):
s3 :: Int - Int
s3 n = sum [gcd x y | x - [ 0 .. n-1 ], y - [ 0 .. n-1
It looks like you are overflowing `Int` with 3^40.
In your QuickCheck test, the function signature uses Int:
prop_sanemodexp :: Int - Int - Int - Property
Note:
Prelude 3^40
12157665459056928801
Prelude 3^40 :: Int
689956897
Prelude 3^40 `mod` 3
0
Prelude (3^40 `mod` 3) :: Int
1
L.
On
On Tue, May 22, 2012 at 4:13 PM, John Simon zildjoh...@gmail.com wrote:
data Lexer = Lexer String
makeLexer :: String - Lexer
makeLexer fn = Lexer fn
`makeLexer` is redundant. You can simply use `Lexer`.
L.
___
Haskell-Cafe mailing list
some preprocessor's #if/#else/#endif pragmas.
See here:
http://stackoverflow.com/questions/6556778/using-if-else-endif-in-haskell
L.
--
Lorenzo Bolla
http://lbolla.info
pgppqbachV6j0.pgp
Description: PGP signature
___
Haskell-Cafe mailing list
Haskell
11 matches
Mail list logo