broom-lang/broom

Syntax overhaul #n

nilern opened this issue · 0 comments

  • (1, 2) -- (unboxed) tuple
  • (1, 2).0 -- get tuple element
  • (:int, {:}) -- tuple type
  • {foo = bar; baz} -- record
  • {foo = bar; baz}.foo -- get record field
  • {:foo : int; bar : (:)} -- record type
  • #foo -- lens for .foo
  • %Foo -- prism for Foo polymorphic variant
  • 'Foo bar -- review (preview in patterns)
  • '%Foo bar -- (p)review Foo polymorphic variant
  • [|Foo : int | Bar : (:)] -- polymorphic variant type
  • (|Foo : int | Bar : (:)) -- row type
  • [1, 2] -- array
  • array int -- array type
  • {| a, b, c ? g : c -> b, f : a -> b |-> {|x|-> f (g x)}} -- function
  • {|-> print "foo"} -- thunk
  • foo bar baz = foo (bar, baz) -- call
  • foo () -- force thunk