case

    0

    0

    lucycodes42

    Haskell public recipes

    esac

    The code looks for a match in the string ${var} against the pattern Just a. If there is a match, the code executes the body. Otherwise, the code prints the remaining text.

    Shortcut: case

    case ${var} of
      ${alt:Just a} -> ${body}
      ${otehrwise:_} -> ${remaining}
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.