module Clean.Unit where import qualified Prelude as P import Clean.Core import Clean.Monoid import Data.Tree class Unit f where pure :: a -> f a instance Unit (Either a) where pure = Right instance Monoid w => Unit ((,) w) where pure a = (zero,a) instance Unit ((->) b) where pure = const instance Unit [] where pure a = [a] instance Unit Tree where pure a = Node a [] instance Unit IO where pure = P.return