3 ms·
Not exactly, partial functions can be surjective, eg f :: Int -> Bool f 0 = True f 1 = False f n = f (n + 1) is surjective onto Bool but also partial (does
by wetmore 6y ago
Not exactly, partial functions can be surjective, eg
f :: Int -> Bool
f 0 = True
f 1 = False
f n = f (n + 1)
is surjective onto Bool but also partial (doesn't return for n > 1). In Haskell we say that when a function doesn't return, the output is bottom, written as ⊥.
You could say that a function f : A -> B is partial if f^{-1}(B \ ⊥) is surjective.