Mercurial > hg > Members > atton > delta_monad
changeset 53:1e6fecb54f1f
Adjust function name
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 19 Nov 2014 13:35:58 +0900 |
parents | 69a01cc80075 |
children | 9bb7c9bee94f |
files | delta.hs |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/delta.hs Wed Nov 19 13:33:37 2014 +0900 +++ b/delta.hs Wed Nov 19 13:35:58 2014 +0900 @@ -13,9 +13,9 @@ deltaAppend (Mono lx x) d = Delta lx x d deltaAppend (Delta lx x d) ds = Delta lx x (deltaAppend d ds) -firstDelta :: Delta a -> Delta a -firstDelta d@(Mono _ _) = d -firstDelta (Delta lx x _) = Mono lx x +headDelta :: Delta a -> Delta a +headDelta d@(Mono _ _) = d +headDelta (Delta lx x _) = Mono lx x tailDelta :: Delta a -> Delta a tailDelta d@(Mono _ _) = d @@ -35,7 +35,7 @@ mu :: Delta (Delta a) -> Delta a mu (Mono ld d) = logAppend ld d -mu (Delta ld d ds) = (logAppend ld $ firstDelta d) `deltaAppend` (mu $ fmap tailDelta ds) +mu (Delta ld d ds) = (logAppend ld $ headDelta d) `deltaAppend` (mu $ fmap tailDelta ds) instance Monad Delta where return x = Mono [] x