Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created December 18, 2014 09:04
Show Gist options
  • Save mwotton/0177b7860dcccc92dafb to your computer and use it in GitHub Desktop.
Save mwotton/0177b7860dcccc92dafb to your computer and use it in GitHub Desktop.
data Foo a b = Foo a b
mkFoo a b = Foo a (2*b)
instance (Show a, Show b) => Show (Foo a b) where
show (Foo a b) = "I am (" ++ show (a,b) ++ ")"
class Foo
def initialize(i,j)
@i=i
@j=2*j
end
def show
"I am (#{@i},#{@j})"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment