Twan van Laarhoven wrote:
For reference, here the full signature of the core combinators:
data Event a
data Behavior a
instance Functor Behavior
instance Applicative Behavior
instance Functor Event
instance Monoid (Event a)
filter :: (a - Bool) - Event a - Event a
apply :: Behavior (a - b) -
Hello,
I'm writing a small Haskell library for functional reactive programming.
The core of the library consists of two data types and several
primitives. However, I have programmed this core *twice*: once as a
*model* that displays the intended semantics, and once as the actual
On 08/04/11 11:54, Heinrich Apfelmus wrote:
Hello,
I'm writing a small Haskell library for functional reactive programming.
The core of the library consists of two data types and several
primitives. However, I have programmed this core *twice*: once as a
*model* that displays the intended
On 4/8/11 8:55 AM, Twan van Laarhoven wrote:
-- this class is useful beyond this FRP library,
-- you might already be able to find it on hackage somewhere
class Functor f = Filterable f where
filter :: (a - Bool) - f a - f a
-- filter p . fmap f == fmap f . filter (p . f)
-- filter (const True)
of records
(i.e. adding new fields, or removing existing fields). Ohori's
system provides only selection (r.l) , update (r|x:=x+1) and
construction (x=2, y=True).
o By describing records and type classes as applications of the same
framework (qualified types), it is clear
It seems to be the season for records -- three proposals already and
I'm going to add a fourth one! Phil Wadler, Martin Wehr and I have
recently completed a paper that describes a radical simplification of
type classes. We restrict overloading to functions that have the
instance type as first
Here's a thought, engendered by a glass of beer in the Lamplighter's pub
in Gastown, Vancouver by John Hughes, Lennart Augustsson, and Simon PJ:
type classes can model extensible records.
Suppose we want to define a record for a person:
record Person = { Age : Int; Weight :
Simon suggests that:
| type classes can model extensible records.
Indeed, they can, and in several different ways, depending on the kind
of extensible records that you want to give the programmer. The particular
system that Simon outlined is pretty close to a proposal for `structures in