Commit 6dc6ef4b authored by Christopher League's avatar Christopher League
Browse files

Remove lens cruft in Schedule.hs

parent 442edfda
......@@ -16,7 +16,6 @@ import App.ByteStoreWorkDir
import App.Foundation
import App.Prelude
import App.YamlStore
import Control.Lens (Lens')
import Data.Aeson as Js
import Data.List (elem, zipWith3)
import qualified Data.Map as Map
......@@ -150,41 +149,17 @@ classDuration =
classTZ :: IsString s => s
classTZ = "America/New_York"
veStampL :: Lens' VEvent UTCTime
veStampL =
(\f ev -> f (veDTStamp ev) <&> \x -> ev {veDTStamp = x})
. (\f st -> f (dtStampValue st) <&> \x -> st {dtStampValue = x})
veUIDL :: Lens' VEvent LazyText
veUIDL =
(\f ev -> f (veUID ev) <&> \x -> ev {veUID = x})
. (\f uid -> f (uidValue uid) <&> \x -> uid {uidValue = x})
veDTStartL :: Lens' VEvent (Maybe DTStart)
veDTStartL f ev =
f (veDTStart ev) <&> \x -> ev {veDTStart = x}
veSummaryL :: Lens' VEvent (Maybe Summary)
veSummaryL f ev =
f (veSummary ev) <&> \x -> ev {veSummary = x}
veDescrL :: Lens' VEvent (Maybe Description)
veDescrL f ev =
f (veDescription ev) <&> \x -> ev {veDescription = x}
veEndDurL :: Lens' VEvent (Maybe (Either DTEnd DurationProp))
veEndDurL f ev =
f (veDTEndDuration ev) <&> \x -> ev {veDTEndDuration = x}
mkClassMeeting :: UTCTime -> DateTime -> LazyText -> LazyText -> VEvent
mkClassMeeting now start title descr =
def
& veStampL .~ now
& veUIDL .~ "cs101-mtg-" <> show (localDay (dateTimeFloating start))
& veDTStartL ?~ DTStartDateTime start def
& veSummaryL ?~ Summary title def def def
& veDescrL ?~ Description descr def def def
& veEndDurL ?~ Right classDuration
{ veDTStamp = DTStamp now def,
veUID = UID ("cs101-mtg-" <> show (localDay (dateTimeFloating start))) def,
veLocation = Just (Location "Pratt 610" def def def),
veDTStart = Just (DTStartDateTime start def),
veSummary = Just (Summary title def def def),
veDescription = Just (Description descr def def def),
veDTEndDuration = Just (Right classDuration)
}
eventMap :: Ord a => [VEvent] -> Map (LazyText, Maybe a) VEvent
eventMap =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment