amuletml / amulet

An ML-like functional programming language
https://amulet.works/
BSD 3-Clause "New" or "Revised" License
328 stars 16 forks source link

Update documentation #268

Open chrisnevers opened 4 years ago

chrisnevers commented 4 years ago

Looking through the Getting Started docs and noticed there needs some updates.

One

This example doesn't compile:

let _ = print "hello, world!"

It gives the following error:

main.ml[3:5 ..3:5]: error (E2018)
  No instance for show string arising in the binding
  │ 
3 │ let _ = print "hello, world!"
  │     ^
  • Note: this constraint can not be quantified over
    because it is impossible to quantify over pattern bindings

The following message has a detailed explanation: 2018.
Try 'amc explain 2018' to see it.
make: *** [build] Error 1

Two

The example doesn't compile:

$ amc mod2.ml mod1.ml main.ml -o main.lua

The compile option needs to be specified:

$ amc compile mod2.ml mod1.ml main.ml -o main.lua

Other

Could you please add more docs for the std library and include more examples in the Everything You Need To Know To Write Amulet for example how to create/use exceptions.

Thanks for interesting project, I look forward to using it!

SquidDev commented 4 years ago

Just as a reminder to myself:

Recursive functions do not need a rec keyword as in OCaml.

This is incorrect.

The monad option instance aborts the computation when it encounters a None.

Our syntax for monads is different - this section needs redoing.

tacoberu commented 3 years ago

Hi. I would like to contribute to the documentation. I am currently using Amulet intensively on one project. So I have many aha moments that could be used. On the other hand, sometimes I don't quite understand some constructions. (I'm more of a Haskellist.) What if we opened a Wiki in this repository? I could add different fragments there. Which could act as inspiration for official documentation.

SquidDev commented 3 years ago

@tacoberu Yep, that's a good idea. I've enabled it and hopefully set the permissions so anyone can add/edit it.

tacoberu commented 3 years ago

works +1