Skip to content

Instantly share code, notes, and snippets.

@LeviSchuck
Created October 1, 2013 19:53
Show Gist options
  • Save LeviSchuck/6784111 to your computer and use it in GitHub Desktop.
Save LeviSchuck/6784111 to your computer and use it in GitHub Desktop.
genericFunction :: (Show a) -> a -> String
genericFunction thing = show thing
data OneThing = OneThing (deriving Show)
data AnotherThing = AnotherThing (deriving Show)
data MyFunctions = MyFunctions
{ showOne :: OneThing -> String
, showAnother :: AnotherThing -> String
}
currentFunctions = MyFunctions
{ showOne = genericFunction
, showAnother = genericFunction
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment