1 {-# LANGUAGE NoImplicitPrelude #-}
2 {-# OPTIONS_GHC -fno-warn-tabs #-}
4 module Hcompta.Expr.Set where
6 import Hcompta.Expr.Dup
10 class Expr_Set repr where
11 complement :: repr a -> repr a
12 intersection :: repr a -> repr a -> repr a
13 union :: repr a -> repr a -> repr a
15 instance -- Expr_Set Dup
18 ) => Expr_Set (Dup r1 r2) where
19 complement (x1 `Dup` x2) = complement x1 `Dup` complement x2
20 intersection (x1 `Dup` x2) (y1 `Dup` y2) = intersection x1 y1 `Dup` intersection x2 y2
21 union (x1 `Dup` x2) (y1 `Dup` y2) = union x1 y1 `Dup` union x2 y2