[Haskell-cafe] ANN: Netwire 2.0.0

Ertugrul Soeylemez es at ertes.de
Mon Nov 14 16:46:07 CET 2011

Hello everybody,

it's finally done.  I have just released Netwire 2.0.0, which is a
complete rewrite from scratch.  It has been generalized to arbitrary
automata with inhibition, so FRP is now just a special use case.

First of all the top module is now:

    import Control.Wire

Wire is now an arrow transformer instead of an arrow-to-monad
transformer and the inhibition type is polymorphic instead of the
hard-coded SomeException type:

    Wire e (>~) a b

Wire represents the following underlying type:

    a >~ (Either e b, Wire e (>~) a b)

Inhibition uses any monoid 'e'.  To get the old behaviour, you can use
Last SomeException as 'e'.  One significant change is that all features
which were builtin in Netwire 1 are now addons, including even time and
random number generation.  These addons are available in the form of
type classes (Control.Wire.Classes) for the underlying arrow, including
for example:

  * ArrowIO,
  * ArrowRandom,
  * ArrowTime.

Also there are no explicit sessions anymore.  The current state of a
wire is simply the wire itself.  Everything else is captured by the
underlying arrow (>~), which you can construct the way you like.  There
is no hard-coded WireState anymore.

To get going really fast, just use the following type:

    type SimpleWire = Wire () (Kleisli IO)

with the testWire function.  You can find a small demo here:


There are instances for all addon classes for Kleisli IO, so you can
write your first application very quickly.  For more serious
applications, you would usually write or compose your own underlying
arrow or even leave it polymorphic.

Please don't hesitate to give me feedback.


nightmare = unsafePerformIO (getWrongWife >>= sex)

More information about the Haskell-Cafe mailing list