Hello Stephen
Temporal class
Temporal class is something like timed Maybe. 'dur' takes measurement and
'none' stands for Nothing that lasts for some time t. It's rest for music or
black screen for movie.
Stretchable
it looks like, but to define scalar multiplication in vector space you have
to define (+). And there are rules.
forall k, v : (k) `smul` v + (-k) `smul` v === 0
I can't find meaningful (smul, +) for Media. Semantically 'stretch (-k)' -
may be stretch and reverse. But what is (+)?
TMap : tmap fn t = fmap (fn t)
tmap maps containers of temporal values. 't' isn't fixed.
for example :
data Unit t a = Unit t (Maybe a)
newtype ListUnit a = ListUnit { runListUnit :: [Unit Double a] }
natural instance is
tmap f = ListUnit . fmap (\x -> f (dur x) x) . runListUnit
And i have MediaUnit it maps over Media and Maybe and puts durations in
place.
Event list
It's not for composing things. it's for interpretation. You can use Media
everywhere, and then you can make toEventList and get some meaning.
--
I think data Media is too general, and MediaUnit is too specific. There have
to be something in between. Media does not take into account temporal
properties of values, it's supposed to though.
For example 'reverse' is fine for sequent values,
reverse (a :+: b) = reverse b :+: reverse a
but if you reverse parallel values and one is longer than the other in time
domain, you get wrong output semantically.
reverse (a :=: b) = reverse a :=: reverse b
information about gap in the tail of a or b is lost.
Anton
_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art