I have following Haskell function
fun::Vertex3 GLfloat -> Vertex3 GLfloat -> Vertex3 GLfloat
fun (Vertex3 x0 y0 z0) (Vertex3 x1 y1 z1) = do sth here
where
p0 = (Vertex3 x0 y0 z0)
p1 = (Vertex3 x1 y1 z1)
p = p0 + p1
I'm wondering whether there is a way to not repeat
(Vertex3 x0 y0 z0) (Vertex3 x1 y1 z1) inside the code
I'm looking for some thing like:
fun::Vertex3 GLfloat -> Vertex3 GLfloat -> Vertex3 GLfloat
fun p0 p1 = do sth here
where
p0 = (Vertex3 x0 y0 z0)
p1 = (Vertex3 x1 y1 z1)
p = p0 + p1