File: lib.sml

package info (click to toggle)
camlp4 2.04-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,576 kB
  • ctags: 3,108
  • sloc: ml: 26,444; makefile: 736; sh: 203
file content (21 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
structure System =
  struct
    structure Unsafe =
      struct
        structure Susp =
          struct
            type 'a susp = 'a Lazy.t
            fun delay f = (ref (Lazy.Delayed f) : 'a susp)
            fun force (f : 'a susp) = Lazy.force f
          end
      end
  end

fun null x = x = []
fun fold f = List.fold_right (fn x => fn y => f (x, y))
fun foldl f = List.fold_left (fn x => fn y => f (y, x))
fun foldr f = List.fold_left (fn x => fn y => f (y, x))

val rev = List.rev
val length = List.length
val map = List.map