Explorer

definy.option-expression-literal

description
The value of the literal none or some(quote(e).expression). none if it is another expression
type
Fn(expr: @core.expression) -> Union{#none, #some(Union{#none, #some(@core.expression)})}
expression
fn(expr$0) =>
  match $0 {
    #variant(variant$1) =>
      match $1.tag {
        "none" =>
          match $1.payload {
            #none(_) =>
              #some(#none),
            #some(_) =>
              #none
          },
        "some" =>
          match $1.payload {
            #some(payload$2) =>
              match @definy.quoted-expression-literal(expr: $2) {
                #some(expression$3) =>
                  #some(#some($3)),
                #none(_) =>
                  #none
              },
            #none(_) =>
              #none
          },
        _ =>
          #none
      },
    _ =>
      #none
  }
visibility
public
definy.option-expression-literal (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: Tv9hIK4QtSVDEL2U2QSqugzXnzueH8gq-wBfEUBocY0
content hash: RU3cXG1wbjhVghABC_lOPbki84OggTsmuOF02mVI9wo