Mercurial > hg > Members > atton > similar_monad
changeset 6:5e367a167382
Define samples
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 02 Sep 2014 11:06:49 +0900 |
parents | 051c663a4af2 |
children | d30e40d5b5cf |
files | similer.hs |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/similer.hs Tue Sep 02 11:02:00 2014 +0900 +++ b/similer.hs Tue Sep 02 11:06:49 2014 +0900 @@ -24,3 +24,15 @@ same :: Eq b => Similer a b -> b same (Similer x f y) = if (f x) == y then y else undefined + + +-- samples + +sameExample :: [Int] +sameExample = map same $ map (fmap same) $ fmap twicePlus [1..10] + +nonSameExample :: [Int] +nonSameExample = map same $ map (fmap same) $ fmap plusTwo [1..10] + +nonSameExampleSpecific :: [Int] +nonSameExampleSpecific = map same $ map (fmap same) $ fmap plusTwo [2]