From c093eb6838a0a9544a1c6f4a37bdef9c746f28e5 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 17 Nov 2016 17:25:40 -0600 Subject: [PATCH] Formatting changes --- src/FDoc/RecursionSchemes.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/FDoc/RecursionSchemes.hs b/src/FDoc/RecursionSchemes.hs index 96db1287b..8b6b19f46 100644 --- a/src/FDoc/RecursionSchemes.hs +++ b/src/FDoc/RecursionSchemes.hs @@ -14,7 +14,7 @@ import FDoc.Term data NewField = NewField deriving (Show) {- -Anamorphism +Anamorphism -- add a new field to each term's Record fields ana :: (a -> Base t a) -- ^ a (Base t)-coalgebra -> a -- ^ seed @@ -24,16 +24,14 @@ Anamorphism as a recursion scheme "builds up" a recursive structure. Anamorphisms work by using a coalgebra, which maps a seed value to a fixed point structure. The example below adds a new field to the `Record` fields. - -} - indexedTermAna :: [leaf] -> Term (Syntax leaf) (Record '[NewField, Range, Category]) indexedTermAna childrenLeaves = ana coalgebra (indexedTerm childrenLeaves) where coalgebra term = (NewField .: (extract term)) :< (unwrap term) {- -Catamorphism +Catamorphism example -- add a new field to each term's Record fields cata :: (Base t a -> a) -- ^ a (Base t)-algebra -> t -- ^ fixed point