A Lucid lightweight library

\begin{code}
module Lucid where
\end{code}

\begin{code}
type Process i o = [i] -> [o]
\end{code}

Lucid constants are not handled directly by Haskell.
A good class system can help, but till then,
we hack with a keyword:

\begin{code}
constant :: a -> [a]
constant a = a : constant a
\end{code}

Lucid pointwise operations are not handled directly by Haskell.
A good class system can help, but till then,
we hack with a keyword:

\begin{code}
pointwise1 :: (a -> a') -> Process a a'
pointwise1 = map
\end{code}

\begin{code}
pointwise2 :: (a -> b -> aVb) -> [a] -> [b] -> [aVb]
pointwise2 = zipWith
\end{code}

\begin{code}
first :: Process a a
first = constant . head
\end{code}

\begin{code}
next :: Process a a
next = tail
\end{code}

\begin{code}
fby :: [a] -> [a] -> [a]
x `fby` y = head x : y 
\end{code}
