# HG changeset patch # User Yasutaka Higa # Date 1409623609 -32400 # Node ID 5e367a167382b83e145204e5d30e55ec5e71718a # Parent 051c663a4af2bdc8408e0c8b97069583754426d5 Define samples diff -r 051c663a4af2 -r 5e367a167382 similer.hs --- 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]