Skip to content

Instantly share code, notes, and snippets.

View aaravq's full-sized avatar

Roshan Diwakar aaravq

  • zooQ
  • New York
  • 15:31 (UTC -12:00)
View GitHub Profile
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)