on 657b415 help sign in
41 lines 593 B history raw
1### `++need`
3Unwrap unit
5Retrieve the value from a `++unit` and crash if the unit is null.
7Accepts
8-------
10`a` is a unit.
12Produces
13--------
15Either the unwrapped value of `a` (`u.a`), or crash.
17Source
18------
20 ++ need :: demand
21 |* a/(unit)
22 ?~ a ~|(%need !!)
23 u.a
26Examples
27--------
29 ~zod/try=> =a ((unit [@t @t]) [~ ['a' 'b']])
30 ~zod/try=> (need a)
31 ['a' 'b']
32 ~zod/try=> =a ((unit @ud) [~ 17])
33 ~zod/try=> (need a)
34 17
35 ~zod/try=> =a ((unit @) [~])
36 ~zod/try=> (need a)
37 ! exit
41***