packages feed

HaRe-0.8.0.0: test/testdata/Renaming/D5.hs.expected

module Renaming.D5 where

{-Rename top level identifier 'sumSquares' to 'sum'.
  This refactoring affects module `D5', 'B5' , 'C5' and 'A5' -}

data Tree a = Leaf a | Branch (Tree a) (Tree a)

fringe :: Tree a -> [a]
fringe (Leaf x ) = [x]
fringe (Branch left right) = fringe left ++ fringe right

class SameOrNot a where
   isSame  :: a -> a -> Bool
   isNotSame :: a -> a -> Bool

instance SameOrNot Int where
   isSame a  b = a == b
   isNotSame a b = a /= b

sum (x:xs) = sq x + Renaming.D5.sum xs
    where sq x = x ^pow
          pow = 2

sum [] = 0