{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE DataKinds, TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wall -fno-warn-tabs #-}

module Control.Moffy.Samples.Followbox.ViewType (
	-- * VIEW
	View(..), View1,
	-- * COLOR
	Color(..), white, blue, Png(..),
	-- * TEMP
	VText(..), Line(..), Image(..)
	) where

import Control.Moffy.Samples.Viewable.Basic
import Control.Moffy.Samples.Viewable.Text
import Control.Moffy.Samples.Viewable.Shape
import Control.Moffy.Samples.Viewable.Image
import Data.Type.Set
import Data.OneOfThem

---------------------------------------------------------------------------

newtype View = View [View1] deriving Int -> View -> ShowS
[View] -> ShowS
View -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [View] -> ShowS
$cshowList :: [View] -> ShowS
show :: View -> String
$cshow :: View -> String
showsPrec :: Int -> View -> ShowS
$cshowsPrec :: Int -> View -> ShowS
Show

type View1 = OneOfThem (VText :- Line :- Image :- 'Nil)

instance Semigroup View where View [View1]
vs1 <> :: View -> View -> View
<> View [View1]
vs2 = [View1] -> View
View forall a b. (a -> b) -> a -> b
$ [View1]
vs1 forall a. Semigroup a => a -> a -> a
<> [View1]
vs2
instance Monoid View where mempty :: View
mempty = [View1] -> View
View []