{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/haskell-platform/issues/203","labels_url":"https://api.github.com/repos/haskell/haskell-platform/issues/203/labels{/name}","comments_url":"https://api.github.com/repos/haskell/haskell-platform/issues/203/comments","events_url":"https://api.github.com/repos/haskell/haskell-platform/issues/203/events","html_url":"https://github.com/haskell/haskell-platform/issues/203","id":100530418,"number":203,"title":"how to profile trees.hs","user":{"login":"LovelyYanki","id":5094741,"avatar_url":"https://avatars.githubusercontent.com/u/5094741?v=3","gravatar_id":"","url":"https://api.github.com/users/LovelyYanki","html_url":"https://github.com/LovelyYanki","followers_url":"https://api.github.com/users/LovelyYanki/followers","following_url":"https://api.github.com/users/LovelyYanki/following{/other_user}","gists_url":"https://api.github.com/users/LovelyYanki/gists{/gist_id}","starred_url":"https://api.github.com/users/LovelyYanki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LovelyYanki/subscriptions","organizations_url":"https://api.github.com/users/LovelyYanki/orgs","repos_url":"https://api.github.com/users/LovelyYanki/repos","events_url":"https://api.github.com/users/LovelyYanki/events{/privacy}","received_events_url":"https://api.github.com/users/LovelyYanki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-12T12:18:55Z","updated_at":"2015-08-16T14:50:13Z","closed_at":null,"body":"\r\nmartin@ubuntu:~/mal$ ghc -prof -auto-all -fprof-auto -rtsopts trees.hs\r\n\r\ntrees.hs:1:1:\r\n    Could not find module ‘Prelude’\r\n    Perhaps you haven't installed the profiling libraries for package ‘base-4.8.0.0’?\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:1:8:\r\n    Could not find module ‘Data.List’\r\n    Perhaps you haven't installed the profiling libraries for package ‘base-4.8.0.0’?\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:2:8:\r\n    Could not find module ‘Data.Array’\r\n    Perhaps you haven't installed the profiling libraries for package ‘array-0.5.1.0@array_FaHmcBFfuRM8kmZLEY8D5S’?\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:5:8:\r\n    Could not find module ‘Control.Monad’\r\n    Perhaps you haven't installed the profiling libraries for package ‘base-4.8.0.0’?\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:6:8:\r\n    Could not find module ‘Math.Combinat’\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:7:8:\r\n    Could not find module ‘Math.Core.Utils’\r\n    Perhaps you haven't installed the profiling libraries for package ‘HaskellForMaths-0.4.8@Haske_1GMsbIEksIZBNIbIL0RWxj’?\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:8:8:\r\n    Could not find module ‘Math.Core.Field’\r\n    Perhaps you haven't installed the profiling libraries for package ‘HaskellForMaths-0.4.8@Haske_1GMsbIEksIZBNIbIL0RWxj’?\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:9:8:\r\n    Could not find module ‘Math.Algebras.VectorSpace’\r\n    Perhaps you haven't installed the profiling libraries for package ‘HaskellForMaths-0.4.8@Haske_1GMsbIEksIZBNIbIL0RWxj’?\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:10:8:\r\n    Could not find module ‘Math.Algebras.Structures’\r\n    Perhaps you haven't installed the profiling libraries for package ‘HaskellForMaths-0.4.8@Haske_1GMsbIEksIZBNIbIL0RWxj’?\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:14:8:\r\n    Could not find module ‘System.IO’\r\n    Perhaps you haven't installed the profiling libraries for package ‘base-4.8.0.0’?\r\n    Use -v to see a list of the files searched for.\r\n\r\ntrees.hs:15:18:\r\n    Could not find module ‘Data.Map’\r\n    Perhaps you haven't installed the profiling libraries for package ‘containers-0.5.6.2@conta_47ajk3tbda43DFWyeF3oHQ’?\r\n    Use -v to see a list of the files searched for.\r\nmartin@ubuntu:~/mal$ \r\n\r\n\r\nimport Data.List\r\nimport Data.Array\r\n--import Data.Set\r\n--import Data.Graph \r\nimport Control.Monad\r\nimport Math.Combinat\r\nimport Math.Core.Utils\r\nimport Math.Core.Field\r\nimport Math.Algebras.VectorSpace\r\nimport Math.Algebras.Structures\r\n--import Math.CommutativeAlgebra.GroebnerBasis\r\n--import Math.CommutativeAlgebra.Polynomial\r\n--import Math.Algebras.Matrix\r\nimport System.IO\r\nimport qualified Data.Map as M\r\n\r\ntype Vertex = Int\r\ntype Table a = Array Vertex a\r\ntype Graph e = Table [(e, Vertex)]\r\ntype Bounds  = (Vertex, Vertex)\r\ntype Edge e = (Vertex, e, Vertex)\r\n\r\ntype Labeling a = Vertex -> a\r\ndata LabGraph n e = LabGraph (Graph e) (Labeling n)\r\n\r\n-- | Build a graph from a list of edges.\r\nbuildG :: Bounds -> [Edge e] -> Graph e\r\nbuildG bounds0 edges0 = accumArray (flip (:)) [] bounds0 [(v, (l,w)) | (v,l,w) <- edges0]\r\n \r\n-- | The graph obtained by reversing all edges.\r\ntransposeG  :: Graph e -> Graph e\r\ntransposeG g = buildG (bounds g) (reverseE g)\r\n\r\nedges :: Graph e -> [Edge e]\r\nedges g = [ (v, l, w) | v <- indices g, (l, w) <- g!v ]\r\n \r\nreverseE    :: Graph e -> [Edge e]\r\nreverseE g   = [ (w, l, v) | (v, l, w) <- edges g ]\r\n\r\nshowGraphViz (LabGraph gr lab)  = \r\n    \"digraph name {\\n\" ++\r\n    \"rankdir=LR;\\n\" ++\r\n    (concatMap showNode $ indices gr) ++\r\n    (concatMap showEdge $ edges gr) ++\r\n    \"}\\n\"\r\n    where showEdge (from, t, to) = show from ++ \" -> \" ++ show to ++\r\n\t\t\t\t   \" [label = \\\"\" ++ show t ++ \"\\\"];\\n\"\r\n          showNode v = show v ++ \" [label = \" ++ (show $ lab v) ++ \"];\\n\"\r\n \r\n\r\n-- | Compute the distance to v for every vertex of gr.\r\n--distsTo :: Vertex -> Graph Float -> Table Float\r\n--distsTo v gr = foldGAll infinite distance gr \r\n--    where infinite = 10000000 -- well, you get the idea\r\n--          distance v' neighbours \r\n--              | v == v' = 0\r\n--              | otherwise = minimum [distV+arcWeight | (distV, arcWeight) <- neighbours]\r\n"},"comment":{"url":"https://api.github.com/repos/haskell/haskell-platform/issues/comments/131567787","html_url":"https://github.com/haskell/haskell-platform/issues/203#issuecomment-131567787","issue_url":"https://api.github.com/repos/haskell/haskell-platform/issues/203","id":131567787,"user":{"login":"LovelyYanki","id":5094741,"avatar_url":"https://avatars.githubusercontent.com/u/5094741?v=3","gravatar_id":"","url":"https://api.github.com/users/LovelyYanki","html_url":"https://github.com/LovelyYanki","followers_url":"https://api.github.com/users/LovelyYanki/followers","following_url":"https://api.github.com/users/LovelyYanki/following{/other_user}","gists_url":"https://api.github.com/users/LovelyYanki/gists{/gist_id}","starred_url":"https://api.github.com/users/LovelyYanki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LovelyYanki/subscriptions","organizations_url":"https://api.github.com/users/LovelyYanki/orgs","repos_url":"https://api.github.com/users/LovelyYanki/repos","events_url":"https://api.github.com/users/LovelyYanki/events{/privacy}","received_events_url":"https://api.github.com/users/LovelyYanki/received_events","type":"User","site_admin":false},"created_at":"2015-08-16T14:50:13Z","updated_at":"2015-08-16T14:50:13Z","body":"martin@ubuntu:~$ lsb_release -a\r\nNo LSB modules are available.\r\nDistributor ID: Ubuntu\r\nDescription: Ubuntu 14.04.1 LTS\r\nRelease: 14.04\r\nCodename: trusty"}}