Your example suggests that update was, perhaps, not the best choice
of terminology!
| data Foo a = Foo { foo :: a
|, bar :: Int
|} deriving Show
|
| up s t = s { foo = t }
|
| Now, what should the type of the function 'up' be?
|
| up :: Foo a -> a -> Foo a
|
Here is a curiosity of the Haskell update mechanism;
you can map one type to another using it.
Consider this datatype and function...
data Foo a = Foo { foo :: a
, bar :: Int
} deriving Show
up s t = s { foo = t }
Now, what should the type of the function 'up