{"action":"created","issue":{"url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/153","labels_url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/153/comments","events_url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/153/events","html_url":"https://github.com/albertoruiz/hmatrix/issues/153","id":109598639,"number":153,"title":"How to scale a vector","user":{"login":"sid-kap","id":6425077,"avatar_url":"https://avatars.githubusercontent.com/u/6425077?v=3","gravatar_id":"","url":"https://api.github.com/users/sid-kap","html_url":"https://github.com/sid-kap","followers_url":"https://api.github.com/users/sid-kap/followers","following_url":"https://api.github.com/users/sid-kap/following{/other_user}","gists_url":"https://api.github.com/users/sid-kap/gists{/gist_id}","starred_url":"https://api.github.com/users/sid-kap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sid-kap/subscriptions","organizations_url":"https://api.github.com/users/sid-kap/orgs","repos_url":"https://api.github.com/users/sid-kap/repos","events_url":"https://api.github.com/users/sid-kap/events{/privacy}","received_events_url":"https://api.github.com/users/sid-kap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-03T02:46:47Z","updated_at":"2015-10-03T11:59:01Z","closed_at":null,"body":"I tried to use the `Numeric.LinearAlgebra.scale` function to scale a statically-sized vector (`R 900`), but I kept getting type errors like:\r\n\r\n```\r\n    Couldn't match kind ‘*’ with ‘Nat’\r\n    When matching types\r\n      c :: * -> *\r\n      R :: Nat -> *\r\n    Expected type: c e\r\n      Actual type: R 2\r\n    Relevant bindings include it :: c e (bound at <interactive>:4:1)\r\n    In the second argument of ‘LA.scale’, namely ‘(vec2 2 3)’\r\n    In the expression: LA.scale 1 (vec2 2 3)\r\n```\r\nI guess I don't fully understand the types here, but I assume that R is an instance of the Linear typeclass, so this should work?\r\n\r\nI also had similar difficulty with cmap, doing something like `LA.cmap log (vec2 4 5)`."},"comment":{"url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/comments/145243012","html_url":"https://github.com/albertoruiz/hmatrix/issues/153#issuecomment-145243012","issue_url":"https://api.github.com/repos/albertoruiz/hmatrix/issues/153","id":145243012,"user":{"login":"albertoruiz","id":739735,"avatar_url":"https://avatars.githubusercontent.com/u/739735?v=3","gravatar_id":"","url":"https://api.github.com/users/albertoruiz","html_url":"https://github.com/albertoruiz","followers_url":"https://api.github.com/users/albertoruiz/followers","following_url":"https://api.github.com/users/albertoruiz/following{/other_user}","gists_url":"https://api.github.com/users/albertoruiz/gists{/gist_id}","starred_url":"https://api.github.com/users/albertoruiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertoruiz/subscriptions","organizations_url":"https://api.github.com/users/albertoruiz/orgs","repos_url":"https://api.github.com/users/albertoruiz/repos","events_url":"https://api.github.com/users/albertoruiz/events{/privacy}","received_events_url":"https://api.github.com/users/albertoruiz/received_events","type":"User","site_admin":false},"created_at":"2015-10-03T11:59:01Z","updated_at":"2015-10-03T11:59:01Z","body":"The LA.* functions are usually not needed here (and only work with the dynamic arrays in the regular interface). Most operations in the static module are \"automatic\":\r\n\r\n    λ> let v = vec2 1 2\r\n    λ> v\r\n    (vector [1.0,2.0] :: R 2)\r\n    λ> 3 * v\r\n    (vector [3.0,6.0] :: R 2)\r\n    λ> konst (3::Double) * v\r\n    (vector [3.0,6.0] :: R 2)\r\n    λ> log v\r\n    (vector [0.0,0.6931471805599453] :: R 2)\r\n\r\n(I have updated the [tutorial](http://dis.um.es/~alberto/hmatrix/static.html))"}}