This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Debug.Trace -- Optional: for debugging if needed, remove in final version | |
| data Bits = O Bits | I Bits | E deriving (Show, Eq) | |
| -- Helper function to append two Bits sequences. | |
| -- append xs ys concatenates xs and ys. | |
| append :: Bits -> Bits -> Bits | |
| append E ys = ys | |
| append (O xs) ys = O (append xs ys) | |
| append (I xs) ys = I (append xs ys) |