[Haskell-cafe] Suggestion for implementation of vector library

David Roundy droundy at darcs.net
Tue Jun 17 14:31:31 EDT 2008


On Tue, Jun 17, 2008 at 08:24:58AM -0700, John Meacham wrote:
> You can also create helper functions like
> 
> v3 = Vector3
> 
> so you can do (v3 1 2 3 <+> v3 4 5 6)

Or just use

data Vector3 = V3 !Float !Float !Float

and you've got compact pattern matching as well as constructing.

David


More information about the Haskell-Cafe mailing list