- = dsExpr expr `thenDs` \ expr2 ->
- dsLExpr from `thenDs` \ from2 ->
- dsLExpr thn `thenDs` \ thn2 ->
- returnDs (mkApps expr2 [from2, thn2])
-
-dsExpr (ArithSeq expr (FromThenTo from thn two))
- = dsExpr expr `thenDs` \ expr2 ->
- dsLExpr from `thenDs` \ from2 ->
- dsLExpr thn `thenDs` \ thn2 ->
- dsLExpr two `thenDs` \ two2 ->
- returnDs (mkApps expr2 [from2, thn2, two2])
-
-dsExpr (PArrSeq expr (FromTo from two))
- = dsExpr expr `thenDs` \ expr2 ->
- dsLExpr from `thenDs` \ from2 ->
- dsLExpr two `thenDs` \ two2 ->
- returnDs (mkApps expr2 [from2, two2])
-
-dsExpr (PArrSeq expr (FromThenTo from thn two))
- = dsExpr expr `thenDs` \ expr2 ->
- dsLExpr from `thenDs` \ from2 ->
- dsLExpr thn `thenDs` \ thn2 ->
- dsLExpr two `thenDs` \ two2 ->
- returnDs (mkApps expr2 [from2, thn2, two2])
+ = mkApps <$> dsExpr expr <*> mapM dsLExpr [from, thn]
+
+dsExpr (ArithSeq expr (FromThenTo from thn to))
+ = mkApps <$> dsExpr expr <*> mapM dsLExpr [from, thn, to]
+
+dsExpr (PArrSeq expr (FromTo from to))
+ = mkApps <$> dsExpr expr <*> mapM dsLExpr [from, to]
+
+dsExpr (PArrSeq expr (FromThenTo from thn to))
+ = mkApps <$> dsExpr expr <*> mapM dsLExpr [from, thn, to]