Skip to content

floeorg/floe

Repository files navigation

Floe logo

GitHub release crates.io npm Open VSX VS Code Marketplace

 

A functional language that compiles to TypeScript. Pipes, pattern matching, Result/Option types, and full npm interop.

import trusted { useState } from "react"

type User {
  name: string,
  role: string,
  active: boolean,
}

type Status {
  | Loading
  | Failed(string)
  | Ready(Array<User>)
}

export fn Dashboard() -> JSX.Element {
  const [status, setStatus] = useState<Status>(Loading)

  status |> match {
    Loading -> <Spinner />,
    Failed(msg) -> <Alert message={msg} />,
    Ready(users) -> {
      const active = users
        |> filter(.active)
        |> sortBy(.name)

      <div>
        <h2>{active |> length} active</h2>
        {active |> map((u) =>
          <Card key={u.name} title={u.name} badge={u.role} />
        )}
      </div>
    },
  }
}

Links

About

Floe is a programming language that compiles to TypeScript. It’s designed for TypeScript and React developers who want stronger guarantees without leaving their ecosystem.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors