on master help sign in
add less than function for day type
commit3656536648cba3bba5861abbcbce7d28e466b5de authorAgentM <agentm@themactionfaction.com> dateFri 1 Apr 2016, 13:48 (11 years ago) parent281683d
1 file changed+5−1
ProjectM36/DataTypes/Day.hs+5−1
ProjectM36/DataTypes/Day.hs+5−1
@@ -15,5 +15,9 @@ dayFunctions = HS.fromList [
1515 AtomFunction { atomFuncName = "fromGregorian",
1616 atomFuncType = [intAtomType, intAtomType, intAtomType, dayAtomType],
1717 atomFunc = \(year:month:day:_) -> ConstructedAtom "Day" dayAtomType [Atom (fromGregorian (fromIntegral (unsafeCast year::Int)) (unsafeCast month) (unsafeCast day))]
18− }
18+ },
19+ AtomFunction { atomFuncName = "dayEarlierThan",
20+ atomFuncType = [dayAtomType, dayAtomType, boolAtomType],
21+ atomFunc = \((ConstructedAtom _ _ (dayA:_)):(ConstructedAtom _ _ (dayB:_)):_) -> Atom (unsafeCast dayA < (unsafeCast dayB :: Day))
22+ }
1923 ]