1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-07-30 19:40:36 +02:00

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.
This commit is contained in:
Chariton Charitonidis
2019-03-15 11:01:23 +02:00
committed by GitHub
parent c85d93a5ed
commit c4664b31e5

View File

@@ -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