From 36b56ad3a247cee960101f2814daa8fea7ca0d1c Mon Sep 17 00:00:00 2001 From: Stephen Diehl Date: Wed, 14 Sep 2016 09:47:47 +0100 Subject: [PATCH] for function for #19 --- src/Protolude.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Protolude.hs b/src/Protolude.hs index 592e9e4b9..2ac666b97 100644 --- a/src/Protolude.hs +++ b/src/Protolude.hs @@ -17,6 +17,7 @@ module Protolude ( print, throwIO, throwTo, + foreach, show, LText, @@ -393,6 +394,9 @@ throwIO = liftIO . Control.Exception.throwIO throwTo :: (X.MonadIO m, Exception e) => ThreadId -> e -> m () throwTo tid e = liftIO (Control.Exception.throwTo tid e) +foreach :: Functor f => f a -> (a -> b) -> f b +foreach = flip fmap + show :: (Show a, StringConv String b) => a -> b show x = toS (PBase.show x) {-# SPECIALIZE show :: Show a => a -> Text #-}