Created
October 26, 2013 11:00
-
-
Save danidiaz/7168119 to your computer and use it in GitHub Desktop.
Isos and au
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Control.Lens | |
| import Data.Foldable | |
| import Data.Monoid | |
| import Data.Complex | |
| import Data.Complex.Lens | |
| r0 = au (from _polar.wrapping Sum) foldMap [(1.0,pi),(1.0,0.0)] | |
| r1 = view _polar $ getSum $ mconcat $ (map $ view $ from _polar.wrapping Sum) [(1.0,pi),(1.0,0.0)] | |
| r2 = view _polar $ getSum $ foldMap (Sum . (view $ from _polar)) [(1.0,pi),(1.0,0.0)] | |
| main = do | |
| putStrLn . show $ r0 | |
| putStrLn . show $ r1 | |
| putStrLn . show $ r2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment