Skip to content

Cannot make st s a = s -> s & a as an instance of functor. #3265

Answered by nikswamy
katsujukou asked this question in Q&A
Discussion options

You must be logged in to vote

The variable not found is a bug; thanks for the bug report!

Here's a way to make your code work. Aside from using your top-level definition as a workaround for the scoping bug, the main issue here is that you need to work with FStar.FunctionalExtensionality. (https://fstar-lang.org/tutorial/book/part2/part2_equality.html#functional-extensionality)

open FStar.Tactics.Typeclasses
open FStar.FunctionalExtensionality
module F = FStar.FunctionalExtensionality

noeq
type functor_laws
  (#f: Type -> Type)
  (#map : (#a:_ -> #b:_ -> (a -> b) -> f a -> f b))
  = {
    map_id : #a:_ -> (x:f a) -> 
      Lemma (map (id #a) x == id #(f a) x);
    map_compose: #a:_ -> #b:_ -> #c:_ -> g: (a -> b) -> h: (b

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@katsujukou
Comment options

Answer selected by katsujukou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants