Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>LamPlusNew to Visual Studio Code? Get it now.
LamPlus

LamPlus

jiamingshan

|
2 installs
| (0) | Free
Language support for LamPlus functional programming language
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LamPlus Language Extension

A Visual Studio Code extension providing syntax highlighting and language support for the LamPlus functional programming language.

Features

  • Syntax Highlighting: Full syntax highlighting for LamPlus language constructs
  • Auto-completion: Bracket and quote auto-completion
  • Comment Support: Line comments using #
  • Code Folding: Support for folding code blocks
  • File Extensions: Supports .lam and .lamp files

Language Features

LamPlus is a functional programming language with the following key features:

Keywords

  • Definitions: def, fail, type, rec, effect
  • Control Flow: main, let, in, switch, on, match, with, handle, return
  • Lambda: \ (backslash for lambda expressions)

Types

  • Function Types: A -> B
  • Effect Types: A ~> B
  • Sum Types: + {'label1: Type1, 'label2: Type2}
  • Product Types: (Type1, Type2, Type3)
  • Type Parameters: Type[T1, T2]

Identifiers

  • Global Types/Functions: Start with uppercase letter (e.g., List, Option)
  • Local Variables: Start with lowercase letter or underscore (e.g., x, _temp)
  • Effects: Start with $ (e.g., $Console, $IO)
  • Labels: Start with ' (e.g., 'some, 'none)

Operators

  • ->: Function type arrow
  • ~>: Effect type arrow
  • <~: Resume operator
  • =: Assignment
  • :: Type annotation
  • |: Pattern alternative
  • +: Sum type constructor

Example Code

# Type definitions
type Option[T] = + {'some: T, 'none: ()}
type List[T] = + {'cons: (T, List[T]), 'nil: ()}

# Effect definition
effect $Console: String ~> ()

# Function definition
def map[A, B]: (A -> B, List[A]) -> List[B] = 
  \f. \lst. 
    match lst with {
      'nil x: 'nil (),
      'cons (head, tail): 'cons (f head, map f tail)
    }

# Main function with effects
main: () = 
  let numbers: List[Int] = 'cons (1, 'cons (2, 'nil ())) in
  handle 
    $Console "Hello, LamPlus!"
  with {
    $Console msg k: 
      let () = print msg in k (),
    return x: x
  }

Installation

  1. Download and install the extension from the VS Code Marketplace
  2. Open any .lam or .lamp file to see syntax highlighting in action

Development

To develop this extension:

  1. Clone this repository
  2. Open in VS Code
  3. Press F5 to open a new Extension Development Host window
  4. Open a .lam file to test the syntax highlighting

Language Grammar

This extension is based on a Lark parser grammar that defines the complete syntax of the LamPlus language. The TextMate grammar provides syntax highlighting for:

  • Keywords and control structures
  • Type definitions and annotations
  • Function definitions and lambda expressions
  • Pattern matching constructs
  • Effect definitions and handlers
  • Comments and documentation

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

MIT License - see LICENSE file for details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft