Stabel

Check-in [cfb0ec9059]
Login
Overview
Comment:Add module definitions to all standard library modules.
Timelines: family | ancestors | descendants | both | module-definition
Files: files | file ages | folders
SHA3-256: cfb0ec905968ba5562b041d9ceabea614a5abc4ad5124eddbc7a09d52a164300
User & Date: robin.hansen on 2021-05-31 10:36:25
Other Links: branch diff | manifest | tags
Context
2021-06-01
10:34
Add default import on standard_library/core module. check-in: 74d477ef73 user: robin.hansen tags: module-definition
2021-05-31
10:36
Add module definitions to all standard library modules. check-in: cfb0ec9059 user: robin.hansen tags: module-definition
2021-05-29
16:14
Fixed bug where internal modules wasn't necesarily compiled in correct order. check-in: e91945bdeb user: robin.hansen tags: module-definition
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified stdlib/src/list.play from [a7b678c1a9] to [0c89385133].



















1
2
3
4
5
6
7
..
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49


















defunion: List a
: NonEmpty a
: Empty

defstruct: NonEmpty a
: first a
: rest (List a)
................................................................................
  swap pair/second> # rest b quot
  fold

def: reverse
type: (List a) -- (List a)
: Empty [ >NonEmpty ] fold

def: fold-right
type: (List a) b [ a b -- b ] -- b
: -rotate reverse rotate fold

def: test
: 1 2 3 of-three
  0 [ + ] fold

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|


<
<
<
<
<
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
53
54
55
56
57
58
59
60
61
62





defmodule:
exposing:
  List
  NonEmpty
  >first
  first>
  >rest
  rest>
  Empty
  of-one
  of-two
  of-three
  fold
  reverse
  fold-reverse
  test
:

defunion: List a
: NonEmpty a
: Empty

defstruct: NonEmpty a
: first a
: rest (List a)
................................................................................
  swap pair/second> # rest b quot
  fold

def: reverse
type: (List a) -- (List a)
: Empty [ >NonEmpty ] fold

def: fold-reverse
type: (List a) b [ a b -- b ] -- b
: -rotate reverse rotate fold





Modified stdlib/src/maybe.play from [00d98b8fe3] to [081e92a1e7].









1
2
3
4
5
6
7








defunion: Maybe a
: a
: Nothing

defstruct: Nothing

defmulti: map
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
defmodule:
exposing:
  Maybe
  Nothing
  map
  when-nothing
:

defunion: Maybe a
: a
: Nothing

defstruct: Nothing

defmulti: map

Modified stdlib/src/pair.play from [0056df763e] to [6c626d6606].















1
2
3
4
5
6
7














defstruct: Pair a b
: first a
: second b

def: spill
type: (Pair a b) -- a b
: [ first> ] [ second> ] core/split
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
defmodule:
exposing:
  Pair
  >Pair
  >first
  first>
  >second
  second>
  spill
  map
  map-first
  map-second
:

defstruct: Pair a b
: first a
: second b

def: spill
type: (Pair a b) -- a b
: [ first> ] [ second> ] core/split