summaryrefslogtreecommitdiffhomepage
path: root/standard-ml.html.markdown
diff options
context:
space:
mode:
authorChariton Charitonidis <haritonch@yahoo.com>2019-03-15 11:01:23 +0200
committerGitHub <noreply@github.com>2019-03-15 11:01:23 +0200
commitc4664b31e5231fb56cb36cbebcef50ee699fda07 (patch)
tree87bd37b93d7cfe51f081adf87db53749936f0896 /standard-ml.html.markdown
parentc85d93a5ed7e42ad0341bc37e43545c405da004f (diff)
Added a comment to better demonstrate custom datatypes.
It is not obvious for a beginner (like me) to declare a new value of the temp datatype which can be either C (celsius) or F (fahrenheit). I think it would be better to demonstrate the declaration of such a datatype.
Diffstat (limited to 'standard-ml.html.markdown')
-rw-r--r--standard-ml.html.markdown3
1 files changed, 3 insertions, 0 deletions
diff --git a/standard-ml.html.markdown b/standard-ml.html.markdown
index b34f1c08..0ba42f39 100644
--- a/standard-ml.html.markdown
+++ b/standard-ml.html.markdown
@@ -272,6 +272,9 @@ fun evenly_positioned_elems (odd::even::xs) = even::evenly_positioned_elems xs
datatype temp =
C of real
| F of real
+
+(* Declaring a new C temp value...
+ val t: temp = C 45.0 *)
fun temp_to_f t =
case t of