From 6d1f39826963890e9612b39f92843f134b6973f3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 5 Feb 2018 17:02:55 +0100 Subject: Framework for DFST edit lens --- edit-lens/src/Control/Edit.lhs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'edit-lens/src/Control/Edit.lhs') 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 @@ \begin{comment} \begin{code} module Control.Edit - ( Module(..) + ( Module(..), apply' ) where \end{code} \end{comment} @@ -24,6 +24,8 @@ In Haskell charakterisieren wir Moduln über ihren Monoid, d.h. die Wahl des Mon Eine Repräsentierung als Typklasse bietet sich an: \begin{code} +infix 5 `apply` + class Monoid m => Module m where type Domain m :: * apply :: Domain m -> m -> Maybe (Domain m) @@ -37,6 +39,10 @@ class Monoid m => Module m where -- ^ Calculate a representation of an element of 'Domain m' in 'Del m' -- -- prop> init `apply` divInit m = m + +infixl 5 `apply'` +apply' :: Module m => Maybe (Domain m) -> m -> Maybe (Domain m) +apply' md e = flip apply e =<< md \end{code} \end{defn} -- cgit v1.2.3