frame-0.1: src/Frame/Data.lhs
> module Frame.Data (
> Data (..)
> ) where
> import Frame.GUI
> import qualified Data.ByteString.Lazy as L
> -- | A collection of views which can be streamed to the client by the server
> data Data
> = View GUI -- ^ A full view
> | ViewPart [Container] -- ^ A partial view
> | File L.ByteString -- ^ A file
> | Error404 -- ^ File not found, 404 HTTP response
> | Redirect URL -- ^ Redirection
> instance Composable Data where
> (View g) <+ c = View $ g <+ c
> (ViewPart cs) <+ c = ViewPart $ cs ++ [c]
> d <+ _ = d
> c +> (View g) = View $ c +> g
> c +> (ViewPart cs) = ViewPart $ (c:cs)
> _ +> d = d