On Tue, 12 Apr 2011, Edward Amsden wrote:

I am trying as an experiment to write something as follows:

data Wrapper a b where
 Pure :: (a -> b) -> Wrapper a b
 Nullable :: (Maybe a -> b) -> Wrapper a b

class Liftable a b where
 liftTo :: (b -> c) -> a b c

instance Liftable Wrapper a where
 liftTo = Pure

Would it be ok, to erm wrap 'a', say

newtype Generic a = Generic a

instance Liftable Wrapper (Generic a) where
 liftTo = ...


instance Liftable Wrapper (Maybe a) where
 liftTo = Nullable

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to