]> Git — Sourcephile - haskell/symantic.git/blob - Language/LOL/Symantic/Trans/Common.hs
init
[haskell/symantic.git] / Language / LOL / Symantic / Trans / Common.hs
1 {-# LANGUAGE MultiParamTypeClasses #-}
2 module Language.LOL.Symantic.Trans.Common where
3
4 -- |
5 -- * 'trans_lift' is generally not /surjective/
6 -- * 'trans_apply' is not /injective/
7 -- * 'trans_apply' . 'trans_lift' == 'id'
8 -- * 'trans_lift' . 'trans_apply' /= 'id'
9 class Trans trans repr where
10 trans_lift :: repr a -> trans repr a
11 trans_apply :: trans repr a -> repr a
12
13 trans_map1 :: (repr a -> repr b) -> (trans repr a -> trans repr b)
14 trans_map1 f = trans_lift . f . trans_apply
15
16 trans_map2
17 :: (repr a -> repr b -> repr c)
18 -> (trans repr a -> trans repr b -> trans repr c)
19 trans_map2 f e1 e2 = trans_lift (f (trans_apply e1) (trans_apply e2))