Re: [Haskell-cafe] Testing Implementation vs Model - Records or Type Classes?

2011-04-09 Thread Heinrich Apfelmus
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) -

[Haskell-cafe] Testing Implementation vs Model - Records or Type Classes?

2011-04-08 Thread Heinrich Apfelmus
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

Re: [Haskell-cafe] Testing Implementation vs Model - Records or Type Classes?

2011-04-08 Thread Twan van Laarhoven
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

Re: [Haskell-cafe] Testing Implementation vs Model - Records or Type Classes?

2011-04-08 Thread wren ng thornton
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)