Skip to content

Instantly share code, notes, and snippets.

@rrichardson
Created June 11, 2013 19:19
Show Gist options
  • Save rrichardson/5759791 to your computer and use it in GitHub Desktop.
Save rrichardson/5759791 to your computer and use it in GitHub Desktop.
combine' :: (a -> a -> a) -> Value -> Value -> Value
combine' fun (IntVal a) (IntVal b) = IntVal $ fun a b
combine' fun (IntVal a) (RealVal b) = RealVal $ fun b $ fromInteger a
combine' fun (RealVal a) (IntVal b) = RealVal $ fun a $ fromInteger b
combine' fun (RealVal a) (RealVal b) = RealVal $ fun a b
--combine' fun (StrVal a) (StrVal b) = StrVal $ fun a b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment