# function type def

4 messages
Open this post in threaded view
|

## function type def

 HI It's one of those things - I know sort of instinctively why it is so but can't think of the formal rationale for it: f g x = g (g x) :: (t -> t) -> (t -> t) Why not (t -> t) -> t -> (t -> t) to take account of the argument x for g? Cheers Paul _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

## Re: function type def

 PR Stanley <[hidden email]> writes: > It's one of those things - I know sort of instinctively why it is so > but can't think of the formal rationale for it: > f g x = g (g x) :: (t -> t) -> (t -> t) (t -> t) -> (t -> t) So    g :: t -> t    x :: t Thus    f :: (t -> t) -> t -> t (The last parenthesis is not necessary, but implies that the type of the partial application  f g  is a function t -> t .) -k -- If I haven't seen further, it is by standing in the footprints of giants _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe