mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 11:05:17 +03:00
Update docs
This commit is contained in:
parent
df60e07962
commit
f094a52ba9
@ -9,7 +9,6 @@ Welcome to Idris 2. Enjoy yourself!
|
||||
Main> :t main
|
||||
Main.main : IO ()
|
||||
Main> :c hello main
|
||||
compiling hello.ss with output to hello.so
|
||||
File hello.so written
|
||||
File build/exec/hello written
|
||||
Main> :q
|
||||
Bye for now!
|
||||
|
@ -87,8 +87,7 @@ which you can run:
|
||||
::
|
||||
|
||||
$ idris2 hello.idr -o hello
|
||||
compiling hello.ss with output to hello.so
|
||||
$ ./build/exec/hello.so
|
||||
$ ./build/exec/hello
|
||||
Hello world
|
||||
|
||||
Please note that the dollar sign ``$`` indicates the shell prompt!
|
||||
|
@ -143,9 +143,9 @@ We can test these functions at the Idris prompt:
|
||||
::
|
||||
|
||||
Main> plus (S (S Z)) (S (S Z))
|
||||
S (S (S (S Z)))
|
||||
4
|
||||
Main> mult (S (S (S Z))) (plus (S (S Z)) (S (S Z)))
|
||||
S (S (S (S (S (S (S (S (S (S (S (S Z)))))))))))
|
||||
12
|
||||
|
||||
Like arithmetic operations, integer literals are also overloaded using
|
||||
interfaces, meaning that we can also test the functions as follows:
|
||||
@ -153,9 +153,9 @@ interfaces, meaning that we can also test the functions as follows:
|
||||
::
|
||||
|
||||
Idris> plus 2 2
|
||||
S (S (S (S Z)))
|
||||
4
|
||||
Idris> mult 3 (plus 2 2)
|
||||
S (S (S (S (S (S (S (S (S (S (S (S Z)))))))))))
|
||||
12
|
||||
|
||||
You may wonder, by the way, why we have unary natural numbers when our
|
||||
computers have perfectly good integer arithmetic built in. The reason
|
||||
|
Loading…
Reference in New Issue
Block a user