How (if at all) does the exponential interpretation of (->)
(a -> b
as ba) generalize to categories other than Hask/Set? For example it would appear that the interpretation for the category of non-deterministic functions is roughly Kliesli [] a b
as 2a * b (a -> b -> Bool
).
Asked
Active
Viewed 358 times
4

duplode
- 33,731
- 7
- 79
- 150

David Harrison
- 327
- 2
- 7
-
4I'm not sure I understand what you are asking. Exponentials can be found in any cartesian closed category. http://en.wikipedia.org/wiki/Cartesian_closed_category – chi Dec 26 '14 at 17:59
-
1The exponential interpretation of `a -> b` is `b^a`. Consider `a -> ()` which has only `1^a=1` inhabitant, namely `const ()`. On the other hand, `() -> b` has `b^1=b` inhabitants, one for each inhabitant of `b`. – Cirdec Dec 26 '14 at 18:51
-
@chi Expand that a tiny bit -- basically just copy some definitions from Wikipedia -- and I'll upvote your answer. – Daniel Wagner Dec 26 '14 at 20:06
-
@Cirdec - Do you know of an existing SO answer to that effect? I want to add a cross-reference to an unrelated answer of mine that touches on the subject. (This off-topic comment will self-destruct whenever I remember to destruct it.) – Christian Conkle Dec 27 '14 at 03:53
-
@ChristianConkle This answer contains a similar explanation http://stackoverflow.com/a/9197803/414413 – Cirdec Dec 27 '14 at 04:07
1 Answers
4
The notion of exponential can be defined in general terms, beyond Hask/Set. A category with exponentials and products is called a cartesian closed category. This is a key notion in theoretical computer science since each c.c. category is essentially a model of the typed lambda calculus.
Roughly, in a cartesian closed category for any pair of objects a,b
there exist:
- a product object
(a * b)
, and - an exponential object
(b^ab)
with morphisms
eval : (b^a)*a -> b
(in Haskell:\(f,x) -> f x
, AKA apply)- for any
f : (a*b)->c
, there existsLf : a -> (c^b)
(in Haskell:curry f
)
satisfying the equation "they enjoy in the lambda calculus", i.e., if f : (a*b)->c
, then:
f = (Lf * id_a) ; eval
In Haskell, the last equation is:
f = \(x :: (a,b), y :: a) -> apply (curry f x, id y) where apply (g,z) = g z
or, using arrows,
f = (curry f *** id) >>> apply where apply (g,z) = g z

chi
- 111,837
- 3
- 133
- 218