Compared

LA home
Computing
 Algorithms
 Bioinformatics
 FP,  λ
 Logic,  π
 MML
 Prog.Langs

FP
 Haskell
  H-98
 SML
  SML97
λ-calc. Haskell 98 SML 97
λx.e \x->e fn x=>e
normal-order evaluation by need, non-strict eager, strict
fixed-point combinator, Y triggers a type-checker bug in ghc!['05] y.sml

ho hum :-) Haskell 98 SML 97
: h:t, list cons(tructor) e:t, e has type t
:: e::t, e has type t x::xs, list cons(tructor)

  Haskell 98 SML 97
e has type t e :: t e : t
reference type n.a. t ref (contents, deref, !x) (assign, :=)
polymorphic type data T u v = C u v |... datatype ('u, 'v) t = C of 'u*'v |...
product type, U×V×... (u,v,...) u*v*...
function type,  -> u -> v u -> v
t*,  i.e., the type `list of t', [t] t list
tuple value (x1, x2, ...) (x1, x2, ...)
list cons x : xs x :: xs
empty list,  < >, ε [] nil or []
non-empty list [1,2,3] [1,2,3]
function sqr x = x*x fun sqr x = x*x
function by cases len [] = 0
len (_:xs) = 1 + len xs
fun len [] = 0
| len (_::xs) = 1 + len xs
anonymous function λx.e \x-> e fn x=>e
composition (.)::(b->c)->(a->b)->a->c op o:('b->'c)*('a->'b)->'a->'c
e.g., ((fn x=>x+1)o(fn x=>x*x)) 2
val it = 5 : int
let let decs in exp let decs in exp end
conditional if e then et else ef if e then et else ef
case case e of pat->e |... case e of pat=>e |...
window on the wide world:

Computer Science Education Week

Linux
 Ubuntu
free op. sys.
OpenOffice
free office suite,
ver 3.4+

The GIMP
~ free photoshop
Firefox
web browser
FlashBlock
like it says!

© L. Allison   http://www.allisons.org/ll/   (or as otherwise indicated),
Faculty of Information Technology (Clayton), Monash University, Australia 3800 (6/'05 was School of Computer Science and Software Engineering, Fac. Info. Tech., Monash University,
was Department of Computer Science, Fac. Comp. & Info. Tech., '89 was Department of Computer Science, Fac. Sci., '68-'71 was Department of Information Science, Fac. Sci.)
Created with "vi (Linux + Solaris)",  charset=iso-8859-1,  fetched Tuesday, 23-Sep-2014 04:16:04 EST.