This module provides a custom type representing chemical elements and a record type for store informations about them.
A Custom type representing all 118 atoms (as of 2024) in the periodic table.
A record type containing minimal informations for each atoms in the periodic table.
An Atomsrecord containing PeriodicTableInfo of the all 118 atoms.
periodicTable.sodium -->
{ atomicNumber = 11
, period = 3
, group = 1
, symbol = "Na"
, name = "sodium"
}Returns new AtomInfo having specified informations.
type Metality
= Metal
| NonMetal
metality : AtomInfo Metality
metality =
create
(\atom ->
let
{ period, group } =
get atom periodicTable
in
if
(period == 1)
|| (period <= 6)
&& (group >= 10 + period)
then
NonMetal
else
Metal
)
get Xe metality --> NonMetal
get U metality --> MetalReturns value of an atom stored in the second argument. You also can directly access record like atoms.hydrogen, which has a better performance in return for a bit more keyboad typing.
calcium : PeriodicTableInfo
calcium = get Ca periodicTable
calcium.period --> 4
calcium.group --> 2
A Record type alias containing some information about all 118 atoms (as of 2024) in the periodic table. The names of atom in US English are used as the record key.