module WURFLTypes(
   Tropical(..)
 , MD(..)
 , emptyMD
 , Tree(..)
 ) 
 where
    
class Tropical a where
    tempty :: a
    tappend :: a -> a -> a

instance Tropical (Maybe a) where
    tempty = Nothing
    tappend Nothing a = a
    tappend  ma@(Just _) Nothing = ma
    tappend  (Just _) mb@(Just _) = mb
  
emptyMD :: MD
emptyMD =   
     MD (True) -- Post support
        (11) -- columns
        (2) -- row 2
        (35) -- height
        (90) -- width
        (2) -- colors
        (False)
        (False)
        (False)
        (False)
        (0) -- j2me heap
        (0) -- Jéme width and height
        (0)
        ("wml_1_1") -- prefered markup
        ("Unknown") -- brand
        (True) -- is wireless
        (False) -- streaming
        
data MD = MD { 
          postMethodSupport :: !Bool -- bugs, post_method_support
        , columns :: !Int -- display, columns
        , rows :: !Int -- display, rows
        , maxImageHeight :: !Int -- display, max_image_height
        , maxImageWidth :: !Int -- display, max_image_width
        , colors :: !Int -- image_format, colors
        , gif :: !Bool -- display, gif
        , jpg :: !Bool -- display, jpg
        , png :: !Bool -- display, png
        , j2me :: !Bool -- j2me, j2me_midp_2_0
        , j2meHeap :: !Int -- j2me, j2me_heap_size
        , j2meHeight :: !Int -- j2me, j2me_screen_height
        , j2meWidth :: !Int -- j2me, j2me_screen_width
        , markup :: !String -- markup, preferred_markup
        , brand :: !String -- product_info, brand_name
        , isWireless :: !Bool -- product_info, is_wireless_device
        , streaming3gpp :: !Bool -- streaming, streaming_3gpp
        } deriving(Show)

data Tree a = Node String (Maybe a) [Tree a] deriving(Eq,Show)