From 76dcef514c22eb1e0a00703b4f97680c653ec466 Mon Sep 17 00:00:00 2001 From: Konstantin Zudov Date: Mon, 31 Aug 2015 15:57:14 +0300 Subject: [PATCH] Added Generic instance --- bower.json | 1 + src/Data/List.purs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/bower.json b/bower.json index 7142a40..ba674b1 100644 --- a/bower.json +++ b/bower.json @@ -24,6 +24,7 @@ ], "dependencies": { "purescript-foldable-traversable": "^0.4.0", + "purescript-generics": "~0.5.1", "purescript-lazy": "^0.4.0", "purescript-unfoldable": "^0.4.0" }, diff --git a/src/Data/List.purs b/src/Data/List.purs index 4be0f4f..092b8a5 100644 --- a/src/Data/List.purs +++ b/src/Data/List.purs @@ -85,6 +85,7 @@ module Data.List import Prelude +import Data.Generic import Data.Maybe import Data.Tuple (Tuple(..)) import Data.Monoid @@ -105,6 +106,8 @@ import Control.MonadPlus -- | `Cons` constructor). data List a = Nil | Cons a (List a) +derive instance genericList :: (Generic a) => Generic (List a) + -- | Convert a list into any unfoldable structure. -- | -- | Running time: `O(n)`