Skip to content

floeorg/floe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,148 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

Warning

Floe is experimental. The language is pre-1.0, under active development, and should not be used in production. Expect bugs, rough edges, and breaking changes to the syntax, compiler output, and public APIs between releases. Pin your version and read the CHANGELOG before upgrading.

import trusted { useState } from "react"

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

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

export let Dashboard() -> JSX.Element = {
  let (status, setStatus) = useState<Status>(Loading)

  status |> match {
    Loading -> <Spinner />,
    Failed(msg) -> <Alert message={msg} />,
    Ready(users) -> {
      let 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 developers who want stronger guarantees without leaving their ecosystem.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors