Hacker News new | ask | show | jobs
by xyproto 2643 days ago
That is pretty neat. Does it mean that one could do something similar for vectors and quaternions?

    let open Quaternion in
    x * y + x
2 comments

Yep. You could write

    module Quaternion = struct
      let (+) =
        ...
    
      let ( * ) =
        ...
    end
then

    let open Quaternion in
imports the contents of Quaternion into local scope, so you can write

    x * y + z
Yes.