This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Dangerously unwrap value wrapper types
version 1.0.0
license MIT
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2017-04-27 17:04:18 UTC
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

Modules

README

elm-unwrap

This library provides quick functions for uunwrapping value wrapper types such as Maybe and Result types. I have found myself rewriting this time and time again, so I thought to separate it out into a package.

Only use these if the program SHOULD crash in the case of the value not being present.

Installation

elm package install callumjhays/elm-unwrap

Functions

Unwrap.maybe : Maybe val -> val

Forcibly unwraps a maybe. Crash the program when it is Nothing.

Unwrap.maybe (Just 42) == 42
Unwrap.maybe Nothing -- CRASHES

Unwrap.result : Result err val -> val

Forcibly unwraps a result. Crash the program when it is Err.

Unwrap.result (Ok 42) == 42
Unwrap.result (Err "Should never happen") -- CRASHES