MPL-2.0 licensed by Veronika Romashkina, Dmitrii Kovanikov
Maintained by Kowainik
This version can be pinned in stack with:membrain-0.0.0.2@sha256:260f607ed2cdfd4c7ff37feb1443fd6423617f5f72bef4d9c1e799b5bef6ca0b,3743

Module documentation for 0.0.0.2

Depends on 1 package(full list with versions):

membrain

memory-brain GitHub CI Hackage Stackage Lts Stackage Nightly MPL-2.0 license

“People think dreams aren’t real just because they aren’t made of matter, of particles. Dreams are real. But they are made of viewpoints, of images, of memories and puns and lost hopes.”

― Neil Gaiman

This package implements type-safe memory units. It pursues the following goals:

  1. Focus on correctness.
  2. Low amount of boilerplate should be required to use the library.

The ideas behind this package are described in the following blog post:

The library is built around the following data type:

newtype Memory (mem :: Nat) = Memory
    { unMemory :: Natural
    }

This data type stores every memory internally as bits. However, unit multiplier is stored as type-level natural number. This approach allows to represent different units and implement instances for them with low amount of boilerplate.

membrain implements various useful functions to work with Memory:

  1. Smart constructors.
  2. Conversion functions.
  3. Pretty displaying.
  4. Dependently-typed parsing.
  5. Numeric functions.
  6. Type-safe wrappers around functions from base.

Acknowledgement

Icons made by Kiranshastry from Flaticon is licensed by CC 3.0 BY.

Changes

Changelog

membrain uses PVP Versioning. The changelog is available on GitHub.

0.0.0.2 — 11 May, 2020

  • #48: Support GHC-8.10. Upgrade GHC-8.8 to 8.8.3.

0.0.0.1 — 09 Feb, 2020

  • Upgrade to GHC-8.8.2.

0.0.0.0 — 23 Jul, 2019

  • Initially created.