summaryrefslogtreecommitdiff
path: root/edit-lens/src/Control/Edit.lhs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-02-05 17:02:55 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2018-02-05 17:02:55 +0100
commit6d1f39826963890e9612b39f92843f134b6973f3 (patch)
treea613a5ff0b0b61a021a22cda7523e1d9aef9c9d9 /edit-lens/src/Control/Edit.lhs
parent529d127667a366f306f975b3ed34e8a118f3cefc (diff)
downloadincremental-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.lhs8
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}
3module Control.Edit 3module 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
24Eine Repräsentierung als Typklasse bietet sich an: 24Eine Repräsentierung als Typklasse bietet sich an:
25 25
26\begin{code} 26\begin{code}
27infix 5 `apply`
28
27class Monoid m => Module m where 29class 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
43infixl 5 `apply'`
44apply' :: Module m => Maybe (Domain m) -> m -> Maybe (Domain m)
45apply' md e = flip apply e =<< md
40\end{code} 46\end{code}
41\end{defn} 47\end{defn}
42 48