On Tue, Aug 3, 2010 at 8:33 PM, Claude Heiland-Allen <claudiusmaxi...@goto10.org> wrote: > {-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-} > import Language.Haskell.Djinn (djinnD) > $(djinnD "maybeToEither" [t|forall a b . a -> Maybe b -> Either a b|]) > main = print . map (maybeToEither "foo") $ [Nothing, Just "bar"]
This is very cool (as is Djinn itself), but for me the ideal syntax would be maybeToEither :: a -> Maybe b -> Either a b maybeToEither = $(derived) Is something like this possible in TH? The splice would have to know its declared (even inferred?) type. --Max _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe