CoolerZ 2017-02-18 18:02:53
can you give a type signature in a instance declaration? http://lpaste.net/352701
CoolerZ 2017-02-18 18:03:02
http://lpaste.net/352701
CoolerZ 2017-02-18 18:03:53
i get an error telling me to use a language extension InstanceSigs
kadoban 2017-02-18 18:04:05
It requires that extension, yes.
CoolerZ 2017-02-18 18:09:16
kadoban, is there a way around that
Cale 2017-02-18 18:10:06
CoolerZ: Yes, not giving the type signature there
Cale 2017-02-18 18:10:19
It should be uniquely determined by the class definition
CoolerZ 2017-02-18 18:11:40
Cale, uh well the type signature is required to use fmap
CoolerZ 2017-02-18 18:11:57
to specify x is a Functor
CoolerZ 2017-02-18 18:13:13
trying to do this exercise to write a functor instance
CoolerZ 2017-02-18 18:13:14
5. Do you need something extra to make the instance work?
CoolerZ 2017-02-18 18:13:15
data LiftItOut f a =
CoolerZ 2017-02-18 18:13:15
LiftItOut (f a)
CoolerZ 2017-02-18 18:17:57
anyone?
MarcelineVQ 2017-02-18 18:17:58
you can place constraints ( => ) on instances, check back on your chapter exercises for chapter 15 for a reminder on where you've done that before
CoolerZ 2017-02-18 18:19:24
oh right
Cale 2017-02-18 18:19:38
Yeah, it should be instance Functor x => Functor (LiftItOut x) where ...
Cale 2017-02-18 18:19:54
(or better yet, use f instead of x ;)