Ethereum value unit
Instances1Unit
UnitSpec a => Unit (Value a)Defined in web3-ethereum-1.1.0.1 · Network.Ethereum.Unit
:: a typeCtrl KGHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12
Moduleweb3-ethereum-1.1.0.1Haskell2010
Ethereum has a metric system of denominations used as units of ether. Each denomination has its own unique name (some bear the family name of seminal figures playing a role in evolution of computer science and cryptoeconomics). The smallest denomination aka base unit of ether is called Wei. Below is a list of the named denominations and their value in Wei. Following a common (although somewhat ambiguous) pattern, ether also designates a unit (of 1e18 or one quintillion Wei) of the currency. Note that the currency is not called Ethereum as many mistakenly think, nor is Ethereum a unit.
In Haskell the Ethereum unit system presented as set of types: Wei, Szabo, Finney, etc. They are members of Unit typeclass. Also available standart Show, Read, Num operations over Ethereum units.
> let x = 1.2 :: Ether
> toWei x
1200000000000000000
> let y = x + 2
> y
3.20 ether
> let z = 15 :: Szabo
> y + z
interactive:6:5: error:
• Couldn't match type ‘Network.Ethereum.Unit.U4’
with ‘Network.Ethereum.Unit.U6’
Expected type: Ether
Actual type: Szabo
Unit type classEthereum value unit
UnitSpec a => Unit (Value a)Defined in web3-ethereum-1.1.0.1 · Network.Ethereum.UnitWei unit type
Babbage unit type
Lovelace unit type
Shannon unit type
Szabo unit type
Finney unit type
Ether unit type
KEther unit type