Skip to content

Instantly share code, notes, and snippets.

@nrolland
Created May 7, 2015 10:01
Show Gist options
  • Save nrolland/17406b8113e23edeea92 to your computer and use it in GitHub Desktop.
Save nrolland/17406b8113e23edeea92 to your computer and use it in GitHub Desktop.
newtype Complex = Complex
{ real :: Number
, imaginary :: Number
}
eqCplx :: Complex -> Complex -> Boolean
eqCplx (Complex a) (Complex b) = (a.real == b.real) `and` (a.imaginary == b.imaginary)
where and :: Boolean -> Boolean -> Boolean
and x y = x && y
notEqCplxOK x y = not (eqCplx x y)
notEqCplxKO = not <<< eqCplx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment