# Examples for the Motoko Base library

**URL:** <https://forum.dfinity.org/t/examples-for-the-motoko-base-library/5770>\
**Category:** Developers\
**Tags:** Functional-Programming\
**Created:** [July 7, 2021, 5:30pm UTC](https://forum.dfinity.org/t/examples-for-the-motoko-base-library/5770 "2021-07-07T17:30:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harish007](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@harish007](https://forum.dfinity.org/u/harish007)\
**Post date:** [July 7, 2021, 5:30pm UTC](https://forum.dfinity.org/t/examples-for-the-motoko-base-library/5770/1 "2021-07-07T17:30:43Z")

</div>

I want examples for the Motoko base library. I really don’t know how to use some of the functions. Where can I get examples for the Motoko base library?. Can anyone help me?

---

<div class="post-metadata">

**Author:** ![matthewhammer](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/matthewhammer/32/323_2.png) [@matthewhammer](https://forum.dfinity.org/u/matthewhammer)\
**Post date:** [July 7, 2021, 6:07pm UTC](https://forum.dfinity.org/t/examples-for-the-motoko-base-library/5770/2 "2021-07-07T18:07:25Z")

</div>

There are tests that show how to call most of the functions in certain modules. Not every module has a good test, but that’s the eventual goal:

> **[dfinity/motoko-base](https://github.com/dfinity/motoko-base/tree/master/test)**
>
> master/test

These examples just show the language and some uses of the base library throughout:

> **[dfinity/examples](https://github.com/dfinity/examples/tree/master/motoko)**
>
> master/motoko

And CanCan uses the base library quite a bit:

> <https://github.com/dfinity/cancan/blob/main/service/CanCan.mo>

Especially in the utility modules here:

> **[dfinity/cancan](https://github.com/dfinity/cancan/tree/main/backend)**
>
> main/backend

---

<div class="post-metadata">

**Author:** ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)\
**Post date:** [July 7, 2021, 7:14pm UTC](https://forum.dfinity.org/t/examples-for-the-motoko-base-library/5770/3 "2021-07-07T19:14:26Z")

</div>

You might also find it handy to explore the actual files on your local machine too (open them in your IDE and search etc), see here:

> [@How to learn Motoko with no experience?](https://forum.dfinity.org/t/how-to-learn-motoko-with-no-experience/1643/5):
>
> You might also want to take a look at the Motoko base library to get a feel for the way things are done, and to see what modules are available. You’ll find it in the $(dfx cache show)/base directory after installing the sdk, or the repo here: [GitHub - dfinity/motoko-base: The Motoko base library](https://github.com/dfinity/motoko-base) There are some great project repos you can reference as well, a quick search through these often finds a good solution or approach. Some to start with are: [https://github.com/enzoh/superheroes](https://github.com/enzoh/superheroes)[https:/…](https://github.com/hansl/journey)
