isovector/thinking-with-types

Issues getting code from OpenSums to compile

JonathanLorimer opened this issue · 1 comments

Relevent pages 138-141

import Fcf is not found, and if you get rid of that you are hit with other errors when you implement

type FindElem (key :: k) (ts :: [k])
   = FromMaybe Stuck =<< FindIndex (TyEq key) ts

there are three errors:

 error:
    Not in scope: type constructor or class ‘Stuck’
   |
33 |    = FromMaybe Stuck =<< FindIndex (TyEq key) ts
   |                ^^^^^
/Users/jonathan.l/Documents/thinking-with-types/src/CH11.hs:33:22-24: error:
    Not in scope: type constructor or class ‘=<<’
   |
33 |    = FromMaybe Stuck =<< FindIndex (TyEq key) ts
   |                      ^^^
/Users/jonathan.l/Documents/thinking-with-types/src/CH11.hs:33:26-34: error:
    Not in scope: type constructor or class ‘FindIndex’
   |
33 |    = FromMaybe Stuck =<< FindIndex (TyEq key) ts
   |                          ^^^^^^^^^

Try adding first-class-families to your dependencies