fslaborg / fslaborg/FsSpreadsheet
[BUG] DSL: required and optional operators dont unpack value
Open
Type: Bug
- Dominant language
- F#
- Stars
- 40
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
**To Reproduce**
```fsharp
(+.) id (Option.Some 5)
```
returns
```
val it: SheetEntity = Some ((String, "Some(45)"), [])
```
But the internal value should be only `45`.
**Solution**
use `parseAny`
```fsharp
let inline (+.) (f : 'T -> 'U) (v : 'T) : SheetEntity =
let err = fun s -> NoneRequired([message s])
try
f v
|> parseAny err
with
| err -> NoneRequired([Exception err])
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.