thrist 0.3 → 0.3.0.1
raw patch · 3 files changed
+16/−6 lines, 3 files
Files
- Data/Thrist/List.hs +12/−2
- LICENSE +1/−1
- thrist.cabal +3/−3
Data/Thrist/List.hs view
@@ -1,7 +1,8 @@ module Data.Thrist.List ( List(..) ) where import Data.Thrist-import Control.Monad()+import Control.Monad ()+import Control.Applicative (Applicative(..)) -- Adapter for creating lists: -- (Thrist List a a) is isomorphic to [a]@@ -14,9 +15,18 @@ newtype List' a = List' (Thrist List a a) +instance Functor List' where+ fmap _ (List' Nil) = List' Nil+ fmap f (List' (Cons (El a) as)) = List' $ Cons (El $ f a) (unlist' . fmap f $ List' as)+ where unlist' (List' l) = l++instance Applicative List' where+ pure = return+ (<*>) = undefined -- TODO+ instance Monad List' where return a = List' $ Cons (El a) Nil- List' a >>= f = undefined+ List' a >>= f = undefined -- TODO {- We need something like:
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2008-2012 Gabor Greif and Brandon Simmons+Copyright (c) 2008-2013 Gabor Greif and Brandon Simmons All rights reserved.
thrist.cabal view
@@ -1,5 +1,5 @@ Name: thrist-Version: 0.3+Version: 0.3.0.1 Synopsis: Type-threaded list Description:@@ -30,10 +30,10 @@ . [0.1] Initial version -Category: Data Structures+Category: Data Structures, Categories License: BSD3 License-File: LICENSE-Copyright: (c) 2008-2012 Gabor Greif and Brandon Simmons+Copyright: (c) 2008-2013 Gabor Greif and Brandon Simmons Author: Gabor Greif, Brandon Simmons Maintainer: ggreif+thrist@gmail.com, brandon.m.simmons+thrist@gmail.com