Last active
March 21, 2016 03:44
-
-
Save nickpascucci/f618941df7f29e02c097 to your computer and use it in GitHub Desktop.
Revisions
-
nickpascucci revised this gist
Mar 21, 2016 . 1 changed file with 13 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,16 @@ -- Vector magnitude/absolute value. This doesn't type check - if you -- can figure out why, please leave a comment! magnitude :: Vec (Qu d l n) -> Qu d l n magnitude (Vec3 x y z) = qSqrt ((qSq x) |+| (qSq y) |+| (qSq z)) -- Couldn't match type ‘d’ with ‘Normalize (d @@+ d) @/ Two’ -- ‘d’ is a rigid type variable bound by the type signature for interactive:IHaskell128.magnitude :: Vec (Qu d l n) -> Qu d l n at :1:14 -- Expected type: Qu d l n -- Actual type: Qu (Normalize (d @@+ d) @/ Two) l n -- Relevant bindings include -- z :: Qu d l n (bound at :2:21) -- y :: Qu d l n (bound at :2:19) -- x :: Qu d l n (bound at :2:17) -- magnitude :: Vec (Qu d l n) -> Qu d l n (bound at :2:1) -- In the expression: qSqrt ((qSq x) |+| (qSq y) |+| (qSq z)) -- In an equation for ‘magnitude’: magnitude (Vec3 x y z) = qSqrt ((qSq x) |+| (qSq y) |+| (qSq z)) -
nickpascucci created this gist
Mar 21, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ -- Vector magnitude/absolute value. This doesn't type check - if you -- can figure out why, please leave a comment! magnitude :: Vec (Qu d l n) -> Qu d l n magnitude (Vec3 x y z) = qSqrt ((qSq x) |+| (qSq y) |+| (qSq z))