CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
|
|
@ -0,0 +1,2 @@
|
|||
class Eatable a where
|
||||
eat :: a -> String
|
||||
|
|
@ -0,0 +1 @@
|
|||
data (Eatable a) => FoodBox a = F [a]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
data Banana = Foo -- the implementation doesn't really matter in this case
|
||||
instance Eatable Banana where
|
||||
eat _ = "I'm eating a banana"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
instance Eatable Double where
|
||||
eat d = "I'm eating " ++ show d
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
class Food a where
|
||||
munch :: a -> String
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
instance (Food a) => Eatable a where
|
||||
eat x = munch x
|
||||
Loading…
Add table
Add a link
Reference in a new issue