Question Details

No question body available.

Tags

haskell function-composition pointfree

Answers (1)

Accepted Answer Available
Accepted Answer
October 8, 2025 Score: 6 Rep: 156,545 Quality: Expert Completeness: 80%

A quick comment: () l becomes (l), not (l). For most number types, this distinction doesn't matter.

Generally, an op section has the following semantics:

  • (op) means \x y -> x op y
  • (e op) means \x -> e op x
  • (op e) means \x -> x op e

So let's start from your expression:

(() .) (l) w h
= { expand the (e .) section with e = () }
(\x -> () . x) (l) w h
= { beta reduce }
(() . (l)) w h
= { definition of . }
() ((l) w) h
= { expand the (e ) section with e = l }
() ((\x -> lx) w) h
= { beta reduce }
() (lw) h
= { expand the () section }
(\x y -> xy) (lw) h
= { beta reduce }
(lw)h

Actually, to be fully precise, the semantics of the two sections (op) and (e op) should not be the lambda expressions I showed, but their eta reduction. But it's pretty rare for that difference to matter, so if you didn't understand that, feel free to ignore it -- by the time it's important, you'll likely know it already.