This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Test | |
a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
000473(:return (:ok "Data type Nat : Type | |
Unary natural numbers | |
Constructors: | |
Z : Nat | |
Zero | |
S : Nat -> Nat | |
Successor | |
" ((10 3 ((:name "Prelude.Nat.Nat") (:implicit :False) (:decor :type) (:doc-overview "Unary natural numbers") (:type "Type") (:namespace "Prelude.Nat"))) (16 4 ((:decor :type) (:type "Type") (:doc-overview "The type of types") (:name "Type"))) (70 1 ((:name "Prelude.Nat.Z") (:implicit :False) (:decor :data) (:doc-overview "Zero") (:type "Nat") (:namespace "Prelude.Nat"))) (74 3 ((:name "Prelude.Nat.Nat") (:implicit :False) (:decor :type) (:doc-overview "Unary natural numbers") (:type "Type") (:namespace "Prelude.Nat"))) (104 1 ((:name "Prelude.Nat.S") (:implicit :False) (:decor :data) (:doc-overview "Successor") (:type "Nat -> Nat") (:namespace "Prelude.Nat"))) (108 3 ((:name "Prelude.Nat.Nat") (:implicit :False) (:decor :type) (:doc-overview "Unary natural numbers") (:type "Type") (:namespace "Prelude.Nat"))) (115 3 ((:name "Prelude.Nat.Nat") (: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Monoid | |
mempty: -> | |
throw new Error "mempty not implemented" | |
mappend: -> | |
throw new Error "mappend not implemented" | |
mconcat: -> | |
throw new Error "mconcat not implemented" | |
class Option extends Monoid | |
mempty: -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let optionize f = | |
function | |
| None -> None | |
| Some(x) -> Some(f x) | |
let newListMap f list = List.map (optionize f) list | |
let listWithNull = [Some 0; Some 6; Some 3; None; Some 34; None; Some 1] | |
let square x = x*x |
NewerOlder