Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • What's interesting is this: :t ((.).(.)) undefined undefined yields ((.).(.)) undefined undefined :: a -> a1 -> c and :t undefined (.).(.) undefined yields undefined (.).(.) undefined :: (a -> b) -> c in GHCI. Commented Feb 19, 2016 at 8:17
  • 1
    @Ana This one is even more complicated. An operator in () are treated as a normal named function, also function application (white space) has higher precedence than function composition ., so undefined (.) . (.) undefined is actually (undefined (.)) . ((.) undefined). Commented Feb 19, 2016 at 8:28
  • In undefined (.), undefined is expanded to ((b -> c) -> (a -> b) -> (a -> c)) -> v' where v' is free, so undefind (.) has type v' just like undefined itself. In (.) undefined, undefined is expanded to b' -> c' so (.) undefined is resolved to type (a' -> b') -> (a' -> c'), by applying the middle . v' expended to (a' -> c') -> r', so the result type is in form (a' -> b') -> r'. Commented Feb 19, 2016 at 8:45