Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
sesiuni:scala:lab9 [2016/07/07 16:26]
dciocirlan [Practice]
sesiuni:scala:lab9 [2016/07/07 17:58] (current)
dciocirlan
Line 63: Line 63:
   - Create a generic class which has the method ''​def head: A''​.\\ Pass an instance of this class to the above method ''​f''​.\\ How does this work?   - Create a generic class which has the method ''​def head: A''​.\\ Pass an instance of this class to the above method ''​f''​.\\ How does this work?
   - Create a class which has an equivalence ''​=::​=''​ method for types which have the ''​def head: A''​ method.\\ Test it with an instance of CBL and an instance of the class you defined earlier.\\ Does this work if the type parameters in CBL and (yourclass) are different, i.e. CBL[Int] and YourClass[String]?​   - Create a class which has an equivalence ''​=::​=''​ method for types which have the ''​def head: A''​ method.\\ Test it with an instance of CBL and an instance of the class you defined earlier.\\ Does this work if the type parameters in CBL and (yourclass) are different, i.e. CBL[Int] and YourClass[String]?​
-  - If you're really brave, make a typeclass (see [[sesiuni:​scala:​lab8| the previous lab]]) which does the same ''​=::​=''​ as the previous exercise.\\ Use the appropriate implicits and test the equivalence as before, but now with operator notation. 
sesiuni/scala/lab9.txt · Last modified: 2016/07/07 17:58 by dciocirlan