on 2e98519 help sign in
47 lines 695 B history raw
1val x = 0
3val hello = "hello world"
5val id = fn x => x
7fun id' x = x
9val () = print "hello world\n"
11val _ = let
12 val hello = "hello"
13 val world = "world"
14in
15 print (hello ^ " " ^ world ^ "\n")
16end
18fun isZero n =
19 if n = 0 then true
20 else false
22fun isTrue b =
23 case b of
24 true => true
25 | false => false
27exception Bad_value of string
29fun isTrue' b =
30 case b of
31 true => true
32 | _ => raise (Bad_value "value is not true!")
34val alwaysTrue =
35 isTrue' false handle Bad_value _ => true
37datatype myBool = True | False
39datatype shape = Square of real | Circle of real | Point
41signature FOO = sig
42 val foo : 'a -> 'a
43end
45structure Foo :> FOO = struct
46 fun foo x = x
47end