Skip to content

Commit

Permalink
Add epoch/era/century lenses for fclabels
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanHowell committed Apr 22, 2012
1 parent 9a1575f commit 17b59a6
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions fclabels/Data/Time/Cube/Label.hs
Expand Up @@ -27,9 +27,9 @@ module Data.Time.Cube.Label
, Data.Time.Cube.Label.modifyM

-- * Helper lenses
-- , epoch
-- , era
-- , century
, epoch
, era
, century
, year
, month
, monthOfYear
Expand Down Expand Up @@ -133,6 +133,21 @@ modify
-> f
modify l v = runIdentity . modifyM l v

epoch
:: (Functor m, Monad m, DateTimePart c f Epoch)
=> DateTimeLensT m c f Epoch
epoch = datePart

era
:: (Functor m, Monad m, DateTimePart c f Era)
=> DateTimeLensT m c f Era
era = datePart

century
:: (Functor m, Monad m, DateTimePart c f Century)
=> DateTimeLensT m c f Century
century = datePart

year
:: (Functor m, Monad m, DateTimePart c f Year)
=> DateTimeLensT m c f Year
Expand Down

0 comments on commit 17b59a6

Please sign in to comment.