Ur Rosetta Stone

From Impredicative Wiki
Jump to: navigation, search

These rough translations are designed to aid understanding, rather than to be rigorous! In some cases the types of the Ur functions and the functions in other languages will correspond exactly; in other cases the Ur function types will be more precise and/or more general.

module option

Ur Haskell
option Maybe
Some Just
None Nothing
eq instance Eq Maybe
ord instance Ord Maybe
isNone isNothing
isSome isJust
mp fmap
bind (=<<)
get fromMaybe

module top

Ur Haskell
not not
ex P data Foo = MkFoo (forall a. P a)
ex_intro MkFoo (see previous row)
ex_elim ex_elim (MkFoo x) f = f x (see previous rows)
compose (.)
show option instance Show Maybe
read option instance Read Maybe
map0 replicate n [*]
foldUR foldr [*]
foldUR2 zipWith [*]

module monad

Ur Haskell
exec sequence [*]
ignore ignore x = x >> return ()
mp liftM
mapR0 replicateM n [*]
appR mapM_ [*]
foldMapR mapAccumR (but monadic) [*]
appR2 zipWithM_ [*]

[*] Not an exact translation

Personal tools