{"action":"created","issue":{"url":"https://api.github.com/repos/SongHerz/haskellprac/issues/2","labels_url":"https://api.github.com/repos/SongHerz/haskellprac/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/SongHerz/haskellprac/issues/2/comments","events_url":"https://api.github.com/repos/SongHerz/haskellprac/issues/2/events","html_url":"https://github.com/SongHerz/haskellprac/issues/2","id":101266903,"number":2,"title":"Eval for RWH ch13","user":{"login":"SongHerz","id":1311107,"avatar_url":"https://avatars.githubusercontent.com/u/1311107?v=3","gravatar_id":"","url":"https://api.github.com/users/SongHerz","html_url":"https://github.com/SongHerz","followers_url":"https://api.github.com/users/SongHerz/followers","following_url":"https://api.github.com/users/SongHerz/following{/other_user}","gists_url":"https://api.github.com/users/SongHerz/gists{/gist_id}","starred_url":"https://api.github.com/users/SongHerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SongHerz/subscriptions","organizations_url":"https://api.github.com/users/SongHerz/orgs","repos_url":"https://api.github.com/users/SongHerz/repos","events_url":"https://api.github.com/users/SongHerz/events{/privacy}","received_events_url":"https://api.github.com/users/SongHerz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-16T14:01:28Z","updated_at":"2015-08-17T09:50:01Z","closed_at":null,"body":"Implement eval functionality for SymbolicManip data type.\r\nFor a given SymbolicManip:\r\n1. evalConst: only eval a SymbolicManip that contains no symbol, raise error on symbol.\r\n2. eval: with a given symbol-value map, eval the SymbolicManip, raise error on symbol without value.\r\n3. evalPartial: eval a SymbolicManip as much as possible with a given symbol-value map, when a symbol has no value from the map, leave it as it is."},"comment":{"url":"https://api.github.com/repos/SongHerz/haskellprac/issues/comments/131756231","html_url":"https://github.com/SongHerz/haskellprac/issues/2#issuecomment-131756231","issue_url":"https://api.github.com/repos/SongHerz/haskellprac/issues/2","id":131756231,"user":{"login":"SongHerz","id":1311107,"avatar_url":"https://avatars.githubusercontent.com/u/1311107?v=3","gravatar_id":"","url":"https://api.github.com/users/SongHerz","html_url":"https://github.com/SongHerz","followers_url":"https://api.github.com/users/SongHerz/followers","following_url":"https://api.github.com/users/SongHerz/following{/other_user}","gists_url":"https://api.github.com/users/SongHerz/gists{/gist_id}","starred_url":"https://api.github.com/users/SongHerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SongHerz/subscriptions","organizations_url":"https://api.github.com/users/SongHerz/orgs","repos_url":"https://api.github.com/users/SongHerz/repos","events_url":"https://api.github.com/users/SongHerz/events{/privacy}","received_events_url":"https://api.github.com/users/SongHerz/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T09:50:01Z","updated_at":"2015-08-17T09:50:01Z","body":"Only implement\r\neval :: (Num a, Ord a) => M.Map String a -> SymbolicManip a -> a\r\n\r\nRaise error when value of a symbol cannot be got from the map.\r\n\r\nBut there are several limitations:\r\n1. Not all operations are available for all instances of Num.\r\nE.g.\r\nInt and Float are both instances of Num, but division operations \r\nfor Int is 'div' function (Int is instance of Integral class, and 'div' defined in Integral class)\r\nfor Float is '/' function (Float is instance of Fractional class, and '/' defined in Fractional class)\r\n\r\n\r\n2. Instead of partial eval, raise error when a symbol cannot be got from the map.\r\nBecause if some symbols are left unchanged, how to simplify an expr '1 + (2 + (Symbol \"x\"))'.\r\nThe problem becomes more complex.\r\n\r\nevalConst is a special case of eval, and not provide a special function for it."}}