@@ -49,12 +49,14 @@ _∘_ : ∀ {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} →
49
49
(∀ {x} (y : B x) → C y) → (g : (x : A) → B x) →
50
50
((x : A) → C (g x))
51
51
f ∘ g = λ x → f (g x)
52
+ {-# INLINE _∘_ #-}
52
53
53
54
-- Flipping order of arguments
54
55
55
56
flip : ∀ {A : Set a} {B : Set b} {C : A → B → Set c} →
56
57
((x : A) (y : B) → C x y) → ((y : B) (x : A) → C x y)
57
58
flip f = λ y x → f x y
59
+ {-# INLINE flip #-}
58
60
59
61
-- Application - note that _$_ is right associative, as in Haskell.
60
62
-- If you want a left associative infix application operator, use
@@ -63,6 +65,7 @@ flip f = λ y x → f x y
63
65
_$_ : ∀ {A : Set a} {B : A → Set b} →
64
66
((x : A) → B x) → ((x : A) → B x)
65
67
f $ x = f x
68
+ {-# INLINE _$_ #-}
66
69
67
70
-- Strict (call-by-value) application
68
71
@@ -75,6 +78,7 @@ _$!_ = flip force
75
78
_|>_ : ∀ {A : Set a} {B : A → Set b} →
76
79
(a : A) → (∀ a → B a) → B a
77
80
_|>_ = flip _$_
81
+ {-# INLINE _|>_ #-}
78
82
79
83
-- The S combinator - written infix as in Conor McBride's paper
80
84
-- "Outrageous but Meaningful Coincidences: Dependent type-safe syntax
@@ -85,21 +89,25 @@ _ˢ_ : ∀ {A : Set a} {B : A → Set b} {C : (x : A) → B x → Set c} →
85
89
(g : (x : A) → B x) →
86
90
((x : A) → C x (g x))
87
91
f ˢ g = λ x → f x (g x)
92
+ {-# INLINE _ˢ_ #-}
88
93
89
94
-- Converting between implicit and explicit function spaces.
90
95
91
96
_$- : ∀ {A : Set a} {B : A → Set b} → ((x : A) → B x) → ({x : A} → B x)
92
97
f $- = f _
98
+ {-# INLINE _$- #-}
93
99
94
100
λ- : ∀ {A : Set a} {B : A → Set b} → ({x : A} → B x) → ((x : A) → B x)
95
101
λ- f = λ x → f
102
+ {-# INLINE λ- #-}
96
103
97
104
-- Case expressions (to be used with pattern-matching lambdas, see
98
105
-- README.Case).
99
106
100
107
case_return_of_ : ∀ {A : Set a} (x : A) (B : A → Set b) →
101
108
((x : A) → B x) → B x
102
109
case x return B of f = f x
110
+ {-# INLINE case_return_of_ #-}
103
111
104
112
------------------------------------------------------------------------
105
113
-- Non-dependent versions of dependent operations
@@ -140,6 +148,7 @@ _|>′_ = _|>_
140
148
141
149
case_of_ : A → (A → B) → B
142
150
case x of f = case x return _ of f
151
+ {-# INLINE case_of_ #-}
143
152
144
153
------------------------------------------------------------------------
145
154
-- Operations that are only defined for non-dependent functions
0 commit comments