class ListLike f where
nil :: f a
cons :: a -> f a -> f a
(·) :: f a -> f a -> f a
newtype LL a = LL (forall ff. ListLike ff => ff a)
instance ListLike LL where
nil :: LL a
nil = LL nil
cons :: a -> LL a -> LL a
cons a (LL as) = LL (cons a as)
(·) :: LL a -> LL a -> LL a
LL as · LL bs = LL (as · bs)
Created
January 27, 2018 20:43
-
-
Save Icelandjack/b1185398719f5932b6906396fb67a9f9 to your computer and use it in GitHub Desktop.
GHC Trac 14661
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment