]> Git — Sourcephile - haskell/symantic.git/blob - Language/LOL/Symantic/Expr/Eq.hs
init
[haskell/symantic.git] / Language / LOL / Symantic / Expr / Eq.hs
1 {-# LANGUAGE DefaultSignatures #-}
2 {-# LANGUAGE FlexibleContexts #-}
3 {-# LANGUAGE ScopedTypeVariables #-}
4 {-# LANGUAGE TypeFamilies #-}
5 -- | Expression for 'Eq'.
6 module Language.LOL.Symantic.Expr.Eq where
7
8 import Language.LOL.Symantic.Repr.Dup
9 import Language.LOL.Symantic.Trans.Common
10
11 -- * Class 'Sym_Eq'
12
13 class Sym_Eq repr where
14 eq :: Eq a => repr a -> repr a -> repr Bool
15 default eq :: (Trans t repr, Eq a) => t repr a -> t repr a -> t repr Bool
16 eq = trans_map2 eq
17
18 instance (Sym_Eq r1, Sym_Eq r2) => Sym_Eq (Dup r1 r2) where
19 eq (x1 `Dup` x2) (y1 `Dup` y2) = eq x1 y1 `Dup` eq x2 y2