assignment.hs 722 Bytes
Newer Older
Henrik Tramberend's avatar
Henrik Tramberend committed
1 2
{-- Author: Henrik Tramberend <henrik@tramberend.de> --} 

3 4 5
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
module Assignment
  (
  ) where

import Control.Lens
import Data.Time
import Data.Yaml
import qualified Data.HashMap.Strict as M
import GHC.Generics

data DueDate = DueDate
  { _date :: UTCTime
  , _track :: Int
  } deriving (Show, Generic)

instance FromJSON DueDate

data Assignment = Assignment
  { _tag :: String
  , _artefacts :: [String]
  , _due :: [DueDate]
  } deriving (Show, Generic)

instance FromJSON Assignment

type Assignments = M.HashMap String Assignment

data AssignmentInfo = AssignmentInfo
  { _graceperiod :: Int
  , _assignments :: Assignments
  } deriving (Show, Generic)