Skip to content

Instantly share code, notes, and snippets.

<lkuper> is it equivalent to say that a function is invertible and that it's a bijection?
<shachaf> Yes.
<lkuper> ok :)
<shachaf> But you have to be careful if you have "functions" between more complicated structures.
<shachaf> In which case there might be more requirements on the inverse. But not with plain old functions.
<lkuper> ah. by ""functions" between more complicated structures", do you mean, like, some other kind of morphism?
<lkuper> (I'm dealing with plain old functions here, but curious)
<shachaf> Right.
<shachaf> E.g. you might care that the inverse of a continuous function is continuous, or something.
<lkuper> I see. so, maybe another way to say this is that, when dealing with sets, it turns out bijectivity and invertibility coincide, but invertibility is a more general concept and applies to fancier kinds of objects too
### Keybase proof
I hereby claim:
* I am lkuper on github.
* I am lindsey (https://keybase.io/lindsey) on keybase.
* I have a public key whose fingerprint is 6832 D0DB 85DB 2D9A 10DC B4B9 DF53 470B 4C78 460C
To claim this, I am signing this object:
#[lang="strdup_uniq"]
#[cfg(not(test))]
#[allow(missing_doc)]
#[inline]
pub unsafe fn strdup_uniq(ptr: *u8, len: uint) -> ~str {
from_buf_len(ptr, len)
}
%====Set up Listings===============================================================
\definecolor{darkgreen}{rgb}{0,0.5,0}
\definecolor{darkred}{rgb}{0.5,0,0}
\lstloadlanguages{Haskell}
\lstnewenvironment{code}
{ % \centering
\lstset{}%
\csname lst@SetFirstLabel\endcsname}
{ %\centering
nbrs :: G.Graph -> G.Vertex -> [G.Vertex]
nbrs g v =
map snd edgesFromNode where
edgesFromNode = filter (\(v1, _) -> v1 == v) (G.edges g)
import threading
class LVar(object):
def __init__(self):
self.value = 0
def get(self, threshold):
while not self.value >= threshold:
pass
return
(load "mkprelude.scm")
(define peanoo
(lambda (n out)
(conde
[(== n (build-num 0)) (== '(O) out)]
[(fresh (n1 res)
(-o n (build-num 1) n1)
(conso 'S res out)
(peanoo n1 res))])))
trait Printable {
fn print(&self) { println!("{:?}", *self) }
}
impl Printable for int {}
impl Printable for ~str {
fn print(&self) { println(*self) }
}
landin:lvar-examples lkuper$ git reset f550a2
Unstaged changes after reset:
M README.md
M parallel-and.hs
M repeated-write-lvar-max-counter.hs
landin:lvar-examples lkuper$ git st
# On branch master
# Your branch is behind 'origin/master' by 8 commits, and can be fast-forwarded.
# (use "git pull" to update your local branch)
#
landin:haskell lkuper$ ./install_lots.sh --enable-tests
./install_lots.sh: line 22: [: missing `]'
+ OPTS=' -fnewgeneric -fgeneric'
+ '[' -e .cabal-sandbox ']'
+ cabal install -fnewgeneric -fgeneric ./lvish ./par-classes/ ./par-transformers/ ./par-collections/ --enable-tests
Resolving dependencies...
In order, the following will be installed:
par-classes-1.0.1 (reinstall)
par-collections-1.0 *test (reinstall) changes: HUnit-1.2.5.2 added,
atomic-primops-0.4 added, monad-par-0.3.4.6 added, test-framework-0.8 added,