retrie-2.0.0: tests/inputs/Comments.test
# Copyright (c) 2025 Andrew Farmer
# Copyright (c) 2020-2024 Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
-l Comments.old
-l Comments.swap
-l Comments.convt
-u Comments.oldFunc
-l Comments.tmpl
-u Comments.idFunc
===
module Comments where
{-# RULES "old" forall x. oldfunc x = newfunc x #-}
{-# RULES "swap" forall x y. swapFunc x y = newSwapFunc y x #-}
{-# RULES "convt" a = alpha #-}
{-# RULES "tmpl" forall x. h x = k {- template comment -} x #-}
main1 :: IO ()
main1 =
- oldfunc -- note: change this to newfunc
+ newfunc -- note: change this to newfunc
arg
main2 :: IO ()
main2 =
- swapFunc
- -- note: swap args and update
- arg1 arg2
+ newSwapFunc arg2 -- note: swap args and update
+ arg1
main3 :: IO ()
main3 =
[
f -- first
- a
- , a -- ^ second
+ alpha
+ , alpha -- ^ second
-- third
- , a
+ , alpha
]
oldFunc x =
[ x
, x
]
-main4 = oldFunc -- comment here
+main4 = [ -- comment here
-- more comment
foo
+ , -- comment here
+ -- more comment
+ foo
+ ]
-main5 = h 1
+main5 = k {- template comment -} 1
idFunc x = x
-main6 = idFunc -- note
+main6 = -- note
1
-main7 = idFunc {- c -} 2
+main7 = {- c -} 2
-main8 = [3, {- d -} idFunc 4, 5]
+main8 = [3, {- d -} 4, 5]
main9 = [6,
-- e
- idFunc -- f
+ -- f
7]