mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-08-31 00:33:40 +02:00
38 lines
611 B
OCaml
38 lines
611 B
OCaml
|
exception AngularMomentumError of char
|
||
|
|
||
|
type t =
|
||
|
| S | P | D | F | G | H | I | J | K | L | M | N | O
|
||
|
|
||
|
let of_char = function
|
||
|
| 's' | 'S' -> S
|
||
|
| 'p' | 'P' -> P
|
||
|
| 'd' | 'D' -> D
|
||
|
| 'f' | 'F' -> F
|
||
|
| 'g' | 'G' -> G
|
||
|
| 'h' | 'H' -> H
|
||
|
| 'i' | 'I' -> I
|
||
|
| 'j' | 'J' -> J
|
||
|
| 'k' | 'K' -> K
|
||
|
| 'l' | 'L' -> L
|
||
|
| 'm' | 'M' -> M
|
||
|
| 'n' | 'N' -> N
|
||
|
| 'o' | 'O' -> O
|
||
|
| c -> raise (AngularMomentumError c)
|
||
|
|
||
|
let to_string = function
|
||
|
| S -> "S"
|
||
|
| P -> "P"
|
||
|
| D -> "D"
|
||
|
| F -> "F"
|
||
|
| G -> "G"
|
||
|
| H -> "H"
|
||
|
| I -> "I"
|
||
|
| J -> "J"
|
||
|
| K -> "K"
|
||
|
| L -> "L"
|
||
|
| M -> "M"
|
||
|
| N -> "N"
|
||
|
| O -> "O"
|
||
|
|
||
|
|