[Haskell-cafe] Different return type?

John Ky newhoggy at gmail.com
Sun Jan 18 20:44:37 EST 2009


Possibly a silly question but is it possible to have a function that has a
different return type based on it's first argument?

For instance

data Person = Person { name :: String, ... }
data Business = Business { business_number :: Int, ...}

key person = name person
key business = business_number business


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090119/f1e746d9/attachment.htm

More information about the Haskell-Cafe mailing list