Re: [Haskell-cafe] [Haskell] [ANN] GenCheck - a generalized property-based testing framework

2012-06-23 Thread Roman Cheplyaka
Hi,

1. Minor correction for your tutorial: reverse . reverse = id is
   called the involution property, not idempotency.

2. Writing haddock documentation would definitely increase the chances
   for GenCheck wide adoption.

-- 
Roman I. Cheplyaka :: http://ro-che.info/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] [ANN] GenCheck - a generalized property-based testing framework

2012-06-23 Thread José Pedro Magalhães
On Tue, Jun 19, 2012 at 4:04 PM, Jacques Carette care...@mcmaster.cawrote:

 User beware: this is gencheck-0.1, there are still a few rough edges.  We
 plan to add a Template Haskell feature to this which should make deriving
 enumerators automatic for version 0.2.


Can you provide me a quick pointer into what methods need to be generated
automatically?


Thanks,
Pedro
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] [ANN] GenCheck - a generalized property-based testing framework

2012-06-23 Thread Jacques Carette

On 12-06-23 04:26 AM, Roman Cheplyaka wrote:

Hi,

1. Minor correction for your tutorial: reverse . reverse = id is
called the involution property, not idempotency.


Indeed!  Fixed, thanks.


2. Writing haddock documentation would definitely increase the chances
for GenCheck wide adoption.


Absolutely - I am working on that now.  It was always the plan, but we 
were sitting on GenCheck for too long, so I decided to push out an early 
0.1 release and fix that up for 0.2


Jacques


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] [ANN] GenCheck - a generalized property-based testing framework

2012-06-23 Thread Jacques Carette

On 12-06-23 04:38 AM, José Pedro Magalhães wrote:



On Tue, Jun 19, 2012 at 4:04 PM, Jacques Carette care...@mcmaster.ca 
mailto:care...@mcmaster.ca wrote:


User beware: this is gencheck-0.1, there are still a few rough
edges.  We plan to add a Template Haskell feature to this which
should make deriving enumerators automatic for version 0.2.


Can you provide me a quick pointer into what methods need to be 
generated automatically?


Sure.  Given a data definition such as
data Zipper a = Zip ![a] ![a] deriving (Eq,Show)
(where the strictness annotations are not relevant), one would want to 
automatically generate


instance Enumerated Zipper where
   enumeration = eMemoize $  eProd Zip (eList A) (eList A)

and for
data BinTree a = BTNode a | BTBr (BinTree a) (BinTree a)

generate
instance Enumerated (BinTree Label) where
  enumeration = eMemoize $ eSum (eNode (BTNode A))
(eProd BTBr eBinTree eBinTree)

Jacques
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] transformers problem: Could not deduce MonadTrans (StateT s) ??

2012-06-23 Thread Anton Kholomiov
Why this function doesn't compile?

phi :: Monad m = StateT s m ()
phi = lift $ return ()

I get (ghc-7.4.1)

Could not deduce (MonadTrans (StateT s))
  arising from a use of `lift'
from the context (Monad m)
  bound by the type signature for phi :: Monad m = StateT s m ()
  at FSMt.hs:28:1-22
Possible fix:
  add (MonadTrans (StateT s)) to the context of
the type signature for phi :: Monad m = StateT s m ()
  or add an instance declaration for (MonadTrans (StateT s))
In the expression: lift
In the expression: lift $ return ()
In an equation for `phi': phi = lift $ return ()
Failed, modules loaded: none.


Anton
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANNOUNCE: dbus 0.10

2012-06-23 Thread John Millikin
This is completing the merger of the dbus-core and dbus-client
packages. The new package does everything they can do, but better.

Hackage: http://hackage.haskell.org/package/dbus
Homepage: https://john-millikin.com/software/haskell-dbus/
API reference: 
https://john-millikin.com/software/haskell-dbus/reference/haskell-dbus/0.10/
Examples: Included in the tarball, and also at
https://john-millikin.com/branches/haskell-dbus/0.10/head:/examples/

Notable changes:
* The module hierarchy was simplified. Most users will only ever need
the DBus and DBus.Client modules.
* Exports which were not used or useful have been removed.
* Much better documentation -- most exports now have a description,
and several have examples.
* The source code isn't literate any more. Too many people expressed
frustration at trying to contribute, so I just converted it all to
standard flat .hs files.
* Better support for custom socket transports and authentication mechanisms.
* Added support for listening for socket connections. This allows
users to implement both sides of a peer-peer session.
* Various improvements to performance, including moving from binary
to cereal.
* Various minor improvements to correctness.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] transformers problem: Could not deduce MonadTrans (StateT s) ??

2012-06-23 Thread Brandon Allbery
On Sat, Jun 23, 2012 at 12:22 PM, Anton Kholomiov anton.kholom...@gmail.com
 wrote:

 Why this function doesn't compile?

 phi :: Monad m = StateT s m ()
 phi = lift $ return ()

 I get (ghc-7.4.1)

 Could not deduce (MonadTrans (StateT s))
   arising from a use of `lift'
 from the context (Monad m)


This means exactly what it says:  you have stated that m must be a Monad,
but you didn't say anything about whether it's a MonadTrans, so you can't
use lift.  The correct signature would be

phi :: (Monad m, MonadTrans m) = StateT s m ()

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] transformers problem: Could not deduce MonadTrans (StateT s) ??

2012-06-23 Thread Anton Kholomiov
No, it wants me to define an instance for
(StateT s) which is supposed to be defined
be the authors of the library.

Actually I discovered that I have two libraries
called transformers.

   transformers-0.2.2.0
   transformers-0.3.0.0

So when I'm doing

import Control.Monad.Trans (0.2.2.0)

I get the error

And when I'm doing

import Control.Monad.Trans.Class (0.3.0.0)

It compiles.


Anton
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] transformers problem: Could not deduce MonadTrans (StateT s) ??

2012-06-23 Thread Anton Kholomiov
At last..

No, it wants me to define an instance for
(StateT s) which is supposed to be defined
be the authors of the library.

Actually I discovered that I have two libraries
called transformers.

   transformers-0.2.2.0
   transformers-0.3.0.0

So when I'm doing

import Control.Monad.Trans (0.2.2.0)

I get the error

And when I'm doing

import Control.Monad.Trans.Class (0.2.2.0)

It compiles.


Anton
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] transformers problem: Could not deduce MonadTrans (StateT s) ??

2012-06-23 Thread MigMit

On 23 Jun 2012, at 21:27, Anton Kholomiov wrote:

 At last..
 
 No, it wants me to define an instance for
 (StateT s) which is supposed to be defined
 be the authors of the library.
 
 Actually I discovered that I have two libraries
 called transformers. 
 
transformers-0.2.2.0
transformers-0.3.0.0
 
 So when I'm doing 
 
 import Control.Monad.Trans (0.2.2.0)

Ehm... seems like you're importing mtl instead of transformers. AFAIK there is 
no Control.Monad.Trans module in transformers.

 
 I get the error
 
 And when I'm doing
 
 import Control.Monad.Trans.Class (0.2.2.0)
 
 It compiles.
 
 
 Anton
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] transformers problem: Could not deduce MonadTrans (StateT s) ??

2012-06-23 Thread Anton Kholomiov
Indeed, thank you. mtl is cruel with me for
the second time uumpf. But it's strange mtl
just reexports transformer's module



2012/6/23 MigMit miguelim...@yandex.ru


 On 23 Jun 2012, at 21:27, Anton Kholomiov wrote:

  At last..
 
  No, it wants me to define an instance for
  (StateT s) which is supposed to be defined
  be the authors of the library.
 
  Actually I discovered that I have two libraries
  called transformers.
 
 transformers-0.2.2.0
 transformers-0.3.0.0
 
  So when I'm doing
 
  import Control.Monad.Trans (0.2.2.0)

 Ehm... seems like you're importing mtl instead of transformers. AFAIK
 there is no Control.Monad.Trans module in transformers.

 
  I get the error
 
  And when I'm doing
 
  import Control.Monad.Trans.Class (0.2.2.0)
 
  It compiles.
 
 
  Anton
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] transformers problem: Could not deduce MonadTrans (StateT s) ??

2012-06-23 Thread Anton Kholomiov
Maybe I export State from one library version
and instance from another?

2012/6/23 Anton Kholomiov anton.kholom...@gmail.com

 Indeed, thank you. mtl is cruel with me for
 the second time uumpf. But it's strange mtl
 just reexports transformer's module




 2012/6/23 MigMit miguelim...@yandex.ru


 On 23 Jun 2012, at 21:27, Anton Kholomiov wrote:

  At last..
 
  No, it wants me to define an instance for
  (StateT s) which is supposed to be defined
  be the authors of the library.
 
  Actually I discovered that I have two libraries
  called transformers.
 
 transformers-0.2.2.0
 transformers-0.3.0.0
 
  So when I'm doing
 
  import Control.Monad.Trans (0.2.2.0)

 Ehm... seems like you're importing mtl instead of transformers. AFAIK
 there is no Control.Monad.Trans module in transformers.

 
  I get the error
 
  And when I'm doing
 
  import Control.Monad.Trans.Class (0.2.2.0)
 
  It compiles.
 
 
  Anton
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: dbus 0.10

2012-06-23 Thread Dmitry Malikov

On 06/23/2012 09:10 PM, John Millikin wrote:

This is completing the merger of the dbus-core and dbus-client
packages. The new package does everything they can do, but better.

Hackage: http://hackage.haskell.org/package/dbus
Homepage: https://john-millikin.com/software/haskell-dbus/
API reference: 
https://john-millikin.com/software/haskell-dbus/reference/haskell-dbus/0.10/
Examples: Included in the tarball, and also at
https://john-millikin.com/branches/haskell-dbus/0.10/head:/examples/

Notable changes:
* The module hierarchy was simplified. Most users will only ever need
the DBus and DBus.Client modules.
* Exports which were not used or useful have been removed.
* Much better documentation -- most exports now have a description,
and several have examples.
* The source code isn't literate any more. Too many people expressed
frustration at trying to contribute, so I just converted it all to
standard flat .hs files.
* Better support for custom socket transports and authentication mechanisms.
* Added support for listening for socket connections. This allows
users to implement both sides of a peer-peer session.
* Various improvements to performance, including moving from binary
to cereal.
* Various minor improvements to correctness.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Great that you finally did that. Because recently it was hard to 
understand that dbus-client is merged into dbus-core-0.9 without some 
haskell-cafe log.


--
Best regards,
dmitry malikov
!


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Unambiguous choice implementation

2012-06-23 Thread Bartosz Milewski
I'm reading Conal Elliot's paper, Push-Pull FRP. At some point he needs an
unambiguous choice operator, essentially to implement select: a future that
waits for one of its future arguments to fire. His implementation of unamb
creates two threads racing on a shared MVar. By his own admission, this is
very inefficient. My question is, is there a better implementation?
-- 
[:Bartosz:]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] cvs-ghc mailing list silently dropping my mails

2012-06-23 Thread Erik de Castro Lopo
Hi all,

I've been trying to send mail to the cvs-ghc mailng list and the list
seems to be silently dropping my emails. I have:

 a) Made sure I was sending mail with the subscribed from address.
 b) Unsubscribed and re-subscribed and tried again.

All to no avail. Is there a moderation queue on that list that needs
to be seen to?

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Martin Odersky on What's wrong with Monads

2012-06-23 Thread Jonathan Geddes
Cafe,

I was watching a panel on languages[0] recently and Martin Odersky (the
creator of Scala) said something about Monads:

What's wrong with Monads is that if you go into a Monad you have to change
your whole syntax from scratch. Every single line of your program changes
if you get it in or out of a Monad. They're not polymorphic so it's really
the old days of Pascal. A monomorphic type system that says 'well that's
all I do' ... there's no way to abstract over things.  [0, 53:45]

Thoughts?

--J Arthur

[0] - http://css.dzone.com/articles/you-can-write-large-programs
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe