From 3f72482cf401bb70b3c20ab1d62d4904385670f2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 13 Nov 2017 17:48:00 +0100 Subject: Comment on language extensions & fix compilation --- edit-lens/src/Control/Lens/Edit.lhs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/edit-lens/src/Control/Lens/Edit.lhs b/edit-lens/src/Control/Lens/Edit.lhs index 69a6f7f..973f409 100644 --- a/edit-lens/src/Control/Lens/Edit.lhs +++ b/edit-lens/src/Control/Lens/Edit.lhs @@ -3,14 +3,16 @@ Dabei werden wir sowohl die Definitionen aus \cite{hofmann2012edit} sowohl in na \begin{code} {-# LANGUAGE TypeFamilies - , KindSignatures , FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , FunctionalDependencies - , AllowAmbiguousTypes - , GADTs #-} +-- Allow more complicated type families +{-# LANGUAGE AllowAmbiguousTypes #-} +-- AmbiguousTypes are useful if we expect functions to be called via TypeApplication +{-# LANGUAGE GADTs #-} +-- For allowing constraints on constructors module Control.Lens.Edit ( Module(..) @@ -47,7 +49,7 @@ class Monoid m => Module m where -- prop> m `apply` (e `mappend` e') = (m `apply` e) `apply` e' init :: Domain m -- ^ 'init @m' (TypeApplication) is the initial element of 'm' - divInit :: Domain m -> Del m + divInit :: Domain m -> m -- ^ Calculate a representation of an element of 'Domain m' in 'Del m' -- -- prop> init `apply` divInit m = m @@ -131,7 +133,7 @@ class (Module m, Module n) => HasEditLens l m n | l -> m, l -> n where -- ^ Map edits of 'n' to changes of 'm', maintaining some state from 'Complement l' -- | Inspect the components of an edit lens (e.g. 'EditLens') -instance HasEditLens (EditLens c m n) where +instance (Module m, Module n) => HasEditLens (EditLens c m n) m n where type Complement (EditLens c m n) = c ground (EditLens g _ _) = g propR (EditLens _ r _) = r -- cgit v1.2.3