Ur Rosetta Stone

From Impredicative Wiki
(Difference between revisions)
Jump to: navigation, search
(completed option)
(done top module)

Revision as of 15:54, 24 June 2011

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 [*]

[*] Not an exact translation

Personal tools