initial check in of what stuff I tried so far, not looking very good
[darcs-mirror-latutman.git] / haskell / State / State_000.hs
1 {-# OPTIONS -fglasgow-exts -fth -fallow-undecidable-instances #-}
2
3 module State.State_000 where
4
5 import Types hiding (HandIn(..), handinDataType, handinDataType1Constr,
6                     Assignment(..), assignmentDataType, assignmentDataType1Constr)
7 import HAppS.Data
8 import HAppS.State
9 import HAppS.State.EventTH
10 import HAppS.Server
11 import Data.Maybe
12 import Control.Monad.State (modify)
13
14 $( deriveAll [''Ord,''Eq,''Read,''Show,''Default] 
15    [d|
16         data HandIn = HandIn {
17                 hiStudentID :: StudentID,
18                 hiPoints :: Points
19         }
20
21         data Assignment = Assignment {
22                 assName :: AssName,
23                 maxPoints :: MaxPoints,
24                 handIns :: [HandIn]
25         }
26    |]
27  )
28
29 $(deriveAll [''Read,''Show,''Default]
30   [d|
31       data State = State {assignments :: [Assignment],
32                           students    :: [Student] }
33    |]
34  )
35
36 instance Xml State where
37     version _ = Just "000"
38 --    otherVersion _ = Other (error "Other" :: Old.State)
39
40