diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-02-05 17:02:55 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-02-05 17:02:55 +0100 |
commit | 6d1f39826963890e9612b39f92843f134b6973f3 (patch) | |
tree | a613a5ff0b0b61a021a22cda7523e1d9aef9c9d9 /edit-lens/src/Control/Edit.lhs | |
parent | 529d127667a366f306f975b3ed34e8a118f3cefc (diff) | |
download | incremental-dfsts-6d1f39826963890e9612b39f92843f134b6973f3.tar incremental-dfsts-6d1f39826963890e9612b39f92843f134b6973f3.tar.gz incremental-dfsts-6d1f39826963890e9612b39f92843f134b6973f3.tar.bz2 incremental-dfsts-6d1f39826963890e9612b39f92843f134b6973f3.tar.xz incremental-dfsts-6d1f39826963890e9612b39f92843f134b6973f3.zip |
Framework for DFST edit lens
Diffstat (limited to 'edit-lens/src/Control/Edit.lhs')
-rw-r--r-- | edit-lens/src/Control/Edit.lhs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/edit-lens/src/Control/Edit.lhs b/edit-lens/src/Control/Edit.lhs index 7be8db4..19fe336 100644 --- a/edit-lens/src/Control/Edit.lhs +++ b/edit-lens/src/Control/Edit.lhs | |||
@@ -1,7 +1,7 @@ | |||
1 | \begin{comment} | 1 | \begin{comment} |
2 | \begin{code} | 2 | \begin{code} |
3 | module Control.Edit | 3 | module Control.Edit |
4 | ( Module(..) | 4 | ( Module(..), apply' |
5 | ) where | 5 | ) where |
6 | \end{code} | 6 | \end{code} |
7 | \end{comment} | 7 | \end{comment} |
@@ -24,6 +24,8 @@ In Haskell charakterisieren wir Moduln über ihren Monoid, d.h. die Wahl des Mon | |||
24 | Eine Repräsentierung als Typklasse bietet sich an: | 24 | Eine Repräsentierung als Typklasse bietet sich an: |
25 | 25 | ||
26 | \begin{code} | 26 | \begin{code} |
27 | infix 5 `apply` | ||
28 | |||
27 | class Monoid m => Module m where | 29 | class Monoid m => Module m where |
28 | type Domain m :: * | 30 | type Domain m :: * |
29 | apply :: Domain m -> m -> Maybe (Domain m) | 31 | apply :: Domain m -> m -> Maybe (Domain m) |
@@ -37,6 +39,10 @@ class Monoid m => Module m where | |||
37 | -- ^ Calculate a representation of an element of 'Domain m' in 'Del m' | 39 | -- ^ Calculate a representation of an element of 'Domain m' in 'Del m' |
38 | -- | 40 | -- |
39 | -- prop> init `apply` divInit m = m | 41 | -- prop> init `apply` divInit m = m |
42 | |||
43 | infixl 5 `apply'` | ||
44 | apply' :: Module m => Maybe (Domain m) -> m -> Maybe (Domain m) | ||
45 | apply' md e = flip apply e =<< md | ||
40 | \end{code} | 46 | \end{code} |
41 | \end{defn} | 47 | \end{defn} |
42 | 48 | ||