Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] DSL: required and optional operators dont unpack value #74

Open
HLWeil opened this issue Oct 17, 2023 · 0 comments
Open

[BUG] DSL: required and optional operators dont unpack value #74

HLWeil opened this issue Oct 17, 2023 · 0 comments
Labels
Type: Bug Something is not working, and it is confirmed by maintainers to be a bug.

Comments

@HLWeil
Copy link
Member

HLWeil commented Oct 17, 2023

To Reproduce

(+.) id (Option.Some 5)

returns

val it: SheetEntity<Value> = Some ((String, "Some(45)"), [])

But the internal value should be only 45.

Solution
use parseAny

let inline (+.) (f : 'T -> 'U) (v : 'T) : SheetEntity<Value> =
    let err = fun s -> NoneRequired([message s])
    try 
        f v 
        |> parseAny err
    with 
    | err -> NoneRequired([Exception err])
@HLWeil HLWeil added the bug Something isn't working label Oct 17, 2023
@kMutagene kMutagene added Type: Bug Something is not working, and it is confirmed by maintainers to be a bug. and removed bug Something isn't working labels Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something is not working, and it is confirmed by maintainers to be a bug.
Projects
None yet
Development

No branches or pull requests

2 participants