Skip to content

[CHAPTER 1] Array.index does not appear to exist? #2

Description

@cowboyd

Trying to follow along with the examples, I cut and paste the imports into the repl from Product.purs

And then tried to insert the first examples into the repl. The first few worked, but it looks like Array and Map aren't in scope. I must have missed some critical piece of setup.

❯❯❯❯ purs --version                                                                                                                                                                        ~/C/P/purescript-lenses master
0.12.0
❯❯❯❯ pulp repl                                                                                                                                                                             ~/C/P/purescript-lenses master
Compiling Product
Compiling ProductSolutions
PSCi, version 0.12.0
Type :? for help

import Prelude

> import Product
> import Data.Lens (lens, view, set, over, _1, _2)
>
> import Data.Tuple
> import Data.String as String
> fst $ Tuple 5 "hi"
5

> _.a {a : 5}
5

> Array.index [0, 5, 50] 1
Error found:
in module $PSCI
at  line 1, column 1 - line 1, column 12

  Unknown module Array


See https://github.com/purescript/documentation/blob/master/errors/UnknownName.md for more information,
or to contribute content related to this error.


> Map.lookup "a" $ Map.singleton "a" 5
Error found:
in module $PSCI
at  line 1, column 1 - line 1, column 11

  Unknown module Map


See https://github.com/purescript/documentation/blob/master/errors/UnknownName.md for more information,
or to contribute content related to this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions