- 论坛徽章:
- 0
|
import Control.Arrow ((***))
splitVerticallyBy,splitHorizontallyBy :: RealFrac r => r -> Rectangle -> (Rectangle, Rectangle)
splitVerticallyBy f = (mirrorRect *** mirrorRect) . splitHorizontallyBy f . mirrorRect
mirrorRect :: Rectangle -> Rectangle
mirrorRect (Rectangle rx ry rw rh) = (Rectangle ry rx rh rw)
Prelude> :m Control.Arrow
Prelude Control.Arrow> :i ***
class (Control.Category.Category a) => Arrow a where
...
(***) :: a b c -> a b' c' -> a (b, b') (c, c')
...
-- Defined in Control.Arrow
infixr 3 ***
不明白(mirrorRect *** mirrorRect) . splitHorizontallyBy f . mirrorRect 中, "***"的用法! |
|