+defaultQTTable :: IntMap SomeQT
+defaultQTTable = mergeWithRTTable defaultRTTable $ IM.fromList $ map toPair $
+ [ SomeQT AXFR
+ , SomeQT MAILB
+ , SomeQT MAILA
+ , SomeQT ANY
+ ]
+ where
+ toPair :: SomeQT -> (Int, SomeQT)
+ toPair sqt@(SomeQT qt) = (qtToInt qt, sqt)
+
+ mergeWithRTTable :: IntMap SomeRT -> IntMap SomeQT -> IntMap SomeQT
+ mergeWithRTTable rts qts
+ = IM.union (toQTTable rts) qts
+
+ toQTTable :: IntMap SomeRT -> IntMap SomeQT
+ toQTTable = IM.map toSomeQT
+
+ toSomeQT :: SomeRT -> SomeQT
+ toSomeQT (SomeRT rt) = SomeQT rt
+
+defaultRCTable :: IntMap SomeRC
+defaultRCTable = IM.fromList $ map toPair $
+ [ SomeRC IN
+ , SomeRC CS
+ , SomeRC CH
+ , SomeRC HS
+ ]
+ where
+ toPair :: SomeRC -> (Int, SomeRC)
+ toPair src@(SomeRC rc) = (rcToInt rc, src)
+
+defaultQCTable :: IntMap SomeQC
+defaultQCTable = mergeWithRCTable defaultRCTable $ IM.fromList $ map toPair $
+ [ SomeQC ANY
+ ]
+ where
+ toPair :: SomeQC -> (Int, SomeQC)
+ toPair sqc@(SomeQC qc) = (qcToInt qc, sqc)
+
+ mergeWithRCTable :: IntMap SomeRC -> IntMap SomeQC -> IntMap SomeQC
+ mergeWithRCTable rcs qcs
+ = IM.union (toQCTable rcs) qcs
+
+ toQCTable :: IntMap SomeRC -> IntMap SomeQC
+ toQCTable = IM.map toSomeQC
+
+ toSomeQC :: SomeRC -> SomeQC
+ toSomeQC (SomeRC rc) = SomeQC rc