-
-
Save Peaker/2865635 to your computer and use it in GitHub Desktop.
Illegal instance declaration, flexible instances?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TypeFamilies #-} | |
class Collection c where | |
type Element c | |
insert :: Element c -> c -> c | |
instance Collection [a] where | |
type Element [a] = a | |
insert = (:) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{-# LANGUAGE MultiParamTypeClasses #-}
class Collection c where
type Element c
insert :: Element c -> c -> c
instance Collection [a] where
type Element [a] = a
insert = (:)