
import Relude

import qualified Data.Generics.Uniplate.Data as U
import qualified Data.List as L

import Expr

distribute :: Expr -> Expr
distribute = U.rewrite f
  where 
    f :: Expr -> Maybe Expr
    f e@Or{} 
      | res == e  = Nothing
      | otherwise = Just res