membrain-0.0.0.1: Type-safe memory units

Copyright(c) 2018-2020 Kowainik
LicenseMPL-2.0
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Membrain.Constructors

Contents

Description

This module implements smart constructors for creating values of type Memory.

Synopsis

Smart constructors

bit :: Natural -> Memory Bit Source #

Creates Memory in Bits from given Natural as the number of bits.

>>> showMemory $ bit 42
"42b"

nibble :: Natural -> Memory Nibble Source #

Creates Memory in Nibbles from given Natural as the number of nibbles.

>>> showMemory $ nibble 42
"42n"

byte :: Natural -> Memory Byte Source #

Creates Memory in Bytes from given Natural as the number of bytes.

>>> showMemory $ byte 42
"42B"

kilobyte :: Natural -> Memory Kilobyte Source #

Creates Memory in Kilobytes from given Natural as the number of kilobytes.

>>> showMemory $ kilobyte 42
"42kB"

megabyte :: Natural -> Memory Megabyte Source #

Creates Memory in Megabytes from given Natural as the number of megabytes.

>>> showMemory $ megabyte 42
"42MB"

gigabyte :: Natural -> Memory Gigabyte Source #

Creates Memory in Gigabytes from given Natural as the number of gigabytes.

>>> showMemory $ gigabyte 42
"42GB"

terabyte :: Natural -> Memory Terabyte Source #

Creates Memory in Terabytes from given Natural as the number of terabytes.

>>> showMemory $ terabyte 42
"42TB"

petabyte :: Natural -> Memory Petabyte Source #

Creates Memory in Petabytes from given Natural as the number of petabytes.

>>> showMemory $ petabyte 42
"42PB"

exabyte :: Natural -> Memory Exabyte Source #

Creates Memory in Exabytes from given Natural as the number of exabytes.

>>> showMemory $ exabyte 42
"42EB"

zettabyte :: Natural -> Memory Zettabyte Source #

Creates Memory in Zettabytes from given Natural as the number of zettabytes.

>>> showMemory $ zettabyte 42
"42ZB"

yottabyte :: Natural -> Memory Yottabyte Source #

Creates Memory in Yottabytes from given Natural as the number of yottabytes.

>>> showMemory $ yottabyte 42
"42YB"

kibibyte :: Natural -> Memory Kibibyte Source #

Creates Memory in Kibibytes from given Natural as the number of kibibytes.

>>> showMemory $ kibibyte 42
"42KiB"

mebibyte :: Natural -> Memory Mebibyte Source #

Creates Memory in Mebibytes from given Natural as the number of mebibytes.

>>> showMemory $ mebibyte 42
"42MiB"

gibibyte :: Natural -> Memory Gibibyte Source #

Creates Memory in Gibibytes from given Natural as the number of gibibytes.

>>> showMemory $ gibibyte 42
"42GiB"

tebibyte :: Natural -> Memory Tebibyte Source #

Creates Memory in Tebibytes from given Natural as the number of tebibytes.

>>> showMemory $ tebibyte 42
"42TiB"

pebibyte :: Natural -> Memory Pebibyte Source #

Creates Memory in Pebibytes from given Natural as the number of pebibytes.

>>> showMemory $ pebibyte 42
"42PiB"

exbibyte :: Natural -> Memory Exbibyte Source #

Creates Memory in Exbibytes from given Natural as the number of exbibytes.

>>> showMemory $ exbibyte 42
"42EiB"

zebibyte :: Natural -> Memory Zebibyte Source #

Creates Memory in Zebibytes from given Natural as the number of zebibytes.

>>> showMemory $ zebibyte 42
"42ZiB"

yobibyte :: Natural -> Memory Yobibyte Source #

Creates Memory in Yobibytes from given Natural as the number of yobibytes.

>>> showMemory $ yobibyte 42
"42YiB"