Stream: Coq users

Topic: Running mystery function unknown interpretation


view this post on Zulip alexm98 (Jun 11 2020 at 13:41):

Hello everyone, I'm trying to run this function in Coq to see what it does, but I get "Unknown interpretation for _ :: _ ".

Fixpoint mistery (A : Type)(m : list bool)(s : list A) :=
match m, s with
| b :: m', x :: s' => if b then x :: mistery A m' s' else mistery A m' s'
| _, _ => nil
end.

view this post on Zulip Karl Palmskog (Jun 11 2020 at 13:44):

You need to add From Coq Require Import List. just above.

view this post on Zulip Kenji Maillard (Jun 11 2020 at 13:45):

And probably also import the notations (Edit: actually only needed if you just import the submodule)

Require Import Coq.Lists.List.
Import ListNotations.

view this post on Zulip alexm98 (Jun 11 2020 at 13:48):

Yes! thanks!


Last updated: Jan 27 2023 at 02:04 UTC