This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | Converts a 'ClockTime' into an HTTP timestamp. | |
formatHttpTime :: UTCTime -> ByteString | |
formatHttpTime = fromStr . formatTime defaultTimeLocale "%a, %d %b %Y %X GMT" | |
-- | Converts an HTTP timestamp into a 'UTCTime'. | |
parseHttpTime :: ByteString -> Maybe UTCTime | |
parseHttpTime s' = | |
parseTime defaultTimeLocale "%a, %d %b %Y %H:%M:%S GMT" s | |
where | |
s = toStr s' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h x=maximum$0:[y|(l,y,r)<-b,l<=x,x<r] | |
print[(x,h x)|x<-[1..9999],h x/=h(x-1)] |
NewerOlder