[Haskell-cafe] Re: Different return type?

2009-01-19 Thread Jon Fairbairn
"John Ky" writes: > Hi, > > Possibly a silly question but is it possible to have a function that has a > different return type based on it's first argument? Are you sure that's what you really want? > For instance > > data Person = Person { name :: String, ... } > data Business = Business { bus

[Haskell-cafe] Re: Different return type?

2009-01-19 Thread Chung-chieh Shan
John Ky wrote in article in gmane.comp.lang.haskell.cafe: > data Person = Person { name :: String, ... } > data Business = Business { business_number :: Int, ...} > > key person = name person > key business = business_number business Let's make this concrete: data Person = Person { name ::